You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129516 lines
4.9 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.beta"
  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.beta"
  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:beta"
  71. const apiName = "compute"
  72. const apiVersion = "beta"
  73. const basePath = "https://www.googleapis.com/compute/beta/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.HealthChecks = NewHealthChecksService(s)
  139. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  140. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  141. s.Images = NewImagesService(s)
  142. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  143. s.InstanceGroups = NewInstanceGroupsService(s)
  144. s.InstanceTemplates = NewInstanceTemplatesService(s)
  145. s.Instances = NewInstancesService(s)
  146. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  147. s.InterconnectLocations = NewInterconnectLocationsService(s)
  148. s.Interconnects = NewInterconnectsService(s)
  149. s.LicenseCodes = NewLicenseCodesService(s)
  150. s.Licenses = NewLicensesService(s)
  151. s.MachineTypes = NewMachineTypesService(s)
  152. s.NetworkEndpointGroups = NewNetworkEndpointGroupsService(s)
  153. s.Networks = NewNetworksService(s)
  154. s.NodeGroups = NewNodeGroupsService(s)
  155. s.NodeTemplates = NewNodeTemplatesService(s)
  156. s.NodeTypes = NewNodeTypesService(s)
  157. s.Projects = NewProjectsService(s)
  158. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  159. s.RegionBackendServices = NewRegionBackendServicesService(s)
  160. s.RegionCommitments = NewRegionCommitmentsService(s)
  161. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  162. s.RegionDisks = NewRegionDisksService(s)
  163. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  164. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  165. s.RegionOperations = NewRegionOperationsService(s)
  166. s.Regions = NewRegionsService(s)
  167. s.ResourcePolicies = NewResourcePoliciesService(s)
  168. s.Routers = NewRoutersService(s)
  169. s.Routes = NewRoutesService(s)
  170. s.SecurityPolicies = NewSecurityPoliciesService(s)
  171. s.Snapshots = NewSnapshotsService(s)
  172. s.SslCertificates = NewSslCertificatesService(s)
  173. s.SslPolicies = NewSslPoliciesService(s)
  174. s.Subnetworks = NewSubnetworksService(s)
  175. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  176. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  177. s.TargetInstances = NewTargetInstancesService(s)
  178. s.TargetPools = NewTargetPoolsService(s)
  179. s.TargetSslProxies = NewTargetSslProxiesService(s)
  180. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  181. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  182. s.UrlMaps = NewUrlMapsService(s)
  183. s.VpnGateways = NewVpnGatewaysService(s)
  184. s.VpnTunnels = NewVpnTunnelsService(s)
  185. s.ZoneOperations = NewZoneOperationsService(s)
  186. s.Zones = NewZonesService(s)
  187. return s, nil
  188. }
  189. type Service struct {
  190. client *http.Client
  191. BasePath string // API endpoint base URL
  192. UserAgent string // optional additional User-Agent fragment
  193. AcceleratorTypes *AcceleratorTypesService
  194. Addresses *AddressesService
  195. Allocations *AllocationsService
  196. Autoscalers *AutoscalersService
  197. BackendBuckets *BackendBucketsService
  198. BackendServices *BackendServicesService
  199. DiskTypes *DiskTypesService
  200. Disks *DisksService
  201. ExternalVpnGateways *ExternalVpnGatewaysService
  202. Firewalls *FirewallsService
  203. ForwardingRules *ForwardingRulesService
  204. GlobalAddresses *GlobalAddressesService
  205. GlobalForwardingRules *GlobalForwardingRulesService
  206. GlobalOperations *GlobalOperationsService
  207. HealthChecks *HealthChecksService
  208. HttpHealthChecks *HttpHealthChecksService
  209. HttpsHealthChecks *HttpsHealthChecksService
  210. Images *ImagesService
  211. InstanceGroupManagers *InstanceGroupManagersService
  212. InstanceGroups *InstanceGroupsService
  213. InstanceTemplates *InstanceTemplatesService
  214. Instances *InstancesService
  215. InterconnectAttachments *InterconnectAttachmentsService
  216. InterconnectLocations *InterconnectLocationsService
  217. Interconnects *InterconnectsService
  218. LicenseCodes *LicenseCodesService
  219. Licenses *LicensesService
  220. MachineTypes *MachineTypesService
  221. NetworkEndpointGroups *NetworkEndpointGroupsService
  222. Networks *NetworksService
  223. NodeGroups *NodeGroupsService
  224. NodeTemplates *NodeTemplatesService
  225. NodeTypes *NodeTypesService
  226. Projects *ProjectsService
  227. RegionAutoscalers *RegionAutoscalersService
  228. RegionBackendServices *RegionBackendServicesService
  229. RegionCommitments *RegionCommitmentsService
  230. RegionDiskTypes *RegionDiskTypesService
  231. RegionDisks *RegionDisksService
  232. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  233. RegionInstanceGroups *RegionInstanceGroupsService
  234. RegionOperations *RegionOperationsService
  235. Regions *RegionsService
  236. ResourcePolicies *ResourcePoliciesService
  237. Routers *RoutersService
  238. Routes *RoutesService
  239. SecurityPolicies *SecurityPoliciesService
  240. Snapshots *SnapshotsService
  241. SslCertificates *SslCertificatesService
  242. SslPolicies *SslPoliciesService
  243. Subnetworks *SubnetworksService
  244. TargetHttpProxies *TargetHttpProxiesService
  245. TargetHttpsProxies *TargetHttpsProxiesService
  246. TargetInstances *TargetInstancesService
  247. TargetPools *TargetPoolsService
  248. TargetSslProxies *TargetSslProxiesService
  249. TargetTcpProxies *TargetTcpProxiesService
  250. TargetVpnGateways *TargetVpnGatewaysService
  251. UrlMaps *UrlMapsService
  252. VpnGateways *VpnGatewaysService
  253. VpnTunnels *VpnTunnelsService
  254. ZoneOperations *ZoneOperationsService
  255. Zones *ZonesService
  256. }
  257. func (s *Service) userAgent() string {
  258. if s.UserAgent == "" {
  259. return googleapi.UserAgent
  260. }
  261. return googleapi.UserAgent + " " + s.UserAgent
  262. }
  263. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  264. rs := &AcceleratorTypesService{s: s}
  265. return rs
  266. }
  267. type AcceleratorTypesService struct {
  268. s *Service
  269. }
  270. func NewAddressesService(s *Service) *AddressesService {
  271. rs := &AddressesService{s: s}
  272. return rs
  273. }
  274. type AddressesService struct {
  275. s *Service
  276. }
  277. func NewAllocationsService(s *Service) *AllocationsService {
  278. rs := &AllocationsService{s: s}
  279. return rs
  280. }
  281. type AllocationsService struct {
  282. s *Service
  283. }
  284. func NewAutoscalersService(s *Service) *AutoscalersService {
  285. rs := &AutoscalersService{s: s}
  286. return rs
  287. }
  288. type AutoscalersService struct {
  289. s *Service
  290. }
  291. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  292. rs := &BackendBucketsService{s: s}
  293. return rs
  294. }
  295. type BackendBucketsService struct {
  296. s *Service
  297. }
  298. func NewBackendServicesService(s *Service) *BackendServicesService {
  299. rs := &BackendServicesService{s: s}
  300. return rs
  301. }
  302. type BackendServicesService struct {
  303. s *Service
  304. }
  305. func NewDiskTypesService(s *Service) *DiskTypesService {
  306. rs := &DiskTypesService{s: s}
  307. return rs
  308. }
  309. type DiskTypesService struct {
  310. s *Service
  311. }
  312. func NewDisksService(s *Service) *DisksService {
  313. rs := &DisksService{s: s}
  314. return rs
  315. }
  316. type DisksService struct {
  317. s *Service
  318. }
  319. func NewExternalVpnGatewaysService(s *Service) *ExternalVpnGatewaysService {
  320. rs := &ExternalVpnGatewaysService{s: s}
  321. return rs
  322. }
  323. type ExternalVpnGatewaysService struct {
  324. s *Service
  325. }
  326. func NewFirewallsService(s *Service) *FirewallsService {
  327. rs := &FirewallsService{s: s}
  328. return rs
  329. }
  330. type FirewallsService struct {
  331. s *Service
  332. }
  333. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  334. rs := &ForwardingRulesService{s: s}
  335. return rs
  336. }
  337. type ForwardingRulesService struct {
  338. s *Service
  339. }
  340. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  341. rs := &GlobalAddressesService{s: s}
  342. return rs
  343. }
  344. type GlobalAddressesService struct {
  345. s *Service
  346. }
  347. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  348. rs := &GlobalForwardingRulesService{s: s}
  349. return rs
  350. }
  351. type GlobalForwardingRulesService struct {
  352. s *Service
  353. }
  354. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  355. rs := &GlobalOperationsService{s: s}
  356. return rs
  357. }
  358. type GlobalOperationsService struct {
  359. s *Service
  360. }
  361. func NewHealthChecksService(s *Service) *HealthChecksService {
  362. rs := &HealthChecksService{s: s}
  363. return rs
  364. }
  365. type HealthChecksService struct {
  366. s *Service
  367. }
  368. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  369. rs := &HttpHealthChecksService{s: s}
  370. return rs
  371. }
  372. type HttpHealthChecksService struct {
  373. s *Service
  374. }
  375. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  376. rs := &HttpsHealthChecksService{s: s}
  377. return rs
  378. }
  379. type HttpsHealthChecksService struct {
  380. s *Service
  381. }
  382. func NewImagesService(s *Service) *ImagesService {
  383. rs := &ImagesService{s: s}
  384. return rs
  385. }
  386. type ImagesService struct {
  387. s *Service
  388. }
  389. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  390. rs := &InstanceGroupManagersService{s: s}
  391. return rs
  392. }
  393. type InstanceGroupManagersService struct {
  394. s *Service
  395. }
  396. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  397. rs := &InstanceGroupsService{s: s}
  398. return rs
  399. }
  400. type InstanceGroupsService struct {
  401. s *Service
  402. }
  403. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  404. rs := &InstanceTemplatesService{s: s}
  405. return rs
  406. }
  407. type InstanceTemplatesService struct {
  408. s *Service
  409. }
  410. func NewInstancesService(s *Service) *InstancesService {
  411. rs := &InstancesService{s: s}
  412. return rs
  413. }
  414. type InstancesService struct {
  415. s *Service
  416. }
  417. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  418. rs := &InterconnectAttachmentsService{s: s}
  419. return rs
  420. }
  421. type InterconnectAttachmentsService struct {
  422. s *Service
  423. }
  424. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  425. rs := &InterconnectLocationsService{s: s}
  426. return rs
  427. }
  428. type InterconnectLocationsService struct {
  429. s *Service
  430. }
  431. func NewInterconnectsService(s *Service) *InterconnectsService {
  432. rs := &InterconnectsService{s: s}
  433. return rs
  434. }
  435. type InterconnectsService struct {
  436. s *Service
  437. }
  438. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  439. rs := &LicenseCodesService{s: s}
  440. return rs
  441. }
  442. type LicenseCodesService struct {
  443. s *Service
  444. }
  445. func NewLicensesService(s *Service) *LicensesService {
  446. rs := &LicensesService{s: s}
  447. return rs
  448. }
  449. type LicensesService struct {
  450. s *Service
  451. }
  452. func NewMachineTypesService(s *Service) *MachineTypesService {
  453. rs := &MachineTypesService{s: s}
  454. return rs
  455. }
  456. type MachineTypesService struct {
  457. s *Service
  458. }
  459. func NewNetworkEndpointGroupsService(s *Service) *NetworkEndpointGroupsService {
  460. rs := &NetworkEndpointGroupsService{s: s}
  461. return rs
  462. }
  463. type NetworkEndpointGroupsService struct {
  464. s *Service
  465. }
  466. func NewNetworksService(s *Service) *NetworksService {
  467. rs := &NetworksService{s: s}
  468. return rs
  469. }
  470. type NetworksService struct {
  471. s *Service
  472. }
  473. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  474. rs := &NodeGroupsService{s: s}
  475. return rs
  476. }
  477. type NodeGroupsService struct {
  478. s *Service
  479. }
  480. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  481. rs := &NodeTemplatesService{s: s}
  482. return rs
  483. }
  484. type NodeTemplatesService struct {
  485. s *Service
  486. }
  487. func NewNodeTypesService(s *Service) *NodeTypesService {
  488. rs := &NodeTypesService{s: s}
  489. return rs
  490. }
  491. type NodeTypesService struct {
  492. s *Service
  493. }
  494. func NewProjectsService(s *Service) *ProjectsService {
  495. rs := &ProjectsService{s: s}
  496. return rs
  497. }
  498. type ProjectsService struct {
  499. s *Service
  500. }
  501. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  502. rs := &RegionAutoscalersService{s: s}
  503. return rs
  504. }
  505. type RegionAutoscalersService struct {
  506. s *Service
  507. }
  508. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  509. rs := &RegionBackendServicesService{s: s}
  510. return rs
  511. }
  512. type RegionBackendServicesService struct {
  513. s *Service
  514. }
  515. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  516. rs := &RegionCommitmentsService{s: s}
  517. return rs
  518. }
  519. type RegionCommitmentsService struct {
  520. s *Service
  521. }
  522. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  523. rs := &RegionDiskTypesService{s: s}
  524. return rs
  525. }
  526. type RegionDiskTypesService struct {
  527. s *Service
  528. }
  529. func NewRegionDisksService(s *Service) *RegionDisksService {
  530. rs := &RegionDisksService{s: s}
  531. return rs
  532. }
  533. type RegionDisksService struct {
  534. s *Service
  535. }
  536. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  537. rs := &RegionInstanceGroupManagersService{s: s}
  538. return rs
  539. }
  540. type RegionInstanceGroupManagersService struct {
  541. s *Service
  542. }
  543. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  544. rs := &RegionInstanceGroupsService{s: s}
  545. return rs
  546. }
  547. type RegionInstanceGroupsService struct {
  548. s *Service
  549. }
  550. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  551. rs := &RegionOperationsService{s: s}
  552. return rs
  553. }
  554. type RegionOperationsService struct {
  555. s *Service
  556. }
  557. func NewRegionsService(s *Service) *RegionsService {
  558. rs := &RegionsService{s: s}
  559. return rs
  560. }
  561. type RegionsService struct {
  562. s *Service
  563. }
  564. func NewResourcePoliciesService(s *Service) *ResourcePoliciesService {
  565. rs := &ResourcePoliciesService{s: s}
  566. return rs
  567. }
  568. type ResourcePoliciesService struct {
  569. s *Service
  570. }
  571. func NewRoutersService(s *Service) *RoutersService {
  572. rs := &RoutersService{s: s}
  573. return rs
  574. }
  575. type RoutersService struct {
  576. s *Service
  577. }
  578. func NewRoutesService(s *Service) *RoutesService {
  579. rs := &RoutesService{s: s}
  580. return rs
  581. }
  582. type RoutesService struct {
  583. s *Service
  584. }
  585. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  586. rs := &SecurityPoliciesService{s: s}
  587. return rs
  588. }
  589. type SecurityPoliciesService struct {
  590. s *Service
  591. }
  592. func NewSnapshotsService(s *Service) *SnapshotsService {
  593. rs := &SnapshotsService{s: s}
  594. return rs
  595. }
  596. type SnapshotsService struct {
  597. s *Service
  598. }
  599. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  600. rs := &SslCertificatesService{s: s}
  601. return rs
  602. }
  603. type SslCertificatesService struct {
  604. s *Service
  605. }
  606. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  607. rs := &SslPoliciesService{s: s}
  608. return rs
  609. }
  610. type SslPoliciesService struct {
  611. s *Service
  612. }
  613. func NewSubnetworksService(s *Service) *SubnetworksService {
  614. rs := &SubnetworksService{s: s}
  615. return rs
  616. }
  617. type SubnetworksService struct {
  618. s *Service
  619. }
  620. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  621. rs := &TargetHttpProxiesService{s: s}
  622. return rs
  623. }
  624. type TargetHttpProxiesService struct {
  625. s *Service
  626. }
  627. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  628. rs := &TargetHttpsProxiesService{s: s}
  629. return rs
  630. }
  631. type TargetHttpsProxiesService struct {
  632. s *Service
  633. }
  634. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  635. rs := &TargetInstancesService{s: s}
  636. return rs
  637. }
  638. type TargetInstancesService struct {
  639. s *Service
  640. }
  641. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  642. rs := &TargetPoolsService{s: s}
  643. return rs
  644. }
  645. type TargetPoolsService struct {
  646. s *Service
  647. }
  648. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  649. rs := &TargetSslProxiesService{s: s}
  650. return rs
  651. }
  652. type TargetSslProxiesService struct {
  653. s *Service
  654. }
  655. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  656. rs := &TargetTcpProxiesService{s: s}
  657. return rs
  658. }
  659. type TargetTcpProxiesService struct {
  660. s *Service
  661. }
  662. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  663. rs := &TargetVpnGatewaysService{s: s}
  664. return rs
  665. }
  666. type TargetVpnGatewaysService struct {
  667. s *Service
  668. }
  669. func NewUrlMapsService(s *Service) *UrlMapsService {
  670. rs := &UrlMapsService{s: s}
  671. return rs
  672. }
  673. type UrlMapsService struct {
  674. s *Service
  675. }
  676. func NewVpnGatewaysService(s *Service) *VpnGatewaysService {
  677. rs := &VpnGatewaysService{s: s}
  678. return rs
  679. }
  680. type VpnGatewaysService struct {
  681. s *Service
  682. }
  683. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  684. rs := &VpnTunnelsService{s: s}
  685. return rs
  686. }
  687. type VpnTunnelsService struct {
  688. s *Service
  689. }
  690. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  691. rs := &ZoneOperationsService{s: s}
  692. return rs
  693. }
  694. type ZoneOperationsService struct {
  695. s *Service
  696. }
  697. func NewZonesService(s *Service) *ZonesService {
  698. rs := &ZonesService{s: s}
  699. return rs
  700. }
  701. type ZonesService struct {
  702. s *Service
  703. }
  704. // AcceleratorConfig: A specification of the type and number of
  705. // accelerator cards attached to the instance.
  706. type AcceleratorConfig struct {
  707. // AcceleratorCount: The number of the guest accelerator cards exposed
  708. // to this instance.
  709. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  710. // AcceleratorType: Full or partial URL of the accelerator type resource
  711. // to attach to this instance. For example:
  712. // projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-
  713. // p100 If you are creating an instance template, specify only the
  714. // accelerator name. See GPUs on Compute Engine for a full list of
  715. // accelerator types.
  716. AcceleratorType string `json:"acceleratorType,omitempty"`
  717. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  718. // unconditionally include in API requests. By default, fields with
  719. // empty values are omitted from API requests. However, any non-pointer,
  720. // non-interface field appearing in ForceSendFields will be sent to the
  721. // server regardless of whether the field is empty or not. This may be
  722. // used to include empty fields in Patch requests.
  723. ForceSendFields []string `json:"-"`
  724. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  725. // include in API requests with the JSON null value. By default, fields
  726. // with empty values are omitted from API requests. However, any field
  727. // with an empty value appearing in NullFields will be sent to the
  728. // server as null. It is an error if a field in this list has a
  729. // non-empty value. This may be used to include null fields in Patch
  730. // requests.
  731. NullFields []string `json:"-"`
  732. }
  733. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  734. type NoMethod AcceleratorConfig
  735. raw := NoMethod(*s)
  736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  737. }
  738. // AcceleratorType: An Accelerator Type resource. (== resource_for
  739. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  740. type AcceleratorType struct {
  741. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  742. // format.
  743. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  744. // Deprecated: [Output Only] The deprecation status associated with this
  745. // accelerator type.
  746. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  747. // Description: [Output Only] An optional textual description of the
  748. // resource.
  749. Description string `json:"description,omitempty"`
  750. // Id: [Output Only] The unique identifier for the resource. This
  751. // identifier is defined by the server.
  752. Id uint64 `json:"id,omitempty,string"`
  753. // Kind: [Output Only] The type of the resource. Always
  754. // compute#acceleratorType for accelerator types.
  755. Kind string `json:"kind,omitempty"`
  756. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  757. // allowed per instance.
  758. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  759. // Name: [Output Only] Name of the resource.
  760. Name string `json:"name,omitempty"`
  761. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  762. // resource.
  763. SelfLink string `json:"selfLink,omitempty"`
  764. // Zone: [Output Only] The name of the zone where the accelerator type
  765. // resides, such as us-central1-a. You must specify this field as part
  766. // of the HTTP request URL. It is not settable as a field in the request
  767. // body.
  768. Zone string `json:"zone,omitempty"`
  769. // ServerResponse contains the HTTP response code and headers from the
  770. // server.
  771. googleapi.ServerResponse `json:"-"`
  772. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  773. // to unconditionally include in API requests. By default, fields with
  774. // empty values are omitted from API requests. However, any non-pointer,
  775. // non-interface field appearing in ForceSendFields will be sent to the
  776. // server regardless of whether the field is empty or not. This may be
  777. // used to include empty fields in Patch requests.
  778. ForceSendFields []string `json:"-"`
  779. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  780. // include in API requests with the JSON null value. By default, fields
  781. // with empty values are omitted from API requests. However, any field
  782. // with an empty value appearing in NullFields will be sent to the
  783. // server as null. It is an error if a field in this list has a
  784. // non-empty value. This may be used to include null fields in Patch
  785. // requests.
  786. NullFields []string `json:"-"`
  787. }
  788. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  789. type NoMethod AcceleratorType
  790. raw := NoMethod(*s)
  791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  792. }
  793. type AcceleratorTypeAggregatedList struct {
  794. // Id: [Output Only] Unique identifier for the resource; defined by the
  795. // server.
  796. Id string `json:"id,omitempty"`
  797. // Items: A list of AcceleratorTypesScopedList resources.
  798. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  799. // Kind: [Output Only] Type of resource. Always
  800. // compute#acceleratorTypeAggregatedList for aggregated lists of
  801. // accelerator types.
  802. Kind string `json:"kind,omitempty"`
  803. // NextPageToken: [Output Only] This token allows you to get the next
  804. // page of results for list requests. If the number of results is larger
  805. // than maxResults, use the nextPageToken as a value for the query
  806. // parameter pageToken in the next list request. Subsequent list
  807. // requests will have their own nextPageToken to continue paging through
  808. // the results.
  809. NextPageToken string `json:"nextPageToken,omitempty"`
  810. // SelfLink: [Output Only] Server-defined URL for this resource.
  811. SelfLink string `json:"selfLink,omitempty"`
  812. // Warning: [Output Only] Informational warning message.
  813. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  814. // ServerResponse contains the HTTP response code and headers from the
  815. // server.
  816. googleapi.ServerResponse `json:"-"`
  817. // ForceSendFields is a list of field names (e.g. "Id") to
  818. // unconditionally include in API requests. By default, fields with
  819. // empty values are omitted from API requests. However, any non-pointer,
  820. // non-interface field appearing in ForceSendFields will be sent to the
  821. // server regardless of whether the field is empty or not. This may be
  822. // used to include empty fields in Patch requests.
  823. ForceSendFields []string `json:"-"`
  824. // NullFields is a list of field names (e.g. "Id") to include in API
  825. // requests with the JSON null value. By default, fields with empty
  826. // values are omitted from API requests. However, any field with an
  827. // empty value appearing in NullFields will be sent to the server as
  828. // null. It is an error if a field in this list has a non-empty value.
  829. // This may be used to include null fields in Patch requests.
  830. NullFields []string `json:"-"`
  831. }
  832. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  833. type NoMethod AcceleratorTypeAggregatedList
  834. raw := NoMethod(*s)
  835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  836. }
  837. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  838. // warning message.
  839. type AcceleratorTypeAggregatedListWarning struct {
  840. // Code: [Output Only] A warning code, if applicable. For example,
  841. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  842. // the response.
  843. //
  844. // Possible values:
  845. // "CLEANUP_FAILED"
  846. // "DEPRECATED_RESOURCE_USED"
  847. // "DEPRECATED_TYPE_USED"
  848. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  849. // "EXPERIMENTAL_TYPE_USED"
  850. // "EXTERNAL_API_WARNING"
  851. // "FIELD_VALUE_OVERRIDEN"
  852. // "INJECTED_KERNELS_DEPRECATED"
  853. // "MISSING_TYPE_DEPENDENCY"
  854. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  855. // "NEXT_HOP_CANNOT_IP_FORWARD"
  856. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  857. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  858. // "NEXT_HOP_NOT_RUNNING"
  859. // "NOT_CRITICAL_ERROR"
  860. // "NO_RESULTS_ON_PAGE"
  861. // "REQUIRED_TOS_AGREEMENT"
  862. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  863. // "RESOURCE_NOT_DELETED"
  864. // "SCHEMA_VALIDATION_IGNORED"
  865. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  866. // "UNDECLARED_PROPERTIES"
  867. // "UNREACHABLE"
  868. Code string `json:"code,omitempty"`
  869. // Data: [Output Only] Metadata about this warning in key: value format.
  870. // For example:
  871. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  872. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  873. // Message: [Output Only] A human-readable description of the warning
  874. // code.
  875. Message string `json:"message,omitempty"`
  876. // ForceSendFields is a list of field names (e.g. "Code") to
  877. // unconditionally include in API requests. By default, fields with
  878. // empty values are omitted from API requests. However, any non-pointer,
  879. // non-interface field appearing in ForceSendFields will be sent to the
  880. // server regardless of whether the field is empty or not. This may be
  881. // used to include empty fields in Patch requests.
  882. ForceSendFields []string `json:"-"`
  883. // NullFields is a list of field names (e.g. "Code") to include in API
  884. // requests with the JSON null value. By default, fields with empty
  885. // values are omitted from API requests. However, any field with an
  886. // empty value appearing in NullFields will be sent to the server as
  887. // null. It is an error if a field in this list has a non-empty value.
  888. // This may be used to include null fields in Patch requests.
  889. NullFields []string `json:"-"`
  890. }
  891. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  892. type NoMethod AcceleratorTypeAggregatedListWarning
  893. raw := NoMethod(*s)
  894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  895. }
  896. type AcceleratorTypeAggregatedListWarningData struct {
  897. // Key: [Output Only] A key that provides more detail on the warning
  898. // being returned. For example, for warnings where there are no results
  899. // in a list request for a particular zone, this key might be scope and
  900. // the key value might be the zone name. Other examples might be a key
  901. // indicating a deprecated resource and a suggested replacement, or a
  902. // warning about invalid network settings (for example, if an instance
  903. // attempts to perform IP forwarding but is not enabled for IP
  904. // forwarding).
  905. Key string `json:"key,omitempty"`
  906. // Value: [Output Only] A warning data value corresponding to the key.
  907. Value string `json:"value,omitempty"`
  908. // ForceSendFields is a list of field names (e.g. "Key") to
  909. // unconditionally include in API requests. By default, fields with
  910. // empty values are omitted from API requests. However, any non-pointer,
  911. // non-interface field appearing in ForceSendFields will be sent to the
  912. // server regardless of whether the field is empty or not. This may be
  913. // used to include empty fields in Patch requests.
  914. ForceSendFields []string `json:"-"`
  915. // NullFields is a list of field names (e.g. "Key") to include in API
  916. // requests with the JSON null value. By default, fields with empty
  917. // values are omitted from API requests. However, any field with an
  918. // empty value appearing in NullFields will be sent to the server as
  919. // null. It is an error if a field in this list has a non-empty value.
  920. // This may be used to include null fields in Patch requests.
  921. NullFields []string `json:"-"`
  922. }
  923. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  924. type NoMethod AcceleratorTypeAggregatedListWarningData
  925. raw := NoMethod(*s)
  926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  927. }
  928. // AcceleratorTypeList: Contains a list of accelerator types.
  929. type AcceleratorTypeList struct {
  930. // Id: [Output Only] Unique identifier for the resource; defined by the
  931. // server.
  932. Id string `json:"id,omitempty"`
  933. // Items: A list of AcceleratorType resources.
  934. Items []*AcceleratorType `json:"items,omitempty"`
  935. // Kind: [Output Only] Type of resource. Always
  936. // compute#acceleratorTypeList for lists of accelerator types.
  937. Kind string `json:"kind,omitempty"`
  938. // NextPageToken: [Output Only] This token allows you to get the next
  939. // page of results for list requests. If the number of results is larger
  940. // than maxResults, use the nextPageToken as a value for the query
  941. // parameter pageToken in the next list request. Subsequent list
  942. // requests will have their own nextPageToken to continue paging through
  943. // the results.
  944. NextPageToken string `json:"nextPageToken,omitempty"`
  945. // SelfLink: [Output Only] Server-defined URL for this resource.
  946. SelfLink string `json:"selfLink,omitempty"`
  947. // Warning: [Output Only] Informational warning message.
  948. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  949. // ServerResponse contains the HTTP response code and headers from the
  950. // server.
  951. googleapi.ServerResponse `json:"-"`
  952. // ForceSendFields is a list of field names (e.g. "Id") to
  953. // unconditionally include in API requests. By default, fields with
  954. // empty values are omitted from API requests. However, any non-pointer,
  955. // non-interface field appearing in ForceSendFields will be sent to the
  956. // server regardless of whether the field is empty or not. This may be
  957. // used to include empty fields in Patch requests.
  958. ForceSendFields []string `json:"-"`
  959. // NullFields is a list of field names (e.g. "Id") to include in API
  960. // requests with the JSON null value. By default, fields with empty
  961. // values are omitted from API requests. However, any field with an
  962. // empty value appearing in NullFields will be sent to the server as
  963. // null. It is an error if a field in this list has a non-empty value.
  964. // This may be used to include null fields in Patch requests.
  965. NullFields []string `json:"-"`
  966. }
  967. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  968. type NoMethod AcceleratorTypeList
  969. raw := NoMethod(*s)
  970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  971. }
  972. // AcceleratorTypeListWarning: [Output Only] Informational warning
  973. // message.
  974. type AcceleratorTypeListWarning struct {
  975. // Code: [Output Only] A warning code, if applicable. For example,
  976. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  977. // the response.
  978. //
  979. // Possible values:
  980. // "CLEANUP_FAILED"
  981. // "DEPRECATED_RESOURCE_USED"
  982. // "DEPRECATED_TYPE_USED"
  983. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  984. // "EXPERIMENTAL_TYPE_USED"
  985. // "EXTERNAL_API_WARNING"
  986. // "FIELD_VALUE_OVERRIDEN"
  987. // "INJECTED_KERNELS_DEPRECATED"
  988. // "MISSING_TYPE_DEPENDENCY"
  989. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  990. // "NEXT_HOP_CANNOT_IP_FORWARD"
  991. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  992. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  993. // "NEXT_HOP_NOT_RUNNING"
  994. // "NOT_CRITICAL_ERROR"
  995. // "NO_RESULTS_ON_PAGE"
  996. // "REQUIRED_TOS_AGREEMENT"
  997. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  998. // "RESOURCE_NOT_DELETED"
  999. // "SCHEMA_VALIDATION_IGNORED"
  1000. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1001. // "UNDECLARED_PROPERTIES"
  1002. // "UNREACHABLE"
  1003. Code string `json:"code,omitempty"`
  1004. // Data: [Output Only] Metadata about this warning in key: value format.
  1005. // For example:
  1006. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1007. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  1008. // Message: [Output Only] A human-readable description of the warning
  1009. // code.
  1010. Message string `json:"message,omitempty"`
  1011. // ForceSendFields is a list of field names (e.g. "Code") to
  1012. // unconditionally include in API requests. By default, fields with
  1013. // empty values are omitted from API requests. However, any non-pointer,
  1014. // non-interface field appearing in ForceSendFields will be sent to the
  1015. // server regardless of whether the field is empty or not. This may be
  1016. // used to include empty fields in Patch requests.
  1017. ForceSendFields []string `json:"-"`
  1018. // NullFields is a list of field names (e.g. "Code") to include in API
  1019. // requests with the JSON null value. By default, fields with empty
  1020. // values are omitted from API requests. However, any field with an
  1021. // empty value appearing in NullFields will be sent to the server as
  1022. // null. It is an error if a field in this list has a non-empty value.
  1023. // This may be used to include null fields in Patch requests.
  1024. NullFields []string `json:"-"`
  1025. }
  1026. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  1027. type NoMethod AcceleratorTypeListWarning
  1028. raw := NoMethod(*s)
  1029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1030. }
  1031. type AcceleratorTypeListWarningData struct {
  1032. // Key: [Output Only] A key that provides more detail on the warning
  1033. // being returned. For example, for warnings where there are no results
  1034. // in a list request for a particular zone, this key might be scope and
  1035. // the key value might be the zone name. Other examples might be a key
  1036. // indicating a deprecated resource and a suggested replacement, or a
  1037. // warning about invalid network settings (for example, if an instance
  1038. // attempts to perform IP forwarding but is not enabled for IP
  1039. // forwarding).
  1040. Key string `json:"key,omitempty"`
  1041. // Value: [Output Only] A warning data value corresponding to the key.
  1042. Value string `json:"value,omitempty"`
  1043. // ForceSendFields is a list of field names (e.g. "Key") to
  1044. // unconditionally include in API requests. By default, fields with
  1045. // empty values are omitted from API requests. However, any non-pointer,
  1046. // non-interface field appearing in ForceSendFields will be sent to the
  1047. // server regardless of whether the field is empty or not. This may be
  1048. // used to include empty fields in Patch requests.
  1049. ForceSendFields []string `json:"-"`
  1050. // NullFields is a list of field names (e.g. "Key") to include in API
  1051. // requests with the JSON null value. By default, fields with empty
  1052. // values are omitted from API requests. However, any field with an
  1053. // empty value appearing in NullFields will be sent to the server as
  1054. // null. It is an error if a field in this list has a non-empty value.
  1055. // This may be used to include null fields in Patch requests.
  1056. NullFields []string `json:"-"`
  1057. }
  1058. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  1059. type NoMethod AcceleratorTypeListWarningData
  1060. raw := NoMethod(*s)
  1061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1062. }
  1063. type AcceleratorTypesScopedList struct {
  1064. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  1065. // in this scope.
  1066. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  1067. // Warning: [Output Only] An informational warning that appears when the
  1068. // accelerator types list is empty.
  1069. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  1070. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  1071. // unconditionally include in API requests. By default, fields with
  1072. // empty values are omitted from API requests. However, any non-pointer,
  1073. // non-interface field appearing in ForceSendFields will be sent to the
  1074. // server regardless of whether the field is empty or not. This may be
  1075. // used to include empty fields in Patch requests.
  1076. ForceSendFields []string `json:"-"`
  1077. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  1078. // include in API requests with the JSON null value. By default, fields
  1079. // with empty values are omitted from API requests. However, any field
  1080. // with an empty value appearing in NullFields will be sent to the
  1081. // server as null. It is an error if a field in this list has a
  1082. // non-empty value. This may be used to include null fields in Patch
  1083. // requests.
  1084. NullFields []string `json:"-"`
  1085. }
  1086. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  1087. type NoMethod AcceleratorTypesScopedList
  1088. raw := NoMethod(*s)
  1089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1090. }
  1091. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  1092. // warning that appears when the accelerator types list is empty.
  1093. type AcceleratorTypesScopedListWarning struct {
  1094. // Code: [Output Only] A warning code, if applicable. For example,
  1095. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1096. // the response.
  1097. //
  1098. // Possible values:
  1099. // "CLEANUP_FAILED"
  1100. // "DEPRECATED_RESOURCE_USED"
  1101. // "DEPRECATED_TYPE_USED"
  1102. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1103. // "EXPERIMENTAL_TYPE_USED"
  1104. // "EXTERNAL_API_WARNING"
  1105. // "FIELD_VALUE_OVERRIDEN"
  1106. // "INJECTED_KERNELS_DEPRECATED"
  1107. // "MISSING_TYPE_DEPENDENCY"
  1108. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1109. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1110. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1111. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1112. // "NEXT_HOP_NOT_RUNNING"
  1113. // "NOT_CRITICAL_ERROR"
  1114. // "NO_RESULTS_ON_PAGE"
  1115. // "REQUIRED_TOS_AGREEMENT"
  1116. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1117. // "RESOURCE_NOT_DELETED"
  1118. // "SCHEMA_VALIDATION_IGNORED"
  1119. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1120. // "UNDECLARED_PROPERTIES"
  1121. // "UNREACHABLE"
  1122. Code string `json:"code,omitempty"`
  1123. // Data: [Output Only] Metadata about this warning in key: value format.
  1124. // For example:
  1125. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1126. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1127. // Message: [Output Only] A human-readable description of the warning
  1128. // code.
  1129. Message string `json:"message,omitempty"`
  1130. // ForceSendFields is a list of field names (e.g. "Code") to
  1131. // unconditionally include in API requests. By default, fields with
  1132. // empty values are omitted from API requests. However, any non-pointer,
  1133. // non-interface field appearing in ForceSendFields will be sent to the
  1134. // server regardless of whether the field is empty or not. This may be
  1135. // used to include empty fields in Patch requests.
  1136. ForceSendFields []string `json:"-"`
  1137. // NullFields is a list of field names (e.g. "Code") to include in API
  1138. // requests with the JSON null value. By default, fields with empty
  1139. // values are omitted from API requests. However, any field with an
  1140. // empty value appearing in NullFields will be sent to the server as
  1141. // null. It is an error if a field in this list has a non-empty value.
  1142. // This may be used to include null fields in Patch requests.
  1143. NullFields []string `json:"-"`
  1144. }
  1145. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1146. type NoMethod AcceleratorTypesScopedListWarning
  1147. raw := NoMethod(*s)
  1148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1149. }
  1150. type AcceleratorTypesScopedListWarningData struct {
  1151. // Key: [Output Only] A key that provides more detail on the warning
  1152. // being returned. For example, for warnings where there are no results
  1153. // in a list request for a particular zone, this key might be scope and
  1154. // the key value might be the zone name. Other examples might be a key
  1155. // indicating a deprecated resource and a suggested replacement, or a
  1156. // warning about invalid network settings (for example, if an instance
  1157. // attempts to perform IP forwarding but is not enabled for IP
  1158. // forwarding).
  1159. Key string `json:"key,omitempty"`
  1160. // Value: [Output Only] A warning data value corresponding to the key.
  1161. Value string `json:"value,omitempty"`
  1162. // ForceSendFields is a list of field names (e.g. "Key") to
  1163. // unconditionally include in API requests. By default, fields with
  1164. // empty values are omitted from API requests. However, any non-pointer,
  1165. // non-interface field appearing in ForceSendFields will be sent to the
  1166. // server regardless of whether the field is empty or not. This may be
  1167. // used to include empty fields in Patch requests.
  1168. ForceSendFields []string `json:"-"`
  1169. // NullFields is a list of field names (e.g. "Key") to include in API
  1170. // requests with the JSON null value. By default, fields with empty
  1171. // values are omitted from API requests. However, any field with an
  1172. // empty value appearing in NullFields will be sent to the server as
  1173. // null. It is an error if a field in this list has a non-empty value.
  1174. // This may be used to include null fields in Patch requests.
  1175. NullFields []string `json:"-"`
  1176. }
  1177. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1178. type NoMethod AcceleratorTypesScopedListWarningData
  1179. raw := NoMethod(*s)
  1180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1181. }
  1182. // AccessConfig: An access configuration attached to an instance's
  1183. // network interface. Only one access config per instance is supported.
  1184. type AccessConfig struct {
  1185. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1186. // for access configs.
  1187. Kind string `json:"kind,omitempty"`
  1188. // Name: The name of this access configuration. The default and
  1189. // recommended name is External NAT but you can use any arbitrary string
  1190. // you would like. For example, My external IP or Network Access.
  1191. Name string `json:"name,omitempty"`
  1192. // NatIP: An external IP address associated with this instance. Specify
  1193. // an unused static external IP address available to the project or
  1194. // leave this field undefined to use an IP from a shared ephemeral IP
  1195. // address pool. If you specify a static external IP address, it must
  1196. // live in the same region as the zone of the instance.
  1197. NatIP string `json:"natIP,omitempty"`
  1198. // NetworkTier: This signifies the networking tier used for configuring
  1199. // this access configuration and can only take the following values:
  1200. // PREMIUM, STANDARD.
  1201. //
  1202. // If an AccessConfig is specified without a valid external IP address,
  1203. // an ephemeral IP will be created with this networkTier.
  1204. //
  1205. // If an AccessConfig with a valid external IP address is specified, it
  1206. // must match that of the networkTier associated with the Address
  1207. // resource owning that IP.
  1208. //
  1209. // Possible values:
  1210. // "PREMIUM"
  1211. // "STANDARD"
  1212. NetworkTier string `json:"networkTier,omitempty"`
  1213. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1214. // This field can only be set when the set_public_ptr field is enabled.
  1215. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1216. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1217. // created to map the external IP address of the instance to a DNS
  1218. // domain name.
  1219. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1220. // Type: The type of configuration. The default and only option is
  1221. // ONE_TO_ONE_NAT.
  1222. //
  1223. // Possible values:
  1224. // "ONE_TO_ONE_NAT" (default)
  1225. Type string `json:"type,omitempty"`
  1226. // ForceSendFields is a list of field names (e.g. "Kind") to
  1227. // unconditionally include in API requests. By default, fields with
  1228. // empty values are omitted from API requests. However, any non-pointer,
  1229. // non-interface field appearing in ForceSendFields will be sent to the
  1230. // server regardless of whether the field is empty or not. This may be
  1231. // used to include empty fields in Patch requests.
  1232. ForceSendFields []string `json:"-"`
  1233. // NullFields is a list of field names (e.g. "Kind") to include in API
  1234. // requests with the JSON null value. By default, fields with empty
  1235. // values are omitted from API requests. However, any field with an
  1236. // empty value appearing in NullFields will be sent to the server as
  1237. // null. It is an error if a field in this list has a non-empty value.
  1238. // This may be used to include null fields in Patch requests.
  1239. NullFields []string `json:"-"`
  1240. }
  1241. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1242. type NoMethod AccessConfig
  1243. raw := NoMethod(*s)
  1244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1245. }
  1246. // Address: A reserved address resource. (== resource_for beta.addresses
  1247. // ==) (== resource_for v1.addresses ==) (== resource_for
  1248. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1249. type Address struct {
  1250. // Address: The static IP address represented by this resource.
  1251. Address string `json:"address,omitempty"`
  1252. // AddressType: The type of address to reserve, either INTERNAL or
  1253. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1254. //
  1255. // Possible values:
  1256. // "EXTERNAL"
  1257. // "INTERNAL"
  1258. // "UNSPECIFIED_TYPE"
  1259. AddressType string `json:"addressType,omitempty"`
  1260. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1261. // format.
  1262. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1263. // Description: An optional description of this resource. Provide this
  1264. // property when you create the resource.
  1265. Description string `json:"description,omitempty"`
  1266. // Id: [Output Only] The unique identifier for the resource. This
  1267. // identifier is defined by the server.
  1268. Id uint64 `json:"id,omitempty,string"`
  1269. // IpVersion: The IP Version that will be used by this address. Valid
  1270. // options are IPV4 or IPV6. This can only be specified for a global
  1271. // address.
  1272. //
  1273. // Possible values:
  1274. // "IPV4"
  1275. // "IPV6"
  1276. // "UNSPECIFIED_VERSION"
  1277. IpVersion string `json:"ipVersion,omitempty"`
  1278. // Kind: [Output Only] Type of the resource. Always compute#address for
  1279. // addresses.
  1280. Kind string `json:"kind,omitempty"`
  1281. // LabelFingerprint: A fingerprint for the labels being applied to this
  1282. // Address, which is essentially a hash of the labels set used for
  1283. // optimistic locking. The fingerprint is initially generated by Compute
  1284. // Engine and changes after every request to modify or update labels.
  1285. // You must always provide an up-to-date fingerprint hash in order to
  1286. // update or change labels, otherwise the request will fail with error
  1287. // 412 conditionNotMet.
  1288. //
  1289. // To see the latest fingerprint, make a get() request to retrieve an
  1290. // Address.
  1291. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  1292. // Labels: Labels to apply to this Address resource. These can be later
  1293. // modified by the setLabels method. Each label key/value must comply
  1294. // with RFC1035. Label values may be empty.
  1295. Labels map[string]string `json:"labels,omitempty"`
  1296. // Name: Name of the resource. Provided by the client when the resource
  1297. // is created. The name must be 1-63 characters long, and comply with
  1298. // RFC1035. Specifically, the name must be 1-63 characters long and
  1299. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1300. // the first character must be a lowercase letter, and all following
  1301. // characters must be a dash, lowercase letter, or digit, except the
  1302. // last character, which cannot be a dash.
  1303. Name string `json:"name,omitempty"`
  1304. // Network: The URL of the network in which to reserve the address. This
  1305. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1306. Network string `json:"network,omitempty"`
  1307. // NetworkTier: This signifies the networking tier used for configuring
  1308. // this Address and can only take the following values: PREMIUM,
  1309. // STANDARD. Global forwarding rules can only be Premium Tier. Regional
  1310. // forwarding rules can be either Premium or Standard Tier. Standard
  1311. // Tier addresses applied to regional forwarding rules can be used with
  1312. // any external load balancer. Regional forwarding rules in Premium Tier
  1313. // can only be used with a Network load balancer.
  1314. //
  1315. // If this field is not specified, it is assumed to be PREMIUM.
  1316. //
  1317. // Possible values:
  1318. // "PREMIUM"
  1319. // "STANDARD"
  1320. NetworkTier string `json:"networkTier,omitempty"`
  1321. // PrefixLength: The prefix length if the resource reprensents an IP
  1322. // range.
  1323. PrefixLength int64 `json:"prefixLength,omitempty"`
  1324. // Purpose: The purpose of resource, only used with INTERNAL type.
  1325. //
  1326. // Possible values:
  1327. // "DNS_RESOLVER"
  1328. // "GCE_ENDPOINT"
  1329. // "NAT_AUTO"
  1330. // "VPC_PEERING"
  1331. Purpose string `json:"purpose,omitempty"`
  1332. // Region: [Output Only] URL of the region where the regional address
  1333. // resides. This field is not applicable to global addresses. You must
  1334. // specify this field as part of the HTTP request URL. You cannot set
  1335. // this field in the request body.
  1336. Region string `json:"region,omitempty"`
  1337. // SelfLink: [Output Only] Server-defined URL for the resource.
  1338. SelfLink string `json:"selfLink,omitempty"`
  1339. // Status: [Output Only] The status of the address, which can be one of
  1340. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1341. // currently in the process of being reserved. A RESERVED address is
  1342. // currently reserved and available to use. An IN_USE address is
  1343. // currently being used by another resource and is not available.
  1344. //
  1345. // Possible values:
  1346. // "IN_USE"
  1347. // "RESERVED"
  1348. // "RESERVING"
  1349. Status string `json:"status,omitempty"`
  1350. // Subnetwork: The URL of the subnetwork in which to reserve the
  1351. // address. If an IP address is specified, it must be within the
  1352. // subnetwork's IP range. This field can only be used with INTERNAL type
  1353. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1354. Subnetwork string `json:"subnetwork,omitempty"`
  1355. // Users: [Output Only] The URLs of the resources that are using this
  1356. // address.
  1357. Users []string `json:"users,omitempty"`
  1358. // ServerResponse contains the HTTP response code and headers from the
  1359. // server.
  1360. googleapi.ServerResponse `json:"-"`
  1361. // ForceSendFields is a list of field names (e.g. "Address") to
  1362. // unconditionally include in API requests. By default, fields with
  1363. // empty values are omitted from API requests. However, any non-pointer,
  1364. // non-interface field appearing in ForceSendFields will be sent to the
  1365. // server regardless of whether the field is empty or not. This may be
  1366. // used to include empty fields in Patch requests.
  1367. ForceSendFields []string `json:"-"`
  1368. // NullFields is a list of field names (e.g. "Address") to include in
  1369. // API requests with the JSON null value. By default, fields with empty
  1370. // values are omitted from API requests. However, any field with an
  1371. // empty value appearing in NullFields will be sent to the server as
  1372. // null. It is an error if a field in this list has a non-empty value.
  1373. // This may be used to include null fields in Patch requests.
  1374. NullFields []string `json:"-"`
  1375. }
  1376. func (s *Address) MarshalJSON() ([]byte, error) {
  1377. type NoMethod Address
  1378. raw := NoMethod(*s)
  1379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1380. }
  1381. type AddressAggregatedList struct {
  1382. // Id: [Output Only] Unique identifier for the resource; defined by the
  1383. // server.
  1384. Id string `json:"id,omitempty"`
  1385. // Items: A list of AddressesScopedList resources.
  1386. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1387. // Kind: [Output Only] Type of resource. Always
  1388. // compute#addressAggregatedList for aggregated lists of addresses.
  1389. Kind string `json:"kind,omitempty"`
  1390. // NextPageToken: [Output Only] This token allows you to get the next
  1391. // page of results for list requests. If the number of results is larger
  1392. // than maxResults, use the nextPageToken as a value for the query
  1393. // parameter pageToken in the next list request. Subsequent list
  1394. // requests will have their own nextPageToken to continue paging through
  1395. // the results.
  1396. NextPageToken string `json:"nextPageToken,omitempty"`
  1397. // SelfLink: [Output Only] Server-defined URL for this resource.
  1398. SelfLink string `json:"selfLink,omitempty"`
  1399. // Warning: [Output Only] Informational warning message.
  1400. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1401. // ServerResponse contains the HTTP response code and headers from the
  1402. // server.
  1403. googleapi.ServerResponse `json:"-"`
  1404. // ForceSendFields is a list of field names (e.g. "Id") to
  1405. // unconditionally include in API requests. By default, fields with
  1406. // empty values are omitted from API requests. However, any non-pointer,
  1407. // non-interface field appearing in ForceSendFields will be sent to the
  1408. // server regardless of whether the field is empty or not. This may be
  1409. // used to include empty fields in Patch requests.
  1410. ForceSendFields []string `json:"-"`
  1411. // NullFields is a list of field names (e.g. "Id") to include in API
  1412. // requests with the JSON null value. By default, fields with empty
  1413. // values are omitted from API requests. However, any field with an
  1414. // empty value appearing in NullFields will be sent to the server as
  1415. // null. It is an error if a field in this list has a non-empty value.
  1416. // This may be used to include null fields in Patch requests.
  1417. NullFields []string `json:"-"`
  1418. }
  1419. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1420. type NoMethod AddressAggregatedList
  1421. raw := NoMethod(*s)
  1422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1423. }
  1424. // AddressAggregatedListWarning: [Output Only] Informational warning
  1425. // message.
  1426. type AddressAggregatedListWarning struct {
  1427. // Code: [Output Only] A warning code, if applicable. For example,
  1428. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1429. // the response.
  1430. //
  1431. // Possible values:
  1432. // "CLEANUP_FAILED"
  1433. // "DEPRECATED_RESOURCE_USED"
  1434. // "DEPRECATED_TYPE_USED"
  1435. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1436. // "EXPERIMENTAL_TYPE_USED"
  1437. // "EXTERNAL_API_WARNING"
  1438. // "FIELD_VALUE_OVERRIDEN"
  1439. // "INJECTED_KERNELS_DEPRECATED"
  1440. // "MISSING_TYPE_DEPENDENCY"
  1441. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1442. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1443. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1444. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1445. // "NEXT_HOP_NOT_RUNNING"
  1446. // "NOT_CRITICAL_ERROR"
  1447. // "NO_RESULTS_ON_PAGE"
  1448. // "REQUIRED_TOS_AGREEMENT"
  1449. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1450. // "RESOURCE_NOT_DELETED"
  1451. // "SCHEMA_VALIDATION_IGNORED"
  1452. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1453. // "UNDECLARED_PROPERTIES"
  1454. // "UNREACHABLE"
  1455. Code string `json:"code,omitempty"`
  1456. // Data: [Output Only] Metadata about this warning in key: value format.
  1457. // For example:
  1458. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1459. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1460. // Message: [Output Only] A human-readable description of the warning
  1461. // code.
  1462. Message string `json:"message,omitempty"`
  1463. // ForceSendFields is a list of field names (e.g. "Code") to
  1464. // unconditionally include in API requests. By default, fields with
  1465. // empty values are omitted from API requests. However, any non-pointer,
  1466. // non-interface field appearing in ForceSendFields will be sent to the
  1467. // server regardless of whether the field is empty or not. This may be
  1468. // used to include empty fields in Patch requests.
  1469. ForceSendFields []string `json:"-"`
  1470. // NullFields is a list of field names (e.g. "Code") to include in API
  1471. // requests with the JSON null value. By default, fields with empty
  1472. // values are omitted from API requests. However, any field with an
  1473. // empty value appearing in NullFields will be sent to the server as
  1474. // null. It is an error if a field in this list has a non-empty value.
  1475. // This may be used to include null fields in Patch requests.
  1476. NullFields []string `json:"-"`
  1477. }
  1478. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1479. type NoMethod AddressAggregatedListWarning
  1480. raw := NoMethod(*s)
  1481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1482. }
  1483. type AddressAggregatedListWarningData struct {
  1484. // Key: [Output Only] A key that provides more detail on the warning
  1485. // being returned. For example, for warnings where there are no results
  1486. // in a list request for a particular zone, this key might be scope and
  1487. // the key value might be the zone name. Other examples might be a key
  1488. // indicating a deprecated resource and a suggested replacement, or a
  1489. // warning about invalid network settings (for example, if an instance
  1490. // attempts to perform IP forwarding but is not enabled for IP
  1491. // forwarding).
  1492. Key string `json:"key,omitempty"`
  1493. // Value: [Output Only] A warning data value corresponding to the key.
  1494. Value string `json:"value,omitempty"`
  1495. // ForceSendFields is a list of field names (e.g. "Key") to
  1496. // unconditionally include in API requests. By default, fields with
  1497. // empty values are omitted from API requests. However, any non-pointer,
  1498. // non-interface field appearing in ForceSendFields will be sent to the
  1499. // server regardless of whether the field is empty or not. This may be
  1500. // used to include empty fields in Patch requests.
  1501. ForceSendFields []string `json:"-"`
  1502. // NullFields is a list of field names (e.g. "Key") to include in API
  1503. // requests with the JSON null value. By default, fields with empty
  1504. // values are omitted from API requests. However, any field with an
  1505. // empty value appearing in NullFields will be sent to the server as
  1506. // null. It is an error if a field in this list has a non-empty value.
  1507. // This may be used to include null fields in Patch requests.
  1508. NullFields []string `json:"-"`
  1509. }
  1510. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1511. type NoMethod AddressAggregatedListWarningData
  1512. raw := NoMethod(*s)
  1513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1514. }
  1515. // AddressList: Contains a list of addresses.
  1516. type AddressList struct {
  1517. // Id: [Output Only] Unique identifier for the resource; defined by the
  1518. // server.
  1519. Id string `json:"id,omitempty"`
  1520. // Items: A list of Address resources.
  1521. Items []*Address `json:"items,omitempty"`
  1522. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1523. // lists of addresses.
  1524. Kind string `json:"kind,omitempty"`
  1525. // NextPageToken: [Output Only] This token allows you to get the next
  1526. // page of results for list requests. If the number of results is larger
  1527. // than maxResults, use the nextPageToken as a value for the query
  1528. // parameter pageToken in the next list request. Subsequent list
  1529. // requests will have their own nextPageToken to continue paging through
  1530. // the results.
  1531. NextPageToken string `json:"nextPageToken,omitempty"`
  1532. // SelfLink: [Output Only] Server-defined URL for this resource.
  1533. SelfLink string `json:"selfLink,omitempty"`
  1534. // Warning: [Output Only] Informational warning message.
  1535. Warning *AddressListWarning `json:"warning,omitempty"`
  1536. // ServerResponse contains the HTTP response code and headers from the
  1537. // server.
  1538. googleapi.ServerResponse `json:"-"`
  1539. // ForceSendFields is a list of field names (e.g. "Id") to
  1540. // unconditionally include in API requests. By default, fields with
  1541. // empty values are omitted from API requests. However, any non-pointer,
  1542. // non-interface field appearing in ForceSendFields will be sent to the
  1543. // server regardless of whether the field is empty or not. This may be
  1544. // used to include empty fields in Patch requests.
  1545. ForceSendFields []string `json:"-"`
  1546. // NullFields is a list of field names (e.g. "Id") to include in API
  1547. // requests with the JSON null value. By default, fields with empty
  1548. // values are omitted from API requests. However, any field with an
  1549. // empty value appearing in NullFields will be sent to the server as
  1550. // null. It is an error if a field in this list has a non-empty value.
  1551. // This may be used to include null fields in Patch requests.
  1552. NullFields []string `json:"-"`
  1553. }
  1554. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1555. type NoMethod AddressList
  1556. raw := NoMethod(*s)
  1557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1558. }
  1559. // AddressListWarning: [Output Only] Informational warning message.
  1560. type AddressListWarning struct {
  1561. // Code: [Output Only] A warning code, if applicable. For example,
  1562. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1563. // the response.
  1564. //
  1565. // Possible values:
  1566. // "CLEANUP_FAILED"
  1567. // "DEPRECATED_RESOURCE_USED"
  1568. // "DEPRECATED_TYPE_USED"
  1569. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1570. // "EXPERIMENTAL_TYPE_USED"
  1571. // "EXTERNAL_API_WARNING"
  1572. // "FIELD_VALUE_OVERRIDEN"
  1573. // "INJECTED_KERNELS_DEPRECATED"
  1574. // "MISSING_TYPE_DEPENDENCY"
  1575. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1576. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1577. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1578. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1579. // "NEXT_HOP_NOT_RUNNING"
  1580. // "NOT_CRITICAL_ERROR"
  1581. // "NO_RESULTS_ON_PAGE"
  1582. // "REQUIRED_TOS_AGREEMENT"
  1583. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1584. // "RESOURCE_NOT_DELETED"
  1585. // "SCHEMA_VALIDATION_IGNORED"
  1586. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1587. // "UNDECLARED_PROPERTIES"
  1588. // "UNREACHABLE"
  1589. Code string `json:"code,omitempty"`
  1590. // Data: [Output Only] Metadata about this warning in key: value format.
  1591. // For example:
  1592. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1593. Data []*AddressListWarningData `json:"data,omitempty"`
  1594. // Message: [Output Only] A human-readable description of the warning
  1595. // code.
  1596. Message string `json:"message,omitempty"`
  1597. // ForceSendFields is a list of field names (e.g. "Code") to
  1598. // unconditionally include in API requests. By default, fields with
  1599. // empty values are omitted from API requests. However, any non-pointer,
  1600. // non-interface field appearing in ForceSendFields will be sent to the
  1601. // server regardless of whether the field is empty or not. This may be
  1602. // used to include empty fields in Patch requests.
  1603. ForceSendFields []string `json:"-"`
  1604. // NullFields is a list of field names (e.g. "Code") to include in API
  1605. // requests with the JSON null value. By default, fields with empty
  1606. // values are omitted from API requests. However, any field with an
  1607. // empty value appearing in NullFields will be sent to the server as
  1608. // null. It is an error if a field in this list has a non-empty value.
  1609. // This may be used to include null fields in Patch requests.
  1610. NullFields []string `json:"-"`
  1611. }
  1612. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1613. type NoMethod AddressListWarning
  1614. raw := NoMethod(*s)
  1615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1616. }
  1617. type AddressListWarningData struct {
  1618. // Key: [Output Only] A key that provides more detail on the warning
  1619. // being returned. For example, for warnings where there are no results
  1620. // in a list request for a particular zone, this key might be scope and
  1621. // the key value might be the zone name. Other examples might be a key
  1622. // indicating a deprecated resource and a suggested replacement, or a
  1623. // warning about invalid network settings (for example, if an instance
  1624. // attempts to perform IP forwarding but is not enabled for IP
  1625. // forwarding).
  1626. Key string `json:"key,omitempty"`
  1627. // Value: [Output Only] A warning data value corresponding to the key.
  1628. Value string `json:"value,omitempty"`
  1629. // ForceSendFields is a list of field names (e.g. "Key") to
  1630. // unconditionally include in API requests. By default, fields with
  1631. // empty values are omitted from API requests. However, any non-pointer,
  1632. // non-interface field appearing in ForceSendFields will be sent to the
  1633. // server regardless of whether the field is empty or not. This may be
  1634. // used to include empty fields in Patch requests.
  1635. ForceSendFields []string `json:"-"`
  1636. // NullFields is a list of field names (e.g. "Key") to include in API
  1637. // requests with the JSON null value. By default, fields with empty
  1638. // values are omitted from API requests. However, any field with an
  1639. // empty value appearing in NullFields will be sent to the server as
  1640. // null. It is an error if a field in this list has a non-empty value.
  1641. // This may be used to include null fields in Patch requests.
  1642. NullFields []string `json:"-"`
  1643. }
  1644. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1645. type NoMethod AddressListWarningData
  1646. raw := NoMethod(*s)
  1647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1648. }
  1649. type AddressesScopedList struct {
  1650. // Addresses: [Output Only] A list of addresses contained in this scope.
  1651. Addresses []*Address `json:"addresses,omitempty"`
  1652. // Warning: [Output Only] Informational warning which replaces the list
  1653. // of addresses when the list is empty.
  1654. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1655. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1656. // unconditionally include in API requests. By default, fields with
  1657. // empty values are omitted from API requests. However, any non-pointer,
  1658. // non-interface field appearing in ForceSendFields will be sent to the
  1659. // server regardless of whether the field is empty or not. This may be
  1660. // used to include empty fields in Patch requests.
  1661. ForceSendFields []string `json:"-"`
  1662. // NullFields is a list of field names (e.g. "Addresses") to include in
  1663. // API requests with the JSON null value. By default, fields with empty
  1664. // values are omitted from API requests. However, any field with an
  1665. // empty value appearing in NullFields will be sent to the server as
  1666. // null. It is an error if a field in this list has a non-empty value.
  1667. // This may be used to include null fields in Patch requests.
  1668. NullFields []string `json:"-"`
  1669. }
  1670. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1671. type NoMethod AddressesScopedList
  1672. raw := NoMethod(*s)
  1673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1674. }
  1675. // AddressesScopedListWarning: [Output Only] Informational warning which
  1676. // replaces the list of addresses when the list is empty.
  1677. type AddressesScopedListWarning struct {
  1678. // Code: [Output Only] A warning code, if applicable. For example,
  1679. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1680. // the response.
  1681. //
  1682. // Possible values:
  1683. // "CLEANUP_FAILED"
  1684. // "DEPRECATED_RESOURCE_USED"
  1685. // "DEPRECATED_TYPE_USED"
  1686. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1687. // "EXPERIMENTAL_TYPE_USED"
  1688. // "EXTERNAL_API_WARNING"
  1689. // "FIELD_VALUE_OVERRIDEN"
  1690. // "INJECTED_KERNELS_DEPRECATED"
  1691. // "MISSING_TYPE_DEPENDENCY"
  1692. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1693. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1694. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1695. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1696. // "NEXT_HOP_NOT_RUNNING"
  1697. // "NOT_CRITICAL_ERROR"
  1698. // "NO_RESULTS_ON_PAGE"
  1699. // "REQUIRED_TOS_AGREEMENT"
  1700. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1701. // "RESOURCE_NOT_DELETED"
  1702. // "SCHEMA_VALIDATION_IGNORED"
  1703. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1704. // "UNDECLARED_PROPERTIES"
  1705. // "UNREACHABLE"
  1706. Code string `json:"code,omitempty"`
  1707. // Data: [Output Only] Metadata about this warning in key: value format.
  1708. // For example:
  1709. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1710. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1711. // Message: [Output Only] A human-readable description of the warning
  1712. // code.
  1713. Message string `json:"message,omitempty"`
  1714. // ForceSendFields is a list of field names (e.g. "Code") to
  1715. // unconditionally include in API requests. By default, fields with
  1716. // empty values are omitted from API requests. However, any non-pointer,
  1717. // non-interface field appearing in ForceSendFields will be sent to the
  1718. // server regardless of whether the field is empty or not. This may be
  1719. // used to include empty fields in Patch requests.
  1720. ForceSendFields []string `json:"-"`
  1721. // NullFields is a list of field names (e.g. "Code") to include in API
  1722. // requests with the JSON null value. By default, fields with empty
  1723. // values are omitted from API requests. However, any field with an
  1724. // empty value appearing in NullFields will be sent to the server as
  1725. // null. It is an error if a field in this list has a non-empty value.
  1726. // This may be used to include null fields in Patch requests.
  1727. NullFields []string `json:"-"`
  1728. }
  1729. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1730. type NoMethod AddressesScopedListWarning
  1731. raw := NoMethod(*s)
  1732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1733. }
  1734. type AddressesScopedListWarningData struct {
  1735. // Key: [Output Only] A key that provides more detail on the warning
  1736. // being returned. For example, for warnings where there are no results
  1737. // in a list request for a particular zone, this key might be scope and
  1738. // the key value might be the zone name. Other examples might be a key
  1739. // indicating a deprecated resource and a suggested replacement, or a
  1740. // warning about invalid network settings (for example, if an instance
  1741. // attempts to perform IP forwarding but is not enabled for IP
  1742. // forwarding).
  1743. Key string `json:"key,omitempty"`
  1744. // Value: [Output Only] A warning data value corresponding to the key.
  1745. Value string `json:"value,omitempty"`
  1746. // ForceSendFields is a list of field names (e.g. "Key") to
  1747. // unconditionally include in API requests. By default, fields with
  1748. // empty values are omitted from API requests. However, any non-pointer,
  1749. // non-interface field appearing in ForceSendFields will be sent to the
  1750. // server regardless of whether the field is empty or not. This may be
  1751. // used to include empty fields in Patch requests.
  1752. ForceSendFields []string `json:"-"`
  1753. // NullFields is a list of field names (e.g. "Key") to include in API
  1754. // requests with the JSON null value. By default, fields with empty
  1755. // values are omitted from API requests. However, any field with an
  1756. // empty value appearing in NullFields will be sent to the server as
  1757. // null. It is an error if a field in this list has a non-empty value.
  1758. // This may be used to include null fields in Patch requests.
  1759. NullFields []string `json:"-"`
  1760. }
  1761. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1762. type NoMethod AddressesScopedListWarningData
  1763. raw := NoMethod(*s)
  1764. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1765. }
  1766. // AliasIpRange: An alias IP range attached to an instance's network
  1767. // interface.
  1768. type AliasIpRange struct {
  1769. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1770. // This IP CIDR range must belong to the specified subnetwork and cannot
  1771. // contain IP addresses reserved by system or used by other network
  1772. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1773. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1774. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1775. // SubnetworkRangeName: Optional subnetwork secondary range name
  1776. // specifying the secondary range from which to allocate the IP CIDR
  1777. // range for this alias IP range. If left unspecified, the primary range
  1778. // of the subnetwork will be used.
  1779. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1780. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1781. // unconditionally include in API requests. By default, fields with
  1782. // empty values are omitted from API requests. However, any non-pointer,
  1783. // non-interface field appearing in ForceSendFields will be sent to the
  1784. // server regardless of whether the field is empty or not. This may be
  1785. // used to include empty fields in Patch requests.
  1786. ForceSendFields []string `json:"-"`
  1787. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1788. // in API requests with the JSON null value. By default, fields with
  1789. // empty values are omitted from API requests. However, any field with
  1790. // an empty value appearing in NullFields will be sent to the server as
  1791. // null. It is an error if a field in this list has a non-empty value.
  1792. // This may be used to include null fields in Patch requests.
  1793. NullFields []string `json:"-"`
  1794. }
  1795. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1796. type NoMethod AliasIpRange
  1797. raw := NoMethod(*s)
  1798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1799. }
  1800. // Allocation: Allocation resource
  1801. type Allocation struct {
  1802. // Commitment: [OutputOnly] Full or partial url for parent commitment
  1803. // for allocations which are tied to a commitment.
  1804. Commitment string `json:"commitment,omitempty"`
  1805. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1806. // format.
  1807. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1808. // Description: An optional description of this resource. Provide this
  1809. // property when you create the resource.
  1810. Description string `json:"description,omitempty"`
  1811. // Id: [Output Only] The unique identifier for the resource. This
  1812. // identifier is defined by the server.
  1813. Id uint64 `json:"id,omitempty,string"`
  1814. // Kind: [Output Only] Type of the resource. Always compute#allocations
  1815. // for allocations.
  1816. Kind string `json:"kind,omitempty"`
  1817. // Name: The name of the resource, provided by the client when initially
  1818. // creating the resource. The resource name must be 1-63 characters
  1819. // long, and comply with RFC1035. Specifically, the name must be 1-63
  1820. // characters long and match the regular expression
  1821. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  1822. // a lowercase letter, and all following characters must be a dash,
  1823. // lowercase letter, or digit, except the last character, which cannot
  1824. // be a dash.
  1825. Name string `json:"name,omitempty"`
  1826. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  1827. // resource.
  1828. SelfLink string `json:"selfLink,omitempty"`
  1829. // SpecificAllocation: Allocation for instances with specific machine
  1830. // shapes.
  1831. SpecificAllocation *AllocationSpecificSKUAllocation `json:"specificAllocation,omitempty"`
  1832. // SpecificAllocationRequired: Indicates whether the allocation can be
  1833. // consumed by VMs with "any allocation" defined. If the field is set,
  1834. // then only VMs that target the allocation by name using
  1835. // --allocation-affinity can consume this allocation.
  1836. SpecificAllocationRequired bool `json:"specificAllocationRequired,omitempty"`
  1837. // Zone: Zone in which the allocation resides, must be provided if
  1838. // allocation is created with commitment creation.
  1839. Zone string `json:"zone,omitempty"`
  1840. // ServerResponse contains the HTTP response code and headers from the
  1841. // server.
  1842. googleapi.ServerResponse `json:"-"`
  1843. // ForceSendFields is a list of field names (e.g. "Commitment") to
  1844. // unconditionally include in API requests. By default, fields with
  1845. // empty values are omitted from API requests. However, any non-pointer,
  1846. // non-interface field appearing in ForceSendFields will be sent to the
  1847. // server regardless of whether the field is empty or not. This may be
  1848. // used to include empty fields in Patch requests.
  1849. ForceSendFields []string `json:"-"`
  1850. // NullFields is a list of field names (e.g. "Commitment") to include in
  1851. // API requests with the JSON null value. By default, fields with empty
  1852. // values are omitted from API requests. However, any field with an
  1853. // empty value appearing in NullFields will be sent to the server as
  1854. // null. It is an error if a field in this list has a non-empty value.
  1855. // This may be used to include null fields in Patch requests.
  1856. NullFields []string `json:"-"`
  1857. }
  1858. func (s *Allocation) MarshalJSON() ([]byte, error) {
  1859. type NoMethod Allocation
  1860. raw := NoMethod(*s)
  1861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1862. }
  1863. // AllocationAffinity: AllocationAffinity is the configuration of
  1864. // desired allocation which this instance could take capacity from.
  1865. type AllocationAffinity struct {
  1866. // Possible values:
  1867. // "ANY_ALLOCATION"
  1868. // "NO_ALLOCATION"
  1869. // "SPECIFIC_ALLOCATION"
  1870. // "UNSPECIFIED"
  1871. ConsumeAllocationType string `json:"consumeAllocationType,omitempty"`
  1872. // Key: Corresponds to the label key of allocation resource.
  1873. Key string `json:"key,omitempty"`
  1874. // Values: Corresponds to the label values of allocation resource.
  1875. Values []string `json:"values,omitempty"`
  1876. // ForceSendFields is a list of field names (e.g.
  1877. // "ConsumeAllocationType") to unconditionally include in API requests.
  1878. // By default, fields with empty values are omitted from API requests.
  1879. // However, any non-pointer, non-interface field appearing in
  1880. // ForceSendFields will be sent to the server regardless of whether the
  1881. // field is empty or not. This may be used to include empty fields in
  1882. // Patch requests.
  1883. ForceSendFields []string `json:"-"`
  1884. // NullFields is a list of field names (e.g. "ConsumeAllocationType") to
  1885. // include in API requests with the JSON null value. By default, fields
  1886. // with empty values are omitted from API requests. However, any field
  1887. // with an empty value appearing in NullFields will be sent to the
  1888. // server as null. It is an error if a field in this list has a
  1889. // non-empty value. This may be used to include null fields in Patch
  1890. // requests.
  1891. NullFields []string `json:"-"`
  1892. }
  1893. func (s *AllocationAffinity) MarshalJSON() ([]byte, error) {
  1894. type NoMethod AllocationAffinity
  1895. raw := NoMethod(*s)
  1896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1897. }
  1898. // AllocationAggregatedList: Contains a list of allocations.
  1899. type AllocationAggregatedList struct {
  1900. // Id: [Output Only] Unique identifier for the resource; defined by the
  1901. // server.
  1902. Id string `json:"id,omitempty"`
  1903. // Items: A list of Allocation resources.
  1904. Items map[string]AllocationsScopedList `json:"items,omitempty"`
  1905. // Kind: Type of resource.
  1906. Kind string `json:"kind,omitempty"`
  1907. // NextPageToken: [Output Only] This token allows you to get the next
  1908. // page of results for list requests. If the number of results is larger
  1909. // than maxResults, use the nextPageToken as a value for the query
  1910. // parameter pageToken in the next list request. Subsequent list
  1911. // requests will have their own nextPageToken to continue paging through
  1912. // the results.
  1913. NextPageToken string `json:"nextPageToken,omitempty"`
  1914. // SelfLink: [Output Only] Server-defined URL for this resource.
  1915. SelfLink string `json:"selfLink,omitempty"`
  1916. // Warning: [Output Only] Informational warning message.
  1917. Warning *AllocationAggregatedListWarning `json:"warning,omitempty"`
  1918. // ServerResponse contains the HTTP response code and headers from the
  1919. // server.
  1920. googleapi.ServerResponse `json:"-"`
  1921. // ForceSendFields is a list of field names (e.g. "Id") to
  1922. // unconditionally include in API requests. By default, fields with
  1923. // empty values are omitted from API requests. However, any non-pointer,
  1924. // non-interface field appearing in ForceSendFields will be sent to the
  1925. // server regardless of whether the field is empty or not. This may be
  1926. // used to include empty fields in Patch requests.
  1927. ForceSendFields []string `json:"-"`
  1928. // NullFields is a list of field names (e.g. "Id") to include in API
  1929. // requests with the JSON null value. By default, fields with empty
  1930. // values are omitted from API requests. However, any field with an
  1931. // empty value appearing in NullFields will be sent to the server as
  1932. // null. It is an error if a field in this list has a non-empty value.
  1933. // This may be used to include null fields in Patch requests.
  1934. NullFields []string `json:"-"`
  1935. }
  1936. func (s *AllocationAggregatedList) MarshalJSON() ([]byte, error) {
  1937. type NoMethod AllocationAggregatedList
  1938. raw := NoMethod(*s)
  1939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1940. }
  1941. // AllocationAggregatedListWarning: [Output Only] Informational warning
  1942. // message.
  1943. type AllocationAggregatedListWarning struct {
  1944. // Code: [Output Only] A warning code, if applicable. For example,
  1945. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1946. // the response.
  1947. //
  1948. // Possible values:
  1949. // "CLEANUP_FAILED"
  1950. // "DEPRECATED_RESOURCE_USED"
  1951. // "DEPRECATED_TYPE_USED"
  1952. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1953. // "EXPERIMENTAL_TYPE_USED"
  1954. // "EXTERNAL_API_WARNING"
  1955. // "FIELD_VALUE_OVERRIDEN"
  1956. // "INJECTED_KERNELS_DEPRECATED"
  1957. // "MISSING_TYPE_DEPENDENCY"
  1958. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1959. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1960. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1961. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1962. // "NEXT_HOP_NOT_RUNNING"
  1963. // "NOT_CRITICAL_ERROR"
  1964. // "NO_RESULTS_ON_PAGE"
  1965. // "REQUIRED_TOS_AGREEMENT"
  1966. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1967. // "RESOURCE_NOT_DELETED"
  1968. // "SCHEMA_VALIDATION_IGNORED"
  1969. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1970. // "UNDECLARED_PROPERTIES"
  1971. // "UNREACHABLE"
  1972. Code string `json:"code,omitempty"`
  1973. // Data: [Output Only] Metadata about this warning in key: value format.
  1974. // For example:
  1975. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1976. Data []*AllocationAggregatedListWarningData `json:"data,omitempty"`
  1977. // Message: [Output Only] A human-readable description of the warning
  1978. // code.
  1979. Message string `json:"message,omitempty"`
  1980. // ForceSendFields is a list of field names (e.g. "Code") to
  1981. // unconditionally include in API requests. By default, fields with
  1982. // empty values are omitted from API requests. However, any non-pointer,
  1983. // non-interface field appearing in ForceSendFields will be sent to the
  1984. // server regardless of whether the field is empty or not. This may be
  1985. // used to include empty fields in Patch requests.
  1986. ForceSendFields []string `json:"-"`
  1987. // NullFields is a list of field names (e.g. "Code") to include in API
  1988. // requests with the JSON null value. By default, fields with empty
  1989. // values are omitted from API requests. However, any field with an
  1990. // empty value appearing in NullFields will be sent to the server as
  1991. // null. It is an error if a field in this list has a non-empty value.
  1992. // This may be used to include null fields in Patch requests.
  1993. NullFields []string `json:"-"`
  1994. }
  1995. func (s *AllocationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1996. type NoMethod AllocationAggregatedListWarning
  1997. raw := NoMethod(*s)
  1998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1999. }
  2000. type AllocationAggregatedListWarningData struct {
  2001. // Key: [Output Only] A key that provides more detail on the warning
  2002. // being returned. For example, for warnings where there are no results
  2003. // in a list request for a particular zone, this key might be scope and
  2004. // the key value might be the zone name. Other examples might be a key
  2005. // indicating a deprecated resource and a suggested replacement, or a
  2006. // warning about invalid network settings (for example, if an instance
  2007. // attempts to perform IP forwarding but is not enabled for IP
  2008. // forwarding).
  2009. Key string `json:"key,omitempty"`
  2010. // Value: [Output Only] A warning data value corresponding to the key.
  2011. Value string `json:"value,omitempty"`
  2012. // ForceSendFields is a list of field names (e.g. "Key") to
  2013. // unconditionally include in API requests. By default, fields with
  2014. // empty values are omitted from API requests. However, any non-pointer,
  2015. // non-interface field appearing in ForceSendFields will be sent to the
  2016. // server regardless of whether the field is empty or not. This may be
  2017. // used to include empty fields in Patch requests.
  2018. ForceSendFields []string `json:"-"`
  2019. // NullFields is a list of field names (e.g. "Key") to include in API
  2020. // requests with the JSON null value. By default, fields with empty
  2021. // values are omitted from API requests. However, any field with an
  2022. // empty value appearing in NullFields will be sent to the server as
  2023. // null. It is an error if a field in this list has a non-empty value.
  2024. // This may be used to include null fields in Patch requests.
  2025. NullFields []string `json:"-"`
  2026. }
  2027. func (s *AllocationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2028. type NoMethod AllocationAggregatedListWarningData
  2029. raw := NoMethod(*s)
  2030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2031. }
  2032. type AllocationList struct {
  2033. // Id: [Output Only] The unique identifier for the resource. This
  2034. // identifier is defined by the server.
  2035. Id string `json:"id,omitempty"`
  2036. // Items: [Output Only] A list of Allocation resources.
  2037. Items []*Allocation `json:"items,omitempty"`
  2038. // Kind: [Output Only] Type of resource.Always compute#allocationsList
  2039. // for listsof allocations
  2040. Kind string `json:"kind,omitempty"`
  2041. // NextPageToken: [Output Only] This token allows you to get the next
  2042. // page of results for list requests. If the number of results is larger
  2043. // than maxResults, use the nextPageToken as a value for the query
  2044. // parameter pageToken in the next list request. Subsequent list
  2045. // requests will have their own nextPageToken to continue paging through
  2046. // the results.
  2047. NextPageToken string `json:"nextPageToken,omitempty"`
  2048. // SelfLink: [Output Only] Server-defined URL for this resource.
  2049. SelfLink string `json:"selfLink,omitempty"`
  2050. // Warning: [Output Only] Informational warning message.
  2051. Warning *AllocationListWarning `json:"warning,omitempty"`
  2052. // ServerResponse contains the HTTP response code and headers from the
  2053. // server.
  2054. googleapi.ServerResponse `json:"-"`
  2055. // ForceSendFields is a list of field names (e.g. "Id") to
  2056. // unconditionally include in API requests. By default, fields with
  2057. // empty values are omitted from API requests. However, any non-pointer,
  2058. // non-interface field appearing in ForceSendFields will be sent to the
  2059. // server regardless of whether the field is empty or not. This may be
  2060. // used to include empty fields in Patch requests.
  2061. ForceSendFields []string `json:"-"`
  2062. // NullFields is a list of field names (e.g. "Id") to include in API
  2063. // requests with the JSON null value. By default, fields with empty
  2064. // values are omitted from API requests. However, any field with an
  2065. // empty value appearing in NullFields will be sent to the server as
  2066. // null. It is an error if a field in this list has a non-empty value.
  2067. // This may be used to include null fields in Patch requests.
  2068. NullFields []string `json:"-"`
  2069. }
  2070. func (s *AllocationList) MarshalJSON() ([]byte, error) {
  2071. type NoMethod AllocationList
  2072. raw := NoMethod(*s)
  2073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2074. }
  2075. // AllocationListWarning: [Output Only] Informational warning message.
  2076. type AllocationListWarning struct {
  2077. // Code: [Output Only] A warning code, if applicable. For example,
  2078. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2079. // the response.
  2080. //
  2081. // Possible values:
  2082. // "CLEANUP_FAILED"
  2083. // "DEPRECATED_RESOURCE_USED"
  2084. // "DEPRECATED_TYPE_USED"
  2085. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2086. // "EXPERIMENTAL_TYPE_USED"
  2087. // "EXTERNAL_API_WARNING"
  2088. // "FIELD_VALUE_OVERRIDEN"
  2089. // "INJECTED_KERNELS_DEPRECATED"
  2090. // "MISSING_TYPE_DEPENDENCY"
  2091. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2092. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2093. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2094. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2095. // "NEXT_HOP_NOT_RUNNING"
  2096. // "NOT_CRITICAL_ERROR"
  2097. // "NO_RESULTS_ON_PAGE"
  2098. // "REQUIRED_TOS_AGREEMENT"
  2099. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2100. // "RESOURCE_NOT_DELETED"
  2101. // "SCHEMA_VALIDATION_IGNORED"
  2102. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2103. // "UNDECLARED_PROPERTIES"
  2104. // "UNREACHABLE"
  2105. Code string `json:"code,omitempty"`
  2106. // Data: [Output Only] Metadata about this warning in key: value format.
  2107. // For example:
  2108. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2109. Data []*AllocationListWarningData `json:"data,omitempty"`
  2110. // Message: [Output Only] A human-readable description of the warning
  2111. // code.
  2112. Message string `json:"message,omitempty"`
  2113. // ForceSendFields is a list of field names (e.g. "Code") to
  2114. // unconditionally include in API requests. By default, fields with
  2115. // empty values are omitted from API requests. However, any non-pointer,
  2116. // non-interface field appearing in ForceSendFields will be sent to the
  2117. // server regardless of whether the field is empty or not. This may be
  2118. // used to include empty fields in Patch requests.
  2119. ForceSendFields []string `json:"-"`
  2120. // NullFields is a list of field names (e.g. "Code") to include in API
  2121. // requests with the JSON null value. By default, fields with empty
  2122. // values are omitted from API requests. However, any field with an
  2123. // empty value appearing in NullFields will be sent to the server as
  2124. // null. It is an error if a field in this list has a non-empty value.
  2125. // This may be used to include null fields in Patch requests.
  2126. NullFields []string `json:"-"`
  2127. }
  2128. func (s *AllocationListWarning) MarshalJSON() ([]byte, error) {
  2129. type NoMethod AllocationListWarning
  2130. raw := NoMethod(*s)
  2131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2132. }
  2133. type AllocationListWarningData struct {
  2134. // Key: [Output Only] A key that provides more detail on the warning
  2135. // being returned. For example, for warnings where there are no results
  2136. // in a list request for a particular zone, this key might be scope and
  2137. // the key value might be the zone name. Other examples might be a key
  2138. // indicating a deprecated resource and a suggested replacement, or a
  2139. // warning about invalid network settings (for example, if an instance
  2140. // attempts to perform IP forwarding but is not enabled for IP
  2141. // forwarding).
  2142. Key string `json:"key,omitempty"`
  2143. // Value: [Output Only] A warning data value corresponding to the key.
  2144. Value string `json:"value,omitempty"`
  2145. // ForceSendFields is a list of field names (e.g. "Key") to
  2146. // unconditionally include in API requests. By default, fields with
  2147. // empty values are omitted from API requests. However, any non-pointer,
  2148. // non-interface field appearing in ForceSendFields will be sent to the
  2149. // server regardless of whether the field is empty or not. This may be
  2150. // used to include empty fields in Patch requests.
  2151. ForceSendFields []string `json:"-"`
  2152. // NullFields is a list of field names (e.g. "Key") to include in API
  2153. // requests with the JSON null value. By default, fields with empty
  2154. // values are omitted from API requests. However, any field with an
  2155. // empty value appearing in NullFields will be sent to the server as
  2156. // null. It is an error if a field in this list has a non-empty value.
  2157. // This may be used to include null fields in Patch requests.
  2158. NullFields []string `json:"-"`
  2159. }
  2160. func (s *AllocationListWarningData) MarshalJSON() ([]byte, error) {
  2161. type NoMethod AllocationListWarningData
  2162. raw := NoMethod(*s)
  2163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2164. }
  2165. // AllocationSpecificSKUAllocation: This allocation type allows to pre
  2166. // allocate specific instance configuration.
  2167. type AllocationSpecificSKUAllocation struct {
  2168. // Count: Specifies number of resources that are allocated.
  2169. Count int64 `json:"count,omitempty,string"`
  2170. // InUseCount: [OutputOnly] Indicates how many resource are in use.
  2171. InUseCount int64 `json:"inUseCount,omitempty,string"`
  2172. // InstanceProperties: The instance properties for this specific sku
  2173. // allocation.
  2174. InstanceProperties *AllocationSpecificSKUAllocationAllocatedInstanceProperties `json:"instanceProperties,omitempty"`
  2175. // ForceSendFields is a list of field names (e.g. "Count") to
  2176. // unconditionally include in API requests. By default, fields with
  2177. // empty values are omitted from API requests. However, any non-pointer,
  2178. // non-interface field appearing in ForceSendFields will be sent to the
  2179. // server regardless of whether the field is empty or not. This may be
  2180. // used to include empty fields in Patch requests.
  2181. ForceSendFields []string `json:"-"`
  2182. // NullFields is a list of field names (e.g. "Count") to include in API
  2183. // requests with the JSON null value. By default, fields with empty
  2184. // values are omitted from API requests. However, any field with an
  2185. // empty value appearing in NullFields will be sent to the server as
  2186. // null. It is an error if a field in this list has a non-empty value.
  2187. // This may be used to include null fields in Patch requests.
  2188. NullFields []string `json:"-"`
  2189. }
  2190. func (s *AllocationSpecificSKUAllocation) MarshalJSON() ([]byte, error) {
  2191. type NoMethod AllocationSpecificSKUAllocation
  2192. raw := NoMethod(*s)
  2193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2194. }
  2195. // AllocationSpecificSKUAllocationAllocatedInstanceProperties:
  2196. // Properties of the SKU instances being reserved.
  2197. type AllocationSpecificSKUAllocationAllocatedInstanceProperties struct {
  2198. // GuestAccelerators: Specifies accelerator type and count.
  2199. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  2200. // LocalSsds: Specifies amount of local ssd to reserve with each
  2201. // instance. The type of disk is local-ssd.
  2202. LocalSsds []*AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk `json:"localSsds,omitempty"`
  2203. // MachineType: Specifies type of machine (name only) which has fixed
  2204. // number of vCPUs and fixed amount of memory. This also includes
  2205. // specifying custom machine type following
  2206. // custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
  2207. MachineType string `json:"machineType,omitempty"`
  2208. // MinCpuPlatform: Minimum cpu platform the allocation.
  2209. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  2210. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  2211. // to unconditionally include in API requests. By default, fields with
  2212. // empty values are omitted from API requests. However, any non-pointer,
  2213. // non-interface field appearing in ForceSendFields will be sent to the
  2214. // server regardless of whether the field is empty or not. This may be
  2215. // used to include empty fields in Patch requests.
  2216. ForceSendFields []string `json:"-"`
  2217. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  2218. // include in API requests with the JSON null value. By default, fields
  2219. // with empty values are omitted from API requests. However, any field
  2220. // with an empty value appearing in NullFields will be sent to the
  2221. // server as null. It is an error if a field in this list has a
  2222. // non-empty value. This may be used to include null fields in Patch
  2223. // requests.
  2224. NullFields []string `json:"-"`
  2225. }
  2226. func (s *AllocationSpecificSKUAllocationAllocatedInstanceProperties) MarshalJSON() ([]byte, error) {
  2227. type NoMethod AllocationSpecificSKUAllocationAllocatedInstanceProperties
  2228. raw := NoMethod(*s)
  2229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2230. }
  2231. type AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk struct {
  2232. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  2233. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2234. // Interface: Specifies the disk interface to use for attaching this
  2235. // disk, which is either SCSI or NVME. The default is SCSI. For
  2236. // performance characteristics of SCSI over NVMe, see Local SSD
  2237. // performance.
  2238. //
  2239. // Possible values:
  2240. // "NVME"
  2241. // "SCSI"
  2242. Interface string `json:"interface,omitempty"`
  2243. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
  2244. // unconditionally include in API requests. By default, fields with
  2245. // empty values are omitted from API requests. However, any non-pointer,
  2246. // non-interface field appearing in ForceSendFields will be sent to the
  2247. // server regardless of whether the field is empty or not. This may be
  2248. // used to include empty fields in Patch requests.
  2249. ForceSendFields []string `json:"-"`
  2250. // NullFields is a list of field names (e.g. "DiskSizeGb") to include in
  2251. // API requests with the JSON null value. By default, fields with empty
  2252. // values are omitted from API requests. However, any field with an
  2253. // empty value appearing in NullFields will be sent to the server as
  2254. // null. It is an error if a field in this list has a non-empty value.
  2255. // This may be used to include null fields in Patch requests.
  2256. NullFields []string `json:"-"`
  2257. }
  2258. func (s *AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk) MarshalJSON() ([]byte, error) {
  2259. type NoMethod AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk
  2260. raw := NoMethod(*s)
  2261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2262. }
  2263. type AllocationsResizeRequest struct {
  2264. // SpecificSkuCount: Number of allocated resources can be resized with
  2265. // minimum = 1 and maximum = 1000.
  2266. SpecificSkuCount int64 `json:"specificSkuCount,omitempty,string"`
  2267. // ForceSendFields is a list of field names (e.g. "SpecificSkuCount") to
  2268. // unconditionally include in API requests. By default, fields with
  2269. // empty values are omitted from API requests. However, any non-pointer,
  2270. // non-interface field appearing in ForceSendFields will be sent to the
  2271. // server regardless of whether the field is empty or not. This may be
  2272. // used to include empty fields in Patch requests.
  2273. ForceSendFields []string `json:"-"`
  2274. // NullFields is a list of field names (e.g. "SpecificSkuCount") to
  2275. // include in API requests with the JSON null value. By default, fields
  2276. // with empty values are omitted from API requests. However, any field
  2277. // with an empty value appearing in NullFields will be sent to the
  2278. // server as null. It is an error if a field in this list has a
  2279. // non-empty value. This may be used to include null fields in Patch
  2280. // requests.
  2281. NullFields []string `json:"-"`
  2282. }
  2283. func (s *AllocationsResizeRequest) MarshalJSON() ([]byte, error) {
  2284. type NoMethod AllocationsResizeRequest
  2285. raw := NoMethod(*s)
  2286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2287. }
  2288. type AllocationsScopedList struct {
  2289. // Allocations: A list of allocations contained in this scope.
  2290. Allocations []*Allocation `json:"allocations,omitempty"`
  2291. // Warning: Informational warning which replaces the list of allocations
  2292. // when the list is empty.
  2293. Warning *AllocationsScopedListWarning `json:"warning,omitempty"`
  2294. // ForceSendFields is a list of field names (e.g. "Allocations") to
  2295. // unconditionally include in API requests. By default, fields with
  2296. // empty values are omitted from API requests. However, any non-pointer,
  2297. // non-interface field appearing in ForceSendFields will be sent to the
  2298. // server regardless of whether the field is empty or not. This may be
  2299. // used to include empty fields in Patch requests.
  2300. ForceSendFields []string `json:"-"`
  2301. // NullFields is a list of field names (e.g. "Allocations") to include
  2302. // in API requests with the JSON null value. By default, fields with
  2303. // empty values are omitted from API requests. However, any field with
  2304. // an empty value appearing in NullFields will be sent to the server as
  2305. // null. It is an error if a field in this list has a non-empty value.
  2306. // This may be used to include null fields in Patch requests.
  2307. NullFields []string `json:"-"`
  2308. }
  2309. func (s *AllocationsScopedList) MarshalJSON() ([]byte, error) {
  2310. type NoMethod AllocationsScopedList
  2311. raw := NoMethod(*s)
  2312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2313. }
  2314. // AllocationsScopedListWarning: Informational warning which replaces
  2315. // the list of allocations when the list is empty.
  2316. type AllocationsScopedListWarning struct {
  2317. // Code: [Output Only] A warning code, if applicable. For example,
  2318. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2319. // the response.
  2320. //
  2321. // Possible values:
  2322. // "CLEANUP_FAILED"
  2323. // "DEPRECATED_RESOURCE_USED"
  2324. // "DEPRECATED_TYPE_USED"
  2325. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2326. // "EXPERIMENTAL_TYPE_USED"
  2327. // "EXTERNAL_API_WARNING"
  2328. // "FIELD_VALUE_OVERRIDEN"
  2329. // "INJECTED_KERNELS_DEPRECATED"
  2330. // "MISSING_TYPE_DEPENDENCY"
  2331. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2332. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2333. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2334. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2335. // "NEXT_HOP_NOT_RUNNING"
  2336. // "NOT_CRITICAL_ERROR"
  2337. // "NO_RESULTS_ON_PAGE"
  2338. // "REQUIRED_TOS_AGREEMENT"
  2339. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2340. // "RESOURCE_NOT_DELETED"
  2341. // "SCHEMA_VALIDATION_IGNORED"
  2342. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2343. // "UNDECLARED_PROPERTIES"
  2344. // "UNREACHABLE"
  2345. Code string `json:"code,omitempty"`
  2346. // Data: [Output Only] Metadata about this warning in key: value format.
  2347. // For example:
  2348. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2349. Data []*AllocationsScopedListWarningData `json:"data,omitempty"`
  2350. // Message: [Output Only] A human-readable description of the warning
  2351. // code.
  2352. Message string `json:"message,omitempty"`
  2353. // ForceSendFields is a list of field names (e.g. "Code") to
  2354. // unconditionally include in API requests. By default, fields with
  2355. // empty values are omitted from API requests. However, any non-pointer,
  2356. // non-interface field appearing in ForceSendFields will be sent to the
  2357. // server regardless of whether the field is empty or not. This may be
  2358. // used to include empty fields in Patch requests.
  2359. ForceSendFields []string `json:"-"`
  2360. // NullFields is a list of field names (e.g. "Code") to include in API
  2361. // requests with the JSON null value. By default, fields with empty
  2362. // values are omitted from API requests. However, any field with an
  2363. // empty value appearing in NullFields will be sent to the server as
  2364. // null. It is an error if a field in this list has a non-empty value.
  2365. // This may be used to include null fields in Patch requests.
  2366. NullFields []string `json:"-"`
  2367. }
  2368. func (s *AllocationsScopedListWarning) MarshalJSON() ([]byte, error) {
  2369. type NoMethod AllocationsScopedListWarning
  2370. raw := NoMethod(*s)
  2371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2372. }
  2373. type AllocationsScopedListWarningData struct {
  2374. // Key: [Output Only] A key that provides more detail on the warning
  2375. // being returned. For example, for warnings where there are no results
  2376. // in a list request for a particular zone, this key might be scope and
  2377. // the key value might be the zone name. Other examples might be a key
  2378. // indicating a deprecated resource and a suggested replacement, or a
  2379. // warning about invalid network settings (for example, if an instance
  2380. // attempts to perform IP forwarding but is not enabled for IP
  2381. // forwarding).
  2382. Key string `json:"key,omitempty"`
  2383. // Value: [Output Only] A warning data value corresponding to the key.
  2384. Value string `json:"value,omitempty"`
  2385. // ForceSendFields is a list of field names (e.g. "Key") to
  2386. // unconditionally include in API requests. By default, fields with
  2387. // empty values are omitted from API requests. However, any non-pointer,
  2388. // non-interface field appearing in ForceSendFields will be sent to the
  2389. // server regardless of whether the field is empty or not. This may be
  2390. // used to include empty fields in Patch requests.
  2391. ForceSendFields []string `json:"-"`
  2392. // NullFields is a list of field names (e.g. "Key") to include in API
  2393. // requests with the JSON null value. By default, fields with empty
  2394. // values are omitted from API requests. However, any field with an
  2395. // empty value appearing in NullFields will be sent to the server as
  2396. // null. It is an error if a field in this list has a non-empty value.
  2397. // This may be used to include null fields in Patch requests.
  2398. NullFields []string `json:"-"`
  2399. }
  2400. func (s *AllocationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  2401. type NoMethod AllocationsScopedListWarningData
  2402. raw := NoMethod(*s)
  2403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2404. }
  2405. // AttachedDisk: An instance-attached disk resource.
  2406. type AttachedDisk struct {
  2407. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  2408. // instance is deleted (but not when the disk is detached from the
  2409. // instance).
  2410. AutoDelete bool `json:"autoDelete,omitempty"`
  2411. // Boot: Indicates that this is a boot disk. The virtual machine will
  2412. // use the first partition of the disk for its root filesystem.
  2413. Boot bool `json:"boot,omitempty"`
  2414. // DeviceName: Specifies a unique device name of your choice that is
  2415. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  2416. // system running within the instance. This name can be used to
  2417. // reference the device for mounting, resizing, and so on, from within
  2418. // the instance.
  2419. //
  2420. // If not specified, the server chooses a default device name to apply
  2421. // to this disk, in the form persistent-disk-x, where x is a number
  2422. // assigned by Google Compute Engine. This field is only applicable for
  2423. // persistent disks.
  2424. DeviceName string `json:"deviceName,omitempty"`
  2425. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  2426. // customer-supplied encryption key.
  2427. //
  2428. // If you are creating a new disk, this field encrypts the new disk
  2429. // using an encryption key that you provide. If you are attaching an
  2430. // existing disk that is already encrypted, this field decrypts the disk
  2431. // using the customer-supplied encryption key.
  2432. //
  2433. // If you encrypt a disk using a customer-supplied key, you must provide
  2434. // the same key again when you attempt to use this resource at a later
  2435. // time. For example, you must provide the key when you create a
  2436. // snapshot or an image from the disk or when you attach the disk to a
  2437. // virtual machine instance.
  2438. //
  2439. // If you do not provide an encryption key, then the disk will be
  2440. // encrypted using an automatically generated key and you do not need to
  2441. // provide a key to use the disk later.
  2442. //
  2443. // Instance templates do not store customer-supplied encryption keys, so
  2444. // you cannot use your own keys to encrypt disks in a managed instance
  2445. // group.
  2446. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  2447. // GuestOsFeatures: A list of features to enable on the guest operating
  2448. // system. Applicable only for bootable images. Read Enabling guest
  2449. // operating system features to see a list of available options.
  2450. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  2451. // Index: [Output Only] A zero-based index to this disk, where 0 is
  2452. // reserved for the boot disk. If you have many disks attached to an
  2453. // instance, each disk would have a unique index number.
  2454. Index int64 `json:"index,omitempty"`
  2455. // InitializeParams: [Input Only] Specifies the parameters for a new
  2456. // disk that will be created alongside the new instance. Use
  2457. // initialization parameters to create boot disks or local SSDs attached
  2458. // to the new instance.
  2459. //
  2460. // This property is mutually exclusive with the source property; you can
  2461. // only define one or the other, but not both.
  2462. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  2463. // Interface: Specifies the disk interface to use for attaching this
  2464. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  2465. // disks must always use SCSI and the request will fail if you attempt
  2466. // to attach a persistent disk in any other format than SCSI. Local SSDs
  2467. // can use either NVME or SCSI. For performance characteristics of SCSI
  2468. // over NVMe, see Local SSD performance.
  2469. //
  2470. // Possible values:
  2471. // "NVME"
  2472. // "SCSI"
  2473. Interface string `json:"interface,omitempty"`
  2474. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  2475. // for attached disks.
  2476. Kind string `json:"kind,omitempty"`
  2477. // Licenses: [Output Only] Any valid publicly visible licenses.
  2478. Licenses []string `json:"licenses,omitempty"`
  2479. // Mode: The mode in which to attach this disk, either READ_WRITE or
  2480. // READ_ONLY. If not specified, the default is to attach the disk in
  2481. // READ_WRITE mode.
  2482. //
  2483. // Possible values:
  2484. // "READ_ONLY"
  2485. // "READ_WRITE"
  2486. Mode string `json:"mode,omitempty"`
  2487. // Source: Specifies a valid partial or full URL to an existing
  2488. // Persistent Disk resource. When creating a new instance, one of
  2489. // initializeParams.sourceImage or disks.source is required except for
  2490. // local SSD.
  2491. //
  2492. // If desired, you can also attach existing non-root persistent disks
  2493. // using this property. This field is only applicable for persistent
  2494. // disks.
  2495. //
  2496. // Note that for InstanceTemplate, specify the disk name, not the URL
  2497. // for the disk.
  2498. Source string `json:"source,omitempty"`
  2499. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  2500. // If not specified, the default is PERSISTENT.
  2501. //
  2502. // Possible values:
  2503. // "PERSISTENT"
  2504. // "SCRATCH"
  2505. Type string `json:"type,omitempty"`
  2506. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  2507. // unconditionally include in API requests. By default, fields with
  2508. // empty values are omitted from API requests. However, any non-pointer,
  2509. // non-interface field appearing in ForceSendFields will be sent to the
  2510. // server regardless of whether the field is empty or not. This may be
  2511. // used to include empty fields in Patch requests.
  2512. ForceSendFields []string `json:"-"`
  2513. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  2514. // API requests with the JSON null value. By default, fields with empty
  2515. // values are omitted from API requests. However, any field with an
  2516. // empty value appearing in NullFields will be sent to the server as
  2517. // null. It is an error if a field in this list has a non-empty value.
  2518. // This may be used to include null fields in Patch requests.
  2519. NullFields []string `json:"-"`
  2520. }
  2521. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  2522. type NoMethod AttachedDisk
  2523. raw := NoMethod(*s)
  2524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2525. }
  2526. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  2527. // for a new disk that will be created alongside the new instance. Use
  2528. // initialization parameters to create boot disks or local SSDs attached
  2529. // to the new instance.
  2530. //
  2531. // This property is mutually exclusive with the source property; you can
  2532. // only define one or the other, but not both.
  2533. type AttachedDiskInitializeParams struct {
  2534. // Description: An optional description. Provide this property when
  2535. // creating the disk.
  2536. Description string `json:"description,omitempty"`
  2537. // DiskName: Specifies the disk name. If not specified, the default is
  2538. // to use the name of the instance. If the disk with the instance name
  2539. // exists already in the given zone/region, a new name will be
  2540. // automatically generated.
  2541. DiskName string `json:"diskName,omitempty"`
  2542. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  2543. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2544. // DiskType: Specifies the disk type to use to create the instance. If
  2545. // not specified, the default is pd-standard, specified using the full
  2546. // URL. For
  2547. // example:
  2548. // https://www.googleapis.com/compute/v1/projects/project/zones/
  2549. // zone/diskTypes/pd-standard
  2550. //
  2551. //
  2552. // Other values include pd-ssd and local-ssd. If you define this field,
  2553. // you can provide either the full or partial URL. For example, the
  2554. // following are valid values:
  2555. // -
  2556. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  2557. // - projects/project/zones/zone/diskTypes/diskType
  2558. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  2559. // is the name of the disk type, not URL.
  2560. DiskType string `json:"diskType,omitempty"`
  2561. // GuestOsFeatures: A list of features to enable on the guest operating
  2562. // system. Applicable only for bootable images. Read Enabling guest
  2563. // operating system features to see a list of available options.
  2564. //
  2565. // Guest OS features are applied by merging
  2566. // initializeParams.guestOsFeatures and disks.guestOsFeatures
  2567. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  2568. // Labels: Labels to apply to this disk. These can be later modified by
  2569. // the disks.setLabels method. This field is only applicable for
  2570. // persistent disks.
  2571. Labels map[string]string `json:"labels,omitempty"`
  2572. // SourceImage: The source image to create this disk. When creating a
  2573. // new instance, one of initializeParams.sourceImage or disks.source is
  2574. // required except for local SSD.
  2575. //
  2576. // To create a disk with one of the public operating system images,
  2577. // specify the image by its family name. For example, specify
  2578. // family/debian-9 to use the latest Debian 9
  2579. // image:
  2580. // projects/debian-cloud/global/images/family/debian-9
  2581. //
  2582. //
  2583. // Alternati
  2584. // vely, use a specific version of a public operating system
  2585. // image:
  2586. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  2587. //
  2588. //
  2589. //
  2590. // To create a disk with a custom image that you created, specify the
  2591. // image name in the following
  2592. // format:
  2593. // global/images/my-custom-image
  2594. //
  2595. //
  2596. // You can also specify a custom image by its image family, which
  2597. // returns the latest version of the image in that family. Replace the
  2598. // image name with
  2599. // family/family-name:
  2600. // global/images/family/my-image-family
  2601. //
  2602. //
  2603. // If the source image is deleted later, this field will not be set.
  2604. SourceImage string `json:"sourceImage,omitempty"`
  2605. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  2606. // source image. Required if the source image is protected by a
  2607. // customer-supplied encryption key.
  2608. //
  2609. // Instance templates do not store customer-supplied encryption keys, so
  2610. // you cannot create disks for instances in a managed instance group if
  2611. // the source images are encrypted with your own keys.
  2612. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  2613. // ForceSendFields is a list of field names (e.g. "Description") to
  2614. // unconditionally include in API requests. By default, fields with
  2615. // empty values are omitted from API requests. However, any non-pointer,
  2616. // non-interface field appearing in ForceSendFields will be sent to the
  2617. // server regardless of whether the field is empty or not. This may be
  2618. // used to include empty fields in Patch requests.
  2619. ForceSendFields []string `json:"-"`
  2620. // NullFields is a list of field names (e.g. "Description") to include
  2621. // in API requests with the JSON null value. By default, fields with
  2622. // empty values are omitted from API requests. However, any field with
  2623. // an empty value appearing in NullFields will be sent to the server as
  2624. // null. It is an error if a field in this list has a non-empty value.
  2625. // This may be used to include null fields in Patch requests.
  2626. NullFields []string `json:"-"`
  2627. }
  2628. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  2629. type NoMethod AttachedDiskInitializeParams
  2630. raw := NoMethod(*s)
  2631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2632. }
  2633. // AuditConfig: Specifies the audit configuration for a service. The
  2634. // configuration determines which permission types are logged, and what
  2635. // identities, if any, are exempted from logging. An AuditConfig must
  2636. // have one or more AuditLogConfigs.
  2637. //
  2638. // If there are AuditConfigs for both `allServices` and a specific
  2639. // service, the union of the two AuditConfigs is used for that service:
  2640. // the log_types specified in each AuditConfig are enabled, and the
  2641. // exempted_members in each AuditLogConfig are exempted.
  2642. //
  2643. // Example Policy with multiple AuditConfigs:
  2644. //
  2645. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  2646. // [ { "log_type": "DATA_READ", "exempted_members": [
  2647. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  2648. // "log_type": "ADMIN_READ", } ] }, { "service":
  2649. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  2650. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  2651. // "user:bar@gmail.com" ] } ] } ] }
  2652. //
  2653. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  2654. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  2655. // logging, and bar@gmail.com from DATA_WRITE logging.
  2656. type AuditConfig struct {
  2657. // AuditLogConfigs: The configuration for logging of each type of
  2658. // permission.
  2659. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  2660. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2661. // Service: Specifies a service that will be enabled for audit logging.
  2662. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  2663. // `allServices` is a special value that covers all services.
  2664. Service string `json:"service,omitempty"`
  2665. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  2666. // unconditionally include in API requests. By default, fields with
  2667. // empty values are omitted from API requests. However, any non-pointer,
  2668. // non-interface field appearing in ForceSendFields will be sent to the
  2669. // server regardless of whether the field is empty or not. This may be
  2670. // used to include empty fields in Patch requests.
  2671. ForceSendFields []string `json:"-"`
  2672. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  2673. // include in API requests with the JSON null value. By default, fields
  2674. // with empty values are omitted from API requests. However, any field
  2675. // with an empty value appearing in NullFields will be sent to the
  2676. // server as null. It is an error if a field in this list has a
  2677. // non-empty value. This may be used to include null fields in Patch
  2678. // requests.
  2679. NullFields []string `json:"-"`
  2680. }
  2681. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  2682. type NoMethod AuditConfig
  2683. raw := NoMethod(*s)
  2684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2685. }
  2686. // AuditLogConfig: Provides the configuration for logging a type of
  2687. // permissions. Example:
  2688. //
  2689. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  2690. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  2691. // "DATA_WRITE", } ] }
  2692. //
  2693. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  2694. // foo@gmail.com from DATA_READ logging.
  2695. type AuditLogConfig struct {
  2696. // ExemptedMembers: Specifies the identities that do not cause logging
  2697. // for this type of permission. Follows the same format of
  2698. // [Binding.members][].
  2699. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2700. // LogType: The log type that this config enables.
  2701. //
  2702. // Possible values:
  2703. // "ADMIN_READ"
  2704. // "DATA_READ"
  2705. // "DATA_WRITE"
  2706. // "LOG_TYPE_UNSPECIFIED"
  2707. LogType string `json:"logType,omitempty"`
  2708. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  2709. // unconditionally include in API requests. By default, fields with
  2710. // empty values are omitted from API requests. However, any non-pointer,
  2711. // non-interface field appearing in ForceSendFields will be sent to the
  2712. // server regardless of whether the field is empty or not. This may be
  2713. // used to include empty fields in Patch requests.
  2714. ForceSendFields []string `json:"-"`
  2715. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2716. // include in API requests with the JSON null value. By default, fields
  2717. // with empty values are omitted from API requests. However, any field
  2718. // with an empty value appearing in NullFields will be sent to the
  2719. // server as null. It is an error if a field in this list has a
  2720. // non-empty value. This may be used to include null fields in Patch
  2721. // requests.
  2722. NullFields []string `json:"-"`
  2723. }
  2724. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  2725. type NoMethod AuditLogConfig
  2726. raw := NoMethod(*s)
  2727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2728. }
  2729. // AuthorizationLoggingOptions: Authorization-related information used
  2730. // by Cloud Audit Logging.
  2731. type AuthorizationLoggingOptions struct {
  2732. // PermissionType: The type of the permission that was checked.
  2733. //
  2734. // Possible values:
  2735. // "ADMIN_READ"
  2736. // "ADMIN_WRITE"
  2737. // "DATA_READ"
  2738. // "DATA_WRITE"
  2739. // "PERMISSION_TYPE_UNSPECIFIED"
  2740. PermissionType string `json:"permissionType,omitempty"`
  2741. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2742. // unconditionally include in API requests. By default, fields with
  2743. // empty values are omitted from API requests. However, any non-pointer,
  2744. // non-interface field appearing in ForceSendFields will be sent to the
  2745. // server regardless of whether the field is empty or not. This may be
  2746. // used to include empty fields in Patch requests.
  2747. ForceSendFields []string `json:"-"`
  2748. // NullFields is a list of field names (e.g. "PermissionType") to
  2749. // include in API requests with the JSON null value. By default, fields
  2750. // with empty values are omitted from API requests. However, any field
  2751. // with an empty value appearing in NullFields will be sent to the
  2752. // server as null. It is an error if a field in this list has a
  2753. // non-empty value. This may be used to include null fields in Patch
  2754. // requests.
  2755. NullFields []string `json:"-"`
  2756. }
  2757. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2758. type NoMethod AuthorizationLoggingOptions
  2759. raw := NoMethod(*s)
  2760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2761. }
  2762. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2763. // to automatically scale virtual machine instances in managed instance
  2764. // groups according to an autoscaling policy that you define. For more
  2765. // information, read Autoscaling Groups of Instances. (== resource_for
  2766. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2767. // resource_for beta.regionAutoscalers ==) (== resource_for
  2768. // v1.regionAutoscalers ==)
  2769. type Autoscaler struct {
  2770. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2771. // algorithm. You can define one or more of the policies for an
  2772. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2773. // loadBalancingUtilization.
  2774. //
  2775. // If none of these are specified, the default will be to autoscale
  2776. // based on cpuUtilization to 0.6 or 60%.
  2777. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2778. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2779. // format.
  2780. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2781. // Description: An optional description of this resource. Provide this
  2782. // property when you create the resource.
  2783. Description string `json:"description,omitempty"`
  2784. // Id: [Output Only] The unique identifier for the resource. This
  2785. // identifier is defined by the server.
  2786. Id uint64 `json:"id,omitempty,string"`
  2787. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  2788. // for autoscalers.
  2789. Kind string `json:"kind,omitempty"`
  2790. // Name: Name of the resource. Provided by the client when the resource
  2791. // is created. The name must be 1-63 characters long, and comply with
  2792. // RFC1035. Specifically, the name must be 1-63 characters long and
  2793. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2794. // the first character must be a lowercase letter, and all following
  2795. // characters must be a dash, lowercase letter, or digit, except the
  2796. // last character, which cannot be a dash.
  2797. Name string `json:"name,omitempty"`
  2798. // Region: [Output Only] URL of the region where the instance group
  2799. // resides (for autoscalers living in regional scope).
  2800. Region string `json:"region,omitempty"`
  2801. // SelfLink: [Output Only] Server-defined URL for the resource.
  2802. SelfLink string `json:"selfLink,omitempty"`
  2803. // Status: [Output Only] The status of the autoscaler configuration.
  2804. //
  2805. // Possible values:
  2806. // "ACTIVE"
  2807. // "DELETING"
  2808. // "ERROR"
  2809. // "PENDING"
  2810. Status string `json:"status,omitempty"`
  2811. // StatusDetails: [Output Only] Human-readable details about the current
  2812. // state of the autoscaler. Read the documentation for Commonly returned
  2813. // status messages for examples of status messages you might encounter.
  2814. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  2815. // Target: URL of the managed instance group that this autoscaler will
  2816. // scale.
  2817. Target string `json:"target,omitempty"`
  2818. // Zone: [Output Only] URL of the zone where the instance group resides
  2819. // (for autoscalers living in zonal scope).
  2820. Zone string `json:"zone,omitempty"`
  2821. // ServerResponse contains the HTTP response code and headers from the
  2822. // server.
  2823. googleapi.ServerResponse `json:"-"`
  2824. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  2825. // to unconditionally include in API requests. By default, fields with
  2826. // empty values are omitted from API requests. However, any non-pointer,
  2827. // non-interface field appearing in ForceSendFields will be sent to the
  2828. // server regardless of whether the field is empty or not. This may be
  2829. // used to include empty fields in Patch requests.
  2830. ForceSendFields []string `json:"-"`
  2831. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  2832. // include in API requests with the JSON null value. By default, fields
  2833. // with empty values are omitted from API requests. However, any field
  2834. // with an empty value appearing in NullFields will be sent to the
  2835. // server as null. It is an error if a field in this list has a
  2836. // non-empty value. This may be used to include null fields in Patch
  2837. // requests.
  2838. NullFields []string `json:"-"`
  2839. }
  2840. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  2841. type NoMethod Autoscaler
  2842. raw := NoMethod(*s)
  2843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2844. }
  2845. type AutoscalerAggregatedList struct {
  2846. // Id: [Output Only] Unique identifier for the resource; defined by the
  2847. // server.
  2848. Id string `json:"id,omitempty"`
  2849. // Items: A list of AutoscalersScopedList resources.
  2850. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  2851. // Kind: [Output Only] Type of resource. Always
  2852. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  2853. Kind string `json:"kind,omitempty"`
  2854. // NextPageToken: [Output Only] This token allows you to get the next
  2855. // page of results for list requests. If the number of results is larger
  2856. // than maxResults, use the nextPageToken as a value for the query
  2857. // parameter pageToken in the next list request. Subsequent list
  2858. // requests will have their own nextPageToken to continue paging through
  2859. // the results.
  2860. NextPageToken string `json:"nextPageToken,omitempty"`
  2861. // SelfLink: [Output Only] Server-defined URL for this resource.
  2862. SelfLink string `json:"selfLink,omitempty"`
  2863. // Warning: [Output Only] Informational warning message.
  2864. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  2865. // ServerResponse contains the HTTP response code and headers from the
  2866. // server.
  2867. googleapi.ServerResponse `json:"-"`
  2868. // ForceSendFields is a list of field names (e.g. "Id") to
  2869. // unconditionally include in API requests. By default, fields with
  2870. // empty values are omitted from API requests. However, any non-pointer,
  2871. // non-interface field appearing in ForceSendFields will be sent to the
  2872. // server regardless of whether the field is empty or not. This may be
  2873. // used to include empty fields in Patch requests.
  2874. ForceSendFields []string `json:"-"`
  2875. // NullFields is a list of field names (e.g. "Id") to include in API
  2876. // requests with the JSON null value. By default, fields with empty
  2877. // values are omitted from API requests. However, any field with an
  2878. // empty value appearing in NullFields will be sent to the server as
  2879. // null. It is an error if a field in this list has a non-empty value.
  2880. // This may be used to include null fields in Patch requests.
  2881. NullFields []string `json:"-"`
  2882. }
  2883. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  2884. type NoMethod AutoscalerAggregatedList
  2885. raw := NoMethod(*s)
  2886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2887. }
  2888. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  2889. // message.
  2890. type AutoscalerAggregatedListWarning struct {
  2891. // Code: [Output Only] A warning code, if applicable. For example,
  2892. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2893. // the response.
  2894. //
  2895. // Possible values:
  2896. // "CLEANUP_FAILED"
  2897. // "DEPRECATED_RESOURCE_USED"
  2898. // "DEPRECATED_TYPE_USED"
  2899. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2900. // "EXPERIMENTAL_TYPE_USED"
  2901. // "EXTERNAL_API_WARNING"
  2902. // "FIELD_VALUE_OVERRIDEN"
  2903. // "INJECTED_KERNELS_DEPRECATED"
  2904. // "MISSING_TYPE_DEPENDENCY"
  2905. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2906. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2907. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2908. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2909. // "NEXT_HOP_NOT_RUNNING"
  2910. // "NOT_CRITICAL_ERROR"
  2911. // "NO_RESULTS_ON_PAGE"
  2912. // "REQUIRED_TOS_AGREEMENT"
  2913. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2914. // "RESOURCE_NOT_DELETED"
  2915. // "SCHEMA_VALIDATION_IGNORED"
  2916. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2917. // "UNDECLARED_PROPERTIES"
  2918. // "UNREACHABLE"
  2919. Code string `json:"code,omitempty"`
  2920. // Data: [Output Only] Metadata about this warning in key: value format.
  2921. // For example:
  2922. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2923. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  2924. // Message: [Output Only] A human-readable description of the warning
  2925. // code.
  2926. Message string `json:"message,omitempty"`
  2927. // ForceSendFields is a list of field names (e.g. "Code") to
  2928. // unconditionally include in API requests. By default, fields with
  2929. // empty values are omitted from API requests. However, any non-pointer,
  2930. // non-interface field appearing in ForceSendFields will be sent to the
  2931. // server regardless of whether the field is empty or not. This may be
  2932. // used to include empty fields in Patch requests.
  2933. ForceSendFields []string `json:"-"`
  2934. // NullFields is a list of field names (e.g. "Code") to include in API
  2935. // requests with the JSON null value. By default, fields with empty
  2936. // values are omitted from API requests. However, any field with an
  2937. // empty value appearing in NullFields will be sent to the server as
  2938. // null. It is an error if a field in this list has a non-empty value.
  2939. // This may be used to include null fields in Patch requests.
  2940. NullFields []string `json:"-"`
  2941. }
  2942. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2943. type NoMethod AutoscalerAggregatedListWarning
  2944. raw := NoMethod(*s)
  2945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2946. }
  2947. type AutoscalerAggregatedListWarningData struct {
  2948. // Key: [Output Only] A key that provides more detail on the warning
  2949. // being returned. For example, for warnings where there are no results
  2950. // in a list request for a particular zone, this key might be scope and
  2951. // the key value might be the zone name. Other examples might be a key
  2952. // indicating a deprecated resource and a suggested replacement, or a
  2953. // warning about invalid network settings (for example, if an instance
  2954. // attempts to perform IP forwarding but is not enabled for IP
  2955. // forwarding).
  2956. Key string `json:"key,omitempty"`
  2957. // Value: [Output Only] A warning data value corresponding to the key.
  2958. Value string `json:"value,omitempty"`
  2959. // ForceSendFields is a list of field names (e.g. "Key") to
  2960. // unconditionally include in API requests. By default, fields with
  2961. // empty values are omitted from API requests. However, any non-pointer,
  2962. // non-interface field appearing in ForceSendFields will be sent to the
  2963. // server regardless of whether the field is empty or not. This may be
  2964. // used to include empty fields in Patch requests.
  2965. ForceSendFields []string `json:"-"`
  2966. // NullFields is a list of field names (e.g. "Key") to include in API
  2967. // requests with the JSON null value. By default, fields with empty
  2968. // values are omitted from API requests. However, any field with an
  2969. // empty value appearing in NullFields will be sent to the server as
  2970. // null. It is an error if a field in this list has a non-empty value.
  2971. // This may be used to include null fields in Patch requests.
  2972. NullFields []string `json:"-"`
  2973. }
  2974. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2975. type NoMethod AutoscalerAggregatedListWarningData
  2976. raw := NoMethod(*s)
  2977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2978. }
  2979. // AutoscalerList: Contains a list of Autoscaler resources.
  2980. type AutoscalerList struct {
  2981. // Id: [Output Only] Unique identifier for the resource; defined by the
  2982. // server.
  2983. Id string `json:"id,omitempty"`
  2984. // Items: A list of Autoscaler resources.
  2985. Items []*Autoscaler `json:"items,omitempty"`
  2986. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  2987. // for lists of autoscalers.
  2988. Kind string `json:"kind,omitempty"`
  2989. // NextPageToken: [Output Only] This token allows you to get the next
  2990. // page of results for list requests. If the number of results is larger
  2991. // than maxResults, use the nextPageToken as a value for the query
  2992. // parameter pageToken in the next list request. Subsequent list
  2993. // requests will have their own nextPageToken to continue paging through
  2994. // the results.
  2995. NextPageToken string `json:"nextPageToken,omitempty"`
  2996. // SelfLink: [Output Only] Server-defined URL for this resource.
  2997. SelfLink string `json:"selfLink,omitempty"`
  2998. // Warning: [Output Only] Informational warning message.
  2999. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  3000. // ServerResponse contains the HTTP response code and headers from the
  3001. // server.
  3002. googleapi.ServerResponse `json:"-"`
  3003. // ForceSendFields is a list of field names (e.g. "Id") to
  3004. // unconditionally include in API requests. By default, fields with
  3005. // empty values are omitted from API requests. However, any non-pointer,
  3006. // non-interface field appearing in ForceSendFields will be sent to the
  3007. // server regardless of whether the field is empty or not. This may be
  3008. // used to include empty fields in Patch requests.
  3009. ForceSendFields []string `json:"-"`
  3010. // NullFields is a list of field names (e.g. "Id") to include in API
  3011. // requests with the JSON null value. By default, fields with empty
  3012. // values are omitted from API requests. However, any field with an
  3013. // empty value appearing in NullFields will be sent to the server as
  3014. // null. It is an error if a field in this list has a non-empty value.
  3015. // This may be used to include null fields in Patch requests.
  3016. NullFields []string `json:"-"`
  3017. }
  3018. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  3019. type NoMethod AutoscalerList
  3020. raw := NoMethod(*s)
  3021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3022. }
  3023. // AutoscalerListWarning: [Output Only] Informational warning message.
  3024. type AutoscalerListWarning struct {
  3025. // Code: [Output Only] A warning code, if applicable. For example,
  3026. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3027. // the response.
  3028. //
  3029. // Possible values:
  3030. // "CLEANUP_FAILED"
  3031. // "DEPRECATED_RESOURCE_USED"
  3032. // "DEPRECATED_TYPE_USED"
  3033. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3034. // "EXPERIMENTAL_TYPE_USED"
  3035. // "EXTERNAL_API_WARNING"
  3036. // "FIELD_VALUE_OVERRIDEN"
  3037. // "INJECTED_KERNELS_DEPRECATED"
  3038. // "MISSING_TYPE_DEPENDENCY"
  3039. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3040. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3041. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3042. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3043. // "NEXT_HOP_NOT_RUNNING"
  3044. // "NOT_CRITICAL_ERROR"
  3045. // "NO_RESULTS_ON_PAGE"
  3046. // "REQUIRED_TOS_AGREEMENT"
  3047. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3048. // "RESOURCE_NOT_DELETED"
  3049. // "SCHEMA_VALIDATION_IGNORED"
  3050. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3051. // "UNDECLARED_PROPERTIES"
  3052. // "UNREACHABLE"
  3053. Code string `json:"code,omitempty"`
  3054. // Data: [Output Only] Metadata about this warning in key: value format.
  3055. // For example:
  3056. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3057. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  3058. // Message: [Output Only] A human-readable description of the warning
  3059. // code.
  3060. Message string `json:"message,omitempty"`
  3061. // ForceSendFields is a list of field names (e.g. "Code") to
  3062. // unconditionally include in API requests. By default, fields with
  3063. // empty values are omitted from API requests. However, any non-pointer,
  3064. // non-interface field appearing in ForceSendFields will be sent to the
  3065. // server regardless of whether the field is empty or not. This may be
  3066. // used to include empty fields in Patch requests.
  3067. ForceSendFields []string `json:"-"`
  3068. // NullFields is a list of field names (e.g. "Code") to include in API
  3069. // requests with the JSON null value. By default, fields with empty
  3070. // values are omitted from API requests. However, any field with an
  3071. // empty value appearing in NullFields will be sent to the server as
  3072. // null. It is an error if a field in this list has a non-empty value.
  3073. // This may be used to include null fields in Patch requests.
  3074. NullFields []string `json:"-"`
  3075. }
  3076. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  3077. type NoMethod AutoscalerListWarning
  3078. raw := NoMethod(*s)
  3079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3080. }
  3081. type AutoscalerListWarningData struct {
  3082. // Key: [Output Only] A key that provides more detail on the warning
  3083. // being returned. For example, for warnings where there are no results
  3084. // in a list request for a particular zone, this key might be scope and
  3085. // the key value might be the zone name. Other examples might be a key
  3086. // indicating a deprecated resource and a suggested replacement, or a
  3087. // warning about invalid network settings (for example, if an instance
  3088. // attempts to perform IP forwarding but is not enabled for IP
  3089. // forwarding).
  3090. Key string `json:"key,omitempty"`
  3091. // Value: [Output Only] A warning data value corresponding to the key.
  3092. Value string `json:"value,omitempty"`
  3093. // ForceSendFields is a list of field names (e.g. "Key") to
  3094. // unconditionally include in API requests. By default, fields with
  3095. // empty values are omitted from API requests. However, any non-pointer,
  3096. // non-interface field appearing in ForceSendFields will be sent to the
  3097. // server regardless of whether the field is empty or not. This may be
  3098. // used to include empty fields in Patch requests.
  3099. ForceSendFields []string `json:"-"`
  3100. // NullFields is a list of field names (e.g. "Key") to include in API
  3101. // requests with the JSON null value. By default, fields with empty
  3102. // values are omitted from API requests. However, any field with an
  3103. // empty value appearing in NullFields will be sent to the server as
  3104. // null. It is an error if a field in this list has a non-empty value.
  3105. // This may be used to include null fields in Patch requests.
  3106. NullFields []string `json:"-"`
  3107. }
  3108. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  3109. type NoMethod AutoscalerListWarningData
  3110. raw := NoMethod(*s)
  3111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3112. }
  3113. type AutoscalerStatusDetails struct {
  3114. // Message: The status message.
  3115. Message string `json:"message,omitempty"`
  3116. // Type: The type of error returned.
  3117. //
  3118. // Possible values:
  3119. // "ALL_INSTANCES_UNHEALTHY"
  3120. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  3121. // "CAPPED_AT_MAX_NUM_REPLICAS"
  3122. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  3123. // "CUSTOM_METRIC_INVALID"
  3124. // "MIN_EQUALS_MAX"
  3125. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  3126. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  3127. // "MORE_THAN_ONE_BACKEND_SERVICE"
  3128. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  3129. // "REGION_RESOURCE_STOCKOUT"
  3130. // "SCALING_TARGET_DOES_NOT_EXIST"
  3131. // "UNKNOWN"
  3132. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  3133. // "ZONE_RESOURCE_STOCKOUT"
  3134. Type string `json:"type,omitempty"`
  3135. // ForceSendFields is a list of field names (e.g. "Message") to
  3136. // unconditionally include in API requests. By default, fields with
  3137. // empty values are omitted from API requests. However, any non-pointer,
  3138. // non-interface field appearing in ForceSendFields will be sent to the
  3139. // server regardless of whether the field is empty or not. This may be
  3140. // used to include empty fields in Patch requests.
  3141. ForceSendFields []string `json:"-"`
  3142. // NullFields is a list of field names (e.g. "Message") to include in
  3143. // API requests with the JSON null value. By default, fields with empty
  3144. // values are omitted from API requests. However, any field with an
  3145. // empty value appearing in NullFields will be sent to the server as
  3146. // null. It is an error if a field in this list has a non-empty value.
  3147. // This may be used to include null fields in Patch requests.
  3148. NullFields []string `json:"-"`
  3149. }
  3150. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  3151. type NoMethod AutoscalerStatusDetails
  3152. raw := NoMethod(*s)
  3153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3154. }
  3155. type AutoscalersScopedList struct {
  3156. // Autoscalers: [Output Only] A list of autoscalers contained in this
  3157. // scope.
  3158. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  3159. // Warning: [Output Only] Informational warning which replaces the list
  3160. // of autoscalers when the list is empty.
  3161. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  3162. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  3163. // unconditionally include in API requests. By default, fields with
  3164. // empty values are omitted from API requests. However, any non-pointer,
  3165. // non-interface field appearing in ForceSendFields will be sent to the
  3166. // server regardless of whether the field is empty or not. This may be
  3167. // used to include empty fields in Patch requests.
  3168. ForceSendFields []string `json:"-"`
  3169. // NullFields is a list of field names (e.g. "Autoscalers") to include
  3170. // in API requests with the JSON null value. By default, fields with
  3171. // empty values are omitted from API requests. However, any field with
  3172. // an empty value appearing in NullFields will be sent to the server as
  3173. // null. It is an error if a field in this list has a non-empty value.
  3174. // This may be used to include null fields in Patch requests.
  3175. NullFields []string `json:"-"`
  3176. }
  3177. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  3178. type NoMethod AutoscalersScopedList
  3179. raw := NoMethod(*s)
  3180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3181. }
  3182. // AutoscalersScopedListWarning: [Output Only] Informational warning
  3183. // which replaces the list of autoscalers when the list is empty.
  3184. type AutoscalersScopedListWarning struct {
  3185. // Code: [Output Only] A warning code, if applicable. For example,
  3186. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3187. // the response.
  3188. //
  3189. // Possible values:
  3190. // "CLEANUP_FAILED"
  3191. // "DEPRECATED_RESOURCE_USED"
  3192. // "DEPRECATED_TYPE_USED"
  3193. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3194. // "EXPERIMENTAL_TYPE_USED"
  3195. // "EXTERNAL_API_WARNING"
  3196. // "FIELD_VALUE_OVERRIDEN"
  3197. // "INJECTED_KERNELS_DEPRECATED"
  3198. // "MISSING_TYPE_DEPENDENCY"
  3199. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3200. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3201. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3202. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3203. // "NEXT_HOP_NOT_RUNNING"
  3204. // "NOT_CRITICAL_ERROR"
  3205. // "NO_RESULTS_ON_PAGE"
  3206. // "REQUIRED_TOS_AGREEMENT"
  3207. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3208. // "RESOURCE_NOT_DELETED"
  3209. // "SCHEMA_VALIDATION_IGNORED"
  3210. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3211. // "UNDECLARED_PROPERTIES"
  3212. // "UNREACHABLE"
  3213. Code string `json:"code,omitempty"`
  3214. // Data: [Output Only] Metadata about this warning in key: value format.
  3215. // For example:
  3216. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3217. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  3218. // Message: [Output Only] A human-readable description of the warning
  3219. // code.
  3220. Message string `json:"message,omitempty"`
  3221. // ForceSendFields is a list of field names (e.g. "Code") to
  3222. // unconditionally include in API requests. By default, fields with
  3223. // empty values are omitted from API requests. However, any non-pointer,
  3224. // non-interface field appearing in ForceSendFields will be sent to the
  3225. // server regardless of whether the field is empty or not. This may be
  3226. // used to include empty fields in Patch requests.
  3227. ForceSendFields []string `json:"-"`
  3228. // NullFields is a list of field names (e.g. "Code") to include in API
  3229. // requests with the JSON null value. By default, fields with empty
  3230. // values are omitted from API requests. However, any field with an
  3231. // empty value appearing in NullFields will be sent to the server as
  3232. // null. It is an error if a field in this list has a non-empty value.
  3233. // This may be used to include null fields in Patch requests.
  3234. NullFields []string `json:"-"`
  3235. }
  3236. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  3237. type NoMethod AutoscalersScopedListWarning
  3238. raw := NoMethod(*s)
  3239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3240. }
  3241. type AutoscalersScopedListWarningData struct {
  3242. // Key: [Output Only] A key that provides more detail on the warning
  3243. // being returned. For example, for warnings where there are no results
  3244. // in a list request for a particular zone, this key might be scope and
  3245. // the key value might be the zone name. Other examples might be a key
  3246. // indicating a deprecated resource and a suggested replacement, or a
  3247. // warning about invalid network settings (for example, if an instance
  3248. // attempts to perform IP forwarding but is not enabled for IP
  3249. // forwarding).
  3250. Key string `json:"key,omitempty"`
  3251. // Value: [Output Only] A warning data value corresponding to the key.
  3252. Value string `json:"value,omitempty"`
  3253. // ForceSendFields is a list of field names (e.g. "Key") to
  3254. // unconditionally include in API requests. By default, fields with
  3255. // empty values are omitted from API requests. However, any non-pointer,
  3256. // non-interface field appearing in ForceSendFields will be sent to the
  3257. // server regardless of whether the field is empty or not. This may be
  3258. // used to include empty fields in Patch requests.
  3259. ForceSendFields []string `json:"-"`
  3260. // NullFields is a list of field names (e.g. "Key") to include in API
  3261. // requests with the JSON null value. By default, fields with empty
  3262. // values are omitted from API requests. However, any field with an
  3263. // empty value appearing in NullFields will be sent to the server as
  3264. // null. It is an error if a field in this list has a non-empty value.
  3265. // This may be used to include null fields in Patch requests.
  3266. NullFields []string `json:"-"`
  3267. }
  3268. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  3269. type NoMethod AutoscalersScopedListWarningData
  3270. raw := NoMethod(*s)
  3271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3272. }
  3273. // AutoscalingPolicy: Cloud Autoscaler policy.
  3274. type AutoscalingPolicy struct {
  3275. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  3276. // wait before it starts collecting information from a new instance.
  3277. // This prevents the autoscaler from collecting information when the
  3278. // instance is initializing, during which the collected usage would not
  3279. // be reliable. The default time autoscaler waits is 60
  3280. // seconds.
  3281. //
  3282. // Virtual machine initialization times might vary because of numerous
  3283. // factors. We recommend that you test how long an instance may take to
  3284. // initialize. To do this, create an instance and time the startup
  3285. // process.
  3286. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  3287. // CpuUtilization: Defines the CPU utilization policy that allows the
  3288. // autoscaler to scale based on the average CPU utilization of a managed
  3289. // instance group.
  3290. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  3291. // CustomMetricUtilizations: Configuration parameters of autoscaling
  3292. // based on a custom metric.
  3293. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  3294. // LoadBalancingUtilization: Configuration parameters of autoscaling
  3295. // based on load balancer.
  3296. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  3297. // MaxNumReplicas: The maximum number of instances that the autoscaler
  3298. // can scale up to. This is required when creating or updating an
  3299. // autoscaler. The maximum number of replicas should not be lower than
  3300. // minimal number of replicas.
  3301. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  3302. // MinNumReplicas: The minimum number of replicas that the autoscaler
  3303. // can scale down to. This cannot be less than 0. If not provided,
  3304. // autoscaler will choose a default value depending on maximum number of
  3305. // instances allowed.
  3306. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  3307. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  3308. // to unconditionally include in API requests. By default, fields with
  3309. // empty values are omitted from API requests. However, any non-pointer,
  3310. // non-interface field appearing in ForceSendFields will be sent to the
  3311. // server regardless of whether the field is empty or not. This may be
  3312. // used to include empty fields in Patch requests.
  3313. ForceSendFields []string `json:"-"`
  3314. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  3315. // include in API requests with the JSON null value. By default, fields
  3316. // with empty values are omitted from API requests. However, any field
  3317. // with an empty value appearing in NullFields will be sent to the
  3318. // server as null. It is an error if a field in this list has a
  3319. // non-empty value. This may be used to include null fields in Patch
  3320. // requests.
  3321. NullFields []string `json:"-"`
  3322. }
  3323. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  3324. type NoMethod AutoscalingPolicy
  3325. raw := NoMethod(*s)
  3326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3327. }
  3328. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  3329. type AutoscalingPolicyCpuUtilization struct {
  3330. // UtilizationTarget: The target CPU utilization that the autoscaler
  3331. // should maintain. Must be a float value in the range (0, 1]. If not
  3332. // specified, the default is 0.6.
  3333. //
  3334. // If the CPU level is below the target utilization, the autoscaler
  3335. // scales down the number of instances until it reaches the minimum
  3336. // number of instances you specified or until the average CPU of your
  3337. // instances reaches the target utilization.
  3338. //
  3339. // If the average CPU is above the target utilization, the autoscaler
  3340. // scales up until it reaches the maximum number of instances you
  3341. // specified or until the average utilization reaches the target
  3342. // utilization.
  3343. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3344. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3345. // to unconditionally include in API requests. By default, fields with
  3346. // empty values are omitted from API requests. However, any non-pointer,
  3347. // non-interface field appearing in ForceSendFields will be sent to the
  3348. // server regardless of whether the field is empty or not. This may be
  3349. // used to include empty fields in Patch requests.
  3350. ForceSendFields []string `json:"-"`
  3351. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3352. // include in API requests with the JSON null value. By default, fields
  3353. // with empty values are omitted from API requests. However, any field
  3354. // with an empty value appearing in NullFields will be sent to the
  3355. // server as null. It is an error if a field in this list has a
  3356. // non-empty value. This may be used to include null fields in Patch
  3357. // requests.
  3358. NullFields []string `json:"-"`
  3359. }
  3360. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  3361. type NoMethod AutoscalingPolicyCpuUtilization
  3362. raw := NoMethod(*s)
  3363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3364. }
  3365. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  3366. type NoMethod AutoscalingPolicyCpuUtilization
  3367. var s1 struct {
  3368. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3369. *NoMethod
  3370. }
  3371. s1.NoMethod = (*NoMethod)(s)
  3372. if err := json.Unmarshal(data, &s1); err != nil {
  3373. return err
  3374. }
  3375. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3376. return nil
  3377. }
  3378. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  3379. // policy.
  3380. type AutoscalingPolicyCustomMetricUtilization struct {
  3381. // Filter: A filter string, compatible with a Stackdriver Monitoring
  3382. // filter string for TimeSeries.list API call. This filter is used to
  3383. // select a specific TimeSeries for the purpose of autoscaling and to
  3384. // determine whether the metric is exporting per-instance or per-group
  3385. // data.
  3386. //
  3387. // For the filter to be valid for autoscaling purposes, the following
  3388. // rules apply:
  3389. // - You can only use the AND operator for joining selectors.
  3390. // - You can only use direct equality comparison operator (=) without
  3391. // any functions for each selector.
  3392. // - You can specify the metric in both the filter string and in the
  3393. // metric field. However, if specified in both places, the metric must
  3394. // be identical.
  3395. // - The monitored resource type determines what kind of values are
  3396. // expected for the metric. If it is a gce_instance, the autoscaler
  3397. // expects the metric to include a separate TimeSeries for each instance
  3398. // in a group. In such a case, you cannot filter on resource labels.
  3399. // If the resource type is any other value, the autoscaler expects this
  3400. // metric to contain values that apply to the entire autoscaled instance
  3401. // group and resource label filtering can be performed to point
  3402. // autoscaler at the correct TimeSeries to scale upon. This is called a
  3403. // per-group metric for the purpose of autoscaling.
  3404. //
  3405. // If not specified, the type defaults to gce_instance.
  3406. //
  3407. // You should provide a filter that is selective enough to pick just one
  3408. // TimeSeries for the autoscaled group or for each of the instances (if
  3409. // you are using gce_instance resource type). If multiple TimeSeries are
  3410. // returned upon the query execution, the autoscaler will sum their
  3411. // respective values to obtain its scaling value.
  3412. Filter string `json:"filter,omitempty"`
  3413. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  3414. // The metric cannot have negative values.
  3415. //
  3416. // The metric must have a value type of INT64 or DOUBLE.
  3417. Metric string `json:"metric,omitempty"`
  3418. // SingleInstanceAssignment: If scaling is based on a per-group metric
  3419. // value that represents the total amount of work to be done or resource
  3420. // usage, set this value to an amount assigned for a single instance of
  3421. // the scaled group. Autoscaler will keep the number of instances
  3422. // proportional to the value of this metric, the metric itself should
  3423. // not change value due to group resizing.
  3424. //
  3425. // A good metric to use with the target is for example
  3426. // pubsub.googleapis.com/subscription/num_undelivered_messages or a
  3427. // custom metric exporting the total number of requests coming to your
  3428. // instances.
  3429. //
  3430. // A bad example would be a metric exporting an average or median
  3431. // latency, since this value can't include a chunk assignable to a
  3432. // single instance, it could be better used with utilization_target
  3433. // instead.
  3434. SingleInstanceAssignment float64 `json:"singleInstanceAssignment,omitempty"`
  3435. // UtilizationTarget: The target value of the metric that autoscaler
  3436. // should maintain. This must be a positive value. A utilization metric
  3437. // scales number of virtual machines handling requests to increase or
  3438. // decrease proportionally to the metric.
  3439. //
  3440. // For example, a good metric to use as a utilization_target is
  3441. // compute.googleapis.com/instance/network/received_bytes_count. The
  3442. // autoscaler will work to keep this value constant for each of the
  3443. // instances.
  3444. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3445. // UtilizationTargetType: Defines how target utilization value is
  3446. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  3447. // DELTA_PER_SECOND, or DELTA_PER_MINUTE.
  3448. //
  3449. // Possible values:
  3450. // "DELTA_PER_MINUTE"
  3451. // "DELTA_PER_SECOND"
  3452. // "GAUGE"
  3453. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  3454. // ForceSendFields is a list of field names (e.g. "Filter") to
  3455. // unconditionally include in API requests. By default, fields with
  3456. // empty values are omitted from API requests. However, any non-pointer,
  3457. // non-interface field appearing in ForceSendFields will be sent to the
  3458. // server regardless of whether the field is empty or not. This may be
  3459. // used to include empty fields in Patch requests.
  3460. ForceSendFields []string `json:"-"`
  3461. // NullFields is a list of field names (e.g. "Filter") to include in API
  3462. // requests with the JSON null value. By default, fields with empty
  3463. // values are omitted from API requests. However, any field with an
  3464. // empty value appearing in NullFields will be sent to the server as
  3465. // null. It is an error if a field in this list has a non-empty value.
  3466. // This may be used to include null fields in Patch requests.
  3467. NullFields []string `json:"-"`
  3468. }
  3469. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  3470. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3471. raw := NoMethod(*s)
  3472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3473. }
  3474. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  3475. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3476. var s1 struct {
  3477. SingleInstanceAssignment gensupport.JSONFloat64 `json:"singleInstanceAssignment"`
  3478. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3479. *NoMethod
  3480. }
  3481. s1.NoMethod = (*NoMethod)(s)
  3482. if err := json.Unmarshal(data, &s1); err != nil {
  3483. return err
  3484. }
  3485. s.SingleInstanceAssignment = float64(s1.SingleInstanceAssignment)
  3486. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3487. return nil
  3488. }
  3489. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  3490. // of autoscaling based on load balancing.
  3491. type AutoscalingPolicyLoadBalancingUtilization struct {
  3492. // UtilizationTarget: Fraction of backend capacity utilization (set in
  3493. // HTTP(S) load balancing configuration) that autoscaler should
  3494. // maintain. Must be a positive float value. If not defined, the default
  3495. // is 0.8.
  3496. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3497. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3498. // to unconditionally include in API requests. By default, fields with
  3499. // empty values are omitted from API requests. However, any non-pointer,
  3500. // non-interface field appearing in ForceSendFields will be sent to the
  3501. // server regardless of whether the field is empty or not. This may be
  3502. // used to include empty fields in Patch requests.
  3503. ForceSendFields []string `json:"-"`
  3504. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3505. // include in API requests with the JSON null value. By default, fields
  3506. // with empty values are omitted from API requests. However, any field
  3507. // with an empty value appearing in NullFields will be sent to the
  3508. // server as null. It is an error if a field in this list has a
  3509. // non-empty value. This may be used to include null fields in Patch
  3510. // requests.
  3511. NullFields []string `json:"-"`
  3512. }
  3513. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  3514. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3515. raw := NoMethod(*s)
  3516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3517. }
  3518. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  3519. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3520. var s1 struct {
  3521. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3522. *NoMethod
  3523. }
  3524. s1.NoMethod = (*NoMethod)(s)
  3525. if err := json.Unmarshal(data, &s1); err != nil {
  3526. return err
  3527. }
  3528. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3529. return nil
  3530. }
  3531. // Backend: Message containing information of one individual backend.
  3532. type Backend struct {
  3533. // BalancingMode: Specifies the balancing mode for this backend. For
  3534. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  3535. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  3536. // TCP/SSL).
  3537. //
  3538. // For Internal Load Balancing, the default and only supported mode is
  3539. // CONNECTION.
  3540. //
  3541. // Possible values:
  3542. // "CONNECTION"
  3543. // "RATE"
  3544. // "UTILIZATION"
  3545. BalancingMode string `json:"balancingMode,omitempty"`
  3546. // CapacityScaler: A multiplier applied to the group's maximum servicing
  3547. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  3548. // 1, which means the group will serve up to 100% of its configured
  3549. // capacity (depending on balancingMode). A setting of 0 means the group
  3550. // is completely drained, offering 0% of its available Capacity. Valid
  3551. // range is [0.0,1.0].
  3552. //
  3553. // This cannot be used for internal load balancing.
  3554. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  3555. // Description: An optional description of this resource. Provide this
  3556. // property when you create the resource.
  3557. Description string `json:"description,omitempty"`
  3558. // Group: The fully-qualified URL of an Instance Group or Network
  3559. // Endpoint Group resource. In case of instance group this defines the
  3560. // list of instances that serve traffic. Member virtual machine
  3561. // instances from each instance group must live in the same zone as the
  3562. // instance group itself. No two backends in a backend service are
  3563. // allowed to use same Instance Group resource.
  3564. //
  3565. // For Network Endpoint Groups this defines list of endpoints. All
  3566. // endpoints of Network Endpoint Group must be hosted on instances
  3567. // located in the same zone as the Network Endpoint Group.
  3568. //
  3569. // Backend service can not contain mix of Instance Group and Network
  3570. // Endpoint Group backends.
  3571. //
  3572. // Note that you must specify an Instance Group or Network Endpoint
  3573. // Group resource using the fully-qualified URL, rather than a partial
  3574. // URL.
  3575. //
  3576. // When the BackendService has load balancing scheme INTERNAL, the
  3577. // instance group must be within the same region as the BackendService.
  3578. // Network Endpoint Groups are not supported for INTERNAL load balancing
  3579. // scheme.
  3580. Group string `json:"group,omitempty"`
  3581. // MaxConnections: The max number of simultaneous connections for the
  3582. // group. Can be used with either CONNECTION or UTILIZATION balancing
  3583. // modes. For CONNECTION mode, either maxConnections or
  3584. // maxConnectionsPerInstance must be set.
  3585. //
  3586. // This cannot be used for internal load balancing.
  3587. MaxConnections int64 `json:"maxConnections,omitempty"`
  3588. // MaxConnectionsPerEndpoint: The max number of simultaneous connections
  3589. // that a single backend network endpoint can handle. This is used to
  3590. // calculate the capacity of the group. Can be used in either CONNECTION
  3591. // or UTILIZATION balancing modes. For CONNECTION mode, either
  3592. // maxConnections or maxConnectionsPerEndpoint must be set.
  3593. //
  3594. // This cannot be used for internal load balancing.
  3595. MaxConnectionsPerEndpoint int64 `json:"maxConnectionsPerEndpoint,omitempty"`
  3596. // MaxConnectionsPerInstance: The max number of simultaneous connections
  3597. // that a single backend instance can handle. This is used to calculate
  3598. // the capacity of the group. Can be used in either CONNECTION or
  3599. // UTILIZATION balancing modes. For CONNECTION mode, either
  3600. // maxConnections or maxConnectionsPerInstance must be set.
  3601. //
  3602. // This cannot be used for internal load balancing.
  3603. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  3604. // MaxRate: The max requests per second (RPS) of the group. Can be used
  3605. // with either RATE or UTILIZATION balancing modes, but required if RATE
  3606. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  3607. // set.
  3608. //
  3609. // This cannot be used for internal load balancing.
  3610. MaxRate int64 `json:"maxRate,omitempty"`
  3611. // MaxRatePerEndpoint: The max requests per second (RPS) that a single
  3612. // backend network endpoint can handle. This is used to calculate the
  3613. // capacity of the group. Can be used in either balancing mode. For RATE
  3614. // mode, either maxRate or maxRatePerEndpoint must be set.
  3615. //
  3616. // This cannot be used for internal load balancing.
  3617. MaxRatePerEndpoint float64 `json:"maxRatePerEndpoint,omitempty"`
  3618. // MaxRatePerInstance: The max requests per second (RPS) that a single
  3619. // backend instance can handle. This is used to calculate the capacity
  3620. // of the group. Can be used in either balancing mode. For RATE mode,
  3621. // either maxRate or maxRatePerInstance must be set.
  3622. //
  3623. // This cannot be used for internal load balancing.
  3624. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  3625. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  3626. // defines the CPU utilization target for the group. The default is 0.8.
  3627. // Valid range is [0.0, 1.0].
  3628. //
  3629. // This cannot be used for internal load balancing.
  3630. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  3631. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  3632. // unconditionally include in API requests. By default, fields with
  3633. // empty values are omitted from API requests. However, any non-pointer,
  3634. // non-interface field appearing in ForceSendFields will be sent to the
  3635. // server regardless of whether the field is empty or not. This may be
  3636. // used to include empty fields in Patch requests.
  3637. ForceSendFields []string `json:"-"`
  3638. // NullFields is a list of field names (e.g. "BalancingMode") to include
  3639. // in API requests with the JSON null value. By default, fields with
  3640. // empty values are omitted from API requests. However, any field with
  3641. // an empty value appearing in NullFields will be sent to the server as
  3642. // null. It is an error if a field in this list has a non-empty value.
  3643. // This may be used to include null fields in Patch requests.
  3644. NullFields []string `json:"-"`
  3645. }
  3646. func (s *Backend) MarshalJSON() ([]byte, error) {
  3647. type NoMethod Backend
  3648. raw := NoMethod(*s)
  3649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3650. }
  3651. func (s *Backend) UnmarshalJSON(data []byte) error {
  3652. type NoMethod Backend
  3653. var s1 struct {
  3654. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  3655. MaxRatePerEndpoint gensupport.JSONFloat64 `json:"maxRatePerEndpoint"`
  3656. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  3657. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  3658. *NoMethod
  3659. }
  3660. s1.NoMethod = (*NoMethod)(s)
  3661. if err := json.Unmarshal(data, &s1); err != nil {
  3662. return err
  3663. }
  3664. s.CapacityScaler = float64(s1.CapacityScaler)
  3665. s.MaxRatePerEndpoint = float64(s1.MaxRatePerEndpoint)
  3666. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  3667. s.MaxUtilization = float64(s1.MaxUtilization)
  3668. return nil
  3669. }
  3670. // BackendBucket: A BackendBucket resource. This resource defines a
  3671. // Cloud Storage bucket.
  3672. type BackendBucket struct {
  3673. // BucketName: Cloud Storage bucket name.
  3674. BucketName string `json:"bucketName,omitempty"`
  3675. // CdnPolicy: Cloud CDN configuration for this BackendBucket.
  3676. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  3677. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3678. // format.
  3679. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3680. // Description: An optional textual description of the resource;
  3681. // provided by the client when the resource is created.
  3682. Description string `json:"description,omitempty"`
  3683. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  3684. EnableCdn bool `json:"enableCdn,omitempty"`
  3685. // Id: [Output Only] Unique identifier for the resource; defined by the
  3686. // server.
  3687. Id uint64 `json:"id,omitempty,string"`
  3688. // Kind: Type of the resource.
  3689. Kind string `json:"kind,omitempty"`
  3690. // Name: Name of the resource. Provided by the client when the resource
  3691. // is created. The name must be 1-63 characters long, and comply with
  3692. // RFC1035. Specifically, the name must be 1-63 characters long and
  3693. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3694. // the first character must be a lowercase letter, and all following
  3695. // characters must be a dash, lowercase letter, or digit, except the
  3696. // last character, which cannot be a dash.
  3697. Name string `json:"name,omitempty"`
  3698. // SelfLink: [Output Only] Server-defined URL for the resource.
  3699. SelfLink string `json:"selfLink,omitempty"`
  3700. // ServerResponse contains the HTTP response code and headers from the
  3701. // server.
  3702. googleapi.ServerResponse `json:"-"`
  3703. // ForceSendFields is a list of field names (e.g. "BucketName") to
  3704. // unconditionally include in API requests. By default, fields with
  3705. // empty values are omitted from API requests. However, any non-pointer,
  3706. // non-interface field appearing in ForceSendFields will be sent to the
  3707. // server regardless of whether the field is empty or not. This may be
  3708. // used to include empty fields in Patch requests.
  3709. ForceSendFields []string `json:"-"`
  3710. // NullFields is a list of field names (e.g. "BucketName") to include in
  3711. // API requests with the JSON null value. By default, fields with empty
  3712. // values are omitted from API requests. However, any field with an
  3713. // empty value appearing in NullFields will be sent to the server as
  3714. // null. It is an error if a field in this list has a non-empty value.
  3715. // This may be used to include null fields in Patch requests.
  3716. NullFields []string `json:"-"`
  3717. }
  3718. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  3719. type NoMethod BackendBucket
  3720. raw := NoMethod(*s)
  3721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3722. }
  3723. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  3724. // for a backend bucket.
  3725. type BackendBucketCdnPolicy struct {
  3726. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  3727. // signed URL request will be considered fresh. After this time period,
  3728. // the response will be revalidated before being served. Defaults to 1hr
  3729. // (3600s). When serving responses to signed URL requests, Cloud CDN
  3730. // will internally behave as though all responses from this backend had
  3731. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  3732. // existing Cache-Control header. The actual headers served in responses
  3733. // will not be altered.
  3734. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3735. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  3736. // request URLs.
  3737. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3738. // ForceSendFields is a list of field names (e.g.
  3739. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  3740. // requests. By default, fields with empty values are omitted from API
  3741. // requests. However, any non-pointer, non-interface field appearing in
  3742. // ForceSendFields will be sent to the server regardless of whether the
  3743. // field is empty or not. This may be used to include empty fields in
  3744. // Patch requests.
  3745. ForceSendFields []string `json:"-"`
  3746. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  3747. // to include in API requests with the JSON null value. By default,
  3748. // fields with empty values are omitted from API requests. However, any
  3749. // field with an empty value appearing in NullFields will be sent to the
  3750. // server as null. It is an error if a field in this list has a
  3751. // non-empty value. This may be used to include null fields in Patch
  3752. // requests.
  3753. NullFields []string `json:"-"`
  3754. }
  3755. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  3756. type NoMethod BackendBucketCdnPolicy
  3757. raw := NoMethod(*s)
  3758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3759. }
  3760. // BackendBucketList: Contains a list of BackendBucket resources.
  3761. type BackendBucketList struct {
  3762. // Id: [Output Only] Unique identifier for the resource; defined by the
  3763. // server.
  3764. Id string `json:"id,omitempty"`
  3765. // Items: A list of BackendBucket resources.
  3766. Items []*BackendBucket `json:"items,omitempty"`
  3767. // Kind: Type of resource.
  3768. Kind string `json:"kind,omitempty"`
  3769. // NextPageToken: [Output Only] This token allows you to get the next
  3770. // page of results for list requests. If the number of results is larger
  3771. // than maxResults, use the nextPageToken as a value for the query
  3772. // parameter pageToken in the next list request. Subsequent list
  3773. // requests will have their own nextPageToken to continue paging through
  3774. // the results.
  3775. NextPageToken string `json:"nextPageToken,omitempty"`
  3776. // SelfLink: [Output Only] Server-defined URL for this resource.
  3777. SelfLink string `json:"selfLink,omitempty"`
  3778. // Warning: [Output Only] Informational warning message.
  3779. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  3780. // ServerResponse contains the HTTP response code and headers from the
  3781. // server.
  3782. googleapi.ServerResponse `json:"-"`
  3783. // ForceSendFields is a list of field names (e.g. "Id") to
  3784. // unconditionally include in API requests. By default, fields with
  3785. // empty values are omitted from API requests. However, any non-pointer,
  3786. // non-interface field appearing in ForceSendFields will be sent to the
  3787. // server regardless of whether the field is empty or not. This may be
  3788. // used to include empty fields in Patch requests.
  3789. ForceSendFields []string `json:"-"`
  3790. // NullFields is a list of field names (e.g. "Id") to include in API
  3791. // requests with the JSON null value. By default, fields with empty
  3792. // values are omitted from API requests. However, any field with an
  3793. // empty value appearing in NullFields will be sent to the server as
  3794. // null. It is an error if a field in this list has a non-empty value.
  3795. // This may be used to include null fields in Patch requests.
  3796. NullFields []string `json:"-"`
  3797. }
  3798. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  3799. type NoMethod BackendBucketList
  3800. raw := NoMethod(*s)
  3801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3802. }
  3803. // BackendBucketListWarning: [Output Only] Informational warning
  3804. // message.
  3805. type BackendBucketListWarning struct {
  3806. // Code: [Output Only] A warning code, if applicable. For example,
  3807. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3808. // the response.
  3809. //
  3810. // Possible values:
  3811. // "CLEANUP_FAILED"
  3812. // "DEPRECATED_RESOURCE_USED"
  3813. // "DEPRECATED_TYPE_USED"
  3814. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3815. // "EXPERIMENTAL_TYPE_USED"
  3816. // "EXTERNAL_API_WARNING"
  3817. // "FIELD_VALUE_OVERRIDEN"
  3818. // "INJECTED_KERNELS_DEPRECATED"
  3819. // "MISSING_TYPE_DEPENDENCY"
  3820. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3821. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3822. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3823. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3824. // "NEXT_HOP_NOT_RUNNING"
  3825. // "NOT_CRITICAL_ERROR"
  3826. // "NO_RESULTS_ON_PAGE"
  3827. // "REQUIRED_TOS_AGREEMENT"
  3828. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3829. // "RESOURCE_NOT_DELETED"
  3830. // "SCHEMA_VALIDATION_IGNORED"
  3831. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3832. // "UNDECLARED_PROPERTIES"
  3833. // "UNREACHABLE"
  3834. Code string `json:"code,omitempty"`
  3835. // Data: [Output Only] Metadata about this warning in key: value format.
  3836. // For example:
  3837. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3838. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  3839. // Message: [Output Only] A human-readable description of the warning
  3840. // code.
  3841. Message string `json:"message,omitempty"`
  3842. // ForceSendFields is a list of field names (e.g. "Code") to
  3843. // unconditionally include in API requests. By default, fields with
  3844. // empty values are omitted from API requests. However, any non-pointer,
  3845. // non-interface field appearing in ForceSendFields will be sent to the
  3846. // server regardless of whether the field is empty or not. This may be
  3847. // used to include empty fields in Patch requests.
  3848. ForceSendFields []string `json:"-"`
  3849. // NullFields is a list of field names (e.g. "Code") to include in API
  3850. // requests with the JSON null value. By default, fields with empty
  3851. // values are omitted from API requests. However, any field with an
  3852. // empty value appearing in NullFields will be sent to the server as
  3853. // null. It is an error if a field in this list has a non-empty value.
  3854. // This may be used to include null fields in Patch requests.
  3855. NullFields []string `json:"-"`
  3856. }
  3857. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  3858. type NoMethod BackendBucketListWarning
  3859. raw := NoMethod(*s)
  3860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3861. }
  3862. type BackendBucketListWarningData struct {
  3863. // Key: [Output Only] A key that provides more detail on the warning
  3864. // being returned. For example, for warnings where there are no results
  3865. // in a list request for a particular zone, this key might be scope and
  3866. // the key value might be the zone name. Other examples might be a key
  3867. // indicating a deprecated resource and a suggested replacement, or a
  3868. // warning about invalid network settings (for example, if an instance
  3869. // attempts to perform IP forwarding but is not enabled for IP
  3870. // forwarding).
  3871. Key string `json:"key,omitempty"`
  3872. // Value: [Output Only] A warning data value corresponding to the key.
  3873. Value string `json:"value,omitempty"`
  3874. // ForceSendFields is a list of field names (e.g. "Key") to
  3875. // unconditionally include in API requests. By default, fields with
  3876. // empty values are omitted from API requests. However, any non-pointer,
  3877. // non-interface field appearing in ForceSendFields will be sent to the
  3878. // server regardless of whether the field is empty or not. This may be
  3879. // used to include empty fields in Patch requests.
  3880. ForceSendFields []string `json:"-"`
  3881. // NullFields is a list of field names (e.g. "Key") to include in API
  3882. // requests with the JSON null value. By default, fields with empty
  3883. // values are omitted from API requests. However, any field with an
  3884. // empty value appearing in NullFields will be sent to the server as
  3885. // null. It is an error if a field in this list has a non-empty value.
  3886. // This may be used to include null fields in Patch requests.
  3887. NullFields []string `json:"-"`
  3888. }
  3889. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  3890. type NoMethod BackendBucketListWarningData
  3891. raw := NoMethod(*s)
  3892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3893. }
  3894. // BackendService: A BackendService resource. This resource defines a
  3895. // group of backend virtual machines and their serving capacity. (==
  3896. // resource_for v1.backendService ==) (== resource_for
  3897. // beta.backendService ==)
  3898. type BackendService struct {
  3899. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  3900. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  3901. // non-persistent and lasts only until the end of the browser session
  3902. // (or equivalent). The maximum allowed value for TTL is one day.
  3903. //
  3904. // When the load balancing scheme is INTERNAL, this field is not used.
  3905. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  3906. // Backends: The list of backends that serve this BackendService.
  3907. Backends []*Backend `json:"backends,omitempty"`
  3908. // CdnPolicy: Cloud CDN configuration for this BackendService.
  3909. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  3910. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  3911. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3912. // format.
  3913. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3914. // CustomRequestHeaders: Headers that the HTTP/S load balancer should
  3915. // add to proxied requests.
  3916. CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
  3917. // Description: An optional description of this resource. Provide this
  3918. // property when you create the resource.
  3919. Description string `json:"description,omitempty"`
  3920. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  3921. //
  3922. // When the load balancing scheme is INTERNAL, this field is not used.
  3923. EnableCDN bool `json:"enableCDN,omitempty"`
  3924. // Fingerprint: Fingerprint of this resource. A hash of the contents
  3925. // stored in this object. This field is used in optimistic locking. This
  3926. // field will be ignored when inserting a BackendService. An up-to-date
  3927. // fingerprint must be provided in order to update the BackendService,
  3928. // otherwise the request will fail with error 412 conditionNotMet.
  3929. //
  3930. // To see the latest fingerprint, make a get() request to retrieve a
  3931. // BackendService.
  3932. Fingerprint string `json:"fingerprint,omitempty"`
  3933. // HealthChecks: The list of URLs to the HttpHealthCheck or
  3934. // HttpsHealthCheck resource for health checking this BackendService.
  3935. // Currently at most one health check can be specified, and a health
  3936. // check is required for Compute Engine backend services. A health check
  3937. // must not be specified for App Engine backend and Cloud Function
  3938. // backend.
  3939. //
  3940. // For internal load balancing, a URL to a HealthCheck resource must be
  3941. // specified instead.
  3942. HealthChecks []string `json:"healthChecks,omitempty"`
  3943. Iap *BackendServiceIAP `json:"iap,omitempty"`
  3944. // Id: [Output Only] The unique identifier for the resource. This
  3945. // identifier is defined by the server.
  3946. Id uint64 `json:"id,omitempty,string"`
  3947. // Kind: [Output Only] Type of resource. Always compute#backendService
  3948. // for backend services.
  3949. Kind string `json:"kind,omitempty"`
  3950. // LoadBalancingScheme: Indicates whether the backend service will be
  3951. // used with internal or external load balancing. A backend service
  3952. // created for one type of load balancing cannot be used with the other.
  3953. // Possible values are INTERNAL and EXTERNAL.
  3954. //
  3955. // Possible values:
  3956. // "EXTERNAL"
  3957. // "INTERNAL"
  3958. // "INTERNAL_SELF_MANAGED"
  3959. // "INVALID_LOAD_BALANCING_SCHEME"
  3960. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  3961. // LogConfig: This field denotes the logging options for the load
  3962. // balancer traffic served by this backend service. If logging is
  3963. // enabled, logs will be exported to Stackdriver.
  3964. LogConfig *BackendServiceLogConfig `json:"logConfig,omitempty"`
  3965. // Name: Name of the resource. Provided by the client when the resource
  3966. // is created. The name must be 1-63 characters long, and comply with
  3967. // RFC1035. Specifically, the name must be 1-63 characters long and
  3968. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3969. // the first character must be a lowercase letter, and all following
  3970. // characters must be a dash, lowercase letter, or digit, except the
  3971. // last character, which cannot be a dash.
  3972. Name string `json:"name,omitempty"`
  3973. // Port: Deprecated in favor of portName. The TCP port to connect on the
  3974. // backend. The default value is 80.
  3975. //
  3976. // This cannot be used for internal load balancing.
  3977. Port int64 `json:"port,omitempty"`
  3978. // PortName: Name of backend port. The same name should appear in the
  3979. // instance groups referenced by this service. Required when the load
  3980. // balancing scheme is EXTERNAL.
  3981. //
  3982. // When the load balancing scheme is INTERNAL, this field is not used.
  3983. PortName string `json:"portName,omitempty"`
  3984. // Protocol: The protocol this BackendService uses to communicate with
  3985. // backends.
  3986. //
  3987. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  3988. // HTTP.
  3989. //
  3990. // For internal load balancing, the possible values are TCP and UDP, and
  3991. // the default is TCP.
  3992. //
  3993. // Possible values:
  3994. // "HTTP"
  3995. // "HTTP2"
  3996. // "HTTPS"
  3997. // "SSL"
  3998. // "TCP"
  3999. // "UDP"
  4000. Protocol string `json:"protocol,omitempty"`
  4001. // Region: [Output Only] URL of the region where the regional backend
  4002. // service resides. This field is not applicable to global backend
  4003. // services. You must specify this field as part of the HTTP request
  4004. // URL. It is not settable as a field in the request body.
  4005. Region string `json:"region,omitempty"`
  4006. // SecurityPolicy: [Output Only] The resource URL for the security
  4007. // policy associated with this backend service.
  4008. SecurityPolicy string `json:"securityPolicy,omitempty"`
  4009. // SelfLink: [Output Only] Server-defined URL for the resource.
  4010. SelfLink string `json:"selfLink,omitempty"`
  4011. // SessionAffinity: Type of session affinity to use. The default is
  4012. // NONE.
  4013. //
  4014. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  4015. // or GENERATED_COOKIE.
  4016. //
  4017. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  4018. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  4019. //
  4020. // When the protocol is UDP, this field is not used.
  4021. //
  4022. // Possible values:
  4023. // "CLIENT_IP"
  4024. // "CLIENT_IP_PORT_PROTO"
  4025. // "CLIENT_IP_PROTO"
  4026. // "GENERATED_COOKIE"
  4027. // "NONE"
  4028. SessionAffinity string `json:"sessionAffinity,omitempty"`
  4029. // TimeoutSec: How many seconds to wait for the backend before
  4030. // considering it a failed request. Default is 30 seconds.
  4031. TimeoutSec int64 `json:"timeoutSec,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.
  4036. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  4037. // By default, fields with empty values are omitted from API requests.
  4038. // However, any non-pointer, non-interface field appearing in
  4039. // ForceSendFields will be sent to the server regardless of whether the
  4040. // field is empty or not. This may be used to include empty fields in
  4041. // Patch requests.
  4042. ForceSendFields []string `json:"-"`
  4043. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  4044. // include in API requests with the JSON null value. By default, fields
  4045. // with empty values are omitted from API requests. However, any field
  4046. // with an empty value appearing in NullFields will be sent to the
  4047. // server as null. It is an error if a field in this list has a
  4048. // non-empty value. This may be used to include null fields in Patch
  4049. // requests.
  4050. NullFields []string `json:"-"`
  4051. }
  4052. func (s *BackendService) MarshalJSON() ([]byte, error) {
  4053. type NoMethod BackendService
  4054. raw := NoMethod(*s)
  4055. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4056. }
  4057. // BackendServiceAggregatedList: Contains a list of
  4058. // BackendServicesScopedList.
  4059. type BackendServiceAggregatedList struct {
  4060. // Id: [Output Only] Unique identifier for the resource; defined by the
  4061. // server.
  4062. Id string `json:"id,omitempty"`
  4063. // Items: A list of BackendServicesScopedList resources.
  4064. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  4065. // Kind: Type of resource.
  4066. Kind string `json:"kind,omitempty"`
  4067. // NextPageToken: [Output Only] This token allows you to get the next
  4068. // page of results for list requests. If the number of results is larger
  4069. // than maxResults, use the nextPageToken as a value for the query
  4070. // parameter pageToken in the next list request. Subsequent list
  4071. // requests will have their own nextPageToken to continue paging through
  4072. // the results.
  4073. NextPageToken string `json:"nextPageToken,omitempty"`
  4074. // SelfLink: [Output Only] Server-defined URL for this resource.
  4075. SelfLink string `json:"selfLink,omitempty"`
  4076. // Warning: [Output Only] Informational warning message.
  4077. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  4078. // ServerResponse contains the HTTP response code and headers from the
  4079. // server.
  4080. googleapi.ServerResponse `json:"-"`
  4081. // ForceSendFields is a list of field names (e.g. "Id") to
  4082. // unconditionally include in API requests. By default, fields with
  4083. // empty values are omitted from API requests. However, any non-pointer,
  4084. // non-interface field appearing in ForceSendFields will be sent to the
  4085. // server regardless of whether the field is empty or not. This may be
  4086. // used to include empty fields in Patch requests.
  4087. ForceSendFields []string `json:"-"`
  4088. // NullFields is a list of field names (e.g. "Id") to include in API
  4089. // requests with the JSON null value. By default, fields with empty
  4090. // values are omitted from API requests. However, any field with an
  4091. // empty value appearing in NullFields will be sent to the server as
  4092. // null. It is an error if a field in this list has a non-empty value.
  4093. // This may be used to include null fields in Patch requests.
  4094. NullFields []string `json:"-"`
  4095. }
  4096. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  4097. type NoMethod BackendServiceAggregatedList
  4098. raw := NoMethod(*s)
  4099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4100. }
  4101. // BackendServiceAggregatedListWarning: [Output Only] Informational
  4102. // warning message.
  4103. type BackendServiceAggregatedListWarning struct {
  4104. // Code: [Output Only] A warning code, if applicable. For example,
  4105. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4106. // the response.
  4107. //
  4108. // Possible values:
  4109. // "CLEANUP_FAILED"
  4110. // "DEPRECATED_RESOURCE_USED"
  4111. // "DEPRECATED_TYPE_USED"
  4112. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4113. // "EXPERIMENTAL_TYPE_USED"
  4114. // "EXTERNAL_API_WARNING"
  4115. // "FIELD_VALUE_OVERRIDEN"
  4116. // "INJECTED_KERNELS_DEPRECATED"
  4117. // "MISSING_TYPE_DEPENDENCY"
  4118. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4119. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4120. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4121. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4122. // "NEXT_HOP_NOT_RUNNING"
  4123. // "NOT_CRITICAL_ERROR"
  4124. // "NO_RESULTS_ON_PAGE"
  4125. // "REQUIRED_TOS_AGREEMENT"
  4126. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4127. // "RESOURCE_NOT_DELETED"
  4128. // "SCHEMA_VALIDATION_IGNORED"
  4129. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4130. // "UNDECLARED_PROPERTIES"
  4131. // "UNREACHABLE"
  4132. Code string `json:"code,omitempty"`
  4133. // Data: [Output Only] Metadata about this warning in key: value format.
  4134. // For example:
  4135. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4136. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  4137. // Message: [Output Only] A human-readable description of the warning
  4138. // code.
  4139. Message string `json:"message,omitempty"`
  4140. // ForceSendFields is a list of field names (e.g. "Code") to
  4141. // unconditionally include in API requests. By default, fields with
  4142. // empty values are omitted from API requests. However, any non-pointer,
  4143. // non-interface field appearing in ForceSendFields will be sent to the
  4144. // server regardless of whether the field is empty or not. This may be
  4145. // used to include empty fields in Patch requests.
  4146. ForceSendFields []string `json:"-"`
  4147. // NullFields is a list of field names (e.g. "Code") to include in API
  4148. // requests with the JSON null value. By default, fields with empty
  4149. // values are omitted from API requests. However, any field with an
  4150. // empty value appearing in NullFields will be sent to the server as
  4151. // null. It is an error if a field in this list has a non-empty value.
  4152. // This may be used to include null fields in Patch requests.
  4153. NullFields []string `json:"-"`
  4154. }
  4155. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4156. type NoMethod BackendServiceAggregatedListWarning
  4157. raw := NoMethod(*s)
  4158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4159. }
  4160. type BackendServiceAggregatedListWarningData struct {
  4161. // Key: [Output Only] A key that provides more detail on the warning
  4162. // being returned. For example, for warnings where there are no results
  4163. // in a list request for a particular zone, this key might be scope and
  4164. // the key value might be the zone name. Other examples might be a key
  4165. // indicating a deprecated resource and a suggested replacement, or a
  4166. // warning about invalid network settings (for example, if an instance
  4167. // attempts to perform IP forwarding but is not enabled for IP
  4168. // forwarding).
  4169. Key string `json:"key,omitempty"`
  4170. // Value: [Output Only] A warning data value corresponding to the key.
  4171. Value string `json:"value,omitempty"`
  4172. // ForceSendFields is a list of field names (e.g. "Key") to
  4173. // unconditionally include in API requests. By default, fields with
  4174. // empty values are omitted from API requests. However, any non-pointer,
  4175. // non-interface field appearing in ForceSendFields will be sent to the
  4176. // server regardless of whether the field is empty or not. This may be
  4177. // used to include empty fields in Patch requests.
  4178. ForceSendFields []string `json:"-"`
  4179. // NullFields is a list of field names (e.g. "Key") to include in API
  4180. // requests with the JSON null value. By default, fields with empty
  4181. // values are omitted from API requests. However, any field with an
  4182. // empty value appearing in NullFields will be sent to the server as
  4183. // null. It is an error if a field in this list has a non-empty value.
  4184. // This may be used to include null fields in Patch requests.
  4185. NullFields []string `json:"-"`
  4186. }
  4187. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4188. type NoMethod BackendServiceAggregatedListWarningData
  4189. raw := NoMethod(*s)
  4190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4191. }
  4192. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  4193. // for a backend service.
  4194. type BackendServiceCdnPolicy struct {
  4195. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  4196. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  4197. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  4198. // signed URL request will be considered fresh. After this time period,
  4199. // the response will be revalidated before being served. Defaults to 1hr
  4200. // (3600s). When serving responses to signed URL requests, Cloud CDN
  4201. // will internally behave as though all responses from this backend had
  4202. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  4203. // existing Cache-Control header. The actual headers served in responses
  4204. // will not be altered.
  4205. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  4206. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  4207. // request URLs.
  4208. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  4209. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  4210. // unconditionally include in API requests. By default, fields with
  4211. // empty values are omitted from API requests. However, any non-pointer,
  4212. // non-interface field appearing in ForceSendFields will be sent to the
  4213. // server regardless of whether the field is empty or not. This may be
  4214. // used to include empty fields in Patch requests.
  4215. ForceSendFields []string `json:"-"`
  4216. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  4217. // include in API requests with the JSON null value. By default, fields
  4218. // with empty values are omitted from API requests. However, any field
  4219. // with an empty value appearing in NullFields will be sent to the
  4220. // server as null. It is an error if a field in this list has a
  4221. // non-empty value. This may be used to include null fields in Patch
  4222. // requests.
  4223. NullFields []string `json:"-"`
  4224. }
  4225. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  4226. type NoMethod BackendServiceCdnPolicy
  4227. raw := NoMethod(*s)
  4228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4229. }
  4230. type BackendServiceGroupHealth struct {
  4231. // HealthStatus: Health state of the backend instances or endpoints in
  4232. // requested instance or network endpoint group, determined based on
  4233. // configured health checks.
  4234. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  4235. // Kind: [Output Only] Type of resource. Always
  4236. // compute#backendServiceGroupHealth for the health of backend services.
  4237. Kind string `json:"kind,omitempty"`
  4238. // ServerResponse contains the HTTP response code and headers from the
  4239. // server.
  4240. googleapi.ServerResponse `json:"-"`
  4241. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  4242. // unconditionally include in API requests. By default, fields with
  4243. // empty values are omitted from API requests. However, any non-pointer,
  4244. // non-interface field appearing in ForceSendFields will be sent to the
  4245. // server regardless of whether the field is empty or not. This may be
  4246. // used to include empty fields in Patch requests.
  4247. ForceSendFields []string `json:"-"`
  4248. // NullFields is a list of field names (e.g. "HealthStatus") to include
  4249. // in API requests with the JSON null value. By default, fields with
  4250. // empty values are omitted from API requests. However, any field with
  4251. // an empty value appearing in NullFields will be sent to the server as
  4252. // null. It is an error if a field in this list has a non-empty value.
  4253. // This may be used to include null fields in Patch requests.
  4254. NullFields []string `json:"-"`
  4255. }
  4256. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  4257. type NoMethod BackendServiceGroupHealth
  4258. raw := NoMethod(*s)
  4259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4260. }
  4261. // BackendServiceIAP: Identity-Aware Proxy
  4262. type BackendServiceIAP struct {
  4263. Enabled bool `json:"enabled,omitempty"`
  4264. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  4265. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  4266. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  4267. // field oauth2_client_secret above.
  4268. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  4269. // ForceSendFields is a list of field names (e.g. "Enabled") to
  4270. // unconditionally include in API requests. By default, fields with
  4271. // empty values are omitted from API requests. However, any non-pointer,
  4272. // non-interface field appearing in ForceSendFields will be sent to the
  4273. // server regardless of whether the field is empty or not. This may be
  4274. // used to include empty fields in Patch requests.
  4275. ForceSendFields []string `json:"-"`
  4276. // NullFields is a list of field names (e.g. "Enabled") to include in
  4277. // API requests with the JSON null value. By default, fields with empty
  4278. // values are omitted from API requests. However, any field with an
  4279. // empty value appearing in NullFields will be sent to the server as
  4280. // null. It is an error if a field in this list has a non-empty value.
  4281. // This may be used to include null fields in Patch requests.
  4282. NullFields []string `json:"-"`
  4283. }
  4284. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  4285. type NoMethod BackendServiceIAP
  4286. raw := NoMethod(*s)
  4287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4288. }
  4289. // BackendServiceList: Contains a list of BackendService resources.
  4290. type BackendServiceList struct {
  4291. // Id: [Output Only] Unique identifier for the resource; defined by the
  4292. // server.
  4293. Id string `json:"id,omitempty"`
  4294. // Items: A list of BackendService resources.
  4295. Items []*BackendService `json:"items,omitempty"`
  4296. // Kind: [Output Only] Type of resource. Always
  4297. // compute#backendServiceList for lists of backend services.
  4298. Kind string `json:"kind,omitempty"`
  4299. // NextPageToken: [Output Only] This token allows you to get the next
  4300. // page of results for list requests. If the number of results is larger
  4301. // than maxResults, use the nextPageToken as a value for the query
  4302. // parameter pageToken in the next list request. Subsequent list
  4303. // requests will have their own nextPageToken to continue paging through
  4304. // the results.
  4305. NextPageToken string `json:"nextPageToken,omitempty"`
  4306. // SelfLink: [Output Only] Server-defined URL for this resource.
  4307. SelfLink string `json:"selfLink,omitempty"`
  4308. // Warning: [Output Only] Informational warning message.
  4309. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  4310. // ServerResponse contains the HTTP response code and headers from the
  4311. // server.
  4312. googleapi.ServerResponse `json:"-"`
  4313. // ForceSendFields is a list of field names (e.g. "Id") to
  4314. // unconditionally include in API requests. By default, fields with
  4315. // empty values are omitted from API requests. However, any non-pointer,
  4316. // non-interface field appearing in ForceSendFields will be sent to the
  4317. // server regardless of whether the field is empty or not. This may be
  4318. // used to include empty fields in Patch requests.
  4319. ForceSendFields []string `json:"-"`
  4320. // NullFields is a list of field names (e.g. "Id") to include in API
  4321. // requests with the JSON null value. By default, fields with empty
  4322. // values are omitted from API requests. However, any field with an
  4323. // empty value appearing in NullFields will be sent to the server as
  4324. // null. It is an error if a field in this list has a non-empty value.
  4325. // This may be used to include null fields in Patch requests.
  4326. NullFields []string `json:"-"`
  4327. }
  4328. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  4329. type NoMethod BackendServiceList
  4330. raw := NoMethod(*s)
  4331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4332. }
  4333. // BackendServiceListWarning: [Output Only] Informational warning
  4334. // message.
  4335. type BackendServiceListWarning struct {
  4336. // Code: [Output Only] A warning code, if applicable. For example,
  4337. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4338. // the response.
  4339. //
  4340. // Possible values:
  4341. // "CLEANUP_FAILED"
  4342. // "DEPRECATED_RESOURCE_USED"
  4343. // "DEPRECATED_TYPE_USED"
  4344. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4345. // "EXPERIMENTAL_TYPE_USED"
  4346. // "EXTERNAL_API_WARNING"
  4347. // "FIELD_VALUE_OVERRIDEN"
  4348. // "INJECTED_KERNELS_DEPRECATED"
  4349. // "MISSING_TYPE_DEPENDENCY"
  4350. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4351. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4352. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4353. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4354. // "NEXT_HOP_NOT_RUNNING"
  4355. // "NOT_CRITICAL_ERROR"
  4356. // "NO_RESULTS_ON_PAGE"
  4357. // "REQUIRED_TOS_AGREEMENT"
  4358. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4359. // "RESOURCE_NOT_DELETED"
  4360. // "SCHEMA_VALIDATION_IGNORED"
  4361. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4362. // "UNDECLARED_PROPERTIES"
  4363. // "UNREACHABLE"
  4364. Code string `json:"code,omitempty"`
  4365. // Data: [Output Only] Metadata about this warning in key: value format.
  4366. // For example:
  4367. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4368. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  4369. // Message: [Output Only] A human-readable description of the warning
  4370. // code.
  4371. Message string `json:"message,omitempty"`
  4372. // ForceSendFields is a list of field names (e.g. "Code") to
  4373. // unconditionally include in API requests. By default, fields with
  4374. // empty values are omitted from API requests. However, any non-pointer,
  4375. // non-interface field appearing in ForceSendFields will be sent to the
  4376. // server regardless of whether the field is empty or not. This may be
  4377. // used to include empty fields in Patch requests.
  4378. ForceSendFields []string `json:"-"`
  4379. // NullFields is a list of field names (e.g. "Code") to include in API
  4380. // requests with the JSON null value. By default, fields with empty
  4381. // values are omitted from API requests. However, any field with an
  4382. // empty value appearing in NullFields will be sent to the server as
  4383. // null. It is an error if a field in this list has a non-empty value.
  4384. // This may be used to include null fields in Patch requests.
  4385. NullFields []string `json:"-"`
  4386. }
  4387. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  4388. type NoMethod BackendServiceListWarning
  4389. raw := NoMethod(*s)
  4390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4391. }
  4392. type BackendServiceListWarningData struct {
  4393. // Key: [Output Only] A key that provides more detail on the warning
  4394. // being returned. For example, for warnings where there are no results
  4395. // in a list request for a particular zone, this key might be scope and
  4396. // the key value might be the zone name. Other examples might be a key
  4397. // indicating a deprecated resource and a suggested replacement, or a
  4398. // warning about invalid network settings (for example, if an instance
  4399. // attempts to perform IP forwarding but is not enabled for IP
  4400. // forwarding).
  4401. Key string `json:"key,omitempty"`
  4402. // Value: [Output Only] A warning data value corresponding to the key.
  4403. Value string `json:"value,omitempty"`
  4404. // ForceSendFields is a list of field names (e.g. "Key") to
  4405. // unconditionally include in API requests. By default, fields with
  4406. // empty values are omitted from API requests. However, any non-pointer,
  4407. // non-interface field appearing in ForceSendFields will be sent to the
  4408. // server regardless of whether the field is empty or not. This may be
  4409. // used to include empty fields in Patch requests.
  4410. ForceSendFields []string `json:"-"`
  4411. // NullFields is a list of field names (e.g. "Key") to include in API
  4412. // requests with the JSON null value. By default, fields with empty
  4413. // values are omitted from API requests. However, any field with an
  4414. // empty value appearing in NullFields will be sent to the server as
  4415. // null. It is an error if a field in this list has a non-empty value.
  4416. // This may be used to include null fields in Patch requests.
  4417. NullFields []string `json:"-"`
  4418. }
  4419. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  4420. type NoMethod BackendServiceListWarningData
  4421. raw := NoMethod(*s)
  4422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4423. }
  4424. // BackendServiceLogConfig: The available logging options for the load
  4425. // balancer traffic served by this backend service.
  4426. type BackendServiceLogConfig struct {
  4427. // Enable: This field denotes whether to enable logging for the load
  4428. // balancer traffic served by this backend service.
  4429. Enable bool `json:"enable,omitempty"`
  4430. // SampleRate: This field can only be specified if logging is enabled
  4431. // for this backend service. The value of the field must be in [0, 1].
  4432. // This configures the sampling rate of requests to the load balancer
  4433. // where 1.0 means all logged requests are reported and 0.0 means no
  4434. // logged requests are reported. The default value is 1.0.
  4435. SampleRate float64 `json:"sampleRate,omitempty"`
  4436. // ForceSendFields is a list of field names (e.g. "Enable") to
  4437. // unconditionally include in API requests. By default, fields with
  4438. // empty values are omitted from API requests. However, any non-pointer,
  4439. // non-interface field appearing in ForceSendFields will be sent to the
  4440. // server regardless of whether the field is empty or not. This may be
  4441. // used to include empty fields in Patch requests.
  4442. ForceSendFields []string `json:"-"`
  4443. // NullFields is a list of field names (e.g. "Enable") to include in API
  4444. // requests with the JSON null value. By default, fields with empty
  4445. // values are omitted from API requests. However, any field with an
  4446. // empty value appearing in NullFields will be sent to the server as
  4447. // null. It is an error if a field in this list has a non-empty value.
  4448. // This may be used to include null fields in Patch requests.
  4449. NullFields []string `json:"-"`
  4450. }
  4451. func (s *BackendServiceLogConfig) MarshalJSON() ([]byte, error) {
  4452. type NoMethod BackendServiceLogConfig
  4453. raw := NoMethod(*s)
  4454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4455. }
  4456. func (s *BackendServiceLogConfig) UnmarshalJSON(data []byte) error {
  4457. type NoMethod BackendServiceLogConfig
  4458. var s1 struct {
  4459. SampleRate gensupport.JSONFloat64 `json:"sampleRate"`
  4460. *NoMethod
  4461. }
  4462. s1.NoMethod = (*NoMethod)(s)
  4463. if err := json.Unmarshal(data, &s1); err != nil {
  4464. return err
  4465. }
  4466. s.SampleRate = float64(s1.SampleRate)
  4467. return nil
  4468. }
  4469. type BackendServiceReference struct {
  4470. BackendService string `json:"backendService,omitempty"`
  4471. // ForceSendFields is a list of field names (e.g. "BackendService") to
  4472. // unconditionally include in API requests. By default, fields with
  4473. // empty values are omitted from API requests. However, any non-pointer,
  4474. // non-interface field appearing in ForceSendFields will be sent to the
  4475. // server regardless of whether the field is empty or not. This may be
  4476. // used to include empty fields in Patch requests.
  4477. ForceSendFields []string `json:"-"`
  4478. // NullFields is a list of field names (e.g. "BackendService") to
  4479. // include in API requests with the JSON null value. By default, fields
  4480. // with empty values are omitted from API requests. However, any field
  4481. // with an empty value appearing in NullFields will be sent to the
  4482. // server as null. It is an error if a field in this list has a
  4483. // non-empty value. This may be used to include null fields in Patch
  4484. // requests.
  4485. NullFields []string `json:"-"`
  4486. }
  4487. func (s *BackendServiceReference) MarshalJSON() ([]byte, error) {
  4488. type NoMethod BackendServiceReference
  4489. raw := NoMethod(*s)
  4490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4491. }
  4492. type BackendServicesScopedList struct {
  4493. // BackendServices: A list of BackendServices contained in this scope.
  4494. BackendServices []*BackendService `json:"backendServices,omitempty"`
  4495. // Warning: Informational warning which replaces the list of backend
  4496. // services when the list is empty.
  4497. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  4498. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  4499. // unconditionally include in API requests. By default, fields with
  4500. // empty values are omitted from API requests. However, any non-pointer,
  4501. // non-interface field appearing in ForceSendFields will be sent to the
  4502. // server regardless of whether the field is empty or not. This may be
  4503. // used to include empty fields in Patch requests.
  4504. ForceSendFields []string `json:"-"`
  4505. // NullFields is a list of field names (e.g. "BackendServices") to
  4506. // include in API requests with the JSON null value. By default, fields
  4507. // with empty values are omitted from API requests. However, any field
  4508. // with an empty value appearing in NullFields will be sent to the
  4509. // server as null. It is an error if a field in this list has a
  4510. // non-empty value. This may be used to include null fields in Patch
  4511. // requests.
  4512. NullFields []string `json:"-"`
  4513. }
  4514. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  4515. type NoMethod BackendServicesScopedList
  4516. raw := NoMethod(*s)
  4517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4518. }
  4519. // BackendServicesScopedListWarning: Informational warning which
  4520. // replaces the list of backend services when the list is empty.
  4521. type BackendServicesScopedListWarning struct {
  4522. // Code: [Output Only] A warning code, if applicable. For example,
  4523. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4524. // the response.
  4525. //
  4526. // Possible values:
  4527. // "CLEANUP_FAILED"
  4528. // "DEPRECATED_RESOURCE_USED"
  4529. // "DEPRECATED_TYPE_USED"
  4530. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4531. // "EXPERIMENTAL_TYPE_USED"
  4532. // "EXTERNAL_API_WARNING"
  4533. // "FIELD_VALUE_OVERRIDEN"
  4534. // "INJECTED_KERNELS_DEPRECATED"
  4535. // "MISSING_TYPE_DEPENDENCY"
  4536. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4537. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4538. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4539. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4540. // "NEXT_HOP_NOT_RUNNING"
  4541. // "NOT_CRITICAL_ERROR"
  4542. // "NO_RESULTS_ON_PAGE"
  4543. // "REQUIRED_TOS_AGREEMENT"
  4544. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4545. // "RESOURCE_NOT_DELETED"
  4546. // "SCHEMA_VALIDATION_IGNORED"
  4547. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4548. // "UNDECLARED_PROPERTIES"
  4549. // "UNREACHABLE"
  4550. Code string `json:"code,omitempty"`
  4551. // Data: [Output Only] Metadata about this warning in key: value format.
  4552. // For example:
  4553. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4554. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  4555. // Message: [Output Only] A human-readable description of the warning
  4556. // code.
  4557. Message string `json:"message,omitempty"`
  4558. // ForceSendFields is a list of field names (e.g. "Code") to
  4559. // unconditionally include in API requests. By default, fields with
  4560. // empty values are omitted from API requests. However, any non-pointer,
  4561. // non-interface field appearing in ForceSendFields will be sent to the
  4562. // server regardless of whether the field is empty or not. This may be
  4563. // used to include empty fields in Patch requests.
  4564. ForceSendFields []string `json:"-"`
  4565. // NullFields is a list of field names (e.g. "Code") to include in API
  4566. // requests with the JSON null value. By default, fields with empty
  4567. // values are omitted from API requests. However, any field with an
  4568. // empty value appearing in NullFields will be sent to the server as
  4569. // null. It is an error if a field in this list has a non-empty value.
  4570. // This may be used to include null fields in Patch requests.
  4571. NullFields []string `json:"-"`
  4572. }
  4573. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  4574. type NoMethod BackendServicesScopedListWarning
  4575. raw := NoMethod(*s)
  4576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4577. }
  4578. type BackendServicesScopedListWarningData struct {
  4579. // Key: [Output Only] A key that provides more detail on the warning
  4580. // being returned. For example, for warnings where there are no results
  4581. // in a list request for a particular zone, this key might be scope and
  4582. // the key value might be the zone name. Other examples might be a key
  4583. // indicating a deprecated resource and a suggested replacement, or a
  4584. // warning about invalid network settings (for example, if an instance
  4585. // attempts to perform IP forwarding but is not enabled for IP
  4586. // forwarding).
  4587. Key string `json:"key,omitempty"`
  4588. // Value: [Output Only] A warning data value corresponding to the key.
  4589. Value string `json:"value,omitempty"`
  4590. // ForceSendFields is a list of field names (e.g. "Key") to
  4591. // unconditionally include in API requests. By default, fields with
  4592. // empty values are omitted from API requests. However, any non-pointer,
  4593. // non-interface field appearing in ForceSendFields will be sent to the
  4594. // server regardless of whether the field is empty or not. This may be
  4595. // used to include empty fields in Patch requests.
  4596. ForceSendFields []string `json:"-"`
  4597. // NullFields is a list of field names (e.g. "Key") to include in API
  4598. // requests with the JSON null value. By default, fields with empty
  4599. // values are omitted from API requests. However, any field with an
  4600. // empty value appearing in NullFields will be sent to the server as
  4601. // null. It is an error if a field in this list has a non-empty value.
  4602. // This may be used to include null fields in Patch requests.
  4603. NullFields []string `json:"-"`
  4604. }
  4605. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  4606. type NoMethod BackendServicesScopedListWarningData
  4607. raw := NoMethod(*s)
  4608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4609. }
  4610. // Binding: Associates `members` with a `role`.
  4611. type Binding struct {
  4612. // Condition: Unimplemented. The condition that is associated with this
  4613. // binding. NOTE: an unsatisfied condition will not allow user access
  4614. // via current binding. Different bindings, including their conditions,
  4615. // are examined independently.
  4616. Condition *Expr `json:"condition,omitempty"`
  4617. // Members: Specifies the identities requesting access for a Cloud
  4618. // Platform resource. `members` can have the following values:
  4619. //
  4620. // * `allUsers`: A special identifier that represents anyone who is on
  4621. // the internet; with or without a Google account.
  4622. //
  4623. // * `allAuthenticatedUsers`: A special identifier that represents
  4624. // anyone who is authenticated with a Google account or a service
  4625. // account.
  4626. //
  4627. // * `user:{emailid}`: An email address that represents a specific
  4628. // Google account. For example, `alice@gmail.com` .
  4629. //
  4630. //
  4631. //
  4632. // * `serviceAccount:{emailid}`: An email address that represents a
  4633. // service account. For example,
  4634. // `my-other-app@appspot.gserviceaccount.com`.
  4635. //
  4636. // * `group:{emailid}`: An email address that represents a Google group.
  4637. // For example, `admins@example.com`.
  4638. //
  4639. //
  4640. //
  4641. // * `domain:{domain}`: The G Suite domain (primary) that represents all
  4642. // the users of that domain. For example, `google.com` or `example.com`.
  4643. Members []string `json:"members,omitempty"`
  4644. // Role: Role that is assigned to `members`. For example,
  4645. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  4646. Role string `json:"role,omitempty"`
  4647. // ForceSendFields is a list of field names (e.g. "Condition") to
  4648. // unconditionally include in API requests. By default, fields with
  4649. // empty values are omitted from API requests. However, any non-pointer,
  4650. // non-interface field appearing in ForceSendFields will be sent to the
  4651. // server regardless of whether the field is empty or not. This may be
  4652. // used to include empty fields in Patch requests.
  4653. ForceSendFields []string `json:"-"`
  4654. // NullFields is a list of field names (e.g. "Condition") to include in
  4655. // API requests with the JSON null value. By default, fields with empty
  4656. // values are omitted from API requests. However, any field with an
  4657. // empty value appearing in NullFields will be sent to the server as
  4658. // null. It is an error if a field in this list has a non-empty value.
  4659. // This may be used to include null fields in Patch requests.
  4660. NullFields []string `json:"-"`
  4661. }
  4662. func (s *Binding) MarshalJSON() ([]byte, error) {
  4663. type NoMethod Binding
  4664. raw := NoMethod(*s)
  4665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4666. }
  4667. type CacheInvalidationRule struct {
  4668. // Host: If set, this invalidation rule will only apply to requests with
  4669. // a Host header matching host.
  4670. Host string `json:"host,omitempty"`
  4671. Path string `json:"path,omitempty"`
  4672. // ForceSendFields is a list of field names (e.g. "Host") to
  4673. // unconditionally include in API requests. By default, fields with
  4674. // empty values are omitted from API requests. However, any non-pointer,
  4675. // non-interface field appearing in ForceSendFields will be sent to the
  4676. // server regardless of whether the field is empty or not. This may be
  4677. // used to include empty fields in Patch requests.
  4678. ForceSendFields []string `json:"-"`
  4679. // NullFields is a list of field names (e.g. "Host") to include in API
  4680. // requests with the JSON null value. By default, fields with empty
  4681. // values are omitted from API requests. However, any field with an
  4682. // empty value appearing in NullFields will be sent to the server as
  4683. // null. It is an error if a field in this list has a non-empty value.
  4684. // This may be used to include null fields in Patch requests.
  4685. NullFields []string `json:"-"`
  4686. }
  4687. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  4688. type NoMethod CacheInvalidationRule
  4689. raw := NoMethod(*s)
  4690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4691. }
  4692. // CacheKeyPolicy: Message containing what to include in the cache key
  4693. // for a request for Cloud CDN.
  4694. type CacheKeyPolicy struct {
  4695. // IncludeHost: If true, requests to different hosts will be cached
  4696. // separately.
  4697. IncludeHost bool `json:"includeHost,omitempty"`
  4698. // IncludeProtocol: If true, http and https requests will be cached
  4699. // separately.
  4700. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  4701. // IncludeQueryString: If true, include query string parameters in the
  4702. // cache key according to query_string_whitelist and
  4703. // query_string_blacklist. If neither is set, the entire query string
  4704. // will be included. If false, the query string will be excluded from
  4705. // the cache key entirely.
  4706. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  4707. // QueryStringBlacklist: Names of query string parameters to exclude in
  4708. // cache keys. All other parameters will be included. Either specify
  4709. // query_string_whitelist or query_string_blacklist, not both. '&' and
  4710. // '=' will be percent encoded and not treated as delimiters.
  4711. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  4712. // QueryStringWhitelist: Names of query string parameters to include in
  4713. // cache keys. All other parameters will be excluded. Either specify
  4714. // query_string_whitelist or query_string_blacklist, not both. '&' and
  4715. // '=' will be percent encoded and not treated as delimiters.
  4716. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  4717. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  4718. // unconditionally include in API requests. By default, fields with
  4719. // empty values are omitted from API requests. However, any non-pointer,
  4720. // non-interface field appearing in ForceSendFields will be sent to the
  4721. // server regardless of whether the field is empty or not. This may be
  4722. // used to include empty fields in Patch requests.
  4723. ForceSendFields []string `json:"-"`
  4724. // NullFields is a list of field names (e.g. "IncludeHost") to include
  4725. // in API requests with the JSON null value. By default, fields with
  4726. // empty values are omitted from API requests. However, any field with
  4727. // an empty value appearing in NullFields will be sent to the server as
  4728. // null. It is an error if a field in this list has a non-empty value.
  4729. // This may be used to include null fields in Patch requests.
  4730. NullFields []string `json:"-"`
  4731. }
  4732. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  4733. type NoMethod CacheKeyPolicy
  4734. raw := NoMethod(*s)
  4735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4736. }
  4737. // Commitment: Represents a Commitment resource. Creating a Commitment
  4738. // resource means that you are purchasing a committed use contract with
  4739. // an explicit start and end time. You can create commitments based on
  4740. // vCPUs and memory usage and receive discounted rates. For full
  4741. // details, read Signing Up for Committed Use Discounts.
  4742. //
  4743. // Committed use discounts are subject to Google Cloud Platform's
  4744. // Service Specific Terms. By purchasing a committed use discount, you
  4745. // agree to these terms. Committed use discounts will not renew, so you
  4746. // must purchase a new commitment to continue receiving discounts. (==
  4747. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  4748. type Commitment struct {
  4749. // Allocations: List of allocations for this commitment.
  4750. Allocations []*Allocation `json:"allocations,omitempty"`
  4751. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4752. // format.
  4753. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4754. // Description: An optional description of this resource. Provide this
  4755. // property when you create the resource.
  4756. Description string `json:"description,omitempty"`
  4757. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  4758. // format.
  4759. EndTimestamp string `json:"endTimestamp,omitempty"`
  4760. // Id: [Output Only] The unique identifier for the resource. This
  4761. // identifier is defined by the server.
  4762. Id uint64 `json:"id,omitempty,string"`
  4763. // Kind: [Output Only] Type of the resource. Always compute#commitment
  4764. // for commitments.
  4765. Kind string `json:"kind,omitempty"`
  4766. // Name: Name of the resource. Provided by the client when the resource
  4767. // is created. The name must be 1-63 characters long, and comply with
  4768. // RFC1035. Specifically, the name must be 1-63 characters long and
  4769. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4770. // the first character must be a lowercase letter, and all following
  4771. // characters must be a dash, lowercase letter, or digit, except the
  4772. // last character, which cannot be a dash.
  4773. Name string `json:"name,omitempty"`
  4774. // Plan: The plan for this commitment, which determines duration and
  4775. // discount rate. The currently supported plans are TWELVE_MONTH (1
  4776. // year), and THIRTY_SIX_MONTH (3 years).
  4777. //
  4778. // Possible values:
  4779. // "INVALID"
  4780. // "THIRTY_SIX_MONTH"
  4781. // "TWELVE_MONTH"
  4782. Plan string `json:"plan,omitempty"`
  4783. // Region: [Output Only] URL of the region where this commitment may be
  4784. // used.
  4785. Region string `json:"region,omitempty"`
  4786. // Resources: A list of commitment amounts for particular resources.
  4787. // Note that VCPU and MEMORY resource commitments must occur together.
  4788. Resources []*ResourceCommitment `json:"resources,omitempty"`
  4789. // SelfLink: [Output Only] Server-defined URL for the resource.
  4790. SelfLink string `json:"selfLink,omitempty"`
  4791. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  4792. // format.
  4793. StartTimestamp string `json:"startTimestamp,omitempty"`
  4794. // Status: [Output Only] Status of the commitment with regards to
  4795. // eventual expiration (each commitment has an end date defined). One of
  4796. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  4797. //
  4798. // Possible values:
  4799. // "ACTIVE"
  4800. // "CREATING"
  4801. // "EXPIRED"
  4802. // "NOT_YET_ACTIVE"
  4803. Status string `json:"status,omitempty"`
  4804. // StatusMessage: [Output Only] An optional, human-readable explanation
  4805. // of the status.
  4806. StatusMessage string `json:"statusMessage,omitempty"`
  4807. // ServerResponse contains the HTTP response code and headers from the
  4808. // server.
  4809. googleapi.ServerResponse `json:"-"`
  4810. // ForceSendFields is a list of field names (e.g. "Allocations") to
  4811. // unconditionally include in API requests. By default, fields with
  4812. // empty values are omitted from API requests. However, any non-pointer,
  4813. // non-interface field appearing in ForceSendFields will be sent to the
  4814. // server regardless of whether the field is empty or not. This may be
  4815. // used to include empty fields in Patch requests.
  4816. ForceSendFields []string `json:"-"`
  4817. // NullFields is a list of field names (e.g. "Allocations") to include
  4818. // in API requests with the JSON null value. By default, fields with
  4819. // empty values are omitted from API requests. However, any field with
  4820. // an empty value appearing in NullFields will be sent to the server as
  4821. // null. It is an error if a field in this list has a non-empty value.
  4822. // This may be used to include null fields in Patch requests.
  4823. NullFields []string `json:"-"`
  4824. }
  4825. func (s *Commitment) MarshalJSON() ([]byte, error) {
  4826. type NoMethod Commitment
  4827. raw := NoMethod(*s)
  4828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4829. }
  4830. type CommitmentAggregatedList struct {
  4831. // Id: [Output Only] Unique identifier for the resource; defined by the
  4832. // server.
  4833. Id string `json:"id,omitempty"`
  4834. // Items: A list of CommitmentsScopedList resources.
  4835. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  4836. // Kind: [Output Only] Type of resource. Always
  4837. // compute#commitmentAggregatedList for aggregated lists of commitments.
  4838. Kind string `json:"kind,omitempty"`
  4839. // NextPageToken: [Output Only] This token allows you to get the next
  4840. // page of results for list requests. If the number of results is larger
  4841. // than maxResults, use the nextPageToken as a value for the query
  4842. // parameter pageToken in the next list request. Subsequent list
  4843. // requests will have their own nextPageToken to continue paging through
  4844. // the results.
  4845. NextPageToken string `json:"nextPageToken,omitempty"`
  4846. // SelfLink: [Output Only] Server-defined URL for this resource.
  4847. SelfLink string `json:"selfLink,omitempty"`
  4848. // Warning: [Output Only] Informational warning message.
  4849. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  4850. // ServerResponse contains the HTTP response code and headers from the
  4851. // server.
  4852. googleapi.ServerResponse `json:"-"`
  4853. // ForceSendFields is a list of field names (e.g. "Id") to
  4854. // unconditionally include in API requests. By default, fields with
  4855. // empty values are omitted from API requests. However, any non-pointer,
  4856. // non-interface field appearing in ForceSendFields will be sent to the
  4857. // server regardless of whether the field is empty or not. This may be
  4858. // used to include empty fields in Patch requests.
  4859. ForceSendFields []string `json:"-"`
  4860. // NullFields is a list of field names (e.g. "Id") to include in API
  4861. // requests with the JSON null value. By default, fields with empty
  4862. // values are omitted from API requests. However, any field with an
  4863. // empty value appearing in NullFields will be sent to the server as
  4864. // null. It is an error if a field in this list has a non-empty value.
  4865. // This may be used to include null fields in Patch requests.
  4866. NullFields []string `json:"-"`
  4867. }
  4868. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  4869. type NoMethod CommitmentAggregatedList
  4870. raw := NoMethod(*s)
  4871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4872. }
  4873. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  4874. // message.
  4875. type CommitmentAggregatedListWarning struct {
  4876. // Code: [Output Only] A warning code, if applicable. For example,
  4877. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4878. // the response.
  4879. //
  4880. // Possible values:
  4881. // "CLEANUP_FAILED"
  4882. // "DEPRECATED_RESOURCE_USED"
  4883. // "DEPRECATED_TYPE_USED"
  4884. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4885. // "EXPERIMENTAL_TYPE_USED"
  4886. // "EXTERNAL_API_WARNING"
  4887. // "FIELD_VALUE_OVERRIDEN"
  4888. // "INJECTED_KERNELS_DEPRECATED"
  4889. // "MISSING_TYPE_DEPENDENCY"
  4890. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4891. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4892. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4893. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4894. // "NEXT_HOP_NOT_RUNNING"
  4895. // "NOT_CRITICAL_ERROR"
  4896. // "NO_RESULTS_ON_PAGE"
  4897. // "REQUIRED_TOS_AGREEMENT"
  4898. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4899. // "RESOURCE_NOT_DELETED"
  4900. // "SCHEMA_VALIDATION_IGNORED"
  4901. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4902. // "UNDECLARED_PROPERTIES"
  4903. // "UNREACHABLE"
  4904. Code string `json:"code,omitempty"`
  4905. // Data: [Output Only] Metadata about this warning in key: value format.
  4906. // For example:
  4907. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4908. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  4909. // Message: [Output Only] A human-readable description of the warning
  4910. // code.
  4911. Message string `json:"message,omitempty"`
  4912. // ForceSendFields is a list of field names (e.g. "Code") to
  4913. // unconditionally include in API requests. By default, fields with
  4914. // empty values are omitted from API requests. However, any non-pointer,
  4915. // non-interface field appearing in ForceSendFields will be sent to the
  4916. // server regardless of whether the field is empty or not. This may be
  4917. // used to include empty fields in Patch requests.
  4918. ForceSendFields []string `json:"-"`
  4919. // NullFields is a list of field names (e.g. "Code") to include in API
  4920. // requests with the JSON null value. By default, fields with empty
  4921. // values are omitted from API requests. However, any field with an
  4922. // empty value appearing in NullFields will be sent to the server as
  4923. // null. It is an error if a field in this list has a non-empty value.
  4924. // This may be used to include null fields in Patch requests.
  4925. NullFields []string `json:"-"`
  4926. }
  4927. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4928. type NoMethod CommitmentAggregatedListWarning
  4929. raw := NoMethod(*s)
  4930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4931. }
  4932. type CommitmentAggregatedListWarningData struct {
  4933. // Key: [Output Only] A key that provides more detail on the warning
  4934. // being returned. For example, for warnings where there are no results
  4935. // in a list request for a particular zone, this key might be scope and
  4936. // the key value might be the zone name. Other examples might be a key
  4937. // indicating a deprecated resource and a suggested replacement, or a
  4938. // warning about invalid network settings (for example, if an instance
  4939. // attempts to perform IP forwarding but is not enabled for IP
  4940. // forwarding).
  4941. Key string `json:"key,omitempty"`
  4942. // Value: [Output Only] A warning data value corresponding to the key.
  4943. Value string `json:"value,omitempty"`
  4944. // ForceSendFields is a list of field names (e.g. "Key") to
  4945. // unconditionally include in API requests. By default, fields with
  4946. // empty values are omitted from API requests. However, any non-pointer,
  4947. // non-interface field appearing in ForceSendFields will be sent to the
  4948. // server regardless of whether the field is empty or not. This may be
  4949. // used to include empty fields in Patch requests.
  4950. ForceSendFields []string `json:"-"`
  4951. // NullFields is a list of field names (e.g. "Key") to include in API
  4952. // requests with the JSON null value. By default, fields with empty
  4953. // values are omitted from API requests. However, any field with an
  4954. // empty value appearing in NullFields will be sent to the server as
  4955. // null. It is an error if a field in this list has a non-empty value.
  4956. // This may be used to include null fields in Patch requests.
  4957. NullFields []string `json:"-"`
  4958. }
  4959. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4960. type NoMethod CommitmentAggregatedListWarningData
  4961. raw := NoMethod(*s)
  4962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4963. }
  4964. // CommitmentList: Contains a list of Commitment resources.
  4965. type CommitmentList struct {
  4966. // Id: [Output Only] Unique identifier for the resource; defined by the
  4967. // server.
  4968. Id string `json:"id,omitempty"`
  4969. // Items: A list of Commitment resources.
  4970. Items []*Commitment `json:"items,omitempty"`
  4971. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  4972. // for lists of commitments.
  4973. Kind string `json:"kind,omitempty"`
  4974. // NextPageToken: [Output Only] This token allows you to get the next
  4975. // page of results for list requests. If the number of results is larger
  4976. // than maxResults, use the nextPageToken as a value for the query
  4977. // parameter pageToken in the next list request. Subsequent list
  4978. // requests will have their own nextPageToken to continue paging through
  4979. // the results.
  4980. NextPageToken string `json:"nextPageToken,omitempty"`
  4981. // SelfLink: [Output Only] Server-defined URL for this resource.
  4982. SelfLink string `json:"selfLink,omitempty"`
  4983. // Warning: [Output Only] Informational warning message.
  4984. Warning *CommitmentListWarning `json:"warning,omitempty"`
  4985. // ServerResponse contains the HTTP response code and headers from the
  4986. // server.
  4987. googleapi.ServerResponse `json:"-"`
  4988. // ForceSendFields is a list of field names (e.g. "Id") to
  4989. // unconditionally include in API requests. By default, fields with
  4990. // empty values are omitted from API requests. However, any non-pointer,
  4991. // non-interface field appearing in ForceSendFields will be sent to the
  4992. // server regardless of whether the field is empty or not. This may be
  4993. // used to include empty fields in Patch requests.
  4994. ForceSendFields []string `json:"-"`
  4995. // NullFields is a list of field names (e.g. "Id") to include in API
  4996. // requests with the JSON null value. By default, fields with empty
  4997. // values are omitted from API requests. However, any field with an
  4998. // empty value appearing in NullFields will be sent to the server as
  4999. // null. It is an error if a field in this list has a non-empty value.
  5000. // This may be used to include null fields in Patch requests.
  5001. NullFields []string `json:"-"`
  5002. }
  5003. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  5004. type NoMethod CommitmentList
  5005. raw := NoMethod(*s)
  5006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5007. }
  5008. // CommitmentListWarning: [Output Only] Informational warning message.
  5009. type CommitmentListWarning struct {
  5010. // Code: [Output Only] A warning code, if applicable. For example,
  5011. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5012. // the response.
  5013. //
  5014. // Possible values:
  5015. // "CLEANUP_FAILED"
  5016. // "DEPRECATED_RESOURCE_USED"
  5017. // "DEPRECATED_TYPE_USED"
  5018. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5019. // "EXPERIMENTAL_TYPE_USED"
  5020. // "EXTERNAL_API_WARNING"
  5021. // "FIELD_VALUE_OVERRIDEN"
  5022. // "INJECTED_KERNELS_DEPRECATED"
  5023. // "MISSING_TYPE_DEPENDENCY"
  5024. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5025. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5026. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5027. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5028. // "NEXT_HOP_NOT_RUNNING"
  5029. // "NOT_CRITICAL_ERROR"
  5030. // "NO_RESULTS_ON_PAGE"
  5031. // "REQUIRED_TOS_AGREEMENT"
  5032. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5033. // "RESOURCE_NOT_DELETED"
  5034. // "SCHEMA_VALIDATION_IGNORED"
  5035. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5036. // "UNDECLARED_PROPERTIES"
  5037. // "UNREACHABLE"
  5038. Code string `json:"code,omitempty"`
  5039. // Data: [Output Only] Metadata about this warning in key: value format.
  5040. // For example:
  5041. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5042. Data []*CommitmentListWarningData `json:"data,omitempty"`
  5043. // Message: [Output Only] A human-readable description of the warning
  5044. // code.
  5045. Message string `json:"message,omitempty"`
  5046. // ForceSendFields is a list of field names (e.g. "Code") to
  5047. // unconditionally include in API requests. By default, fields with
  5048. // empty values are omitted from API requests. However, any non-pointer,
  5049. // non-interface field appearing in ForceSendFields will be sent to the
  5050. // server regardless of whether the field is empty or not. This may be
  5051. // used to include empty fields in Patch requests.
  5052. ForceSendFields []string `json:"-"`
  5053. // NullFields is a list of field names (e.g. "Code") to include in API
  5054. // requests with the JSON null value. By default, fields with empty
  5055. // values are omitted from API requests. However, any field with an
  5056. // empty value appearing in NullFields will be sent to the server as
  5057. // null. It is an error if a field in this list has a non-empty value.
  5058. // This may be used to include null fields in Patch requests.
  5059. NullFields []string `json:"-"`
  5060. }
  5061. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  5062. type NoMethod CommitmentListWarning
  5063. raw := NoMethod(*s)
  5064. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5065. }
  5066. type CommitmentListWarningData struct {
  5067. // Key: [Output Only] A key that provides more detail on the warning
  5068. // being returned. For example, for warnings where there are no results
  5069. // in a list request for a particular zone, this key might be scope and
  5070. // the key value might be the zone name. Other examples might be a key
  5071. // indicating a deprecated resource and a suggested replacement, or a
  5072. // warning about invalid network settings (for example, if an instance
  5073. // attempts to perform IP forwarding but is not enabled for IP
  5074. // forwarding).
  5075. Key string `json:"key,omitempty"`
  5076. // Value: [Output Only] A warning data value corresponding to the key.
  5077. Value string `json:"value,omitempty"`
  5078. // ForceSendFields is a list of field names (e.g. "Key") to
  5079. // unconditionally include in API requests. By default, fields with
  5080. // empty values are omitted from API requests. However, any non-pointer,
  5081. // non-interface field appearing in ForceSendFields will be sent to the
  5082. // server regardless of whether the field is empty or not. This may be
  5083. // used to include empty fields in Patch requests.
  5084. ForceSendFields []string `json:"-"`
  5085. // NullFields is a list of field names (e.g. "Key") to include in API
  5086. // requests with the JSON null value. By default, fields with empty
  5087. // values are omitted from API requests. However, any field with an
  5088. // empty value appearing in NullFields will be sent to the server as
  5089. // null. It is an error if a field in this list has a non-empty value.
  5090. // This may be used to include null fields in Patch requests.
  5091. NullFields []string `json:"-"`
  5092. }
  5093. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  5094. type NoMethod CommitmentListWarningData
  5095. raw := NoMethod(*s)
  5096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5097. }
  5098. type CommitmentsScopedList struct {
  5099. // Commitments: [Output Only] A list of commitments contained in this
  5100. // scope.
  5101. Commitments []*Commitment `json:"commitments,omitempty"`
  5102. // Warning: [Output Only] Informational warning which replaces the list
  5103. // of commitments when the list is empty.
  5104. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  5105. // ForceSendFields is a list of field names (e.g. "Commitments") to
  5106. // unconditionally include in API requests. By default, fields with
  5107. // empty values are omitted from API requests. However, any non-pointer,
  5108. // non-interface field appearing in ForceSendFields will be sent to the
  5109. // server regardless of whether the field is empty or not. This may be
  5110. // used to include empty fields in Patch requests.
  5111. ForceSendFields []string `json:"-"`
  5112. // NullFields is a list of field names (e.g. "Commitments") to include
  5113. // in API requests with the JSON null value. By default, fields with
  5114. // empty values are omitted from API requests. However, any field with
  5115. // an empty value appearing in NullFields will be sent to the server as
  5116. // null. It is an error if a field in this list has a non-empty value.
  5117. // This may be used to include null fields in Patch requests.
  5118. NullFields []string `json:"-"`
  5119. }
  5120. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  5121. type NoMethod CommitmentsScopedList
  5122. raw := NoMethod(*s)
  5123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5124. }
  5125. // CommitmentsScopedListWarning: [Output Only] Informational warning
  5126. // which replaces the list of commitments when the list is empty.
  5127. type CommitmentsScopedListWarning struct {
  5128. // Code: [Output Only] A warning code, if applicable. For example,
  5129. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5130. // the response.
  5131. //
  5132. // Possible values:
  5133. // "CLEANUP_FAILED"
  5134. // "DEPRECATED_RESOURCE_USED"
  5135. // "DEPRECATED_TYPE_USED"
  5136. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5137. // "EXPERIMENTAL_TYPE_USED"
  5138. // "EXTERNAL_API_WARNING"
  5139. // "FIELD_VALUE_OVERRIDEN"
  5140. // "INJECTED_KERNELS_DEPRECATED"
  5141. // "MISSING_TYPE_DEPENDENCY"
  5142. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5143. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5144. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5145. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5146. // "NEXT_HOP_NOT_RUNNING"
  5147. // "NOT_CRITICAL_ERROR"
  5148. // "NO_RESULTS_ON_PAGE"
  5149. // "REQUIRED_TOS_AGREEMENT"
  5150. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5151. // "RESOURCE_NOT_DELETED"
  5152. // "SCHEMA_VALIDATION_IGNORED"
  5153. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5154. // "UNDECLARED_PROPERTIES"
  5155. // "UNREACHABLE"
  5156. Code string `json:"code,omitempty"`
  5157. // Data: [Output Only] Metadata about this warning in key: value format.
  5158. // For example:
  5159. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5160. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  5161. // Message: [Output Only] A human-readable description of the warning
  5162. // code.
  5163. Message string `json:"message,omitempty"`
  5164. // ForceSendFields is a list of field names (e.g. "Code") to
  5165. // unconditionally include in API requests. By default, fields with
  5166. // empty values are omitted from API requests. However, any non-pointer,
  5167. // non-interface field appearing in ForceSendFields will be sent to the
  5168. // server regardless of whether the field is empty or not. This may be
  5169. // used to include empty fields in Patch requests.
  5170. ForceSendFields []string `json:"-"`
  5171. // NullFields is a list of field names (e.g. "Code") to include in API
  5172. // requests with the JSON null value. By default, fields with empty
  5173. // values are omitted from API requests. However, any field with an
  5174. // empty value appearing in NullFields will be sent to the server as
  5175. // null. It is an error if a field in this list has a non-empty value.
  5176. // This may be used to include null fields in Patch requests.
  5177. NullFields []string `json:"-"`
  5178. }
  5179. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  5180. type NoMethod CommitmentsScopedListWarning
  5181. raw := NoMethod(*s)
  5182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5183. }
  5184. type CommitmentsScopedListWarningData struct {
  5185. // Key: [Output Only] A key that provides more detail on the warning
  5186. // being returned. For example, for warnings where there are no results
  5187. // in a list request for a particular zone, this key might be scope and
  5188. // the key value might be the zone name. Other examples might be a key
  5189. // indicating a deprecated resource and a suggested replacement, or a
  5190. // warning about invalid network settings (for example, if an instance
  5191. // attempts to perform IP forwarding but is not enabled for IP
  5192. // forwarding).
  5193. Key string `json:"key,omitempty"`
  5194. // Value: [Output Only] A warning data value corresponding to the key.
  5195. Value string `json:"value,omitempty"`
  5196. // ForceSendFields is a list of field names (e.g. "Key") to
  5197. // unconditionally include in API requests. By default, fields with
  5198. // empty values are omitted from API requests. However, any non-pointer,
  5199. // non-interface field appearing in ForceSendFields will be sent to the
  5200. // server regardless of whether the field is empty or not. This may be
  5201. // used to include empty fields in Patch requests.
  5202. ForceSendFields []string `json:"-"`
  5203. // NullFields is a list of field names (e.g. "Key") to include in API
  5204. // requests with the JSON null value. By default, fields with empty
  5205. // values are omitted from API requests. However, any field with an
  5206. // empty value appearing in NullFields will be sent to the server as
  5207. // null. It is an error if a field in this list has a non-empty value.
  5208. // This may be used to include null fields in Patch requests.
  5209. NullFields []string `json:"-"`
  5210. }
  5211. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  5212. type NoMethod CommitmentsScopedListWarningData
  5213. raw := NoMethod(*s)
  5214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5215. }
  5216. // Condition: A condition to be met.
  5217. type Condition struct {
  5218. // Iam: Trusted attributes supplied by the IAM system.
  5219. //
  5220. // Possible values:
  5221. // "APPROVER"
  5222. // "ATTRIBUTION"
  5223. // "AUTHORITY"
  5224. // "CREDENTIALS_TYPE"
  5225. // "JUSTIFICATION_TYPE"
  5226. // "NO_ATTR"
  5227. // "SECURITY_REALM"
  5228. Iam string `json:"iam,omitempty"`
  5229. // Op: An operator to apply the subject with.
  5230. //
  5231. // Possible values:
  5232. // "DISCHARGED"
  5233. // "EQUALS"
  5234. // "IN"
  5235. // "NOT_EQUALS"
  5236. // "NOT_IN"
  5237. // "NO_OP"
  5238. Op string `json:"op,omitempty"`
  5239. // Svc: Trusted attributes discharged by the service.
  5240. Svc string `json:"svc,omitempty"`
  5241. // Sys: Trusted attributes supplied by any service that owns resources
  5242. // and uses the IAM system for access control.
  5243. //
  5244. // Possible values:
  5245. // "IP"
  5246. // "NAME"
  5247. // "NO_ATTR"
  5248. // "REGION"
  5249. // "SERVICE"
  5250. Sys string `json:"sys,omitempty"`
  5251. // Values: The objects of the condition.
  5252. Values []string `json:"values,omitempty"`
  5253. // ForceSendFields is a list of field names (e.g. "Iam") to
  5254. // unconditionally include in API requests. By default, fields with
  5255. // empty values are omitted from API requests. However, any non-pointer,
  5256. // non-interface field appearing in ForceSendFields will be sent to the
  5257. // server regardless of whether the field is empty or not. This may be
  5258. // used to include empty fields in Patch requests.
  5259. ForceSendFields []string `json:"-"`
  5260. // NullFields is a list of field names (e.g. "Iam") to include in API
  5261. // requests with the JSON null value. By default, fields with empty
  5262. // values are omitted from API requests. However, any field with an
  5263. // empty value appearing in NullFields will be sent to the server as
  5264. // null. It is an error if a field in this list has a non-empty value.
  5265. // This may be used to include null fields in Patch requests.
  5266. NullFields []string `json:"-"`
  5267. }
  5268. func (s *Condition) MarshalJSON() ([]byte, error) {
  5269. type NoMethod Condition
  5270. raw := NoMethod(*s)
  5271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5272. }
  5273. // ConnectionDraining: Message containing connection draining
  5274. // configuration.
  5275. type ConnectionDraining struct {
  5276. // DrainingTimeoutSec: Time for which instance will be drained (not
  5277. // accept new connections, but still work to finish started).
  5278. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  5279. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  5280. // to unconditionally include in API requests. By default, fields with
  5281. // empty values are omitted from API requests. However, any non-pointer,
  5282. // non-interface field appearing in ForceSendFields will be sent to the
  5283. // server regardless of whether the field is empty or not. This may be
  5284. // used to include empty fields in Patch requests.
  5285. ForceSendFields []string `json:"-"`
  5286. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  5287. // include in API requests with the JSON null value. By default, fields
  5288. // with empty values are omitted from API requests. However, any field
  5289. // with an empty value appearing in NullFields will be sent to the
  5290. // server as null. It is an error if a field in this list has a
  5291. // non-empty value. This may be used to include null fields in Patch
  5292. // requests.
  5293. NullFields []string `json:"-"`
  5294. }
  5295. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  5296. type NoMethod ConnectionDraining
  5297. raw := NoMethod(*s)
  5298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5299. }
  5300. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  5301. type CustomerEncryptionKey struct {
  5302. // KmsKeyName: The name of the encryption key that is stored in Google
  5303. // Cloud KMS.
  5304. KmsKeyName string `json:"kmsKeyName,omitempty"`
  5305. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  5306. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  5307. RawKey string `json:"rawKey,omitempty"`
  5308. // RsaEncryptedKey: Specifies an RFC 4648 base64 encoded, RSA-wrapped
  5309. // 2048-bit customer-supplied encryption key to either encrypt or
  5310. // decrypt this resource.
  5311. //
  5312. // The key must meet the following requirements before you can provide
  5313. // it to Compute Engine:
  5314. // - The key is wrapped using a RSA public key certificate provided by
  5315. // Google.
  5316. // - After being wrapped, the key must be encoded in RFC 4648 base64
  5317. // encoding. Gets the RSA public key certificate provided by Google
  5318. // at:
  5319. // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingre
  5320. // ss.pem
  5321. RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"`
  5322. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  5323. // customer-supplied encryption key that protects this resource.
  5324. Sha256 string `json:"sha256,omitempty"`
  5325. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  5326. // unconditionally include in API requests. By default, fields with
  5327. // empty values are omitted from API requests. However, any non-pointer,
  5328. // non-interface field appearing in ForceSendFields will be sent to the
  5329. // server regardless of whether the field is empty or not. This may be
  5330. // used to include empty fields in Patch requests.
  5331. ForceSendFields []string `json:"-"`
  5332. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  5333. // API requests with the JSON null value. By default, fields with empty
  5334. // values are omitted from API requests. However, any field with an
  5335. // empty value appearing in NullFields will be sent to the server as
  5336. // null. It is an error if a field in this list has a non-empty value.
  5337. // This may be used to include null fields in Patch requests.
  5338. NullFields []string `json:"-"`
  5339. }
  5340. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  5341. type NoMethod CustomerEncryptionKey
  5342. raw := NoMethod(*s)
  5343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5344. }
  5345. type CustomerEncryptionKeyProtectedDisk struct {
  5346. // DiskEncryptionKey: Decrypts data associated with the disk with a
  5347. // customer-supplied encryption key.
  5348. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  5349. // Source: Specifies a valid partial or full URL to an existing
  5350. // Persistent Disk resource. This field is only applicable for
  5351. // persistent disks.
  5352. Source string `json:"source,omitempty"`
  5353. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  5354. // to unconditionally include in API requests. By default, fields with
  5355. // empty values are omitted from API requests. However, any non-pointer,
  5356. // non-interface field appearing in ForceSendFields will be sent to the
  5357. // server regardless of whether the field is empty or not. This may be
  5358. // used to include empty fields in Patch requests.
  5359. ForceSendFields []string `json:"-"`
  5360. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  5361. // include in API requests with the JSON null value. By default, fields
  5362. // with empty values are omitted from API requests. However, any field
  5363. // with an empty value appearing in NullFields will be sent to the
  5364. // server as null. It is an error if a field in this list has a
  5365. // non-empty value. This may be used to include null fields in Patch
  5366. // requests.
  5367. NullFields []string `json:"-"`
  5368. }
  5369. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  5370. type NoMethod CustomerEncryptionKeyProtectedDisk
  5371. raw := NoMethod(*s)
  5372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5373. }
  5374. // DeprecationStatus: Deprecation status for a public resource.
  5375. type DeprecationStatus struct {
  5376. // Deleted: An optional RFC3339 timestamp on or after which the state of
  5377. // this resource is intended to change to DELETED. This is only
  5378. // informational and the status will not change unless the client
  5379. // explicitly changes it.
  5380. Deleted string `json:"deleted,omitempty"`
  5381. // Deprecated: An optional RFC3339 timestamp on or after which the state
  5382. // of this resource is intended to change to DEPRECATED. This is only
  5383. // informational and the status will not change unless the client
  5384. // explicitly changes it.
  5385. Deprecated string `json:"deprecated,omitempty"`
  5386. // Obsolete: An optional RFC3339 timestamp on or after which the state
  5387. // of this resource is intended to change to OBSOLETE. This is only
  5388. // informational and the status will not change unless the client
  5389. // explicitly changes it.
  5390. Obsolete string `json:"obsolete,omitempty"`
  5391. // Replacement: The URL of the suggested replacement for a deprecated
  5392. // resource. The suggested replacement resource must be the same kind of
  5393. // resource as the deprecated resource.
  5394. Replacement string `json:"replacement,omitempty"`
  5395. // State: The deprecation state of this resource. This can be ACTIVE
  5396. // DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the
  5397. // end of life date for an image, can use ACTIVE. Operations which
  5398. // create a new resource using a DEPRECATED resource will return
  5399. // successfully, but with a warning indicating the deprecated resource
  5400. // and recommending its replacement. Operations which use OBSOLETE or
  5401. // DELETED resources will be rejected and result in an error.
  5402. //
  5403. // Possible values:
  5404. // "ACTIVE"
  5405. // "DELETED"
  5406. // "DEPRECATED"
  5407. // "OBSOLETE"
  5408. State string `json:"state,omitempty"`
  5409. // ForceSendFields is a list of field names (e.g. "Deleted") to
  5410. // unconditionally include in API requests. By default, fields with
  5411. // empty values are omitted from API requests. However, any non-pointer,
  5412. // non-interface field appearing in ForceSendFields will be sent to the
  5413. // server regardless of whether the field is empty or not. This may be
  5414. // used to include empty fields in Patch requests.
  5415. ForceSendFields []string `json:"-"`
  5416. // NullFields is a list of field names (e.g. "Deleted") to include in
  5417. // API requests with the JSON null value. By default, fields with empty
  5418. // values are omitted from API requests. However, any field with an
  5419. // empty value appearing in NullFields will be sent to the server as
  5420. // null. It is an error if a field in this list has a non-empty value.
  5421. // This may be used to include null fields in Patch requests.
  5422. NullFields []string `json:"-"`
  5423. }
  5424. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  5425. type NoMethod DeprecationStatus
  5426. raw := NoMethod(*s)
  5427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5428. }
  5429. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  5430. // resource_for v1.disks ==)
  5431. type Disk struct {
  5432. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5433. // format.
  5434. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5435. // Description: An optional description of this resource. Provide this
  5436. // property when you create the resource.
  5437. Description string `json:"description,omitempty"`
  5438. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  5439. // encryption key.
  5440. //
  5441. // After you encrypt a disk with a customer-supplied key, you must
  5442. // provide the same key if you use the disk later (e.g. to create a disk
  5443. // snapshot or an image, or to attach the disk to a virtual
  5444. // machine).
  5445. //
  5446. // Customer-supplied encryption keys do not protect access to metadata
  5447. // of the disk.
  5448. //
  5449. // If you do not provide an encryption key when creating the disk, then
  5450. // the disk will be encrypted using an automatically generated key and
  5451. // you do not need to provide a key to use the disk later.
  5452. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  5453. // GuestOsFeatures: A list of features to enable on the guest operating
  5454. // system. Applicable only for bootable images. Read Enabling guest
  5455. // operating system features to see a list of available options.
  5456. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  5457. // Id: [Output Only] The unique identifier for the resource. This
  5458. // identifier is defined by the server.
  5459. Id uint64 `json:"id,omitempty,string"`
  5460. // Kind: [Output Only] Type of the resource. Always compute#disk for
  5461. // disks.
  5462. Kind string `json:"kind,omitempty"`
  5463. // LabelFingerprint: A fingerprint for the labels being applied to this
  5464. // disk, which is essentially a hash of the labels set used for
  5465. // optimistic locking. The fingerprint is initially generated by Compute
  5466. // Engine and changes after every request to modify or update labels.
  5467. // You must always provide an up-to-date fingerprint hash in order to
  5468. // update or change labels, otherwise the request will fail with error
  5469. // 412 conditionNotMet.
  5470. //
  5471. // To see the latest fingerprint, make a get() request to retrieve a
  5472. // disk.
  5473. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  5474. // Labels: Labels to apply to this disk. These can be later modified by
  5475. // the setLabels method.
  5476. Labels map[string]string `json:"labels,omitempty"`
  5477. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  5478. // text format.
  5479. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  5480. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  5481. // text format.
  5482. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  5483. // LicenseCodes: Integer license codes indicating which licenses are
  5484. // attached to this disk.
  5485. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  5486. // Licenses: A list of publicly visible licenses. Reserved for Google's
  5487. // use.
  5488. Licenses []string `json:"licenses,omitempty"`
  5489. // Name: Name of the resource. Provided by the client when the resource
  5490. // is created. The name must be 1-63 characters long, and comply with
  5491. // RFC1035. Specifically, the name must be 1-63 characters long and
  5492. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5493. // the first character must be a lowercase letter, and all following
  5494. // characters must be a dash, lowercase letter, or digit, except the
  5495. // last character, which cannot be a dash.
  5496. Name string `json:"name,omitempty"`
  5497. // Options: Internal use only.
  5498. Options string `json:"options,omitempty"`
  5499. // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
  5500. // in bytes. If not present in a request, a default value is used.
  5501. // Currently supported sizes are 4096 and 16384, other sizes may be
  5502. // added in the future. If an unsupported value is requested, the error
  5503. // message will list the supported values for the caller's project.
  5504. PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
  5505. // Region: [Output Only] URL of the region where the disk resides. Only
  5506. // applicable for regional resources. You must specify this field as
  5507. // part of the HTTP request URL. It is not settable as a field in the
  5508. // request body.
  5509. Region string `json:"region,omitempty"`
  5510. // ReplicaZones: URLs of the zones where the disk should be replicated
  5511. // to. Only applicable for regional resources.
  5512. ReplicaZones []string `json:"replicaZones,omitempty"`
  5513. // ResourcePolicies: Resource policies applied to this disk for
  5514. // automatic snapshot creations.
  5515. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  5516. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  5517. // resource.
  5518. SelfLink string `json:"selfLink,omitempty"`
  5519. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  5520. // this field when creating a persistent disk using the sourceImage or
  5521. // sourceSnapshot parameter, or specify it alone to create an empty
  5522. // persistent disk.
  5523. //
  5524. // If you specify this field along with sourceImage or sourceSnapshot,
  5525. // the value of sizeGb must not be less than the size of the sourceImage
  5526. // or the size of the snapshot. Acceptable values are 1 to 65536,
  5527. // inclusive.
  5528. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5529. // SourceImage: The source image used to create this disk. If the source
  5530. // image is deleted, this field will not be set.
  5531. //
  5532. // To create a disk with one of the public operating system images,
  5533. // specify the image by its family name. For example, specify
  5534. // family/debian-9 to use the latest Debian 9
  5535. // image:
  5536. // projects/debian-cloud/global/images/family/debian-9
  5537. //
  5538. //
  5539. // Alternati
  5540. // vely, use a specific version of a public operating system
  5541. // image:
  5542. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  5543. //
  5544. //
  5545. //
  5546. // To create a disk with a custom image that you created, specify the
  5547. // image name in the following
  5548. // format:
  5549. // global/images/my-custom-image
  5550. //
  5551. //
  5552. // You can also specify a custom image by its image family, which
  5553. // returns the latest version of the image in that family. Replace the
  5554. // image name with
  5555. // family/family-name:
  5556. // global/images/family/my-image-family
  5557. SourceImage string `json:"sourceImage,omitempty"`
  5558. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  5559. // source image. Required if the source image is protected by a
  5560. // customer-supplied encryption key.
  5561. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  5562. // SourceImageId: [Output Only] The ID value of the image used to create
  5563. // this disk. This value identifies the exact image that was used to
  5564. // create this persistent disk. For example, if you created the
  5565. // persistent disk from an image that was later deleted and recreated
  5566. // under the same name, the source image ID would identify the exact
  5567. // version of the image that was used.
  5568. SourceImageId string `json:"sourceImageId,omitempty"`
  5569. // SourceSnapshot: The source snapshot used to create this disk. You can
  5570. // provide this as a partial or full URL to the resource. For example,
  5571. // the following are valid values:
  5572. // -
  5573. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  5574. // - projects/project/global/snapshots/snapshot
  5575. // - global/snapshots/snapshot
  5576. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  5577. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  5578. // the source snapshot. Required if the source snapshot is protected by
  5579. // a customer-supplied encryption key.
  5580. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  5581. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  5582. // create this disk. This value identifies the exact snapshot that was
  5583. // used to create this persistent disk. For example, if you created the
  5584. // persistent disk from a snapshot that was later deleted and recreated
  5585. // under the same name, the source snapshot ID would identify the exact
  5586. // version of the snapshot that was used.
  5587. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  5588. // Status: [Output Only] The status of disk creation.
  5589. //
  5590. // Possible values:
  5591. // "CREATING"
  5592. // "DELETING"
  5593. // "FAILED"
  5594. // "READY"
  5595. // "RESTORING"
  5596. Status string `json:"status,omitempty"`
  5597. // StorageType: [Deprecated] Storage type of the persistent disk.
  5598. //
  5599. // Possible values:
  5600. // "HDD"
  5601. // "SSD"
  5602. StorageType string `json:"storageType,omitempty"`
  5603. // Type: URL of the disk type resource describing which disk type to use
  5604. // to create the disk. Provide this when creating the disk. For example:
  5605. // project/zones/zone/diskTypes/pd-standard or pd-ssd
  5606. Type string `json:"type,omitempty"`
  5607. // Users: [Output Only] Links to the users of the disk (attached
  5608. // instances) in form: project/zones/zone/instances/instance
  5609. Users []string `json:"users,omitempty"`
  5610. // Zone: [Output Only] URL of the zone where the disk resides. You must
  5611. // specify this field as part of the HTTP request URL. It is not
  5612. // settable as a field in the request body.
  5613. Zone string `json:"zone,omitempty"`
  5614. // ServerResponse contains the HTTP response code and headers from the
  5615. // server.
  5616. googleapi.ServerResponse `json:"-"`
  5617. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5618. // to unconditionally include in API requests. By default, fields with
  5619. // empty values are omitted from API requests. However, any non-pointer,
  5620. // non-interface field appearing in ForceSendFields will be sent to the
  5621. // server regardless of whether the field is empty or not. This may be
  5622. // used to include empty fields in Patch requests.
  5623. ForceSendFields []string `json:"-"`
  5624. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5625. // include in API requests with the JSON null value. By default, fields
  5626. // with empty values are omitted from API requests. However, any field
  5627. // with an empty value appearing in NullFields will be sent to the
  5628. // server as null. It is an error if a field in this list has a
  5629. // non-empty value. This may be used to include null fields in Patch
  5630. // requests.
  5631. NullFields []string `json:"-"`
  5632. }
  5633. func (s *Disk) MarshalJSON() ([]byte, error) {
  5634. type NoMethod Disk
  5635. raw := NoMethod(*s)
  5636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5637. }
  5638. type DiskAggregatedList struct {
  5639. // Id: [Output Only] Unique identifier for the resource; defined by the
  5640. // server.
  5641. Id string `json:"id,omitempty"`
  5642. // Items: A list of DisksScopedList resources.
  5643. Items map[string]DisksScopedList `json:"items,omitempty"`
  5644. // Kind: [Output Only] Type of resource. Always
  5645. // compute#diskAggregatedList for aggregated lists of persistent disks.
  5646. Kind string `json:"kind,omitempty"`
  5647. // NextPageToken: [Output Only] This token allows you to get the next
  5648. // page of results for list requests. If the number of results is larger
  5649. // than maxResults, use the nextPageToken as a value for the query
  5650. // parameter pageToken in the next list request. Subsequent list
  5651. // requests will have their own nextPageToken to continue paging through
  5652. // the results.
  5653. NextPageToken string `json:"nextPageToken,omitempty"`
  5654. // SelfLink: [Output Only] Server-defined URL for this resource.
  5655. SelfLink string `json:"selfLink,omitempty"`
  5656. // Warning: [Output Only] Informational warning message.
  5657. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  5658. // ServerResponse contains the HTTP response code and headers from the
  5659. // server.
  5660. googleapi.ServerResponse `json:"-"`
  5661. // ForceSendFields is a list of field names (e.g. "Id") to
  5662. // unconditionally include in API requests. By default, fields with
  5663. // empty values are omitted from API requests. However, any non-pointer,
  5664. // non-interface field appearing in ForceSendFields will be sent to the
  5665. // server regardless of whether the field is empty or not. This may be
  5666. // used to include empty fields in Patch requests.
  5667. ForceSendFields []string `json:"-"`
  5668. // NullFields is a list of field names (e.g. "Id") to include in API
  5669. // requests with the JSON null value. By default, fields with empty
  5670. // values are omitted from API requests. However, any field with an
  5671. // empty value appearing in NullFields will be sent to the server as
  5672. // null. It is an error if a field in this list has a non-empty value.
  5673. // This may be used to include null fields in Patch requests.
  5674. NullFields []string `json:"-"`
  5675. }
  5676. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  5677. type NoMethod DiskAggregatedList
  5678. raw := NoMethod(*s)
  5679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5680. }
  5681. // DiskAggregatedListWarning: [Output Only] Informational warning
  5682. // message.
  5683. type DiskAggregatedListWarning struct {
  5684. // Code: [Output Only] A warning code, if applicable. For example,
  5685. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5686. // the response.
  5687. //
  5688. // Possible values:
  5689. // "CLEANUP_FAILED"
  5690. // "DEPRECATED_RESOURCE_USED"
  5691. // "DEPRECATED_TYPE_USED"
  5692. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5693. // "EXPERIMENTAL_TYPE_USED"
  5694. // "EXTERNAL_API_WARNING"
  5695. // "FIELD_VALUE_OVERRIDEN"
  5696. // "INJECTED_KERNELS_DEPRECATED"
  5697. // "MISSING_TYPE_DEPENDENCY"
  5698. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5699. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5700. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5701. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5702. // "NEXT_HOP_NOT_RUNNING"
  5703. // "NOT_CRITICAL_ERROR"
  5704. // "NO_RESULTS_ON_PAGE"
  5705. // "REQUIRED_TOS_AGREEMENT"
  5706. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5707. // "RESOURCE_NOT_DELETED"
  5708. // "SCHEMA_VALIDATION_IGNORED"
  5709. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5710. // "UNDECLARED_PROPERTIES"
  5711. // "UNREACHABLE"
  5712. Code string `json:"code,omitempty"`
  5713. // Data: [Output Only] Metadata about this warning in key: value format.
  5714. // For example:
  5715. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5716. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  5717. // Message: [Output Only] A human-readable description of the warning
  5718. // code.
  5719. Message string `json:"message,omitempty"`
  5720. // ForceSendFields is a list of field names (e.g. "Code") to
  5721. // unconditionally include in API requests. By default, fields with
  5722. // empty values are omitted from API requests. However, any non-pointer,
  5723. // non-interface field appearing in ForceSendFields will be sent to the
  5724. // server regardless of whether the field is empty or not. This may be
  5725. // used to include empty fields in Patch requests.
  5726. ForceSendFields []string `json:"-"`
  5727. // NullFields is a list of field names (e.g. "Code") to include in API
  5728. // requests with the JSON null value. By default, fields with empty
  5729. // values are omitted from API requests. However, any field with an
  5730. // empty value appearing in NullFields will be sent to the server as
  5731. // null. It is an error if a field in this list has a non-empty value.
  5732. // This may be used to include null fields in Patch requests.
  5733. NullFields []string `json:"-"`
  5734. }
  5735. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5736. type NoMethod DiskAggregatedListWarning
  5737. raw := NoMethod(*s)
  5738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5739. }
  5740. type DiskAggregatedListWarningData struct {
  5741. // Key: [Output Only] A key that provides more detail on the warning
  5742. // being returned. For example, for warnings where there are no results
  5743. // in a list request for a particular zone, this key might be scope and
  5744. // the key value might be the zone name. Other examples might be a key
  5745. // indicating a deprecated resource and a suggested replacement, or a
  5746. // warning about invalid network settings (for example, if an instance
  5747. // attempts to perform IP forwarding but is not enabled for IP
  5748. // forwarding).
  5749. Key string `json:"key,omitempty"`
  5750. // Value: [Output Only] A warning data value corresponding to the key.
  5751. Value string `json:"value,omitempty"`
  5752. // ForceSendFields is a list of field names (e.g. "Key") to
  5753. // unconditionally include in API requests. By default, fields with
  5754. // empty values are omitted from API requests. However, any non-pointer,
  5755. // non-interface field appearing in ForceSendFields will be sent to the
  5756. // server regardless of whether the field is empty or not. This may be
  5757. // used to include empty fields in Patch requests.
  5758. ForceSendFields []string `json:"-"`
  5759. // NullFields is a list of field names (e.g. "Key") to include in API
  5760. // requests with the JSON null value. By default, fields with empty
  5761. // values are omitted from API requests. However, any field with an
  5762. // empty value appearing in NullFields will be sent to the server as
  5763. // null. It is an error if a field in this list has a non-empty value.
  5764. // This may be used to include null fields in Patch requests.
  5765. NullFields []string `json:"-"`
  5766. }
  5767. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5768. type NoMethod DiskAggregatedListWarningData
  5769. raw := NoMethod(*s)
  5770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5771. }
  5772. // DiskInstantiationConfig: A specification of the desired way to
  5773. // instantiate a disk in the instance template when its created from a
  5774. // source instance.
  5775. type DiskInstantiationConfig struct {
  5776. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  5777. // instance is deleted (but not when the disk is detached from the
  5778. // instance).
  5779. AutoDelete bool `json:"autoDelete,omitempty"`
  5780. // CustomImage: The custom source image to be used to restore this disk
  5781. // when instantiating this instance template.
  5782. CustomImage string `json:"customImage,omitempty"`
  5783. // DeviceName: Specifies the device name of the disk to which the
  5784. // configurations apply to.
  5785. DeviceName string `json:"deviceName,omitempty"`
  5786. // InstantiateFrom: Specifies whether to include the disk and what image
  5787. // to use. Possible values are:
  5788. // - source-image: to use the same image that was used to create the
  5789. // source instance's corresponding disk. Applicable to the boot disk and
  5790. // additional read-write disks.
  5791. // - source-image-family: to use the same image family that was used to
  5792. // create the source instance's corresponding disk. Applicable to the
  5793. // boot disk and additional read-write disks.
  5794. // - custom-image: to use a user-provided image url for disk creation.
  5795. // Applicable to the boot disk and additional read-write disks.
  5796. // - attach-read-only: to attach a read-only disk. Applicable to
  5797. // read-only disks.
  5798. // - do-not-include: to exclude a disk from the template. Applicable to
  5799. // additional read-write disks, local SSDs, and read-only disks.
  5800. //
  5801. // Possible values:
  5802. // "ATTACH_READ_ONLY"
  5803. // "BLANK"
  5804. // "CUSTOM_IMAGE"
  5805. // "DEFAULT"
  5806. // "DO_NOT_INCLUDE"
  5807. // "SOURCE_IMAGE"
  5808. // "SOURCE_IMAGE_FAMILY"
  5809. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  5810. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  5811. // unconditionally include in API requests. By default, fields with
  5812. // empty values are omitted from API requests. However, any non-pointer,
  5813. // non-interface field appearing in ForceSendFields will be sent to the
  5814. // server regardless of whether the field is empty or not. This may be
  5815. // used to include empty fields in Patch requests.
  5816. ForceSendFields []string `json:"-"`
  5817. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  5818. // API requests with the JSON null value. By default, fields with empty
  5819. // values are omitted from API requests. However, any field with an
  5820. // empty value appearing in NullFields will be sent to the server as
  5821. // null. It is an error if a field in this list has a non-empty value.
  5822. // This may be used to include null fields in Patch requests.
  5823. NullFields []string `json:"-"`
  5824. }
  5825. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  5826. type NoMethod DiskInstantiationConfig
  5827. raw := NoMethod(*s)
  5828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5829. }
  5830. // DiskList: A list of Disk resources.
  5831. type DiskList struct {
  5832. // Id: [Output Only] Unique identifier for the resource; defined by the
  5833. // server.
  5834. Id string `json:"id,omitempty"`
  5835. // Items: A list of Disk resources.
  5836. Items []*Disk `json:"items,omitempty"`
  5837. // Kind: [Output Only] Type of resource. Always compute#diskList for
  5838. // lists of disks.
  5839. Kind string `json:"kind,omitempty"`
  5840. // NextPageToken: [Output Only] This token allows you to get the next
  5841. // page of results for list requests. If the number of results is larger
  5842. // than maxResults, use the nextPageToken as a value for the query
  5843. // parameter pageToken in the next list request. Subsequent list
  5844. // requests will have their own nextPageToken to continue paging through
  5845. // the results.
  5846. NextPageToken string `json:"nextPageToken,omitempty"`
  5847. // SelfLink: [Output Only] Server-defined URL for this resource.
  5848. SelfLink string `json:"selfLink,omitempty"`
  5849. // Warning: [Output Only] Informational warning message.
  5850. Warning *DiskListWarning `json:"warning,omitempty"`
  5851. // ServerResponse contains the HTTP response code and headers from the
  5852. // server.
  5853. googleapi.ServerResponse `json:"-"`
  5854. // ForceSendFields is a list of field names (e.g. "Id") to
  5855. // unconditionally include in API requests. By default, fields with
  5856. // empty values are omitted from API requests. However, any non-pointer,
  5857. // non-interface field appearing in ForceSendFields will be sent to the
  5858. // server regardless of whether the field is empty or not. This may be
  5859. // used to include empty fields in Patch requests.
  5860. ForceSendFields []string `json:"-"`
  5861. // NullFields is a list of field names (e.g. "Id") to include in API
  5862. // requests with the JSON null value. By default, fields with empty
  5863. // values are omitted from API requests. However, any field with an
  5864. // empty value appearing in NullFields will be sent to the server as
  5865. // null. It is an error if a field in this list has a non-empty value.
  5866. // This may be used to include null fields in Patch requests.
  5867. NullFields []string `json:"-"`
  5868. }
  5869. func (s *DiskList) MarshalJSON() ([]byte, error) {
  5870. type NoMethod DiskList
  5871. raw := NoMethod(*s)
  5872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5873. }
  5874. // DiskListWarning: [Output Only] Informational warning message.
  5875. type DiskListWarning struct {
  5876. // Code: [Output Only] A warning code, if applicable. For example,
  5877. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5878. // the response.
  5879. //
  5880. // Possible values:
  5881. // "CLEANUP_FAILED"
  5882. // "DEPRECATED_RESOURCE_USED"
  5883. // "DEPRECATED_TYPE_USED"
  5884. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5885. // "EXPERIMENTAL_TYPE_USED"
  5886. // "EXTERNAL_API_WARNING"
  5887. // "FIELD_VALUE_OVERRIDEN"
  5888. // "INJECTED_KERNELS_DEPRECATED"
  5889. // "MISSING_TYPE_DEPENDENCY"
  5890. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5891. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5892. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5893. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5894. // "NEXT_HOP_NOT_RUNNING"
  5895. // "NOT_CRITICAL_ERROR"
  5896. // "NO_RESULTS_ON_PAGE"
  5897. // "REQUIRED_TOS_AGREEMENT"
  5898. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5899. // "RESOURCE_NOT_DELETED"
  5900. // "SCHEMA_VALIDATION_IGNORED"
  5901. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5902. // "UNDECLARED_PROPERTIES"
  5903. // "UNREACHABLE"
  5904. Code string `json:"code,omitempty"`
  5905. // Data: [Output Only] Metadata about this warning in key: value format.
  5906. // For example:
  5907. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5908. Data []*DiskListWarningData `json:"data,omitempty"`
  5909. // Message: [Output Only] A human-readable description of the warning
  5910. // code.
  5911. Message string `json:"message,omitempty"`
  5912. // ForceSendFields is a list of field names (e.g. "Code") to
  5913. // unconditionally include in API requests. By default, fields with
  5914. // empty values are omitted from API requests. However, any non-pointer,
  5915. // non-interface field appearing in ForceSendFields will be sent to the
  5916. // server regardless of whether the field is empty or not. This may be
  5917. // used to include empty fields in Patch requests.
  5918. ForceSendFields []string `json:"-"`
  5919. // NullFields is a list of field names (e.g. "Code") to include in API
  5920. // requests with the JSON null value. By default, fields with empty
  5921. // values are omitted from API requests. However, any field with an
  5922. // empty value appearing in NullFields will be sent to the server as
  5923. // null. It is an error if a field in this list has a non-empty value.
  5924. // This may be used to include null fields in Patch requests.
  5925. NullFields []string `json:"-"`
  5926. }
  5927. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  5928. type NoMethod DiskListWarning
  5929. raw := NoMethod(*s)
  5930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5931. }
  5932. type DiskListWarningData struct {
  5933. // Key: [Output Only] A key that provides more detail on the warning
  5934. // being returned. For example, for warnings where there are no results
  5935. // in a list request for a particular zone, this key might be scope and
  5936. // the key value might be the zone name. Other examples might be a key
  5937. // indicating a deprecated resource and a suggested replacement, or a
  5938. // warning about invalid network settings (for example, if an instance
  5939. // attempts to perform IP forwarding but is not enabled for IP
  5940. // forwarding).
  5941. Key string `json:"key,omitempty"`
  5942. // Value: [Output Only] A warning data value corresponding to the key.
  5943. Value string `json:"value,omitempty"`
  5944. // ForceSendFields is a list of field names (e.g. "Key") to
  5945. // unconditionally include in API requests. By default, fields with
  5946. // empty values are omitted from API requests. However, any non-pointer,
  5947. // non-interface field appearing in ForceSendFields will be sent to the
  5948. // server regardless of whether the field is empty or not. This may be
  5949. // used to include empty fields in Patch requests.
  5950. ForceSendFields []string `json:"-"`
  5951. // NullFields is a list of field names (e.g. "Key") to include in API
  5952. // requests with the JSON null value. By default, fields with empty
  5953. // values are omitted from API requests. However, any field with an
  5954. // empty value appearing in NullFields will be sent to the server as
  5955. // null. It is an error if a field in this list has a non-empty value.
  5956. // This may be used to include null fields in Patch requests.
  5957. NullFields []string `json:"-"`
  5958. }
  5959. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  5960. type NoMethod DiskListWarningData
  5961. raw := NoMethod(*s)
  5962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5963. }
  5964. type DiskMoveRequest struct {
  5965. // DestinationZone: The URL of the destination zone to move the disk.
  5966. // This can be a full or partial URL. For example, the following are all
  5967. // valid URLs to a zone:
  5968. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  5969. //
  5970. // - projects/project/zones/zone
  5971. // - zones/zone
  5972. DestinationZone string `json:"destinationZone,omitempty"`
  5973. // TargetDisk: The URL of the target disk to move. This can be a full or
  5974. // partial URL. For example, the following are all valid URLs to a disk:
  5975. //
  5976. // -
  5977. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  5978. // - projects/project/zones/zone/disks/disk
  5979. // - zones/zone/disks/disk
  5980. TargetDisk string `json:"targetDisk,omitempty"`
  5981. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  5982. // unconditionally include in API requests. By default, fields with
  5983. // empty values are omitted from API requests. However, any non-pointer,
  5984. // non-interface field appearing in ForceSendFields will be sent to the
  5985. // server regardless of whether the field is empty or not. This may be
  5986. // used to include empty fields in Patch requests.
  5987. ForceSendFields []string `json:"-"`
  5988. // NullFields is a list of field names (e.g. "DestinationZone") to
  5989. // include in API requests with the JSON null value. By default, fields
  5990. // with empty values are omitted from API requests. However, any field
  5991. // with an empty value appearing in NullFields will be sent to the
  5992. // server as null. It is an error if a field in this list has a
  5993. // non-empty value. This may be used to include null fields in Patch
  5994. // requests.
  5995. NullFields []string `json:"-"`
  5996. }
  5997. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  5998. type NoMethod DiskMoveRequest
  5999. raw := NoMethod(*s)
  6000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6001. }
  6002. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  6003. // (== resource_for v1.diskTypes ==)
  6004. type DiskType struct {
  6005. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6006. // format.
  6007. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6008. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  6009. // GB.
  6010. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  6011. // Deprecated: [Output Only] The deprecation status associated with this
  6012. // disk type.
  6013. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  6014. // Description: [Output Only] An optional description of this resource.
  6015. Description string `json:"description,omitempty"`
  6016. // Id: [Output Only] The unique identifier for the resource. This
  6017. // identifier is defined by the server.
  6018. Id uint64 `json:"id,omitempty,string"`
  6019. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  6020. // disk types.
  6021. Kind string `json:"kind,omitempty"`
  6022. // Name: [Output Only] Name of the resource.
  6023. Name string `json:"name,omitempty"`
  6024. // Region: [Output Only] URL of the region where the disk type resides.
  6025. // Only applicable for regional resources. You must specify this field
  6026. // as part of the HTTP request URL. It is not settable as a field in the
  6027. // request body.
  6028. Region string `json:"region,omitempty"`
  6029. // SelfLink: [Output Only] Server-defined URL for the resource.
  6030. SelfLink string `json:"selfLink,omitempty"`
  6031. // ValidDiskSize: [Output Only] An optional textual description of the
  6032. // valid disk size, such as "10GB-10TB".
  6033. ValidDiskSize string `json:"validDiskSize,omitempty"`
  6034. // Zone: [Output Only] URL of the zone where the disk type resides. You
  6035. // must specify this field as part of the HTTP request URL. It is not
  6036. // settable as a field in the request body.
  6037. Zone string `json:"zone,omitempty"`
  6038. // ServerResponse contains the HTTP response code and headers from the
  6039. // server.
  6040. googleapi.ServerResponse `json:"-"`
  6041. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6042. // to unconditionally include in API requests. By default, fields with
  6043. // empty values are omitted from API requests. However, any non-pointer,
  6044. // non-interface field appearing in ForceSendFields will be sent to the
  6045. // server regardless of whether the field is empty or not. This may be
  6046. // used to include empty fields in Patch requests.
  6047. ForceSendFields []string `json:"-"`
  6048. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  6049. // include in API requests with the JSON null value. By default, fields
  6050. // with empty values are omitted from API requests. However, any field
  6051. // with an empty value appearing in NullFields will be sent to the
  6052. // server as null. It is an error if a field in this list has a
  6053. // non-empty value. This may be used to include null fields in Patch
  6054. // requests.
  6055. NullFields []string `json:"-"`
  6056. }
  6057. func (s *DiskType) MarshalJSON() ([]byte, error) {
  6058. type NoMethod DiskType
  6059. raw := NoMethod(*s)
  6060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6061. }
  6062. type DiskTypeAggregatedList struct {
  6063. // Id: [Output Only] Unique identifier for the resource; defined by the
  6064. // server.
  6065. Id string `json:"id,omitempty"`
  6066. // Items: A list of DiskTypesScopedList resources.
  6067. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  6068. // Kind: [Output Only] Type of resource. Always
  6069. // compute#diskTypeAggregatedList.
  6070. Kind string `json:"kind,omitempty"`
  6071. // NextPageToken: [Output Only] This token allows you to get the next
  6072. // page of results for list requests. If the number of results is larger
  6073. // than maxResults, use the nextPageToken as a value for the query
  6074. // parameter pageToken in the next list request. Subsequent list
  6075. // requests will have their own nextPageToken to continue paging through
  6076. // the results.
  6077. NextPageToken string `json:"nextPageToken,omitempty"`
  6078. // SelfLink: [Output Only] Server-defined URL for this resource.
  6079. SelfLink string `json:"selfLink,omitempty"`
  6080. // Warning: [Output Only] Informational warning message.
  6081. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  6082. // ServerResponse contains the HTTP response code and headers from the
  6083. // server.
  6084. googleapi.ServerResponse `json:"-"`
  6085. // ForceSendFields is a list of field names (e.g. "Id") to
  6086. // unconditionally include in API requests. By default, fields with
  6087. // empty values are omitted from API requests. However, any non-pointer,
  6088. // non-interface field appearing in ForceSendFields will be sent to the
  6089. // server regardless of whether the field is empty or not. This may be
  6090. // used to include empty fields in Patch requests.
  6091. ForceSendFields []string `json:"-"`
  6092. // NullFields is a list of field names (e.g. "Id") to include in API
  6093. // requests with the JSON null value. By default, fields with empty
  6094. // values are omitted from API requests. However, any field with an
  6095. // empty value appearing in NullFields will be sent to the server as
  6096. // null. It is an error if a field in this list has a non-empty value.
  6097. // This may be used to include null fields in Patch requests.
  6098. NullFields []string `json:"-"`
  6099. }
  6100. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  6101. type NoMethod DiskTypeAggregatedList
  6102. raw := NoMethod(*s)
  6103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6104. }
  6105. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  6106. // message.
  6107. type DiskTypeAggregatedListWarning struct {
  6108. // Code: [Output Only] A warning code, if applicable. For example,
  6109. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6110. // the response.
  6111. //
  6112. // Possible values:
  6113. // "CLEANUP_FAILED"
  6114. // "DEPRECATED_RESOURCE_USED"
  6115. // "DEPRECATED_TYPE_USED"
  6116. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6117. // "EXPERIMENTAL_TYPE_USED"
  6118. // "EXTERNAL_API_WARNING"
  6119. // "FIELD_VALUE_OVERRIDEN"
  6120. // "INJECTED_KERNELS_DEPRECATED"
  6121. // "MISSING_TYPE_DEPENDENCY"
  6122. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6123. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6124. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6125. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6126. // "NEXT_HOP_NOT_RUNNING"
  6127. // "NOT_CRITICAL_ERROR"
  6128. // "NO_RESULTS_ON_PAGE"
  6129. // "REQUIRED_TOS_AGREEMENT"
  6130. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6131. // "RESOURCE_NOT_DELETED"
  6132. // "SCHEMA_VALIDATION_IGNORED"
  6133. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6134. // "UNDECLARED_PROPERTIES"
  6135. // "UNREACHABLE"
  6136. Code string `json:"code,omitempty"`
  6137. // Data: [Output Only] Metadata about this warning in key: value format.
  6138. // For example:
  6139. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6140. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  6141. // Message: [Output Only] A human-readable description of the warning
  6142. // code.
  6143. Message string `json:"message,omitempty"`
  6144. // ForceSendFields is a list of field names (e.g. "Code") to
  6145. // unconditionally include in API requests. By default, fields with
  6146. // empty values are omitted from API requests. However, any non-pointer,
  6147. // non-interface field appearing in ForceSendFields will be sent to the
  6148. // server regardless of whether the field is empty or not. This may be
  6149. // used to include empty fields in Patch requests.
  6150. ForceSendFields []string `json:"-"`
  6151. // NullFields is a list of field names (e.g. "Code") to include in API
  6152. // requests with the JSON null value. By default, fields with empty
  6153. // values are omitted from API requests. However, any field with an
  6154. // empty value appearing in NullFields will be sent to the server as
  6155. // null. It is an error if a field in this list has a non-empty value.
  6156. // This may be used to include null fields in Patch requests.
  6157. NullFields []string `json:"-"`
  6158. }
  6159. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6160. type NoMethod DiskTypeAggregatedListWarning
  6161. raw := NoMethod(*s)
  6162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6163. }
  6164. type DiskTypeAggregatedListWarningData struct {
  6165. // Key: [Output Only] A key that provides more detail on the warning
  6166. // being returned. For example, for warnings where there are no results
  6167. // in a list request for a particular zone, this key might be scope and
  6168. // the key value might be the zone name. Other examples might be a key
  6169. // indicating a deprecated resource and a suggested replacement, or a
  6170. // warning about invalid network settings (for example, if an instance
  6171. // attempts to perform IP forwarding but is not enabled for IP
  6172. // forwarding).
  6173. Key string `json:"key,omitempty"`
  6174. // Value: [Output Only] A warning data value corresponding to the key.
  6175. Value string `json:"value,omitempty"`
  6176. // ForceSendFields is a list of field names (e.g. "Key") to
  6177. // unconditionally include in API requests. By default, fields with
  6178. // empty values are omitted from API requests. However, any non-pointer,
  6179. // non-interface field appearing in ForceSendFields will be sent to the
  6180. // server regardless of whether the field is empty or not. This may be
  6181. // used to include empty fields in Patch requests.
  6182. ForceSendFields []string `json:"-"`
  6183. // NullFields is a list of field names (e.g. "Key") to include in API
  6184. // requests with the JSON null value. By default, fields with empty
  6185. // values are omitted from API requests. However, any field with an
  6186. // empty value appearing in NullFields will be sent to the server as
  6187. // null. It is an error if a field in this list has a non-empty value.
  6188. // This may be used to include null fields in Patch requests.
  6189. NullFields []string `json:"-"`
  6190. }
  6191. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6192. type NoMethod DiskTypeAggregatedListWarningData
  6193. raw := NoMethod(*s)
  6194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6195. }
  6196. // DiskTypeList: Contains a list of disk types.
  6197. type DiskTypeList struct {
  6198. // Id: [Output Only] Unique identifier for the resource; defined by the
  6199. // server.
  6200. Id string `json:"id,omitempty"`
  6201. // Items: A list of DiskType resources.
  6202. Items []*DiskType `json:"items,omitempty"`
  6203. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  6204. // disk types.
  6205. Kind string `json:"kind,omitempty"`
  6206. // NextPageToken: [Output Only] This token allows you to get the next
  6207. // page of results for list requests. If the number of results is larger
  6208. // than maxResults, use the nextPageToken as a value for the query
  6209. // parameter pageToken in the next list request. Subsequent list
  6210. // requests will have their own nextPageToken to continue paging through
  6211. // the results.
  6212. NextPageToken string `json:"nextPageToken,omitempty"`
  6213. // SelfLink: [Output Only] Server-defined URL for this resource.
  6214. SelfLink string `json:"selfLink,omitempty"`
  6215. // Warning: [Output Only] Informational warning message.
  6216. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  6217. // ServerResponse contains the HTTP response code and headers from the
  6218. // server.
  6219. googleapi.ServerResponse `json:"-"`
  6220. // ForceSendFields is a list of field names (e.g. "Id") to
  6221. // unconditionally include in API requests. By default, fields with
  6222. // empty values are omitted from API requests. However, any non-pointer,
  6223. // non-interface field appearing in ForceSendFields will be sent to the
  6224. // server regardless of whether the field is empty or not. This may be
  6225. // used to include empty fields in Patch requests.
  6226. ForceSendFields []string `json:"-"`
  6227. // NullFields is a list of field names (e.g. "Id") to include in API
  6228. // requests with the JSON null value. By default, fields with empty
  6229. // values are omitted from API requests. However, any field with an
  6230. // empty value appearing in NullFields will be sent to the server as
  6231. // null. It is an error if a field in this list has a non-empty value.
  6232. // This may be used to include null fields in Patch requests.
  6233. NullFields []string `json:"-"`
  6234. }
  6235. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  6236. type NoMethod DiskTypeList
  6237. raw := NoMethod(*s)
  6238. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6239. }
  6240. // DiskTypeListWarning: [Output Only] Informational warning message.
  6241. type DiskTypeListWarning struct {
  6242. // Code: [Output Only] A warning code, if applicable. For example,
  6243. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6244. // the response.
  6245. //
  6246. // Possible values:
  6247. // "CLEANUP_FAILED"
  6248. // "DEPRECATED_RESOURCE_USED"
  6249. // "DEPRECATED_TYPE_USED"
  6250. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6251. // "EXPERIMENTAL_TYPE_USED"
  6252. // "EXTERNAL_API_WARNING"
  6253. // "FIELD_VALUE_OVERRIDEN"
  6254. // "INJECTED_KERNELS_DEPRECATED"
  6255. // "MISSING_TYPE_DEPENDENCY"
  6256. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6257. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6258. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6259. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6260. // "NEXT_HOP_NOT_RUNNING"
  6261. // "NOT_CRITICAL_ERROR"
  6262. // "NO_RESULTS_ON_PAGE"
  6263. // "REQUIRED_TOS_AGREEMENT"
  6264. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6265. // "RESOURCE_NOT_DELETED"
  6266. // "SCHEMA_VALIDATION_IGNORED"
  6267. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6268. // "UNDECLARED_PROPERTIES"
  6269. // "UNREACHABLE"
  6270. Code string `json:"code,omitempty"`
  6271. // Data: [Output Only] Metadata about this warning in key: value format.
  6272. // For example:
  6273. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6274. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  6275. // Message: [Output Only] A human-readable description of the warning
  6276. // code.
  6277. Message string `json:"message,omitempty"`
  6278. // ForceSendFields is a list of field names (e.g. "Code") to
  6279. // unconditionally include in API requests. By default, fields with
  6280. // empty values are omitted from API requests. However, any non-pointer,
  6281. // non-interface field appearing in ForceSendFields will be sent to the
  6282. // server regardless of whether the field is empty or not. This may be
  6283. // used to include empty fields in Patch requests.
  6284. ForceSendFields []string `json:"-"`
  6285. // NullFields is a list of field names (e.g. "Code") to include in API
  6286. // requests with the JSON null value. By default, fields with empty
  6287. // values are omitted from API requests. However, any field with an
  6288. // empty value appearing in NullFields will be sent to the server as
  6289. // null. It is an error if a field in this list has a non-empty value.
  6290. // This may be used to include null fields in Patch requests.
  6291. NullFields []string `json:"-"`
  6292. }
  6293. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  6294. type NoMethod DiskTypeListWarning
  6295. raw := NoMethod(*s)
  6296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6297. }
  6298. type DiskTypeListWarningData struct {
  6299. // Key: [Output Only] A key that provides more detail on the warning
  6300. // being returned. For example, for warnings where there are no results
  6301. // in a list request for a particular zone, this key might be scope and
  6302. // the key value might be the zone name. Other examples might be a key
  6303. // indicating a deprecated resource and a suggested replacement, or a
  6304. // warning about invalid network settings (for example, if an instance
  6305. // attempts to perform IP forwarding but is not enabled for IP
  6306. // forwarding).
  6307. Key string `json:"key,omitempty"`
  6308. // Value: [Output Only] A warning data value corresponding to the key.
  6309. Value string `json:"value,omitempty"`
  6310. // ForceSendFields is a list of field names (e.g. "Key") to
  6311. // unconditionally include in API requests. By default, fields with
  6312. // empty values are omitted from API requests. However, any non-pointer,
  6313. // non-interface field appearing in ForceSendFields will be sent to the
  6314. // server regardless of whether the field is empty or not. This may be
  6315. // used to include empty fields in Patch requests.
  6316. ForceSendFields []string `json:"-"`
  6317. // NullFields is a list of field names (e.g. "Key") to include in API
  6318. // requests with the JSON null value. By default, fields with empty
  6319. // values are omitted from API requests. However, any field with an
  6320. // empty value appearing in NullFields will be sent to the server as
  6321. // null. It is an error if a field in this list has a non-empty value.
  6322. // This may be used to include null fields in Patch requests.
  6323. NullFields []string `json:"-"`
  6324. }
  6325. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  6326. type NoMethod DiskTypeListWarningData
  6327. raw := NoMethod(*s)
  6328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6329. }
  6330. type DiskTypesScopedList struct {
  6331. // DiskTypes: [Output Only] A list of disk types contained in this
  6332. // scope.
  6333. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  6334. // Warning: [Output Only] Informational warning which replaces the list
  6335. // of disk types when the list is empty.
  6336. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  6337. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  6338. // unconditionally include in API requests. By default, fields with
  6339. // empty values are omitted from API requests. However, any non-pointer,
  6340. // non-interface field appearing in ForceSendFields will be sent to the
  6341. // server regardless of whether the field is empty or not. This may be
  6342. // used to include empty fields in Patch requests.
  6343. ForceSendFields []string `json:"-"`
  6344. // NullFields is a list of field names (e.g. "DiskTypes") to include in
  6345. // API requests with the JSON null value. By default, fields with empty
  6346. // values are omitted from API requests. However, any field with an
  6347. // empty value appearing in NullFields will be sent to the server as
  6348. // null. It is an error if a field in this list has a non-empty value.
  6349. // This may be used to include null fields in Patch requests.
  6350. NullFields []string `json:"-"`
  6351. }
  6352. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  6353. type NoMethod DiskTypesScopedList
  6354. raw := NoMethod(*s)
  6355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6356. }
  6357. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  6358. // replaces the list of disk types when the list is empty.
  6359. type DiskTypesScopedListWarning struct {
  6360. // Code: [Output Only] A warning code, if applicable. For example,
  6361. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6362. // the response.
  6363. //
  6364. // Possible values:
  6365. // "CLEANUP_FAILED"
  6366. // "DEPRECATED_RESOURCE_USED"
  6367. // "DEPRECATED_TYPE_USED"
  6368. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6369. // "EXPERIMENTAL_TYPE_USED"
  6370. // "EXTERNAL_API_WARNING"
  6371. // "FIELD_VALUE_OVERRIDEN"
  6372. // "INJECTED_KERNELS_DEPRECATED"
  6373. // "MISSING_TYPE_DEPENDENCY"
  6374. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6375. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6376. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6377. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6378. // "NEXT_HOP_NOT_RUNNING"
  6379. // "NOT_CRITICAL_ERROR"
  6380. // "NO_RESULTS_ON_PAGE"
  6381. // "REQUIRED_TOS_AGREEMENT"
  6382. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6383. // "RESOURCE_NOT_DELETED"
  6384. // "SCHEMA_VALIDATION_IGNORED"
  6385. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6386. // "UNDECLARED_PROPERTIES"
  6387. // "UNREACHABLE"
  6388. Code string `json:"code,omitempty"`
  6389. // Data: [Output Only] Metadata about this warning in key: value format.
  6390. // For example:
  6391. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6392. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  6393. // Message: [Output Only] A human-readable description of the warning
  6394. // code.
  6395. Message string `json:"message,omitempty"`
  6396. // ForceSendFields is a list of field names (e.g. "Code") to
  6397. // unconditionally include in API requests. By default, fields with
  6398. // empty values are omitted from API requests. However, any non-pointer,
  6399. // non-interface field appearing in ForceSendFields will be sent to the
  6400. // server regardless of whether the field is empty or not. This may be
  6401. // used to include empty fields in Patch requests.
  6402. ForceSendFields []string `json:"-"`
  6403. // NullFields is a list of field names (e.g. "Code") to include in API
  6404. // requests with the JSON null value. By default, fields with empty
  6405. // values are omitted from API requests. However, any field with an
  6406. // empty value appearing in NullFields will be sent to the server as
  6407. // null. It is an error if a field in this list has a non-empty value.
  6408. // This may be used to include null fields in Patch requests.
  6409. NullFields []string `json:"-"`
  6410. }
  6411. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  6412. type NoMethod DiskTypesScopedListWarning
  6413. raw := NoMethod(*s)
  6414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6415. }
  6416. type DiskTypesScopedListWarningData struct {
  6417. // Key: [Output Only] A key that provides more detail on the warning
  6418. // being returned. For example, for warnings where there are no results
  6419. // in a list request for a particular zone, this key might be scope and
  6420. // the key value might be the zone name. Other examples might be a key
  6421. // indicating a deprecated resource and a suggested replacement, or a
  6422. // warning about invalid network settings (for example, if an instance
  6423. // attempts to perform IP forwarding but is not enabled for IP
  6424. // forwarding).
  6425. Key string `json:"key,omitempty"`
  6426. // Value: [Output Only] A warning data value corresponding to the key.
  6427. Value string `json:"value,omitempty"`
  6428. // ForceSendFields is a list of field names (e.g. "Key") to
  6429. // unconditionally include in API requests. By default, fields with
  6430. // empty values are omitted from API requests. However, any non-pointer,
  6431. // non-interface field appearing in ForceSendFields will be sent to the
  6432. // server regardless of whether the field is empty or not. This may be
  6433. // used to include empty fields in Patch requests.
  6434. ForceSendFields []string `json:"-"`
  6435. // NullFields is a list of field names (e.g. "Key") to include in API
  6436. // requests with the JSON null value. By default, fields with empty
  6437. // values are omitted from API requests. However, any field with an
  6438. // empty value appearing in NullFields will be sent to the server as
  6439. // null. It is an error if a field in this list has a non-empty value.
  6440. // This may be used to include null fields in Patch requests.
  6441. NullFields []string `json:"-"`
  6442. }
  6443. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6444. type NoMethod DiskTypesScopedListWarningData
  6445. raw := NoMethod(*s)
  6446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6447. }
  6448. type DisksAddResourcePoliciesRequest struct {
  6449. // ResourcePolicies: Resource policies to be added to this disk.
  6450. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6451. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6452. // unconditionally include in API requests. By default, fields with
  6453. // empty values are omitted from API requests. However, any non-pointer,
  6454. // non-interface field appearing in ForceSendFields will be sent to the
  6455. // server regardless of whether the field is empty or not. This may be
  6456. // used to include empty fields in Patch requests.
  6457. ForceSendFields []string `json:"-"`
  6458. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6459. // include in API requests with the JSON null value. By default, fields
  6460. // with empty values are omitted from API requests. However, any field
  6461. // with an empty value appearing in NullFields will be sent to the
  6462. // server as null. It is an error if a field in this list has a
  6463. // non-empty value. This may be used to include null fields in Patch
  6464. // requests.
  6465. NullFields []string `json:"-"`
  6466. }
  6467. func (s *DisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6468. type NoMethod DisksAddResourcePoliciesRequest
  6469. raw := NoMethod(*s)
  6470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6471. }
  6472. type DisksRemoveResourcePoliciesRequest struct {
  6473. // ResourcePolicies: Resource policies to be removed from this disk.
  6474. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6475. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6476. // unconditionally include in API requests. By default, fields with
  6477. // empty values are omitted from API requests. However, any non-pointer,
  6478. // non-interface field appearing in ForceSendFields will be sent to the
  6479. // server regardless of whether the field is empty or not. This may be
  6480. // used to include empty fields in Patch requests.
  6481. ForceSendFields []string `json:"-"`
  6482. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6483. // include in API requests with the JSON null value. By default, fields
  6484. // with empty values are omitted from API requests. However, any field
  6485. // with an empty value appearing in NullFields will be sent to the
  6486. // server as null. It is an error if a field in this list has a
  6487. // non-empty value. This may be used to include null fields in Patch
  6488. // requests.
  6489. NullFields []string `json:"-"`
  6490. }
  6491. func (s *DisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6492. type NoMethod DisksRemoveResourcePoliciesRequest
  6493. raw := NoMethod(*s)
  6494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6495. }
  6496. type DisksResizeRequest struct {
  6497. // SizeGb: The new size of the persistent disk, which is specified in
  6498. // GB.
  6499. SizeGb int64 `json:"sizeGb,omitempty,string"`
  6500. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  6501. // unconditionally include in API requests. By default, fields with
  6502. // empty values are omitted from API requests. However, any non-pointer,
  6503. // non-interface field appearing in ForceSendFields will be sent to the
  6504. // server regardless of whether the field is empty or not. This may be
  6505. // used to include empty fields in Patch requests.
  6506. ForceSendFields []string `json:"-"`
  6507. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  6508. // requests with the JSON null value. By default, fields with empty
  6509. // values are omitted from API requests. However, any field with an
  6510. // empty value appearing in NullFields will be sent to the server as
  6511. // null. It is an error if a field in this list has a non-empty value.
  6512. // This may be used to include null fields in Patch requests.
  6513. NullFields []string `json:"-"`
  6514. }
  6515. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  6516. type NoMethod DisksResizeRequest
  6517. raw := NoMethod(*s)
  6518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6519. }
  6520. type DisksScopedList struct {
  6521. // Disks: [Output Only] A list of disks contained in this scope.
  6522. Disks []*Disk `json:"disks,omitempty"`
  6523. // Warning: [Output Only] Informational warning which replaces the list
  6524. // of disks when the list is empty.
  6525. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  6526. // ForceSendFields is a list of field names (e.g. "Disks") to
  6527. // 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. "Disks") to include in API
  6534. // requests with the JSON null value. By default, fields with empty
  6535. // values are omitted from API requests. However, any field with an
  6536. // empty value appearing in NullFields will be sent to the server as
  6537. // null. It is an error if a field in this list has a non-empty value.
  6538. // This may be used to include null fields in Patch requests.
  6539. NullFields []string `json:"-"`
  6540. }
  6541. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  6542. type NoMethod DisksScopedList
  6543. raw := NoMethod(*s)
  6544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6545. }
  6546. // DisksScopedListWarning: [Output Only] Informational warning which
  6547. // replaces the list of disks when the list is empty.
  6548. type DisksScopedListWarning struct {
  6549. // Code: [Output Only] A warning code, if applicable. For example,
  6550. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6551. // the response.
  6552. //
  6553. // Possible values:
  6554. // "CLEANUP_FAILED"
  6555. // "DEPRECATED_RESOURCE_USED"
  6556. // "DEPRECATED_TYPE_USED"
  6557. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6558. // "EXPERIMENTAL_TYPE_USED"
  6559. // "EXTERNAL_API_WARNING"
  6560. // "FIELD_VALUE_OVERRIDEN"
  6561. // "INJECTED_KERNELS_DEPRECATED"
  6562. // "MISSING_TYPE_DEPENDENCY"
  6563. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6564. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6565. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6566. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6567. // "NEXT_HOP_NOT_RUNNING"
  6568. // "NOT_CRITICAL_ERROR"
  6569. // "NO_RESULTS_ON_PAGE"
  6570. // "REQUIRED_TOS_AGREEMENT"
  6571. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6572. // "RESOURCE_NOT_DELETED"
  6573. // "SCHEMA_VALIDATION_IGNORED"
  6574. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6575. // "UNDECLARED_PROPERTIES"
  6576. // "UNREACHABLE"
  6577. Code string `json:"code,omitempty"`
  6578. // Data: [Output Only] Metadata about this warning in key: value format.
  6579. // For example:
  6580. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6581. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  6582. // Message: [Output Only] A human-readable description of the warning
  6583. // code.
  6584. Message string `json:"message,omitempty"`
  6585. // ForceSendFields is a list of field names (e.g. "Code") to
  6586. // unconditionally include in API requests. By default, fields with
  6587. // empty values are omitted from API requests. However, any non-pointer,
  6588. // non-interface field appearing in ForceSendFields will be sent to the
  6589. // server regardless of whether the field is empty or not. This may be
  6590. // used to include empty fields in Patch requests.
  6591. ForceSendFields []string `json:"-"`
  6592. // NullFields is a list of field names (e.g. "Code") to include in API
  6593. // requests with the JSON null value. By default, fields with empty
  6594. // values are omitted from API requests. However, any field with an
  6595. // empty value appearing in NullFields will be sent to the server as
  6596. // null. It is an error if a field in this list has a non-empty value.
  6597. // This may be used to include null fields in Patch requests.
  6598. NullFields []string `json:"-"`
  6599. }
  6600. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  6601. type NoMethod DisksScopedListWarning
  6602. raw := NoMethod(*s)
  6603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6604. }
  6605. type DisksScopedListWarningData struct {
  6606. // Key: [Output Only] A key that provides more detail on the warning
  6607. // being returned. For example, for warnings where there are no results
  6608. // in a list request for a particular zone, this key might be scope and
  6609. // the key value might be the zone name. Other examples might be a key
  6610. // indicating a deprecated resource and a suggested replacement, or a
  6611. // warning about invalid network settings (for example, if an instance
  6612. // attempts to perform IP forwarding but is not enabled for IP
  6613. // forwarding).
  6614. Key string `json:"key,omitempty"`
  6615. // Value: [Output Only] A warning data value corresponding to the key.
  6616. Value string `json:"value,omitempty"`
  6617. // ForceSendFields is a list of field names (e.g. "Key") to
  6618. // unconditionally include in API requests. By default, fields with
  6619. // empty values are omitted from API requests. However, any non-pointer,
  6620. // non-interface field appearing in ForceSendFields will be sent to the
  6621. // server regardless of whether the field is empty or not. This may be
  6622. // used to include empty fields in Patch requests.
  6623. ForceSendFields []string `json:"-"`
  6624. // NullFields is a list of field names (e.g. "Key") to include in API
  6625. // requests with the JSON null value. By default, fields with empty
  6626. // values are omitted from API requests. However, any field with an
  6627. // empty value appearing in NullFields will be sent to the server as
  6628. // null. It is an error if a field in this list has a non-empty value.
  6629. // This may be used to include null fields in Patch requests.
  6630. NullFields []string `json:"-"`
  6631. }
  6632. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  6633. type NoMethod DisksScopedListWarningData
  6634. raw := NoMethod(*s)
  6635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6636. }
  6637. // DisplayDevice: A set of Display Device options
  6638. type DisplayDevice struct {
  6639. // EnableDisplay: Defines whether the instance has Display enabled.
  6640. EnableDisplay bool `json:"enableDisplay,omitempty"`
  6641. // ForceSendFields is a list of field names (e.g. "EnableDisplay") to
  6642. // unconditionally include in API requests. By default, fields with
  6643. // empty values are omitted from API requests. However, any non-pointer,
  6644. // non-interface field appearing in ForceSendFields will be sent to the
  6645. // server regardless of whether the field is empty or not. This may be
  6646. // used to include empty fields in Patch requests.
  6647. ForceSendFields []string `json:"-"`
  6648. // NullFields is a list of field names (e.g. "EnableDisplay") to include
  6649. // in API requests with the JSON null value. By default, fields with
  6650. // empty values are omitted from API requests. However, any field with
  6651. // an empty value appearing in NullFields will be sent to the server as
  6652. // null. It is an error if a field in this list has a non-empty value.
  6653. // This may be used to include null fields in Patch requests.
  6654. NullFields []string `json:"-"`
  6655. }
  6656. func (s *DisplayDevice) MarshalJSON() ([]byte, error) {
  6657. type NoMethod DisplayDevice
  6658. raw := NoMethod(*s)
  6659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6660. }
  6661. type DistributionPolicy struct {
  6662. // Zones: Zones where the regional managed instance group will create
  6663. // and manage instances.
  6664. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  6665. // ForceSendFields is a list of field names (e.g. "Zones") to
  6666. // unconditionally include in API requests. By default, fields with
  6667. // empty values are omitted from API requests. However, any non-pointer,
  6668. // non-interface field appearing in ForceSendFields will be sent to the
  6669. // server regardless of whether the field is empty or not. This may be
  6670. // used to include empty fields in Patch requests.
  6671. ForceSendFields []string `json:"-"`
  6672. // NullFields is a list of field names (e.g. "Zones") to include in API
  6673. // requests with the JSON null value. By default, fields with empty
  6674. // values are omitted from API requests. However, any field with an
  6675. // empty value appearing in NullFields will be sent to the server as
  6676. // null. It is an error if a field in this list has a non-empty value.
  6677. // This may be used to include null fields in Patch requests.
  6678. NullFields []string `json:"-"`
  6679. }
  6680. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  6681. type NoMethod DistributionPolicy
  6682. raw := NoMethod(*s)
  6683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6684. }
  6685. type DistributionPolicyZoneConfiguration struct {
  6686. // Zone: The URL of the zone. The zone must exist in the region where
  6687. // the managed instance group is located.
  6688. Zone string `json:"zone,omitempty"`
  6689. // ForceSendFields is a list of field names (e.g. "Zone") to
  6690. // unconditionally include in API requests. By default, fields with
  6691. // empty values are omitted from API requests. However, any non-pointer,
  6692. // non-interface field appearing in ForceSendFields will be sent to the
  6693. // server regardless of whether the field is empty or not. This may be
  6694. // used to include empty fields in Patch requests.
  6695. ForceSendFields []string `json:"-"`
  6696. // NullFields is a list of field names (e.g. "Zone") to include in API
  6697. // requests with the JSON null value. By default, fields with empty
  6698. // values are omitted from API requests. However, any field with an
  6699. // empty value appearing in NullFields will be sent to the server as
  6700. // null. It is an error if a field in this list has a non-empty value.
  6701. // This may be used to include null fields in Patch requests.
  6702. NullFields []string `json:"-"`
  6703. }
  6704. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  6705. type NoMethod DistributionPolicyZoneConfiguration
  6706. raw := NoMethod(*s)
  6707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6708. }
  6709. type ExchangedPeeringRoute struct {
  6710. // DestRange: The destination range of the route.
  6711. DestRange string `json:"destRange,omitempty"`
  6712. // Imported: If the peering route is imported if there is no
  6713. // confliction.
  6714. Imported bool `json:"imported,omitempty"`
  6715. // NextHopRegion: The region of peering route next hop, only applies to
  6716. // dynamic routes.
  6717. NextHopRegion string `json:"nextHopRegion,omitempty"`
  6718. // Priority: The priority of the peering route.
  6719. Priority int64 `json:"priority,omitempty"`
  6720. // Type: The type of the peering route.
  6721. //
  6722. // Possible values:
  6723. // "DYNAMIC_PEERING_ROUTE"
  6724. // "STATIC_PEERING_ROUTE"
  6725. // "SUBNET_PEERING_ROUTE"
  6726. Type string `json:"type,omitempty"`
  6727. // ForceSendFields is a list of field names (e.g. "DestRange") to
  6728. // unconditionally include in API requests. By default, fields with
  6729. // empty values are omitted from API requests. However, any non-pointer,
  6730. // non-interface field appearing in ForceSendFields will be sent to the
  6731. // server regardless of whether the field is empty or not. This may be
  6732. // used to include empty fields in Patch requests.
  6733. ForceSendFields []string `json:"-"`
  6734. // NullFields is a list of field names (e.g. "DestRange") to include in
  6735. // API requests with the JSON null value. By default, fields with empty
  6736. // values are omitted from API requests. However, any field with an
  6737. // empty value appearing in NullFields will be sent to the server as
  6738. // null. It is an error if a field in this list has a non-empty value.
  6739. // This may be used to include null fields in Patch requests.
  6740. NullFields []string `json:"-"`
  6741. }
  6742. func (s *ExchangedPeeringRoute) MarshalJSON() ([]byte, error) {
  6743. type NoMethod ExchangedPeeringRoute
  6744. raw := NoMethod(*s)
  6745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6746. }
  6747. type ExchangedPeeringRoutesList struct {
  6748. // Id: [Output Only] Unique identifier for the resource; defined by the
  6749. // server.
  6750. Id string `json:"id,omitempty"`
  6751. // Items: A list of ExchangedPeeringRoute resources.
  6752. Items []*ExchangedPeeringRoute `json:"items,omitempty"`
  6753. // Kind: [Output Only] Type of resource. Always
  6754. // compute#exchangedPeeringRoutesList for exchanged peering routes
  6755. // lists.
  6756. Kind string `json:"kind,omitempty"`
  6757. // NextPageToken: [Output Only] This token allows you to get the next
  6758. // page of results for list requests. If the number of results is larger
  6759. // than maxResults, use the nextPageToken as a value for the query
  6760. // parameter pageToken in the next list request. Subsequent list
  6761. // requests will have their own nextPageToken to continue paging through
  6762. // the results.
  6763. NextPageToken string `json:"nextPageToken,omitempty"`
  6764. // SelfLink: [Output Only] Server-defined URL for this resource.
  6765. SelfLink string `json:"selfLink,omitempty"`
  6766. // Warning: [Output Only] Informational warning message.
  6767. Warning *ExchangedPeeringRoutesListWarning `json:"warning,omitempty"`
  6768. // ServerResponse contains the HTTP response code and headers from the
  6769. // server.
  6770. googleapi.ServerResponse `json:"-"`
  6771. // ForceSendFields is a list of field names (e.g. "Id") to
  6772. // unconditionally include in API requests. By default, fields with
  6773. // empty values are omitted from API requests. However, any non-pointer,
  6774. // non-interface field appearing in ForceSendFields will be sent to the
  6775. // server regardless of whether the field is empty or not. This may be
  6776. // used to include empty fields in Patch requests.
  6777. ForceSendFields []string `json:"-"`
  6778. // NullFields is a list of field names (e.g. "Id") to include in API
  6779. // requests with the JSON null value. By default, fields with empty
  6780. // values are omitted from API requests. However, any field with an
  6781. // empty value appearing in NullFields will be sent to the server as
  6782. // null. It is an error if a field in this list has a non-empty value.
  6783. // This may be used to include null fields in Patch requests.
  6784. NullFields []string `json:"-"`
  6785. }
  6786. func (s *ExchangedPeeringRoutesList) MarshalJSON() ([]byte, error) {
  6787. type NoMethod ExchangedPeeringRoutesList
  6788. raw := NoMethod(*s)
  6789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6790. }
  6791. // ExchangedPeeringRoutesListWarning: [Output Only] Informational
  6792. // warning message.
  6793. type ExchangedPeeringRoutesListWarning struct {
  6794. // Code: [Output Only] A warning code, if applicable. For example,
  6795. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6796. // the response.
  6797. //
  6798. // Possible values:
  6799. // "CLEANUP_FAILED"
  6800. // "DEPRECATED_RESOURCE_USED"
  6801. // "DEPRECATED_TYPE_USED"
  6802. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6803. // "EXPERIMENTAL_TYPE_USED"
  6804. // "EXTERNAL_API_WARNING"
  6805. // "FIELD_VALUE_OVERRIDEN"
  6806. // "INJECTED_KERNELS_DEPRECATED"
  6807. // "MISSING_TYPE_DEPENDENCY"
  6808. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6809. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6810. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6811. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6812. // "NEXT_HOP_NOT_RUNNING"
  6813. // "NOT_CRITICAL_ERROR"
  6814. // "NO_RESULTS_ON_PAGE"
  6815. // "REQUIRED_TOS_AGREEMENT"
  6816. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6817. // "RESOURCE_NOT_DELETED"
  6818. // "SCHEMA_VALIDATION_IGNORED"
  6819. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6820. // "UNDECLARED_PROPERTIES"
  6821. // "UNREACHABLE"
  6822. Code string `json:"code,omitempty"`
  6823. // Data: [Output Only] Metadata about this warning in key: value format.
  6824. // For example:
  6825. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6826. Data []*ExchangedPeeringRoutesListWarningData `json:"data,omitempty"`
  6827. // Message: [Output Only] A human-readable description of the warning
  6828. // code.
  6829. Message string `json:"message,omitempty"`
  6830. // ForceSendFields is a list of field names (e.g. "Code") to
  6831. // unconditionally include in API requests. By default, fields with
  6832. // empty values are omitted from API requests. However, any non-pointer,
  6833. // non-interface field appearing in ForceSendFields will be sent to the
  6834. // server regardless of whether the field is empty or not. This may be
  6835. // used to include empty fields in Patch requests.
  6836. ForceSendFields []string `json:"-"`
  6837. // NullFields is a list of field names (e.g. "Code") to include in API
  6838. // requests with the JSON null value. By default, fields with empty
  6839. // values are omitted from API requests. However, any field with an
  6840. // empty value appearing in NullFields will be sent to the server as
  6841. // null. It is an error if a field in this list has a non-empty value.
  6842. // This may be used to include null fields in Patch requests.
  6843. NullFields []string `json:"-"`
  6844. }
  6845. func (s *ExchangedPeeringRoutesListWarning) MarshalJSON() ([]byte, error) {
  6846. type NoMethod ExchangedPeeringRoutesListWarning
  6847. raw := NoMethod(*s)
  6848. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6849. }
  6850. type ExchangedPeeringRoutesListWarningData struct {
  6851. // Key: [Output Only] A key that provides more detail on the warning
  6852. // being returned. For example, for warnings where there are no results
  6853. // in a list request for a particular zone, this key might be scope and
  6854. // the key value might be the zone name. Other examples might be a key
  6855. // indicating a deprecated resource and a suggested replacement, or a
  6856. // warning about invalid network settings (for example, if an instance
  6857. // attempts to perform IP forwarding but is not enabled for IP
  6858. // forwarding).
  6859. Key string `json:"key,omitempty"`
  6860. // Value: [Output Only] A warning data value corresponding to the key.
  6861. Value string `json:"value,omitempty"`
  6862. // ForceSendFields is a list of field names (e.g. "Key") to
  6863. // unconditionally include in API requests. By default, fields with
  6864. // empty values are omitted from API requests. However, any non-pointer,
  6865. // non-interface field appearing in ForceSendFields will be sent to the
  6866. // server regardless of whether the field is empty or not. This may be
  6867. // used to include empty fields in Patch requests.
  6868. ForceSendFields []string `json:"-"`
  6869. // NullFields is a list of field names (e.g. "Key") to include in API
  6870. // requests with the JSON null value. By default, fields with empty
  6871. // values are omitted from API requests. However, any field with an
  6872. // empty value appearing in NullFields will be sent to the server as
  6873. // null. It is an error if a field in this list has a non-empty value.
  6874. // This may be used to include null fields in Patch requests.
  6875. NullFields []string `json:"-"`
  6876. }
  6877. func (s *ExchangedPeeringRoutesListWarningData) MarshalJSON() ([]byte, error) {
  6878. type NoMethod ExchangedPeeringRoutesListWarningData
  6879. raw := NoMethod(*s)
  6880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6881. }
  6882. // Expr: Represents an expression text. Example:
  6883. //
  6884. // title: "User account presence" description: "Determines whether the
  6885. // request has a user account" expression: "size(request.user) > 0"
  6886. type Expr struct {
  6887. // Description: An optional description of the expression. This is a
  6888. // longer text which describes the expression, e.g. when hovered over it
  6889. // in a UI.
  6890. Description string `json:"description,omitempty"`
  6891. // Expression: Textual representation of an expression in Common
  6892. // Expression Language syntax.
  6893. //
  6894. // The application context of the containing message determines which
  6895. // well-known feature set of CEL is supported.
  6896. Expression string `json:"expression,omitempty"`
  6897. // Location: An optional string indicating the location of the
  6898. // expression for error reporting, e.g. a file name and a position in
  6899. // the file.
  6900. Location string `json:"location,omitempty"`
  6901. // Title: An optional title for the expression, i.e. a short string
  6902. // describing its purpose. This can be used e.g. in UIs which allow to
  6903. // enter the expression.
  6904. Title string `json:"title,omitempty"`
  6905. // ForceSendFields is a list of field names (e.g. "Description") to
  6906. // unconditionally include in API requests. By default, fields with
  6907. // empty values are omitted from API requests. However, any non-pointer,
  6908. // non-interface field appearing in ForceSendFields will be sent to the
  6909. // server regardless of whether the field is empty or not. This may be
  6910. // used to include empty fields in Patch requests.
  6911. ForceSendFields []string `json:"-"`
  6912. // NullFields is a list of field names (e.g. "Description") to include
  6913. // in API requests with the JSON null value. By default, fields with
  6914. // empty values are omitted from API requests. However, any field with
  6915. // an empty value appearing in NullFields will be sent to the server as
  6916. // null. It is an error if a field in this list has a non-empty value.
  6917. // This may be used to include null fields in Patch requests.
  6918. NullFields []string `json:"-"`
  6919. }
  6920. func (s *Expr) MarshalJSON() ([]byte, error) {
  6921. type NoMethod Expr
  6922. raw := NoMethod(*s)
  6923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6924. }
  6925. // ExternalVpnGateway: External VPN gateway is the on-premises VPN
  6926. // gateway(s) or another cloud provider?s VPN gateway that connects to
  6927. // your Google Cloud VPN gateway. To create a highly available VPN from
  6928. // Google Cloud to your on-premises side or another Cloud provider's VPN
  6929. // gateway, you must create a external VPN gateway resource in GCP,
  6930. // which provides the information to GCP about your external VPN
  6931. // gateway.
  6932. type ExternalVpnGateway struct {
  6933. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6934. // format.
  6935. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6936. // Description: An optional description of this resource. Provide this
  6937. // property when you create the resource.
  6938. Description string `json:"description,omitempty"`
  6939. // Id: [Output Only] The unique identifier for the resource. This
  6940. // identifier is defined by the server.
  6941. Id uint64 `json:"id,omitempty,string"`
  6942. // Interfaces: List of interfaces for this external VPN gateway.
  6943. Interfaces []*ExternalVpnGatewayInterface `json:"interfaces,omitempty"`
  6944. // Kind: [Output Only] Type of the resource. Always
  6945. // compute#externalVpnGateway for externalVpnGateways.
  6946. Kind string `json:"kind,omitempty"`
  6947. // LabelFingerprint: A fingerprint for the labels being applied to this
  6948. // ExternalVpnGateway, which is essentially a hash of the labels set
  6949. // used for optimistic locking. The fingerprint is initially generated
  6950. // by Compute Engine and changes after every request to modify or update
  6951. // labels. You must always provide an up-to-date fingerprint hash in
  6952. // order to update or change labels, otherwise the request will fail
  6953. // with error 412 conditionNotMet.
  6954. //
  6955. // To see the latest fingerprint, make a get() request to retrieve an
  6956. // ExternalVpnGateway.
  6957. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  6958. // Labels: Labels to apply to this ExternalVpnGateway resource. These
  6959. // can be later modified by the setLabels method. Each label key/value
  6960. // must comply with RFC1035. Label values may be empty.
  6961. Labels map[string]string `json:"labels,omitempty"`
  6962. // Name: Name of the resource. Provided by the client when the resource
  6963. // is created. The name must be 1-63 characters long, and comply with
  6964. // RFC1035. Specifically, the name must be 1-63 characters long and
  6965. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6966. // the first character must be a lowercase letter, and all following
  6967. // characters must be a dash, lowercase letter, or digit, except the
  6968. // last character, which cannot be a dash.
  6969. Name string `json:"name,omitempty"`
  6970. // RedundancyType: Indicates the user-supplied redundancy type of this
  6971. // external VPN gateway.
  6972. //
  6973. // Possible values:
  6974. // "FOUR_IPS_REDUNDANCY"
  6975. // "SINGLE_IP_INTERNALLY_REDUNDANT"
  6976. // "TWO_IPS_REDUNDANCY"
  6977. RedundancyType string `json:"redundancyType,omitempty"`
  6978. // SelfLink: [Output Only] Server-defined URL for the resource.
  6979. SelfLink string `json:"selfLink,omitempty"`
  6980. // ServerResponse contains the HTTP response code and headers from the
  6981. // server.
  6982. googleapi.ServerResponse `json:"-"`
  6983. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6984. // to unconditionally include in API requests. By default, fields with
  6985. // empty values are omitted from API requests. However, any non-pointer,
  6986. // non-interface field appearing in ForceSendFields will be sent to the
  6987. // server regardless of whether the field is empty or not. This may be
  6988. // used to include empty fields in Patch requests.
  6989. ForceSendFields []string `json:"-"`
  6990. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  6991. // include in API requests with the JSON null value. By default, fields
  6992. // with empty values are omitted from API requests. However, any field
  6993. // with an empty value appearing in NullFields will be sent to the
  6994. // server as null. It is an error if a field in this list has a
  6995. // non-empty value. This may be used to include null fields in Patch
  6996. // requests.
  6997. NullFields []string `json:"-"`
  6998. }
  6999. func (s *ExternalVpnGateway) MarshalJSON() ([]byte, error) {
  7000. type NoMethod ExternalVpnGateway
  7001. raw := NoMethod(*s)
  7002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7003. }
  7004. // ExternalVpnGatewayInterface: The interface for the external VPN
  7005. // gateway.
  7006. type ExternalVpnGatewayInterface struct {
  7007. // Id: The numeric ID of this interface. The allowed input values for
  7008. // this id for different redundancy types of external VPN gateway:
  7009. // SINGLE_IP_INTERNALLY_REDUNDANT - 0 TWO_IPS_REDUNDANCY - 0, 1
  7010. // FOUR_IPS_REDUNDANCY - 0, 1, 2, 3
  7011. Id int64 `json:"id,omitempty"`
  7012. // IpAddress: IP address of the interface in the external VPN gateway.
  7013. // Only IPv4 is supported. This IP address can be either from your
  7014. // on-premise gateway or another Cloud provider?s VPN gateway, it cannot
  7015. // be an IP address from Google Compute Engine.
  7016. IpAddress string `json:"ipAddress,omitempty"`
  7017. // ForceSendFields is a list of field names (e.g. "Id") to
  7018. // unconditionally include in API requests. By default, fields with
  7019. // empty values are omitted from API requests. However, any non-pointer,
  7020. // non-interface field appearing in ForceSendFields will be sent to the
  7021. // server regardless of whether the field is empty or not. This may be
  7022. // used to include empty fields in Patch requests.
  7023. ForceSendFields []string `json:"-"`
  7024. // NullFields is a list of field names (e.g. "Id") to include in API
  7025. // requests with the JSON null value. By default, fields with empty
  7026. // values are omitted from API requests. However, any field with an
  7027. // empty value appearing in NullFields will be sent to the server as
  7028. // null. It is an error if a field in this list has a non-empty value.
  7029. // This may be used to include null fields in Patch requests.
  7030. NullFields []string `json:"-"`
  7031. }
  7032. func (s *ExternalVpnGatewayInterface) MarshalJSON() ([]byte, error) {
  7033. type NoMethod ExternalVpnGatewayInterface
  7034. raw := NoMethod(*s)
  7035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7036. }
  7037. // ExternalVpnGatewayList: Response to the list request, and contains a
  7038. // list of externalVpnGateways.
  7039. type ExternalVpnGatewayList struct {
  7040. Etag string `json:"etag,omitempty"`
  7041. // Id: [Output Only] Unique identifier for the resource; defined by the
  7042. // server.
  7043. Id string `json:"id,omitempty"`
  7044. // Items: A list of ExternalVpnGateway resources.
  7045. Items []*ExternalVpnGateway `json:"items,omitempty"`
  7046. // Kind: [Output Only] Type of resource. Always
  7047. // compute#externalVpnGatewayList for lists of externalVpnGateways.
  7048. Kind string `json:"kind,omitempty"`
  7049. // NextPageToken: [Output Only] This token allows you to get the next
  7050. // page of results for list requests. If the number of results is larger
  7051. // than maxResults, use the nextPageToken as a value for the query
  7052. // parameter pageToken in the next list request. Subsequent list
  7053. // requests will have their own nextPageToken to continue paging through
  7054. // the results.
  7055. NextPageToken string `json:"nextPageToken,omitempty"`
  7056. // SelfLink: [Output Only] Server-defined URL for this resource.
  7057. SelfLink string `json:"selfLink,omitempty"`
  7058. // Warning: [Output Only] Informational warning message.
  7059. Warning *ExternalVpnGatewayListWarning `json:"warning,omitempty"`
  7060. // ServerResponse contains the HTTP response code and headers from the
  7061. // server.
  7062. googleapi.ServerResponse `json:"-"`
  7063. // ForceSendFields is a list of field names (e.g. "Etag") to
  7064. // unconditionally include in API requests. By default, fields with
  7065. // empty values are omitted from API requests. However, any non-pointer,
  7066. // non-interface field appearing in ForceSendFields will be sent to the
  7067. // server regardless of whether the field is empty or not. This may be
  7068. // used to include empty fields in Patch requests.
  7069. ForceSendFields []string `json:"-"`
  7070. // NullFields is a list of field names (e.g. "Etag") to include in API
  7071. // requests with the JSON null value. By default, fields with empty
  7072. // values are omitted from API requests. However, any field with an
  7073. // empty value appearing in NullFields will be sent to the server as
  7074. // null. It is an error if a field in this list has a non-empty value.
  7075. // This may be used to include null fields in Patch requests.
  7076. NullFields []string `json:"-"`
  7077. }
  7078. func (s *ExternalVpnGatewayList) MarshalJSON() ([]byte, error) {
  7079. type NoMethod ExternalVpnGatewayList
  7080. raw := NoMethod(*s)
  7081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7082. }
  7083. // ExternalVpnGatewayListWarning: [Output Only] Informational warning
  7084. // message.
  7085. type ExternalVpnGatewayListWarning struct {
  7086. // Code: [Output Only] A warning code, if applicable. For example,
  7087. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7088. // the response.
  7089. //
  7090. // Possible values:
  7091. // "CLEANUP_FAILED"
  7092. // "DEPRECATED_RESOURCE_USED"
  7093. // "DEPRECATED_TYPE_USED"
  7094. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7095. // "EXPERIMENTAL_TYPE_USED"
  7096. // "EXTERNAL_API_WARNING"
  7097. // "FIELD_VALUE_OVERRIDEN"
  7098. // "INJECTED_KERNELS_DEPRECATED"
  7099. // "MISSING_TYPE_DEPENDENCY"
  7100. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7101. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7102. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7103. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7104. // "NEXT_HOP_NOT_RUNNING"
  7105. // "NOT_CRITICAL_ERROR"
  7106. // "NO_RESULTS_ON_PAGE"
  7107. // "REQUIRED_TOS_AGREEMENT"
  7108. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7109. // "RESOURCE_NOT_DELETED"
  7110. // "SCHEMA_VALIDATION_IGNORED"
  7111. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7112. // "UNDECLARED_PROPERTIES"
  7113. // "UNREACHABLE"
  7114. Code string `json:"code,omitempty"`
  7115. // Data: [Output Only] Metadata about this warning in key: value format.
  7116. // For example:
  7117. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7118. Data []*ExternalVpnGatewayListWarningData `json:"data,omitempty"`
  7119. // Message: [Output Only] A human-readable description of the warning
  7120. // code.
  7121. Message string `json:"message,omitempty"`
  7122. // ForceSendFields is a list of field names (e.g. "Code") to
  7123. // unconditionally include in API requests. By default, fields with
  7124. // empty values are omitted from API requests. However, any non-pointer,
  7125. // non-interface field appearing in ForceSendFields will be sent to the
  7126. // server regardless of whether the field is empty or not. This may be
  7127. // used to include empty fields in Patch requests.
  7128. ForceSendFields []string `json:"-"`
  7129. // NullFields is a list of field names (e.g. "Code") to include in API
  7130. // requests with the JSON null value. By default, fields with empty
  7131. // values are omitted from API requests. However, any field with an
  7132. // empty value appearing in NullFields will be sent to the server as
  7133. // null. It is an error if a field in this list has a non-empty value.
  7134. // This may be used to include null fields in Patch requests.
  7135. NullFields []string `json:"-"`
  7136. }
  7137. func (s *ExternalVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  7138. type NoMethod ExternalVpnGatewayListWarning
  7139. raw := NoMethod(*s)
  7140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7141. }
  7142. type ExternalVpnGatewayListWarningData struct {
  7143. // Key: [Output Only] A key that provides more detail on the warning
  7144. // being returned. For example, for warnings where there are no results
  7145. // in a list request for a particular zone, this key might be scope and
  7146. // the key value might be the zone name. Other examples might be a key
  7147. // indicating a deprecated resource and a suggested replacement, or a
  7148. // warning about invalid network settings (for example, if an instance
  7149. // attempts to perform IP forwarding but is not enabled for IP
  7150. // forwarding).
  7151. Key string `json:"key,omitempty"`
  7152. // Value: [Output Only] A warning data value corresponding to the key.
  7153. Value string `json:"value,omitempty"`
  7154. // ForceSendFields is a list of field names (e.g. "Key") to
  7155. // unconditionally include in API requests. By default, fields with
  7156. // empty values are omitted from API requests. However, any non-pointer,
  7157. // non-interface field appearing in ForceSendFields will be sent to the
  7158. // server regardless of whether the field is empty or not. This may be
  7159. // used to include empty fields in Patch requests.
  7160. ForceSendFields []string `json:"-"`
  7161. // NullFields is a list of field names (e.g. "Key") to include in API
  7162. // requests with the JSON null value. By default, fields with empty
  7163. // values are omitted from API requests. However, any field with an
  7164. // empty value appearing in NullFields will be sent to the server as
  7165. // null. It is an error if a field in this list has a non-empty value.
  7166. // This may be used to include null fields in Patch requests.
  7167. NullFields []string `json:"-"`
  7168. }
  7169. func (s *ExternalVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  7170. type NoMethod ExternalVpnGatewayListWarningData
  7171. raw := NoMethod(*s)
  7172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7173. }
  7174. // Firewall: Represents a Firewall resource.
  7175. type Firewall struct {
  7176. // Allowed: The list of ALLOW rules specified by this firewall. Each
  7177. // rule specifies a protocol and port-range tuple that describes a
  7178. // permitted connection.
  7179. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  7180. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7181. // format.
  7182. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7183. // Denied: The list of DENY rules specified by this firewall. Each rule
  7184. // specifies a protocol and port-range tuple that describes a denied
  7185. // connection.
  7186. Denied []*FirewallDenied `json:"denied,omitempty"`
  7187. // Description: An optional description of this resource. Provide this
  7188. // property when you create the resource.
  7189. Description string `json:"description,omitempty"`
  7190. // DestinationRanges: If destination ranges are specified, the firewall
  7191. // will apply only to traffic that has destination IP address in these
  7192. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  7193. // supported.
  7194. DestinationRanges []string `json:"destinationRanges,omitempty"`
  7195. // Direction: Direction of traffic to which this firewall applies;
  7196. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  7197. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  7198. // specify sourceRanges OR sourceTags.
  7199. //
  7200. // Possible values:
  7201. // "EGRESS"
  7202. // "INGRESS"
  7203. Direction string `json:"direction,omitempty"`
  7204. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  7205. // applied to the network it is associated with. When set to true, the
  7206. // firewall rule is not enforced and the network behaves as if it did
  7207. // not exist. If this is unspecified, the firewall rule will be enabled.
  7208. Disabled bool `json:"disabled,omitempty"`
  7209. // EnableLogging: Deprecated in favor of enable in LogConfig. This field
  7210. // denotes whether to enable logging for a particular firewall rule. If
  7211. // logging is enabled, logs will be exported to Stackdriver.
  7212. EnableLogging bool `json:"enableLogging,omitempty"`
  7213. // Id: [Output Only] The unique identifier for the resource. This
  7214. // identifier is defined by the server.
  7215. Id uint64 `json:"id,omitempty,string"`
  7216. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  7217. // firewall rules.
  7218. Kind string `json:"kind,omitempty"`
  7219. // LogConfig: This field denotes the logging options for a particular
  7220. // firewall rule. If logging is enabled, logs will be exported to
  7221. // Stackdriver.
  7222. LogConfig *FirewallLogConfig `json:"logConfig,omitempty"`
  7223. // Name: Name of the resource; provided by the client when the resource
  7224. // is created. The name must be 1-63 characters long, and comply with
  7225. // RFC1035. Specifically, the name must be 1-63 characters long and
  7226. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7227. // the first character must be a lowercase letter, and all following
  7228. // characters must be a dash, lowercase letter, or digit, except the
  7229. // last character, which cannot be a dash.
  7230. Name string `json:"name,omitempty"`
  7231. // Network: URL of the network resource for this firewall rule. If not
  7232. // specified when creating a firewall rule, the default network is
  7233. // used:
  7234. // global/networks/default
  7235. // If you choose to specify this property, you can specify the network
  7236. // as a full or partial URL. For example, the following are all valid
  7237. // URLs:
  7238. // -
  7239. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  7240. // - projects/myproject/global/networks/my-network
  7241. // - global/networks/default
  7242. Network string `json:"network,omitempty"`
  7243. // Priority: Priority for this rule. This is an integer between 0 and
  7244. // 65535, both inclusive. When not specified, the value assumed is 1000.
  7245. // Relative priorities determine precedence of conflicting rules. Lower
  7246. // value of priority implies higher precedence (eg, a rule with priority
  7247. // 0 has higher precedence than a rule with priority 1). DENY rules take
  7248. // precedence over ALLOW rules having equal priority.
  7249. Priority int64 `json:"priority,omitempty"`
  7250. // SelfLink: [Output Only] Server-defined URL for the resource.
  7251. SelfLink string `json:"selfLink,omitempty"`
  7252. // SourceRanges: If source ranges are specified, the firewall will apply
  7253. // only to traffic that has source IP address in these ranges. These
  7254. // ranges must be expressed in CIDR format. One or both of sourceRanges
  7255. // and sourceTags may be set. If both properties are set, the firewall
  7256. // will apply to traffic that has source IP address within sourceRanges
  7257. // OR the source IP that belongs to a tag listed in the sourceTags
  7258. // property. The connection does not need to match both properties for
  7259. // the firewall to apply. Only IPv4 is supported.
  7260. SourceRanges []string `json:"sourceRanges,omitempty"`
  7261. // SourceServiceAccounts: If source service accounts are specified, the
  7262. // firewall will apply only to traffic originating from an instance with
  7263. // a service account in this list. Source service accounts cannot be
  7264. // used to control traffic to an instance's external IP address because
  7265. // service accounts are associated with an instance, not an IP address.
  7266. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  7267. // both are set, the firewall will apply to traffic that has source IP
  7268. // address within sourceRanges OR the source IP belongs to an instance
  7269. // with service account listed in sourceServiceAccount. The connection
  7270. // does not need to match both properties for the firewall to apply.
  7271. // sourceServiceAccounts cannot be used at the same time as sourceTags
  7272. // or targetTags.
  7273. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  7274. // SourceTags: If source tags are specified, the firewall rule applies
  7275. // only to traffic with source IPs that match the primary network
  7276. // interfaces of VM instances that have the tag and are in the same VPC
  7277. // network. Source tags cannot be used to control traffic to an
  7278. // instance's external IP address, it only applies to traffic between
  7279. // instances in the same virtual network. Because tags are associated
  7280. // with instances, not IP addresses. One or both of sourceRanges and
  7281. // sourceTags may be set. If both properties are set, the firewall will
  7282. // apply to traffic that has source IP address within sourceRanges OR
  7283. // the source IP that belongs to a tag listed in the sourceTags
  7284. // property. The connection does not need to match both properties for
  7285. // the firewall to apply.
  7286. SourceTags []string `json:"sourceTags,omitempty"`
  7287. // TargetServiceAccounts: A list of service accounts indicating sets of
  7288. // instances located in the network that may make network connections as
  7289. // specified in allowed[]. targetServiceAccounts cannot be used at the
  7290. // same time as targetTags or sourceTags. If neither
  7291. // targetServiceAccounts nor targetTags are specified, the firewall rule
  7292. // applies to all instances on the specified network.
  7293. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  7294. // TargetTags: A list of tags that controls which instances the firewall
  7295. // rule applies to. If targetTags are specified, then the firewall rule
  7296. // applies only to instances in the VPC network that have one of those
  7297. // tags. If no targetTags are specified, the firewall rule applies to
  7298. // all instances on the specified network.
  7299. TargetTags []string `json:"targetTags,omitempty"`
  7300. // ServerResponse contains the HTTP response code and headers from the
  7301. // server.
  7302. googleapi.ServerResponse `json:"-"`
  7303. // ForceSendFields is a list of field names (e.g. "Allowed") to
  7304. // unconditionally include in API requests. By default, fields with
  7305. // empty values are omitted from API requests. However, any non-pointer,
  7306. // non-interface field appearing in ForceSendFields will be sent to the
  7307. // server regardless of whether the field is empty or not. This may be
  7308. // used to include empty fields in Patch requests.
  7309. ForceSendFields []string `json:"-"`
  7310. // NullFields is a list of field names (e.g. "Allowed") to include in
  7311. // API requests with the JSON null value. By default, fields with empty
  7312. // values are omitted from API requests. However, any field with an
  7313. // empty value appearing in NullFields will be sent to the server as
  7314. // null. It is an error if a field in this list has a non-empty value.
  7315. // This may be used to include null fields in Patch requests.
  7316. NullFields []string `json:"-"`
  7317. }
  7318. func (s *Firewall) MarshalJSON() ([]byte, error) {
  7319. type NoMethod Firewall
  7320. raw := NoMethod(*s)
  7321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7322. }
  7323. type FirewallAllowed struct {
  7324. // IPProtocol: The IP protocol to which this rule applies. The protocol
  7325. // type is required when creating a firewall rule. This value can either
  7326. // be one of the following well known protocol strings (tcp, udp, icmp,
  7327. // esp, ah, ipip, sctp), or the IP protocol number.
  7328. IPProtocol string `json:"IPProtocol,omitempty"`
  7329. // Ports: An optional list of ports to which this rule applies. This
  7330. // field is only applicable for UDP or TCP protocol. Each entry must be
  7331. // either an integer or a range. If not specified, this rule applies to
  7332. // connections through any port.
  7333. //
  7334. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  7335. Ports []string `json:"ports,omitempty"`
  7336. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  7337. // unconditionally include in API requests. By default, fields with
  7338. // empty values are omitted from API requests. However, any non-pointer,
  7339. // non-interface field appearing in ForceSendFields will be sent to the
  7340. // server regardless of whether the field is empty or not. This may be
  7341. // used to include empty fields in Patch requests.
  7342. ForceSendFields []string `json:"-"`
  7343. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  7344. // API requests with the JSON null value. By default, fields with empty
  7345. // values are omitted from API requests. However, any field with an
  7346. // empty value appearing in NullFields will be sent to the server as
  7347. // null. It is an error if a field in this list has a non-empty value.
  7348. // This may be used to include null fields in Patch requests.
  7349. NullFields []string `json:"-"`
  7350. }
  7351. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  7352. type NoMethod FirewallAllowed
  7353. raw := NoMethod(*s)
  7354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7355. }
  7356. type FirewallDenied struct {
  7357. // IPProtocol: The IP protocol to which this rule applies. The protocol
  7358. // type is required when creating a firewall rule. This value can either
  7359. // be one of the following well known protocol strings (tcp, udp, icmp,
  7360. // esp, ah, ipip, sctp), or the IP protocol number.
  7361. IPProtocol string `json:"IPProtocol,omitempty"`
  7362. // Ports: An optional list of ports to which this rule applies. This
  7363. // field is only applicable for UDP or TCP protocol. Each entry must be
  7364. // either an integer or a range. If not specified, this rule applies to
  7365. // connections through any port.
  7366. //
  7367. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  7368. Ports []string `json:"ports,omitempty"`
  7369. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  7370. // unconditionally include in API requests. By default, fields with
  7371. // empty values are omitted from API requests. However, any non-pointer,
  7372. // non-interface field appearing in ForceSendFields will be sent to the
  7373. // server regardless of whether the field is empty or not. This may be
  7374. // used to include empty fields in Patch requests.
  7375. ForceSendFields []string `json:"-"`
  7376. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  7377. // API requests with the JSON null value. By default, fields with empty
  7378. // values are omitted from API requests. However, any field with an
  7379. // empty value appearing in NullFields will be sent to the server as
  7380. // null. It is an error if a field in this list has a non-empty value.
  7381. // This may be used to include null fields in Patch requests.
  7382. NullFields []string `json:"-"`
  7383. }
  7384. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  7385. type NoMethod FirewallDenied
  7386. raw := NoMethod(*s)
  7387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7388. }
  7389. // FirewallList: Contains a list of firewalls.
  7390. type FirewallList struct {
  7391. // Id: [Output Only] Unique identifier for the resource; defined by the
  7392. // server.
  7393. Id string `json:"id,omitempty"`
  7394. // Items: A list of Firewall resources.
  7395. Items []*Firewall `json:"items,omitempty"`
  7396. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  7397. // lists of firewalls.
  7398. Kind string `json:"kind,omitempty"`
  7399. // NextPageToken: [Output Only] This token allows you to get the next
  7400. // page of results for list requests. If the number of results is larger
  7401. // than maxResults, use the nextPageToken as a value for the query
  7402. // parameter pageToken in the next list request. Subsequent list
  7403. // requests will have their own nextPageToken to continue paging through
  7404. // the results.
  7405. NextPageToken string `json:"nextPageToken,omitempty"`
  7406. // SelfLink: [Output Only] Server-defined URL for this resource.
  7407. SelfLink string `json:"selfLink,omitempty"`
  7408. // Warning: [Output Only] Informational warning message.
  7409. Warning *FirewallListWarning `json:"warning,omitempty"`
  7410. // ServerResponse contains the HTTP response code and headers from the
  7411. // server.
  7412. googleapi.ServerResponse `json:"-"`
  7413. // ForceSendFields is a list of field names (e.g. "Id") to
  7414. // unconditionally include in API requests. By default, fields with
  7415. // empty values are omitted from API requests. However, any non-pointer,
  7416. // non-interface field appearing in ForceSendFields will be sent to the
  7417. // server regardless of whether the field is empty or not. This may be
  7418. // used to include empty fields in Patch requests.
  7419. ForceSendFields []string `json:"-"`
  7420. // NullFields is a list of field names (e.g. "Id") to include in API
  7421. // requests with the JSON null value. By default, fields with empty
  7422. // values are omitted from API requests. However, any field with an
  7423. // empty value appearing in NullFields will be sent to the server as
  7424. // null. It is an error if a field in this list has a non-empty value.
  7425. // This may be used to include null fields in Patch requests.
  7426. NullFields []string `json:"-"`
  7427. }
  7428. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  7429. type NoMethod FirewallList
  7430. raw := NoMethod(*s)
  7431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7432. }
  7433. // FirewallListWarning: [Output Only] Informational warning message.
  7434. type FirewallListWarning struct {
  7435. // Code: [Output Only] A warning code, if applicable. For example,
  7436. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7437. // the response.
  7438. //
  7439. // Possible values:
  7440. // "CLEANUP_FAILED"
  7441. // "DEPRECATED_RESOURCE_USED"
  7442. // "DEPRECATED_TYPE_USED"
  7443. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7444. // "EXPERIMENTAL_TYPE_USED"
  7445. // "EXTERNAL_API_WARNING"
  7446. // "FIELD_VALUE_OVERRIDEN"
  7447. // "INJECTED_KERNELS_DEPRECATED"
  7448. // "MISSING_TYPE_DEPENDENCY"
  7449. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7450. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7451. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7452. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7453. // "NEXT_HOP_NOT_RUNNING"
  7454. // "NOT_CRITICAL_ERROR"
  7455. // "NO_RESULTS_ON_PAGE"
  7456. // "REQUIRED_TOS_AGREEMENT"
  7457. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7458. // "RESOURCE_NOT_DELETED"
  7459. // "SCHEMA_VALIDATION_IGNORED"
  7460. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7461. // "UNDECLARED_PROPERTIES"
  7462. // "UNREACHABLE"
  7463. Code string `json:"code,omitempty"`
  7464. // Data: [Output Only] Metadata about this warning in key: value format.
  7465. // For example:
  7466. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7467. Data []*FirewallListWarningData `json:"data,omitempty"`
  7468. // Message: [Output Only] A human-readable description of the warning
  7469. // code.
  7470. Message string `json:"message,omitempty"`
  7471. // ForceSendFields is a list of field names (e.g. "Code") to
  7472. // unconditionally include in API requests. By default, fields with
  7473. // empty values are omitted from API requests. However, any non-pointer,
  7474. // non-interface field appearing in ForceSendFields will be sent to the
  7475. // server regardless of whether the field is empty or not. This may be
  7476. // used to include empty fields in Patch requests.
  7477. ForceSendFields []string `json:"-"`
  7478. // NullFields is a list of field names (e.g. "Code") to include in API
  7479. // requests with the JSON null value. By default, fields with empty
  7480. // values are omitted from API requests. However, any field with an
  7481. // empty value appearing in NullFields will be sent to the server as
  7482. // null. It is an error if a field in this list has a non-empty value.
  7483. // This may be used to include null fields in Patch requests.
  7484. NullFields []string `json:"-"`
  7485. }
  7486. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  7487. type NoMethod FirewallListWarning
  7488. raw := NoMethod(*s)
  7489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7490. }
  7491. type FirewallListWarningData struct {
  7492. // Key: [Output Only] A key that provides more detail on the warning
  7493. // being returned. For example, for warnings where there are no results
  7494. // in a list request for a particular zone, this key might be scope and
  7495. // the key value might be the zone name. Other examples might be a key
  7496. // indicating a deprecated resource and a suggested replacement, or a
  7497. // warning about invalid network settings (for example, if an instance
  7498. // attempts to perform IP forwarding but is not enabled for IP
  7499. // forwarding).
  7500. Key string `json:"key,omitempty"`
  7501. // Value: [Output Only] A warning data value corresponding to the key.
  7502. Value string `json:"value,omitempty"`
  7503. // ForceSendFields is a list of field names (e.g. "Key") to
  7504. // unconditionally include in API requests. By default, fields with
  7505. // empty values are omitted from API requests. However, any non-pointer,
  7506. // non-interface field appearing in ForceSendFields will be sent to the
  7507. // server regardless of whether the field is empty or not. This may be
  7508. // used to include empty fields in Patch requests.
  7509. ForceSendFields []string `json:"-"`
  7510. // NullFields is a list of field names (e.g. "Key") to include in API
  7511. // requests with the JSON null value. By default, fields with empty
  7512. // values are omitted from API requests. However, any field with an
  7513. // empty value appearing in NullFields will be sent to the server as
  7514. // null. It is an error if a field in this list has a non-empty value.
  7515. // This may be used to include null fields in Patch requests.
  7516. NullFields []string `json:"-"`
  7517. }
  7518. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  7519. type NoMethod FirewallListWarningData
  7520. raw := NoMethod(*s)
  7521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7522. }
  7523. // FirewallLogConfig: The available logging options for a firewall rule.
  7524. type FirewallLogConfig struct {
  7525. // Enable: This field denotes whether to enable logging for a particular
  7526. // firewall rule.
  7527. Enable bool `json:"enable,omitempty"`
  7528. // ForceSendFields is a list of field names (e.g. "Enable") to
  7529. // unconditionally include in API requests. By default, fields with
  7530. // empty values are omitted from API requests. However, any non-pointer,
  7531. // non-interface field appearing in ForceSendFields will be sent to the
  7532. // server regardless of whether the field is empty or not. This may be
  7533. // used to include empty fields in Patch requests.
  7534. ForceSendFields []string `json:"-"`
  7535. // NullFields is a list of field names (e.g. "Enable") to include in API
  7536. // requests with the JSON null value. By default, fields with empty
  7537. // values are omitted from API requests. However, any field with an
  7538. // empty value appearing in NullFields will be sent to the server as
  7539. // null. It is an error if a field in this list has a non-empty value.
  7540. // This may be used to include null fields in Patch requests.
  7541. NullFields []string `json:"-"`
  7542. }
  7543. func (s *FirewallLogConfig) MarshalJSON() ([]byte, error) {
  7544. type NoMethod FirewallLogConfig
  7545. raw := NoMethod(*s)
  7546. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7547. }
  7548. // FixedOrPercent: Encapsulates numeric value that can be either
  7549. // absolute or relative.
  7550. type FixedOrPercent struct {
  7551. // Calculated: [Output Only] Absolute value of VM instances calculated
  7552. // based on the specific mode.
  7553. //
  7554. //
  7555. // - If the value is fixed, then the caculated value is equal to the
  7556. // fixed value.
  7557. // - If the value is a percent, then the calculated value is percent/100
  7558. // * targetSize. For example, the calculated value of a 80% of a managed
  7559. // instance group with 150 instances would be (80/100 * 150) = 120 VM
  7560. // instances. If there is a remainder, the number is rounded up.
  7561. Calculated int64 `json:"calculated,omitempty"`
  7562. // Fixed: Specifies a fixed number of VM instances. This must be a
  7563. // positive integer.
  7564. Fixed int64 `json:"fixed,omitempty"`
  7565. // Percent: Specifies a percentage of instances between 0 to 100%,
  7566. // inclusive. For example, specify 80 for 80%.
  7567. Percent int64 `json:"percent,omitempty"`
  7568. // ForceSendFields is a list of field names (e.g. "Calculated") to
  7569. // unconditionally include in API requests. By default, fields with
  7570. // empty values are omitted from API requests. However, any non-pointer,
  7571. // non-interface field appearing in ForceSendFields will be sent to the
  7572. // server regardless of whether the field is empty or not. This may be
  7573. // used to include empty fields in Patch requests.
  7574. ForceSendFields []string `json:"-"`
  7575. // NullFields is a list of field names (e.g. "Calculated") to include in
  7576. // API requests with the JSON null value. By default, fields with empty
  7577. // values are omitted from API requests. However, any field with an
  7578. // empty value appearing in NullFields will be sent to the server as
  7579. // null. It is an error if a field in this list has a non-empty value.
  7580. // This may be used to include null fields in Patch requests.
  7581. NullFields []string `json:"-"`
  7582. }
  7583. func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
  7584. type NoMethod FixedOrPercent
  7585. raw := NoMethod(*s)
  7586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7587. }
  7588. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  7589. // specifies which pool of target virtual machines to forward a packet
  7590. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  7591. // resource_for beta.forwardingRules ==) (== resource_for
  7592. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  7593. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  7594. // beta.regionForwardingRules ==) (== resource_for
  7595. // v1.regionForwardingRules ==)
  7596. type ForwardingRule struct {
  7597. // IPAddress: The IP address that this forwarding rule is serving on
  7598. // behalf of.
  7599. //
  7600. // Addresses are restricted based on the forwarding rule's load
  7601. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  7602. // regional).
  7603. //
  7604. // When the load balancing scheme is EXTERNAL, for global forwarding
  7605. // rules, the address must be a global IP, and for regional forwarding
  7606. // rules, the address must live in the same region as the forwarding
  7607. // rule. If this field is empty, an ephemeral IPv4 address from the same
  7608. // scope (global or regional) will be assigned. A regional forwarding
  7609. // rule supports IPv4 only. A global forwarding rule supports either
  7610. // IPv4 or IPv6.
  7611. //
  7612. // When the load balancing scheme is INTERNAL_SELF_MANAGED, this must be
  7613. // a URL reference to an existing Address resource ( internal regional
  7614. // static IP address), with a purpose of GCE_END_POINT and address_type
  7615. // of INTERNAL.
  7616. //
  7617. // When the load balancing scheme is INTERNAL, this can only be an RFC
  7618. // 1918 IP address belonging to the network/subnet configured for the
  7619. // forwarding rule. By default, if this field is empty, an ephemeral
  7620. // internal IP address will be automatically allocated from the IP range
  7621. // of the subnet or network configured for this forwarding rule.
  7622. //
  7623. // An address can be specified either by a literal IP address or a URL
  7624. // reference to an existing Address resource. The following examples are
  7625. // all valid:
  7626. // - 100.1.2.3
  7627. // -
  7628. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  7629. // - projects/project/regions/region/addresses/address
  7630. // - regions/region/addresses/address
  7631. // - global/addresses/address
  7632. // - address
  7633. IPAddress string `json:"IPAddress,omitempty"`
  7634. // IPProtocol: The IP protocol to which this rule applies. Valid options
  7635. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  7636. //
  7637. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  7638. // valid. When the load balancing scheme is INTERNAL_SELF_MANAGED, only
  7639. // TCPis valid.
  7640. //
  7641. // Possible values:
  7642. // "AH"
  7643. // "ESP"
  7644. // "ICMP"
  7645. // "SCTP"
  7646. // "TCP"
  7647. // "UDP"
  7648. IPProtocol string `json:"IPProtocol,omitempty"`
  7649. // AllPorts: This field is used along with the backend_service field for
  7650. // internal load balancing or with the target field for internal
  7651. // TargetInstance. This field cannot be used with port or portRange
  7652. // fields.
  7653. //
  7654. // When the load balancing scheme is INTERNAL and protocol is TCP/UDP,
  7655. // specify this field to allow packets addressed to any ports will be
  7656. // forwarded to the backends configured with this forwarding rule.
  7657. AllPorts bool `json:"allPorts,omitempty"`
  7658. // AllowGlobalAccess: This field is used along with the backend_service
  7659. // field for internal load balancing or with the target field for
  7660. // internal TargetInstance. If the field is set to TRUE, clients can
  7661. // access ILB from all regions. Otherwise only allows access from
  7662. // clients in the same region as the internal load balancer.
  7663. AllowGlobalAccess bool `json:"allowGlobalAccess,omitempty"`
  7664. // BackendService: This field is only used for INTERNAL load
  7665. // balancing.
  7666. //
  7667. // For internal load balancing, this field identifies the BackendService
  7668. // resource to receive the matched traffic.
  7669. BackendService string `json:"backendService,omitempty"`
  7670. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7671. // format.
  7672. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7673. // Description: An optional description of this resource. Provide this
  7674. // property when you create the resource.
  7675. Description string `json:"description,omitempty"`
  7676. // Fingerprint: Fingerprint of this resource. A hash of the contents
  7677. // stored in this object. This field is used in optimistic locking. This
  7678. // field will be ignored when inserting a ForwardingRule. Include the
  7679. // fingerprint in patch request to ensure that you do not overwrite
  7680. // changes that were applied from another concurrent request.
  7681. //
  7682. // To see the latest fingerprint, make a get() request to retrieve a
  7683. // ForwardingRule.
  7684. Fingerprint string `json:"fingerprint,omitempty"`
  7685. // Id: [Output Only] The unique identifier for the resource. This
  7686. // identifier is defined by the server.
  7687. Id uint64 `json:"id,omitempty,string"`
  7688. // IpVersion: The IP Version that will be used by this forwarding rule.
  7689. // Valid options are IPV4 or IPV6. This can only be specified for an
  7690. // external global forwarding rule.
  7691. //
  7692. // Possible values:
  7693. // "IPV4"
  7694. // "IPV6"
  7695. // "UNSPECIFIED_VERSION"
  7696. IpVersion string `json:"ipVersion,omitempty"`
  7697. // Kind: [Output Only] Type of the resource. Always
  7698. // compute#forwardingRule for Forwarding Rule resources.
  7699. Kind string `json:"kind,omitempty"`
  7700. // LabelFingerprint: A fingerprint for the labels being applied to this
  7701. // resource, which is essentially a hash of the labels set used for
  7702. // optimistic locking. The fingerprint is initially generated by Compute
  7703. // Engine and changes after every request to modify or update labels.
  7704. // You must always provide an up-to-date fingerprint hash in order to
  7705. // update or change labels, otherwise the request will fail with error
  7706. // 412 conditionNotMet.
  7707. //
  7708. // To see the latest fingerprint, make a get() request to retrieve a
  7709. // ForwardingRule.
  7710. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7711. // Labels: Labels to apply to this resource. These can be later modified
  7712. // by the setLabels method. Each label key/value pair must comply with
  7713. // RFC1035. Label values may be empty.
  7714. Labels map[string]string `json:"labels,omitempty"`
  7715. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  7716. // used for and can only take the following values: INTERNAL,
  7717. // INTERNAL_SELF_MANAGED, EXTERNAL. The value of INTERNAL means that
  7718. // this will be used for Internal Network Load Balancing (TCP, UDP). The
  7719. // value of INTERNAL_SELF_MANAGED means that this will be used for
  7720. // Internal Global HTTP(S) LB. The value of EXTERNAL means that this
  7721. // will be used for External Load Balancing (HTTP(S) LB, External
  7722. // TCP/UDP LB, SSL Proxy)
  7723. //
  7724. // Possible values:
  7725. // "EXTERNAL"
  7726. // "INTERNAL"
  7727. // "INTERNAL_SELF_MANAGED"
  7728. // "INVALID"
  7729. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  7730. // Name: Name of the resource; provided by the client when the resource
  7731. // is created. The name must be 1-63 characters long, and comply with
  7732. // RFC1035. Specifically, the name must be 1-63 characters long and
  7733. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7734. // the first character must be a lowercase letter, and all following
  7735. // characters must be a dash, lowercase letter, or digit, except the
  7736. // last character, which cannot be a dash.
  7737. Name string `json:"name,omitempty"`
  7738. // Network: This field is not used for external load balancing.
  7739. //
  7740. // For INTERNAL and INTERNAL_SELF_MANAGED load balancing, this field
  7741. // identifies the network that the load balanced IP should belong to for
  7742. // this Forwarding Rule. If this field is not specified, the default
  7743. // network will be used.
  7744. Network string `json:"network,omitempty"`
  7745. // NetworkTier: This signifies the networking tier used for configuring
  7746. // this load balancer and can only take the following values: PREMIUM ,
  7747. // STANDARD.
  7748. //
  7749. // For regional ForwardingRule, the valid values are PREMIUM and
  7750. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  7751. //
  7752. // If this field is not specified, it is assumed to be PREMIUM. If
  7753. // IPAddress is specified, this value must be equal to the networkTier
  7754. // of the Address.
  7755. //
  7756. // Possible values:
  7757. // "PREMIUM"
  7758. // "STANDARD"
  7759. NetworkTier string `json:"networkTier,omitempty"`
  7760. // PortRange: This field is used along with the target field for
  7761. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  7762. // TargetVpnGateway, TargetPool, TargetInstance.
  7763. //
  7764. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  7765. // addressed to ports in the specified range will be forwarded to
  7766. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  7767. // must have disjoint port ranges.
  7768. //
  7769. // Some types of forwarding target have constraints on the acceptable
  7770. // ports:
  7771. // - TargetHttpProxy: 80, 8080
  7772. // - TargetHttpsProxy: 443
  7773. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  7774. // 995, 1688, 1883, 5222
  7775. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  7776. // 995, 1688, 1883, 5222
  7777. // - TargetVpnGateway: 500, 4500
  7778. PortRange string `json:"portRange,omitempty"`
  7779. // Ports: This field is used along with the backend_service field for
  7780. // internal load balancing.
  7781. //
  7782. // When the load balancing scheme is INTERNAL, a list of ports can be
  7783. // configured, for example, ['80'], ['8000','9000'] etc. Only packets
  7784. // addressed to these ports will be forwarded to the backends configured
  7785. // with this forwarding rule.
  7786. //
  7787. // You may specify a maximum of up to 5 ports.
  7788. Ports []string `json:"ports,omitempty"`
  7789. // Region: [Output Only] URL of the region where the regional forwarding
  7790. // rule resides. This field is not applicable to global forwarding
  7791. // rules. You must specify this field as part of the HTTP request URL.
  7792. // It is not settable as a field in the request body.
  7793. Region string `json:"region,omitempty"`
  7794. // SelfLink: [Output Only] Server-defined URL for the resource.
  7795. SelfLink string `json:"selfLink,omitempty"`
  7796. // ServiceLabel: An optional prefix to the service name for this
  7797. // Forwarding Rule. If specified, will be the first label of the fully
  7798. // qualified service name.
  7799. //
  7800. // The label must be 1-63 characters long, and comply with RFC1035.
  7801. // Specifically, the label must be 1-63 characters long and match the
  7802. // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  7803. // character must be a lowercase letter, and all following characters
  7804. // must be a dash, lowercase letter, or digit, except the last
  7805. // character, which cannot be a dash.
  7806. //
  7807. // This field is only used for internal load balancing.
  7808. ServiceLabel string `json:"serviceLabel,omitempty"`
  7809. // ServiceName: [Output Only] The internal fully qualified service name
  7810. // for this Forwarding Rule.
  7811. //
  7812. // This field is only used for internal load balancing.
  7813. ServiceName string `json:"serviceName,omitempty"`
  7814. // Subnetwork: This field is only used for INTERNAL load balancing.
  7815. //
  7816. // For internal load balancing, this field identifies the subnetwork
  7817. // that the load balanced IP should belong to for this Forwarding
  7818. // Rule.
  7819. //
  7820. // If the network specified is in auto subnet mode, this field is
  7821. // optional. However, if the network is in custom subnet mode, a
  7822. // subnetwork must be specified.
  7823. Subnetwork string `json:"subnetwork,omitempty"`
  7824. // Target: The URL of the target resource to receive the matched
  7825. // traffic. For regional forwarding rules, this target must live in the
  7826. // same region as the forwarding rule. For global forwarding rules, this
  7827. // target must be a global load balancing resource. The forwarded
  7828. // traffic must be of a type appropriate to the target object. For
  7829. // INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are
  7830. // valid.
  7831. Target string `json:"target,omitempty"`
  7832. // ServerResponse contains the HTTP response code and headers from the
  7833. // server.
  7834. googleapi.ServerResponse `json:"-"`
  7835. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  7836. // unconditionally include in API requests. By default, fields with
  7837. // empty values are omitted from API requests. However, any non-pointer,
  7838. // non-interface field appearing in ForceSendFields will be sent to the
  7839. // server regardless of whether the field is empty or not. This may be
  7840. // used to include empty fields in Patch requests.
  7841. ForceSendFields []string `json:"-"`
  7842. // NullFields is a list of field names (e.g. "IPAddress") to include in
  7843. // API requests with the JSON null value. By default, fields with empty
  7844. // values are omitted from API requests. However, any field with an
  7845. // empty value appearing in NullFields will be sent to the server as
  7846. // null. It is an error if a field in this list has a non-empty value.
  7847. // This may be used to include null fields in Patch requests.
  7848. NullFields []string `json:"-"`
  7849. }
  7850. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  7851. type NoMethod ForwardingRule
  7852. raw := NoMethod(*s)
  7853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7854. }
  7855. type ForwardingRuleAggregatedList struct {
  7856. // Id: [Output Only] Unique identifier for the resource; defined by the
  7857. // server.
  7858. Id string `json:"id,omitempty"`
  7859. // Items: A list of ForwardingRulesScopedList resources.
  7860. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  7861. // Kind: [Output Only] Type of resource. Always
  7862. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  7863. Kind string `json:"kind,omitempty"`
  7864. // NextPageToken: [Output Only] This token allows you to get the next
  7865. // page of results for list requests. If the number of results is larger
  7866. // than maxResults, use the nextPageToken as a value for the query
  7867. // parameter pageToken in the next list request. Subsequent list
  7868. // requests will have their own nextPageToken to continue paging through
  7869. // the results.
  7870. NextPageToken string `json:"nextPageToken,omitempty"`
  7871. // SelfLink: [Output Only] Server-defined URL for this resource.
  7872. SelfLink string `json:"selfLink,omitempty"`
  7873. // Warning: [Output Only] Informational warning message.
  7874. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  7875. // ServerResponse contains the HTTP response code and headers from the
  7876. // server.
  7877. googleapi.ServerResponse `json:"-"`
  7878. // ForceSendFields is a list of field names (e.g. "Id") to
  7879. // unconditionally include in API requests. By default, fields with
  7880. // empty values are omitted from API requests. However, any non-pointer,
  7881. // non-interface field appearing in ForceSendFields will be sent to the
  7882. // server regardless of whether the field is empty or not. This may be
  7883. // used to include empty fields in Patch requests.
  7884. ForceSendFields []string `json:"-"`
  7885. // NullFields is a list of field names (e.g. "Id") to include in API
  7886. // requests with the JSON null value. By default, fields with empty
  7887. // values are omitted from API requests. However, any field with an
  7888. // empty value appearing in NullFields will be sent to the server as
  7889. // null. It is an error if a field in this list has a non-empty value.
  7890. // This may be used to include null fields in Patch requests.
  7891. NullFields []string `json:"-"`
  7892. }
  7893. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  7894. type NoMethod ForwardingRuleAggregatedList
  7895. raw := NoMethod(*s)
  7896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7897. }
  7898. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  7899. // warning message.
  7900. type ForwardingRuleAggregatedListWarning struct {
  7901. // Code: [Output Only] A warning code, if applicable. For example,
  7902. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7903. // the response.
  7904. //
  7905. // Possible values:
  7906. // "CLEANUP_FAILED"
  7907. // "DEPRECATED_RESOURCE_USED"
  7908. // "DEPRECATED_TYPE_USED"
  7909. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7910. // "EXPERIMENTAL_TYPE_USED"
  7911. // "EXTERNAL_API_WARNING"
  7912. // "FIELD_VALUE_OVERRIDEN"
  7913. // "INJECTED_KERNELS_DEPRECATED"
  7914. // "MISSING_TYPE_DEPENDENCY"
  7915. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7916. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7917. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7918. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7919. // "NEXT_HOP_NOT_RUNNING"
  7920. // "NOT_CRITICAL_ERROR"
  7921. // "NO_RESULTS_ON_PAGE"
  7922. // "REQUIRED_TOS_AGREEMENT"
  7923. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7924. // "RESOURCE_NOT_DELETED"
  7925. // "SCHEMA_VALIDATION_IGNORED"
  7926. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7927. // "UNDECLARED_PROPERTIES"
  7928. // "UNREACHABLE"
  7929. Code string `json:"code,omitempty"`
  7930. // Data: [Output Only] Metadata about this warning in key: value format.
  7931. // For example:
  7932. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7933. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  7934. // Message: [Output Only] A human-readable description of the warning
  7935. // code.
  7936. Message string `json:"message,omitempty"`
  7937. // ForceSendFields is a list of field names (e.g. "Code") to
  7938. // unconditionally include in API requests. By default, fields with
  7939. // empty values are omitted from API requests. However, any non-pointer,
  7940. // non-interface field appearing in ForceSendFields will be sent to the
  7941. // server regardless of whether the field is empty or not. This may be
  7942. // used to include empty fields in Patch requests.
  7943. ForceSendFields []string `json:"-"`
  7944. // NullFields is a list of field names (e.g. "Code") to include in API
  7945. // requests with the JSON null value. By default, fields with empty
  7946. // values are omitted from API requests. However, any field with an
  7947. // empty value appearing in NullFields will be sent to the server as
  7948. // null. It is an error if a field in this list has a non-empty value.
  7949. // This may be used to include null fields in Patch requests.
  7950. NullFields []string `json:"-"`
  7951. }
  7952. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  7953. type NoMethod ForwardingRuleAggregatedListWarning
  7954. raw := NoMethod(*s)
  7955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7956. }
  7957. type ForwardingRuleAggregatedListWarningData struct {
  7958. // Key: [Output Only] A key that provides more detail on the warning
  7959. // being returned. For example, for warnings where there are no results
  7960. // in a list request for a particular zone, this key might be scope and
  7961. // the key value might be the zone name. Other examples might be a key
  7962. // indicating a deprecated resource and a suggested replacement, or a
  7963. // warning about invalid network settings (for example, if an instance
  7964. // attempts to perform IP forwarding but is not enabled for IP
  7965. // forwarding).
  7966. Key string `json:"key,omitempty"`
  7967. // Value: [Output Only] A warning data value corresponding to the key.
  7968. Value string `json:"value,omitempty"`
  7969. // ForceSendFields is a list of field names (e.g. "Key") to
  7970. // unconditionally include in API requests. By default, fields with
  7971. // empty values are omitted from API requests. However, any non-pointer,
  7972. // non-interface field appearing in ForceSendFields will be sent to the
  7973. // server regardless of whether the field is empty or not. This may be
  7974. // used to include empty fields in Patch requests.
  7975. ForceSendFields []string `json:"-"`
  7976. // NullFields is a list of field names (e.g. "Key") to include in API
  7977. // requests with the JSON null value. By default, fields with empty
  7978. // values are omitted from API requests. However, any field with an
  7979. // empty value appearing in NullFields will be sent to the server as
  7980. // null. It is an error if a field in this list has a non-empty value.
  7981. // This may be used to include null fields in Patch requests.
  7982. NullFields []string `json:"-"`
  7983. }
  7984. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  7985. type NoMethod ForwardingRuleAggregatedListWarningData
  7986. raw := NoMethod(*s)
  7987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7988. }
  7989. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  7990. type ForwardingRuleList struct {
  7991. // Id: [Output Only] Unique identifier for the resource; defined by the
  7992. // server.
  7993. Id string `json:"id,omitempty"`
  7994. // Items: A list of ForwardingRule resources.
  7995. Items []*ForwardingRule `json:"items,omitempty"`
  7996. // Kind: Type of resource.
  7997. Kind string `json:"kind,omitempty"`
  7998. // NextPageToken: [Output Only] This token allows you to get the next
  7999. // page of results for list requests. If the number of results is larger
  8000. // than maxResults, use the nextPageToken as a value for the query
  8001. // parameter pageToken in the next list request. Subsequent list
  8002. // requests will have their own nextPageToken to continue paging through
  8003. // the results.
  8004. NextPageToken string `json:"nextPageToken,omitempty"`
  8005. // SelfLink: [Output Only] Server-defined URL for this resource.
  8006. SelfLink string `json:"selfLink,omitempty"`
  8007. // Warning: [Output Only] Informational warning message.
  8008. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  8009. // ServerResponse contains the HTTP response code and headers from the
  8010. // server.
  8011. googleapi.ServerResponse `json:"-"`
  8012. // ForceSendFields is a list of field names (e.g. "Id") to
  8013. // unconditionally include in API requests. By default, fields with
  8014. // empty values are omitted from API requests. However, any non-pointer,
  8015. // non-interface field appearing in ForceSendFields will be sent to the
  8016. // server regardless of whether the field is empty or not. This may be
  8017. // used to include empty fields in Patch requests.
  8018. ForceSendFields []string `json:"-"`
  8019. // NullFields is a list of field names (e.g. "Id") to include in API
  8020. // requests with the JSON null value. By default, fields with empty
  8021. // values are omitted from API requests. However, any field with an
  8022. // empty value appearing in NullFields will be sent to the server as
  8023. // null. It is an error if a field in this list has a non-empty value.
  8024. // This may be used to include null fields in Patch requests.
  8025. NullFields []string `json:"-"`
  8026. }
  8027. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  8028. type NoMethod ForwardingRuleList
  8029. raw := NoMethod(*s)
  8030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8031. }
  8032. // ForwardingRuleListWarning: [Output Only] Informational warning
  8033. // message.
  8034. type ForwardingRuleListWarning struct {
  8035. // Code: [Output Only] A warning code, if applicable. For example,
  8036. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8037. // the response.
  8038. //
  8039. // Possible values:
  8040. // "CLEANUP_FAILED"
  8041. // "DEPRECATED_RESOURCE_USED"
  8042. // "DEPRECATED_TYPE_USED"
  8043. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8044. // "EXPERIMENTAL_TYPE_USED"
  8045. // "EXTERNAL_API_WARNING"
  8046. // "FIELD_VALUE_OVERRIDEN"
  8047. // "INJECTED_KERNELS_DEPRECATED"
  8048. // "MISSING_TYPE_DEPENDENCY"
  8049. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8050. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8051. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8052. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8053. // "NEXT_HOP_NOT_RUNNING"
  8054. // "NOT_CRITICAL_ERROR"
  8055. // "NO_RESULTS_ON_PAGE"
  8056. // "REQUIRED_TOS_AGREEMENT"
  8057. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8058. // "RESOURCE_NOT_DELETED"
  8059. // "SCHEMA_VALIDATION_IGNORED"
  8060. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8061. // "UNDECLARED_PROPERTIES"
  8062. // "UNREACHABLE"
  8063. Code string `json:"code,omitempty"`
  8064. // Data: [Output Only] Metadata about this warning in key: value format.
  8065. // For example:
  8066. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8067. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  8068. // Message: [Output Only] A human-readable description of the warning
  8069. // code.
  8070. Message string `json:"message,omitempty"`
  8071. // ForceSendFields is a list of field names (e.g. "Code") to
  8072. // unconditionally include in API requests. By default, fields with
  8073. // empty values are omitted from API requests. However, any non-pointer,
  8074. // non-interface field appearing in ForceSendFields will be sent to the
  8075. // server regardless of whether the field is empty or not. This may be
  8076. // used to include empty fields in Patch requests.
  8077. ForceSendFields []string `json:"-"`
  8078. // NullFields is a list of field names (e.g. "Code") to include in API
  8079. // requests with the JSON null value. By default, fields with empty
  8080. // values are omitted from API requests. However, any field with an
  8081. // empty value appearing in NullFields will be sent to the server as
  8082. // null. It is an error if a field in this list has a non-empty value.
  8083. // This may be used to include null fields in Patch requests.
  8084. NullFields []string `json:"-"`
  8085. }
  8086. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  8087. type NoMethod ForwardingRuleListWarning
  8088. raw := NoMethod(*s)
  8089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8090. }
  8091. type ForwardingRuleListWarningData struct {
  8092. // Key: [Output Only] A key that provides more detail on the warning
  8093. // being returned. For example, for warnings where there are no results
  8094. // in a list request for a particular zone, this key might be scope and
  8095. // the key value might be the zone name. Other examples might be a key
  8096. // indicating a deprecated resource and a suggested replacement, or a
  8097. // warning about invalid network settings (for example, if an instance
  8098. // attempts to perform IP forwarding but is not enabled for IP
  8099. // forwarding).
  8100. Key string `json:"key,omitempty"`
  8101. // Value: [Output Only] A warning data value corresponding to the key.
  8102. Value string `json:"value,omitempty"`
  8103. // ForceSendFields is a list of field names (e.g. "Key") to
  8104. // unconditionally include in API requests. By default, fields with
  8105. // empty values are omitted from API requests. However, any non-pointer,
  8106. // non-interface field appearing in ForceSendFields will be sent to the
  8107. // server regardless of whether the field is empty or not. This may be
  8108. // used to include empty fields in Patch requests.
  8109. ForceSendFields []string `json:"-"`
  8110. // NullFields is a list of field names (e.g. "Key") to include in API
  8111. // requests with the JSON null value. By default, fields with empty
  8112. // values are omitted from API requests. However, any field with an
  8113. // empty value appearing in NullFields will be sent to the server as
  8114. // null. It is an error if a field in this list has a non-empty value.
  8115. // This may be used to include null fields in Patch requests.
  8116. NullFields []string `json:"-"`
  8117. }
  8118. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  8119. type NoMethod ForwardingRuleListWarningData
  8120. raw := NoMethod(*s)
  8121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8122. }
  8123. type ForwardingRuleReference struct {
  8124. ForwardingRule string `json:"forwardingRule,omitempty"`
  8125. // ForceSendFields is a list of field names (e.g. "ForwardingRule") to
  8126. // unconditionally include in API requests. By default, fields with
  8127. // empty values are omitted from API requests. However, any non-pointer,
  8128. // non-interface field appearing in ForceSendFields will be sent to the
  8129. // server regardless of whether the field is empty or not. This may be
  8130. // used to include empty fields in Patch requests.
  8131. ForceSendFields []string `json:"-"`
  8132. // NullFields is a list of field names (e.g. "ForwardingRule") to
  8133. // include in API requests with the JSON null value. By default, fields
  8134. // with empty values are omitted from API requests. However, any field
  8135. // with an empty value appearing in NullFields will be sent to the
  8136. // server as null. It is an error if a field in this list has a
  8137. // non-empty value. This may be used to include null fields in Patch
  8138. // requests.
  8139. NullFields []string `json:"-"`
  8140. }
  8141. func (s *ForwardingRuleReference) MarshalJSON() ([]byte, error) {
  8142. type NoMethod ForwardingRuleReference
  8143. raw := NoMethod(*s)
  8144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8145. }
  8146. type ForwardingRulesScopedList struct {
  8147. // ForwardingRules: A list of forwarding rules contained in this scope.
  8148. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  8149. // Warning: Informational warning which replaces the list of forwarding
  8150. // rules when the list is empty.
  8151. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  8152. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  8153. // unconditionally include in API requests. By default, fields with
  8154. // empty values are omitted from API requests. However, any non-pointer,
  8155. // non-interface field appearing in ForceSendFields will be sent to the
  8156. // server regardless of whether the field is empty or not. This may be
  8157. // used to include empty fields in Patch requests.
  8158. ForceSendFields []string `json:"-"`
  8159. // NullFields is a list of field names (e.g. "ForwardingRules") to
  8160. // include in API requests with the JSON null value. By default, fields
  8161. // with empty values are omitted from API requests. However, any field
  8162. // with an empty value appearing in NullFields will be sent to the
  8163. // server as null. It is an error if a field in this list has a
  8164. // non-empty value. This may be used to include null fields in Patch
  8165. // requests.
  8166. NullFields []string `json:"-"`
  8167. }
  8168. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  8169. type NoMethod ForwardingRulesScopedList
  8170. raw := NoMethod(*s)
  8171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8172. }
  8173. // ForwardingRulesScopedListWarning: Informational warning which
  8174. // replaces the list of forwarding rules when the list is empty.
  8175. type ForwardingRulesScopedListWarning struct {
  8176. // Code: [Output Only] A warning code, if applicable. For example,
  8177. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8178. // the response.
  8179. //
  8180. // Possible values:
  8181. // "CLEANUP_FAILED"
  8182. // "DEPRECATED_RESOURCE_USED"
  8183. // "DEPRECATED_TYPE_USED"
  8184. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8185. // "EXPERIMENTAL_TYPE_USED"
  8186. // "EXTERNAL_API_WARNING"
  8187. // "FIELD_VALUE_OVERRIDEN"
  8188. // "INJECTED_KERNELS_DEPRECATED"
  8189. // "MISSING_TYPE_DEPENDENCY"
  8190. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8191. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8192. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8193. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8194. // "NEXT_HOP_NOT_RUNNING"
  8195. // "NOT_CRITICAL_ERROR"
  8196. // "NO_RESULTS_ON_PAGE"
  8197. // "REQUIRED_TOS_AGREEMENT"
  8198. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8199. // "RESOURCE_NOT_DELETED"
  8200. // "SCHEMA_VALIDATION_IGNORED"
  8201. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8202. // "UNDECLARED_PROPERTIES"
  8203. // "UNREACHABLE"
  8204. Code string `json:"code,omitempty"`
  8205. // Data: [Output Only] Metadata about this warning in key: value format.
  8206. // For example:
  8207. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8208. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  8209. // Message: [Output Only] A human-readable description of the warning
  8210. // code.
  8211. Message string `json:"message,omitempty"`
  8212. // ForceSendFields is a list of field names (e.g. "Code") to
  8213. // unconditionally include in API requests. By default, fields with
  8214. // empty values are omitted from API requests. However, any non-pointer,
  8215. // non-interface field appearing in ForceSendFields will be sent to the
  8216. // server regardless of whether the field is empty or not. This may be
  8217. // used to include empty fields in Patch requests.
  8218. ForceSendFields []string `json:"-"`
  8219. // NullFields is a list of field names (e.g. "Code") to include in API
  8220. // requests with the JSON null value. By default, fields with empty
  8221. // values are omitted from API requests. However, any field with an
  8222. // empty value appearing in NullFields will be sent to the server as
  8223. // null. It is an error if a field in this list has a non-empty value.
  8224. // This may be used to include null fields in Patch requests.
  8225. NullFields []string `json:"-"`
  8226. }
  8227. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  8228. type NoMethod ForwardingRulesScopedListWarning
  8229. raw := NoMethod(*s)
  8230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8231. }
  8232. type ForwardingRulesScopedListWarningData struct {
  8233. // Key: [Output Only] A key that provides more detail on the warning
  8234. // being returned. For example, for warnings where there are no results
  8235. // in a list request for a particular zone, this key might be scope and
  8236. // the key value might be the zone name. Other examples might be a key
  8237. // indicating a deprecated resource and a suggested replacement, or a
  8238. // warning about invalid network settings (for example, if an instance
  8239. // attempts to perform IP forwarding but is not enabled for IP
  8240. // forwarding).
  8241. Key string `json:"key,omitempty"`
  8242. // Value: [Output Only] A warning data value corresponding to the key.
  8243. Value string `json:"value,omitempty"`
  8244. // ForceSendFields is a list of field names (e.g. "Key") to
  8245. // unconditionally include in API requests. By default, fields with
  8246. // empty values are omitted from API requests. However, any non-pointer,
  8247. // non-interface field appearing in ForceSendFields will be sent to the
  8248. // server regardless of whether the field is empty or not. This may be
  8249. // used to include empty fields in Patch requests.
  8250. ForceSendFields []string `json:"-"`
  8251. // NullFields is a list of field names (e.g. "Key") to include in API
  8252. // requests with the JSON null value. By default, fields with empty
  8253. // values are omitted from API requests. However, any field with an
  8254. // empty value appearing in NullFields will be sent to the server as
  8255. // null. It is an error if a field in this list has a non-empty value.
  8256. // This may be used to include null fields in Patch requests.
  8257. NullFields []string `json:"-"`
  8258. }
  8259. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  8260. type NoMethod ForwardingRulesScopedListWarningData
  8261. raw := NoMethod(*s)
  8262. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8263. }
  8264. type GlobalSetLabelsRequest struct {
  8265. // LabelFingerprint: The fingerprint of the previous set of labels for
  8266. // this resource, used to detect conflicts. The fingerprint is initially
  8267. // generated by Compute Engine and changes after every request to modify
  8268. // or update labels. You must always provide an up-to-date fingerprint
  8269. // hash when updating or changing labels, otherwise the request will
  8270. // fail with error 412 conditionNotMet. Make a get() request to the
  8271. // resource to get the latest fingerprint.
  8272. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8273. // Labels: A list of labels to apply for this resource. Each label key &
  8274. // value must comply with RFC1035. Specifically, the name must be 1-63
  8275. // characters long and match the regular expression
  8276. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  8277. // a lowercase letter, and all following characters must be a dash,
  8278. // lowercase letter, or digit, except the last character, which cannot
  8279. // be a dash. For example, "webserver-frontend": "images". A label value
  8280. // can also be empty (e.g. "my-label": "").
  8281. Labels map[string]string `json:"labels,omitempty"`
  8282. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  8283. // unconditionally include in API requests. By default, fields with
  8284. // empty values are omitted from API requests. However, any non-pointer,
  8285. // non-interface field appearing in ForceSendFields will be sent to the
  8286. // server regardless of whether the field is empty or not. This may be
  8287. // used to include empty fields in Patch requests.
  8288. ForceSendFields []string `json:"-"`
  8289. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  8290. // include in API requests with the JSON null value. By default, fields
  8291. // with empty values are omitted from API requests. However, any field
  8292. // with an empty value appearing in NullFields will be sent to the
  8293. // server as null. It is an error if a field in this list has a
  8294. // non-empty value. This may be used to include null fields in Patch
  8295. // requests.
  8296. NullFields []string `json:"-"`
  8297. }
  8298. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  8299. type NoMethod GlobalSetLabelsRequest
  8300. raw := NoMethod(*s)
  8301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8302. }
  8303. type GlobalSetPolicyRequest struct {
  8304. // Bindings: Flatten Policy to create a backward compatible wire-format.
  8305. // Deprecated. Use 'policy' to specify bindings.
  8306. Bindings []*Binding `json:"bindings,omitempty"`
  8307. // Etag: Flatten Policy to create a backward compatible wire-format.
  8308. // Deprecated. Use 'policy' to specify the etag.
  8309. Etag string `json:"etag,omitempty"`
  8310. // Policy: REQUIRED: The complete policy to be applied to the
  8311. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  8312. // empty policy is in general a valid policy but certain services (like
  8313. // Projects) might reject them.
  8314. Policy *Policy `json:"policy,omitempty"`
  8315. // ForceSendFields is a list of field names (e.g. "Bindings") to
  8316. // unconditionally include in API requests. By default, fields with
  8317. // empty values are omitted from API requests. However, any non-pointer,
  8318. // non-interface field appearing in ForceSendFields will be sent to the
  8319. // server regardless of whether the field is empty or not. This may be
  8320. // used to include empty fields in Patch requests.
  8321. ForceSendFields []string `json:"-"`
  8322. // NullFields is a list of field names (e.g. "Bindings") to include in
  8323. // API requests with the JSON null value. By default, fields with empty
  8324. // values are omitted from API requests. However, any field with an
  8325. // empty value appearing in NullFields will be sent to the server as
  8326. // null. It is an error if a field in this list has a non-empty value.
  8327. // This may be used to include null fields in Patch requests.
  8328. NullFields []string `json:"-"`
  8329. }
  8330. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  8331. type NoMethod GlobalSetPolicyRequest
  8332. raw := NoMethod(*s)
  8333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8334. }
  8335. // GuestAttributes: A guest attributes entry.
  8336. type GuestAttributes struct {
  8337. // Kind: [Output Only] Type of the resource. Always
  8338. // compute#guestAttributes for guest attributes entry.
  8339. Kind string `json:"kind,omitempty"`
  8340. // QueryPath: The path to be queried. This can be the default namespace
  8341. // ('/') or a nested namespace ('//') or a specified key ('//')
  8342. QueryPath string `json:"queryPath,omitempty"`
  8343. // QueryValue: [Output Only] The value of the requested queried path.
  8344. QueryValue *GuestAttributesValue `json:"queryValue,omitempty"`
  8345. // SelfLink: [Output Only] Server-defined URL for this resource.
  8346. SelfLink string `json:"selfLink,omitempty"`
  8347. // VariableKey: The key to search for.
  8348. VariableKey string `json:"variableKey,omitempty"`
  8349. // VariableValue: [Output Only] The value found for the requested key.
  8350. VariableValue string `json:"variableValue,omitempty"`
  8351. // ServerResponse contains the HTTP response code and headers from the
  8352. // server.
  8353. googleapi.ServerResponse `json:"-"`
  8354. // ForceSendFields is a list of field names (e.g. "Kind") to
  8355. // unconditionally include in API requests. By default, fields with
  8356. // empty values are omitted from API requests. However, any non-pointer,
  8357. // non-interface field appearing in ForceSendFields will be sent to the
  8358. // server regardless of whether the field is empty or not. This may be
  8359. // used to include empty fields in Patch requests.
  8360. ForceSendFields []string `json:"-"`
  8361. // NullFields is a list of field names (e.g. "Kind") to include in API
  8362. // requests with the JSON null value. By default, fields with empty
  8363. // values are omitted from API requests. However, any field with an
  8364. // empty value appearing in NullFields will be sent to the server as
  8365. // null. It is an error if a field in this list has a non-empty value.
  8366. // This may be used to include null fields in Patch requests.
  8367. NullFields []string `json:"-"`
  8368. }
  8369. func (s *GuestAttributes) MarshalJSON() ([]byte, error) {
  8370. type NoMethod GuestAttributes
  8371. raw := NoMethod(*s)
  8372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8373. }
  8374. // GuestAttributesEntry: A guest attributes namespace/key/value entry.
  8375. type GuestAttributesEntry struct {
  8376. // Key: Key for the guest attribute entry.
  8377. Key string `json:"key,omitempty"`
  8378. // Namespace: Namespace for the guest attribute entry.
  8379. Namespace string `json:"namespace,omitempty"`
  8380. // Value: Value for the guest attribute entry.
  8381. Value string `json:"value,omitempty"`
  8382. // ForceSendFields is a list of field names (e.g. "Key") to
  8383. // unconditionally include in API requests. By default, fields with
  8384. // empty values are omitted from API requests. However, any non-pointer,
  8385. // non-interface field appearing in ForceSendFields will be sent to the
  8386. // server regardless of whether the field is empty or not. This may be
  8387. // used to include empty fields in Patch requests.
  8388. ForceSendFields []string `json:"-"`
  8389. // NullFields is a list of field names (e.g. "Key") to include in API
  8390. // requests with the JSON null value. By default, fields with empty
  8391. // values are omitted from API requests. However, any field with an
  8392. // empty value appearing in NullFields will be sent to the server as
  8393. // null. It is an error if a field in this list has a non-empty value.
  8394. // This may be used to include null fields in Patch requests.
  8395. NullFields []string `json:"-"`
  8396. }
  8397. func (s *GuestAttributesEntry) MarshalJSON() ([]byte, error) {
  8398. type NoMethod GuestAttributesEntry
  8399. raw := NoMethod(*s)
  8400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8401. }
  8402. // GuestAttributesValue: Array of guest attribute namespace/key/value
  8403. // tuples.
  8404. type GuestAttributesValue struct {
  8405. Items []*GuestAttributesEntry `json:"items,omitempty"`
  8406. // ForceSendFields is a list of field names (e.g. "Items") to
  8407. // unconditionally include in API requests. By default, fields with
  8408. // empty values are omitted from API requests. However, any non-pointer,
  8409. // non-interface field appearing in ForceSendFields will be sent to the
  8410. // server regardless of whether the field is empty or not. This may be
  8411. // used to include empty fields in Patch requests.
  8412. ForceSendFields []string `json:"-"`
  8413. // NullFields is a list of field names (e.g. "Items") to include in API
  8414. // requests with the JSON null value. By default, fields with empty
  8415. // values are omitted from API requests. However, any field with an
  8416. // empty value appearing in NullFields will be sent to the server as
  8417. // null. It is an error if a field in this list has a non-empty value.
  8418. // This may be used to include null fields in Patch requests.
  8419. NullFields []string `json:"-"`
  8420. }
  8421. func (s *GuestAttributesValue) MarshalJSON() ([]byte, error) {
  8422. type NoMethod GuestAttributesValue
  8423. raw := NoMethod(*s)
  8424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8425. }
  8426. // GuestOsFeature: Guest OS features.
  8427. type GuestOsFeature struct {
  8428. // Type: The ID of a supported feature. Read Enabling guest operating
  8429. // system features to see a list of available options.
  8430. //
  8431. // Possible values:
  8432. // "FEATURE_TYPE_UNSPECIFIED"
  8433. // "MULTI_IP_SUBNET"
  8434. // "SECURE_BOOT"
  8435. // "UEFI_COMPATIBLE"
  8436. // "VIRTIO_SCSI_MULTIQUEUE"
  8437. // "WINDOWS"
  8438. Type string `json:"type,omitempty"`
  8439. // ForceSendFields is a list of field names (e.g. "Type") to
  8440. // unconditionally include in API requests. By default, fields with
  8441. // empty values are omitted from API requests. However, any non-pointer,
  8442. // non-interface field appearing in ForceSendFields will be sent to the
  8443. // server regardless of whether the field is empty or not. This may be
  8444. // used to include empty fields in Patch requests.
  8445. ForceSendFields []string `json:"-"`
  8446. // NullFields is a list of field names (e.g. "Type") to include in API
  8447. // requests with the JSON null value. By default, fields with empty
  8448. // values are omitted from API requests. However, any field with an
  8449. // empty value appearing in NullFields will be sent to the server as
  8450. // null. It is an error if a field in this list has a non-empty value.
  8451. // This may be used to include null fields in Patch requests.
  8452. NullFields []string `json:"-"`
  8453. }
  8454. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  8455. type NoMethod GuestOsFeature
  8456. raw := NoMethod(*s)
  8457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8458. }
  8459. type HTTP2HealthCheck struct {
  8460. // Host: The value of the host header in the HTTP/2 health check
  8461. // request. If left empty (default value), the IP on behalf of which
  8462. // this health check is performed will be used.
  8463. Host string `json:"host,omitempty"`
  8464. // Port: The TCP port number for the health check request. The default
  8465. // value is 443. Valid values are 1 through 65535.
  8466. Port int64 `json:"port,omitempty"`
  8467. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8468. // both port and port_name are defined, port takes precedence.
  8469. PortName string `json:"portName,omitempty"`
  8470. // PortSpecification: Specifies how port is selected for health
  8471. // checking, can be one of following values:
  8472. // USE_FIXED_PORT: The port number in
  8473. // port
  8474. // is used for health checking.
  8475. // USE_NAMED_PORT: The
  8476. // portName
  8477. // is used for health checking.
  8478. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  8479. // each network endpoint is used for health checking. For other
  8480. // backends, the port or named port specified in the Backend Service is
  8481. // used for health checking.
  8482. //
  8483. //
  8484. // If not specified, HTTP2 health check follows behavior specified
  8485. // in
  8486. // port
  8487. // and
  8488. // portName
  8489. // fields.
  8490. //
  8491. // Possible values:
  8492. // "USE_FIXED_PORT"
  8493. // "USE_NAMED_PORT"
  8494. // "USE_SERVING_PORT"
  8495. PortSpecification string `json:"portSpecification,omitempty"`
  8496. // ProxyHeader: Specifies the type of proxy header to append before
  8497. // sending data to the backend, either NONE or PROXY_V1. The default is
  8498. // NONE.
  8499. //
  8500. // Possible values:
  8501. // "NONE"
  8502. // "PROXY_V1"
  8503. ProxyHeader string `json:"proxyHeader,omitempty"`
  8504. // RequestPath: The request path of the HTTP/2 health check request. The
  8505. // default value is /.
  8506. RequestPath string `json:"requestPath,omitempty"`
  8507. // Response: The string to match anywhere in the first 1024 bytes of the
  8508. // response body. If left empty (the default value), the status code
  8509. // determines health. The response data can only be ASCII.
  8510. Response string `json:"response,omitempty"`
  8511. // ForceSendFields is a list of field names (e.g. "Host") to
  8512. // unconditionally include in API requests. By default, fields with
  8513. // empty values are omitted from API requests. However, any non-pointer,
  8514. // non-interface field appearing in ForceSendFields will be sent to the
  8515. // server regardless of whether the field is empty or not. This may be
  8516. // used to include empty fields in Patch requests.
  8517. ForceSendFields []string `json:"-"`
  8518. // NullFields is a list of field names (e.g. "Host") to include in API
  8519. // requests with the JSON null value. By default, fields with empty
  8520. // values are omitted from API requests. However, any field with an
  8521. // empty value appearing in NullFields will be sent to the server as
  8522. // null. It is an error if a field in this list has a non-empty value.
  8523. // This may be used to include null fields in Patch requests.
  8524. NullFields []string `json:"-"`
  8525. }
  8526. func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
  8527. type NoMethod HTTP2HealthCheck
  8528. raw := NoMethod(*s)
  8529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8530. }
  8531. type HTTPHealthCheck struct {
  8532. // Host: The value of the host header in the HTTP health check request.
  8533. // If left empty (default value), the IP on behalf of which this health
  8534. // check is performed will be used.
  8535. Host string `json:"host,omitempty"`
  8536. // Port: The TCP port number for the health check request. The default
  8537. // value is 80. Valid values are 1 through 65535.
  8538. Port int64 `json:"port,omitempty"`
  8539. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8540. // both port and port_name are defined, port takes precedence.
  8541. PortName string `json:"portName,omitempty"`
  8542. // PortSpecification: Specifies how port is selected for health
  8543. // checking, can be one of following values:
  8544. // USE_FIXED_PORT: The port number in
  8545. // port
  8546. // is used for health checking.
  8547. // USE_NAMED_PORT: The
  8548. // portName
  8549. // is used for health checking.
  8550. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  8551. // each network endpoint is used for health checking. For other
  8552. // backends, the port or named port specified in the Backend Service is
  8553. // used for health checking.
  8554. //
  8555. //
  8556. // If not specified, HTTP health check follows behavior specified
  8557. // in
  8558. // port
  8559. // and
  8560. // portName
  8561. // fields.
  8562. //
  8563. // Possible values:
  8564. // "USE_FIXED_PORT"
  8565. // "USE_NAMED_PORT"
  8566. // "USE_SERVING_PORT"
  8567. PortSpecification string `json:"portSpecification,omitempty"`
  8568. // ProxyHeader: Specifies the type of proxy header to append before
  8569. // sending data to the backend, either NONE or PROXY_V1. The default is
  8570. // NONE.
  8571. //
  8572. // Possible values:
  8573. // "NONE"
  8574. // "PROXY_V1"
  8575. ProxyHeader string `json:"proxyHeader,omitempty"`
  8576. // RequestPath: The request path of the HTTP health check request. The
  8577. // default value is /.
  8578. RequestPath string `json:"requestPath,omitempty"`
  8579. // Response: The string to match anywhere in the first 1024 bytes of the
  8580. // response body. If left empty (the default value), the status code
  8581. // determines health. The response data can only be ASCII.
  8582. Response string `json:"response,omitempty"`
  8583. // ForceSendFields is a list of field names (e.g. "Host") to
  8584. // unconditionally include in API requests. By default, fields with
  8585. // empty values are omitted from API requests. However, any non-pointer,
  8586. // non-interface field appearing in ForceSendFields will be sent to the
  8587. // server regardless of whether the field is empty or not. This may be
  8588. // used to include empty fields in Patch requests.
  8589. ForceSendFields []string `json:"-"`
  8590. // NullFields is a list of field names (e.g. "Host") to include in API
  8591. // requests with the JSON null value. By default, fields with empty
  8592. // values are omitted from API requests. However, any field with an
  8593. // empty value appearing in NullFields will be sent to the server as
  8594. // null. It is an error if a field in this list has a non-empty value.
  8595. // This may be used to include null fields in Patch requests.
  8596. NullFields []string `json:"-"`
  8597. }
  8598. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  8599. type NoMethod HTTPHealthCheck
  8600. raw := NoMethod(*s)
  8601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8602. }
  8603. type HTTPSHealthCheck struct {
  8604. // Host: The value of the host header in the HTTPS health check request.
  8605. // If left empty (default value), the IP on behalf of which this health
  8606. // check is performed will be used.
  8607. Host string `json:"host,omitempty"`
  8608. // Port: The TCP port number for the health check request. The default
  8609. // value is 443. Valid values are 1 through 65535.
  8610. Port int64 `json:"port,omitempty"`
  8611. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8612. // both port and port_name are defined, port takes precedence.
  8613. PortName string `json:"portName,omitempty"`
  8614. // PortSpecification: Specifies how port is selected for health
  8615. // checking, can be one of following values:
  8616. // USE_FIXED_PORT: The port number in
  8617. // port
  8618. // is used for health checking.
  8619. // USE_NAMED_PORT: The
  8620. // portName
  8621. // is used for health checking.
  8622. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  8623. // each network endpoint is used for health checking. For other
  8624. // backends, the port or named port specified in the Backend Service is
  8625. // used for health checking.
  8626. //
  8627. //
  8628. // If not specified, HTTPS health check follows behavior specified
  8629. // in
  8630. // port
  8631. // and
  8632. // portName
  8633. // fields.
  8634. //
  8635. // Possible values:
  8636. // "USE_FIXED_PORT"
  8637. // "USE_NAMED_PORT"
  8638. // "USE_SERVING_PORT"
  8639. PortSpecification string `json:"portSpecification,omitempty"`
  8640. // ProxyHeader: Specifies the type of proxy header to append before
  8641. // sending data to the backend, either NONE or PROXY_V1. The default is
  8642. // NONE.
  8643. //
  8644. // Possible values:
  8645. // "NONE"
  8646. // "PROXY_V1"
  8647. ProxyHeader string `json:"proxyHeader,omitempty"`
  8648. // RequestPath: The request path of the HTTPS health check request. The
  8649. // default value is /.
  8650. RequestPath string `json:"requestPath,omitempty"`
  8651. // Response: The string to match anywhere in the first 1024 bytes of the
  8652. // response body. If left empty (the default value), the status code
  8653. // determines health. The response data can only be ASCII.
  8654. Response string `json:"response,omitempty"`
  8655. // ForceSendFields is a list of field names (e.g. "Host") to
  8656. // unconditionally include in API requests. By default, fields with
  8657. // empty values are omitted from API requests. However, any non-pointer,
  8658. // non-interface field appearing in ForceSendFields will be sent to the
  8659. // server regardless of whether the field is empty or not. This may be
  8660. // used to include empty fields in Patch requests.
  8661. ForceSendFields []string `json:"-"`
  8662. // NullFields is a list of field names (e.g. "Host") to include in API
  8663. // requests with the JSON null value. By default, fields with empty
  8664. // values are omitted from API requests. However, any field with an
  8665. // empty value appearing in NullFields will be sent to the server as
  8666. // null. It is an error if a field in this list has a non-empty value.
  8667. // This may be used to include null fields in Patch requests.
  8668. NullFields []string `json:"-"`
  8669. }
  8670. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  8671. type NoMethod HTTPSHealthCheck
  8672. raw := NoMethod(*s)
  8673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8674. }
  8675. // HealthCheck: An HealthCheck resource. This resource defines a
  8676. // template for how individual virtual machines should be checked for
  8677. // health, via one of the supported protocols.
  8678. type HealthCheck struct {
  8679. // CheckIntervalSec: How often (in seconds) to send a health check. The
  8680. // default value is 5 seconds.
  8681. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  8682. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  8683. // format.
  8684. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8685. // Description: An optional description of this resource. Provide this
  8686. // property when you create the resource.
  8687. Description string `json:"description,omitempty"`
  8688. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  8689. // after this many consecutive successes. The default value is 2.
  8690. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  8691. Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
  8692. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  8693. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  8694. // Id: [Output Only] The unique identifier for the resource. This
  8695. // identifier is defined by the server.
  8696. Id uint64 `json:"id,omitempty,string"`
  8697. // Kind: Type of the resource.
  8698. Kind string `json:"kind,omitempty"`
  8699. // Name: Name of the resource. Provided by the client when the resource
  8700. // is created. The name must be 1-63 characters long, and comply with
  8701. // RFC1035. Specifically, the name must be 1-63 characters long and
  8702. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8703. // the first character must be a lowercase letter, and all following
  8704. // characters must be a dash, lowercase letter, or digit, except the
  8705. // last character, which cannot be a dash.
  8706. Name string `json:"name,omitempty"`
  8707. // SelfLink: [Output Only] Server-defined URL for the resource.
  8708. SelfLink string `json:"selfLink,omitempty"`
  8709. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  8710. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  8711. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  8712. // The default value is 5 seconds. It is invalid for timeoutSec to have
  8713. // greater value than checkIntervalSec.
  8714. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  8715. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  8716. // HTTPS. If not specified, the default is TCP. Exactly one of the
  8717. // protocol-specific health check field must be specified, which must
  8718. // match type field.
  8719. //
  8720. // Possible values:
  8721. // "HTTP"
  8722. // "HTTP2"
  8723. // "HTTPS"
  8724. // "INVALID"
  8725. // "SSL"
  8726. // "TCP"
  8727. Type string `json:"type,omitempty"`
  8728. // UnhealthyThreshold: A so-far healthy instance will be marked
  8729. // unhealthy after this many consecutive failures. The default value is
  8730. // 2.
  8731. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  8732. // ServerResponse contains the HTTP response code and headers from the
  8733. // server.
  8734. googleapi.ServerResponse `json:"-"`
  8735. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  8736. // unconditionally include in API requests. By default, fields with
  8737. // empty values are omitted from API requests. However, any non-pointer,
  8738. // non-interface field appearing in ForceSendFields will be sent to the
  8739. // server regardless of whether the field is empty or not. This may be
  8740. // used to include empty fields in Patch requests.
  8741. ForceSendFields []string `json:"-"`
  8742. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  8743. // include in API requests with the JSON null value. By default, fields
  8744. // with empty values are omitted from API requests. However, any field
  8745. // with an empty value appearing in NullFields will be sent to the
  8746. // server as null. It is an error if a field in this list has a
  8747. // non-empty value. This may be used to include null fields in Patch
  8748. // requests.
  8749. NullFields []string `json:"-"`
  8750. }
  8751. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  8752. type NoMethod HealthCheck
  8753. raw := NoMethod(*s)
  8754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8755. }
  8756. // HealthCheckList: Contains a list of HealthCheck resources.
  8757. type HealthCheckList struct {
  8758. // Id: [Output Only] Unique identifier for the resource; defined by the
  8759. // server.
  8760. Id string `json:"id,omitempty"`
  8761. // Items: A list of HealthCheck resources.
  8762. Items []*HealthCheck `json:"items,omitempty"`
  8763. // Kind: Type of resource.
  8764. Kind string `json:"kind,omitempty"`
  8765. // NextPageToken: [Output Only] This token allows you to get the next
  8766. // page of results for list requests. If the number of results is larger
  8767. // than maxResults, use the nextPageToken as a value for the query
  8768. // parameter pageToken in the next list request. Subsequent list
  8769. // requests will have their own nextPageToken to continue paging through
  8770. // the results.
  8771. NextPageToken string `json:"nextPageToken,omitempty"`
  8772. // SelfLink: [Output Only] Server-defined URL for this resource.
  8773. SelfLink string `json:"selfLink,omitempty"`
  8774. // Warning: [Output Only] Informational warning message.
  8775. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  8776. // ServerResponse contains the HTTP response code and headers from the
  8777. // server.
  8778. googleapi.ServerResponse `json:"-"`
  8779. // ForceSendFields is a list of field names (e.g. "Id") to
  8780. // unconditionally include in API requests. By default, fields with
  8781. // empty values are omitted from API requests. However, any non-pointer,
  8782. // non-interface field appearing in ForceSendFields will be sent to the
  8783. // server regardless of whether the field is empty or not. This may be
  8784. // used to include empty fields in Patch requests.
  8785. ForceSendFields []string `json:"-"`
  8786. // NullFields is a list of field names (e.g. "Id") to include in API
  8787. // requests with the JSON null value. By default, fields with empty
  8788. // values are omitted from API requests. However, any field with an
  8789. // empty value appearing in NullFields will be sent to the server as
  8790. // null. It is an error if a field in this list has a non-empty value.
  8791. // This may be used to include null fields in Patch requests.
  8792. NullFields []string `json:"-"`
  8793. }
  8794. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  8795. type NoMethod HealthCheckList
  8796. raw := NoMethod(*s)
  8797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8798. }
  8799. // HealthCheckListWarning: [Output Only] Informational warning message.
  8800. type HealthCheckListWarning struct {
  8801. // Code: [Output Only] A warning code, if applicable. For example,
  8802. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8803. // the response.
  8804. //
  8805. // Possible values:
  8806. // "CLEANUP_FAILED"
  8807. // "DEPRECATED_RESOURCE_USED"
  8808. // "DEPRECATED_TYPE_USED"
  8809. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8810. // "EXPERIMENTAL_TYPE_USED"
  8811. // "EXTERNAL_API_WARNING"
  8812. // "FIELD_VALUE_OVERRIDEN"
  8813. // "INJECTED_KERNELS_DEPRECATED"
  8814. // "MISSING_TYPE_DEPENDENCY"
  8815. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8816. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8817. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8818. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8819. // "NEXT_HOP_NOT_RUNNING"
  8820. // "NOT_CRITICAL_ERROR"
  8821. // "NO_RESULTS_ON_PAGE"
  8822. // "REQUIRED_TOS_AGREEMENT"
  8823. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8824. // "RESOURCE_NOT_DELETED"
  8825. // "SCHEMA_VALIDATION_IGNORED"
  8826. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8827. // "UNDECLARED_PROPERTIES"
  8828. // "UNREACHABLE"
  8829. Code string `json:"code,omitempty"`
  8830. // Data: [Output Only] Metadata about this warning in key: value format.
  8831. // For example:
  8832. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8833. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  8834. // Message: [Output Only] A human-readable description of the warning
  8835. // code.
  8836. Message string `json:"message,omitempty"`
  8837. // ForceSendFields is a list of field names (e.g. "Code") to
  8838. // unconditionally include in API requests. By default, fields with
  8839. // empty values are omitted from API requests. However, any non-pointer,
  8840. // non-interface field appearing in ForceSendFields will be sent to the
  8841. // server regardless of whether the field is empty or not. This may be
  8842. // used to include empty fields in Patch requests.
  8843. ForceSendFields []string `json:"-"`
  8844. // NullFields is a list of field names (e.g. "Code") to include in API
  8845. // requests with the JSON null value. By default, fields with empty
  8846. // values are omitted from API requests. However, any field with an
  8847. // empty value appearing in NullFields will be sent to the server as
  8848. // null. It is an error if a field in this list has a non-empty value.
  8849. // This may be used to include null fields in Patch requests.
  8850. NullFields []string `json:"-"`
  8851. }
  8852. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  8853. type NoMethod HealthCheckListWarning
  8854. raw := NoMethod(*s)
  8855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8856. }
  8857. type HealthCheckListWarningData struct {
  8858. // Key: [Output Only] A key that provides more detail on the warning
  8859. // being returned. For example, for warnings where there are no results
  8860. // in a list request for a particular zone, this key might be scope and
  8861. // the key value might be the zone name. Other examples might be a key
  8862. // indicating a deprecated resource and a suggested replacement, or a
  8863. // warning about invalid network settings (for example, if an instance
  8864. // attempts to perform IP forwarding but is not enabled for IP
  8865. // forwarding).
  8866. Key string `json:"key,omitempty"`
  8867. // Value: [Output Only] A warning data value corresponding to the key.
  8868. Value string `json:"value,omitempty"`
  8869. // ForceSendFields is a list of field names (e.g. "Key") to
  8870. // unconditionally include in API requests. By default, fields with
  8871. // empty values are omitted from API requests. However, any non-pointer,
  8872. // non-interface field appearing in ForceSendFields will be sent to the
  8873. // server regardless of whether the field is empty or not. This may be
  8874. // used to include empty fields in Patch requests.
  8875. ForceSendFields []string `json:"-"`
  8876. // NullFields is a list of field names (e.g. "Key") to include in API
  8877. // requests with the JSON null value. By default, fields with empty
  8878. // values are omitted from API requests. However, any field with an
  8879. // empty value appearing in NullFields will be sent to the server as
  8880. // null. It is an error if a field in this list has a non-empty value.
  8881. // This may be used to include null fields in Patch requests.
  8882. NullFields []string `json:"-"`
  8883. }
  8884. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  8885. type NoMethod HealthCheckListWarningData
  8886. raw := NoMethod(*s)
  8887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8888. }
  8889. // HealthCheckReference: A full or valid partial URL to a health check.
  8890. // For example, the following are valid URLs:
  8891. // -
  8892. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  8893. // - projects/project-id/global/httpHealthChecks/health-check
  8894. // - global/httpHealthChecks/health-check
  8895. type HealthCheckReference struct {
  8896. HealthCheck string `json:"healthCheck,omitempty"`
  8897. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  8898. // unconditionally include in API requests. By default, fields with
  8899. // empty values are omitted from API requests. However, any non-pointer,
  8900. // non-interface field appearing in ForceSendFields will be sent to the
  8901. // server regardless of whether the field is empty or not. This may be
  8902. // used to include empty fields in Patch requests.
  8903. ForceSendFields []string `json:"-"`
  8904. // NullFields is a list of field names (e.g. "HealthCheck") to include
  8905. // in API requests with the JSON null value. By default, fields with
  8906. // empty values are omitted from API requests. However, any field with
  8907. // an empty value appearing in NullFields will be sent to the server as
  8908. // null. It is an error if a field in this list has a non-empty value.
  8909. // This may be used to include null fields in Patch requests.
  8910. NullFields []string `json:"-"`
  8911. }
  8912. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  8913. type NoMethod HealthCheckReference
  8914. raw := NoMethod(*s)
  8915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8916. }
  8917. type HealthStatus struct {
  8918. // HealthState: Health state of the instance.
  8919. //
  8920. // Possible values:
  8921. // "HEALTHY"
  8922. // "UNHEALTHY"
  8923. HealthState string `json:"healthState,omitempty"`
  8924. // Instance: URL of the instance resource.
  8925. Instance string `json:"instance,omitempty"`
  8926. // IpAddress: The IP address represented by this resource.
  8927. IpAddress string `json:"ipAddress,omitempty"`
  8928. // Port: The port on the instance.
  8929. Port int64 `json:"port,omitempty"`
  8930. // ForceSendFields is a list of field names (e.g. "HealthState") to
  8931. // unconditionally include in API requests. By default, fields with
  8932. // empty values are omitted from API requests. However, any non-pointer,
  8933. // non-interface field appearing in ForceSendFields will be sent to the
  8934. // server regardless of whether the field is empty or not. This may be
  8935. // used to include empty fields in Patch requests.
  8936. ForceSendFields []string `json:"-"`
  8937. // NullFields is a list of field names (e.g. "HealthState") to include
  8938. // in API requests with the JSON null value. By default, fields with
  8939. // empty values are omitted from API requests. However, any field with
  8940. // an empty value appearing in NullFields will be sent to the server as
  8941. // null. It is an error if a field in this list has a non-empty value.
  8942. // This may be used to include null fields in Patch requests.
  8943. NullFields []string `json:"-"`
  8944. }
  8945. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  8946. type NoMethod HealthStatus
  8947. raw := NoMethod(*s)
  8948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8949. }
  8950. type HealthStatusForNetworkEndpoint struct {
  8951. // BackendService: URL of the backend service associated with the health
  8952. // state of the network endpoint.
  8953. BackendService *BackendServiceReference `json:"backendService,omitempty"`
  8954. // ForwardingRule: URL of the forwarding rule associated with the health
  8955. // state of the network endpoint.
  8956. ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
  8957. // HealthCheck: URL of the health check associated with the health state
  8958. // of the network endpoint.
  8959. HealthCheck *HealthCheckReference `json:"healthCheck,omitempty"`
  8960. // HealthState: Health state of the network endpoint determined based on
  8961. // the health checks configured.
  8962. //
  8963. // Possible values:
  8964. // "DRAINING"
  8965. // "HEALTHY"
  8966. // "UNHEALTHY"
  8967. // "UNKNOWN"
  8968. HealthState string `json:"healthState,omitempty"`
  8969. // ForceSendFields is a list of field names (e.g. "BackendService") to
  8970. // unconditionally include in API requests. By default, fields with
  8971. // empty values are omitted from API requests. However, any non-pointer,
  8972. // non-interface field appearing in ForceSendFields will be sent to the
  8973. // server regardless of whether the field is empty or not. This may be
  8974. // used to include empty fields in Patch requests.
  8975. ForceSendFields []string `json:"-"`
  8976. // NullFields is a list of field names (e.g. "BackendService") to
  8977. // include in API requests with the JSON null value. By default, fields
  8978. // with empty values are omitted from API requests. However, any field
  8979. // with an empty value appearing in NullFields will be sent to the
  8980. // server as null. It is an error if a field in this list has a
  8981. // non-empty value. This may be used to include null fields in Patch
  8982. // requests.
  8983. NullFields []string `json:"-"`
  8984. }
  8985. func (s *HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
  8986. type NoMethod HealthStatusForNetworkEndpoint
  8987. raw := NoMethod(*s)
  8988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8989. }
  8990. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  8991. // use the named PathMatcher to select the BackendService.
  8992. type HostRule struct {
  8993. // Description: An optional description of this resource. Provide this
  8994. // property when you create the resource.
  8995. Description string `json:"description,omitempty"`
  8996. // Hosts: The list of host patterns to match. They must be valid
  8997. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  8998. // case, * must be the first character and must be followed in the
  8999. // pattern by either - or ..
  9000. Hosts []string `json:"hosts,omitempty"`
  9001. // PathMatcher: The name of the PathMatcher to use to match the path
  9002. // portion of the URL if the hostRule matches the URL's host portion.
  9003. PathMatcher string `json:"pathMatcher,omitempty"`
  9004. // ForceSendFields is a list of field names (e.g. "Description") to
  9005. // unconditionally include in API requests. By default, fields with
  9006. // empty values are omitted from API requests. However, any non-pointer,
  9007. // non-interface field appearing in ForceSendFields will be sent to the
  9008. // server regardless of whether the field is empty or not. This may be
  9009. // used to include empty fields in Patch requests.
  9010. ForceSendFields []string `json:"-"`
  9011. // NullFields is a list of field names (e.g. "Description") to include
  9012. // in API requests with the JSON null value. By default, fields with
  9013. // empty values are omitted from API requests. However, any field with
  9014. // an empty value appearing in NullFields will be sent to the server as
  9015. // null. It is an error if a field in this list has a non-empty value.
  9016. // This may be used to include null fields in Patch requests.
  9017. NullFields []string `json:"-"`
  9018. }
  9019. func (s *HostRule) MarshalJSON() ([]byte, error) {
  9020. type NoMethod HostRule
  9021. raw := NoMethod(*s)
  9022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9023. }
  9024. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  9025. // template for how individual instances should be checked for health,
  9026. // via HTTP.
  9027. type HttpHealthCheck struct {
  9028. // CheckIntervalSec: How often (in seconds) to send a health check. The
  9029. // default value is 5 seconds.
  9030. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  9031. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9032. // format.
  9033. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9034. // Description: An optional description of this resource. Provide this
  9035. // property when you create the resource.
  9036. Description string `json:"description,omitempty"`
  9037. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  9038. // after this many consecutive successes. The default value is 2.
  9039. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  9040. // Host: The value of the host header in the HTTP health check request.
  9041. // If left empty (default value), the public IP on behalf of which this
  9042. // health check is performed will be used.
  9043. Host string `json:"host,omitempty"`
  9044. // Id: [Output Only] The unique identifier for the resource. This
  9045. // identifier is defined by the server.
  9046. Id uint64 `json:"id,omitempty,string"`
  9047. // Kind: [Output Only] Type of the resource. Always
  9048. // compute#httpHealthCheck for HTTP health checks.
  9049. Kind string `json:"kind,omitempty"`
  9050. // Name: Name of the resource. Provided by the client when the resource
  9051. // is created. The name must be 1-63 characters long, and comply with
  9052. // RFC1035. Specifically, the name must be 1-63 characters long and
  9053. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9054. // the first character must be a lowercase letter, and all following
  9055. // characters must be a dash, lowercase letter, or digit, except the
  9056. // last character, which cannot be a dash.
  9057. Name string `json:"name,omitempty"`
  9058. // Port: The TCP port number for the HTTP health check request. The
  9059. // default value is 80.
  9060. Port int64 `json:"port,omitempty"`
  9061. // RequestPath: The request path of the HTTP health check request. The
  9062. // default value is /.
  9063. RequestPath string `json:"requestPath,omitempty"`
  9064. // SelfLink: [Output Only] Server-defined URL for the resource.
  9065. SelfLink string `json:"selfLink,omitempty"`
  9066. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  9067. // The default value is 5 seconds. It is invalid for timeoutSec to have
  9068. // greater value than checkIntervalSec.
  9069. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  9070. // UnhealthyThreshold: A so-far healthy instance will be marked
  9071. // unhealthy after this many consecutive failures. The default value is
  9072. // 2.
  9073. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  9074. // ServerResponse contains the HTTP response code and headers from the
  9075. // server.
  9076. googleapi.ServerResponse `json:"-"`
  9077. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  9078. // unconditionally include in API requests. By default, fields with
  9079. // empty values are omitted from API requests. However, any non-pointer,
  9080. // non-interface field appearing in ForceSendFields will be sent to the
  9081. // server regardless of whether the field is empty or not. This may be
  9082. // used to include empty fields in Patch requests.
  9083. ForceSendFields []string `json:"-"`
  9084. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  9085. // include in API requests with the JSON null value. By default, fields
  9086. // with empty values are omitted from API requests. However, any field
  9087. // with an empty value appearing in NullFields will be sent to the
  9088. // server as null. It is an error if a field in this list has a
  9089. // non-empty value. This may be used to include null fields in Patch
  9090. // requests.
  9091. NullFields []string `json:"-"`
  9092. }
  9093. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  9094. type NoMethod HttpHealthCheck
  9095. raw := NoMethod(*s)
  9096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9097. }
  9098. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  9099. type HttpHealthCheckList struct {
  9100. // Id: [Output Only] Unique identifier for the resource; defined by the
  9101. // server.
  9102. Id string `json:"id,omitempty"`
  9103. // Items: A list of HttpHealthCheck resources.
  9104. Items []*HttpHealthCheck `json:"items,omitempty"`
  9105. // Kind: Type of resource.
  9106. Kind string `json:"kind,omitempty"`
  9107. // NextPageToken: [Output Only] This token allows you to get the next
  9108. // page of results for list requests. If the number of results is larger
  9109. // than maxResults, use the nextPageToken as a value for the query
  9110. // parameter pageToken in the next list request. Subsequent list
  9111. // requests will have their own nextPageToken to continue paging through
  9112. // the results.
  9113. NextPageToken string `json:"nextPageToken,omitempty"`
  9114. // SelfLink: [Output Only] Server-defined URL for this resource.
  9115. SelfLink string `json:"selfLink,omitempty"`
  9116. // Warning: [Output Only] Informational warning message.
  9117. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  9118. // ServerResponse contains the HTTP response code and headers from the
  9119. // server.
  9120. googleapi.ServerResponse `json:"-"`
  9121. // ForceSendFields is a list of field names (e.g. "Id") to
  9122. // unconditionally include in API requests. By default, fields with
  9123. // empty values are omitted from API requests. However, any non-pointer,
  9124. // non-interface field appearing in ForceSendFields will be sent to the
  9125. // server regardless of whether the field is empty or not. This may be
  9126. // used to include empty fields in Patch requests.
  9127. ForceSendFields []string `json:"-"`
  9128. // NullFields is a list of field names (e.g. "Id") to include in API
  9129. // requests with the JSON null value. By default, fields with empty
  9130. // values are omitted from API requests. However, any field with an
  9131. // empty value appearing in NullFields will be sent to the server as
  9132. // null. It is an error if a field in this list has a non-empty value.
  9133. // This may be used to include null fields in Patch requests.
  9134. NullFields []string `json:"-"`
  9135. }
  9136. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  9137. type NoMethod HttpHealthCheckList
  9138. raw := NoMethod(*s)
  9139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9140. }
  9141. // HttpHealthCheckListWarning: [Output Only] Informational warning
  9142. // message.
  9143. type HttpHealthCheckListWarning struct {
  9144. // Code: [Output Only] A warning code, if applicable. For example,
  9145. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9146. // the response.
  9147. //
  9148. // Possible values:
  9149. // "CLEANUP_FAILED"
  9150. // "DEPRECATED_RESOURCE_USED"
  9151. // "DEPRECATED_TYPE_USED"
  9152. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9153. // "EXPERIMENTAL_TYPE_USED"
  9154. // "EXTERNAL_API_WARNING"
  9155. // "FIELD_VALUE_OVERRIDEN"
  9156. // "INJECTED_KERNELS_DEPRECATED"
  9157. // "MISSING_TYPE_DEPENDENCY"
  9158. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9159. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9160. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9161. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9162. // "NEXT_HOP_NOT_RUNNING"
  9163. // "NOT_CRITICAL_ERROR"
  9164. // "NO_RESULTS_ON_PAGE"
  9165. // "REQUIRED_TOS_AGREEMENT"
  9166. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9167. // "RESOURCE_NOT_DELETED"
  9168. // "SCHEMA_VALIDATION_IGNORED"
  9169. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9170. // "UNDECLARED_PROPERTIES"
  9171. // "UNREACHABLE"
  9172. Code string `json:"code,omitempty"`
  9173. // Data: [Output Only] Metadata about this warning in key: value format.
  9174. // For example:
  9175. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9176. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  9177. // Message: [Output Only] A human-readable description of the warning
  9178. // code.
  9179. Message string `json:"message,omitempty"`
  9180. // ForceSendFields is a list of field names (e.g. "Code") to
  9181. // unconditionally include in API requests. By default, fields with
  9182. // empty values are omitted from API requests. However, any non-pointer,
  9183. // non-interface field appearing in ForceSendFields will be sent to the
  9184. // server regardless of whether the field is empty or not. This may be
  9185. // used to include empty fields in Patch requests.
  9186. ForceSendFields []string `json:"-"`
  9187. // NullFields is a list of field names (e.g. "Code") to include in API
  9188. // requests with the JSON null value. By default, fields with empty
  9189. // values are omitted from API requests. However, any field with an
  9190. // empty value appearing in NullFields will be sent to the server as
  9191. // null. It is an error if a field in this list has a non-empty value.
  9192. // This may be used to include null fields in Patch requests.
  9193. NullFields []string `json:"-"`
  9194. }
  9195. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  9196. type NoMethod HttpHealthCheckListWarning
  9197. raw := NoMethod(*s)
  9198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9199. }
  9200. type HttpHealthCheckListWarningData struct {
  9201. // Key: [Output Only] A key that provides more detail on the warning
  9202. // being returned. For example, for warnings where there are no results
  9203. // in a list request for a particular zone, this key might be scope and
  9204. // the key value might be the zone name. Other examples might be a key
  9205. // indicating a deprecated resource and a suggested replacement, or a
  9206. // warning about invalid network settings (for example, if an instance
  9207. // attempts to perform IP forwarding but is not enabled for IP
  9208. // forwarding).
  9209. Key string `json:"key,omitempty"`
  9210. // Value: [Output Only] A warning data value corresponding to the key.
  9211. Value string `json:"value,omitempty"`
  9212. // ForceSendFields is a list of field names (e.g. "Key") to
  9213. // unconditionally include in API requests. By default, fields with
  9214. // empty values are omitted from API requests. However, any non-pointer,
  9215. // non-interface field appearing in ForceSendFields will be sent to the
  9216. // server regardless of whether the field is empty or not. This may be
  9217. // used to include empty fields in Patch requests.
  9218. ForceSendFields []string `json:"-"`
  9219. // NullFields is a list of field names (e.g. "Key") to include in API
  9220. // requests with the JSON null value. By default, fields with empty
  9221. // values are omitted from API requests. However, any field with an
  9222. // empty value appearing in NullFields will be sent to the server as
  9223. // null. It is an error if a field in this list has a non-empty value.
  9224. // This may be used to include null fields in Patch requests.
  9225. NullFields []string `json:"-"`
  9226. }
  9227. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  9228. type NoMethod HttpHealthCheckListWarningData
  9229. raw := NoMethod(*s)
  9230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9231. }
  9232. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  9233. // a template for how individual instances should be checked for health,
  9234. // via HTTPS.
  9235. type HttpsHealthCheck struct {
  9236. // CheckIntervalSec: How often (in seconds) to send a health check. The
  9237. // default value is 5 seconds.
  9238. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  9239. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9240. // format.
  9241. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9242. // Description: An optional description of this resource. Provide this
  9243. // property when you create the resource.
  9244. Description string `json:"description,omitempty"`
  9245. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  9246. // after this many consecutive successes. The default value is 2.
  9247. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  9248. // Host: The value of the host header in the HTTPS health check request.
  9249. // If left empty (default value), the public IP on behalf of which this
  9250. // health check is performed will be used.
  9251. Host string `json:"host,omitempty"`
  9252. // Id: [Output Only] The unique identifier for the resource. This
  9253. // identifier is defined by the server.
  9254. Id uint64 `json:"id,omitempty,string"`
  9255. // Kind: Type of the resource.
  9256. Kind string `json:"kind,omitempty"`
  9257. // Name: Name of the resource. Provided by the client when the resource
  9258. // is created. The name must be 1-63 characters long, and comply with
  9259. // RFC1035. Specifically, the name must be 1-63 characters long and
  9260. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9261. // the first character must be a lowercase letter, and all following
  9262. // characters must be a dash, lowercase letter, or digit, except the
  9263. // last character, which cannot be a dash.
  9264. Name string `json:"name,omitempty"`
  9265. // Port: The TCP port number for the HTTPS health check request. The
  9266. // default value is 443.
  9267. Port int64 `json:"port,omitempty"`
  9268. // RequestPath: The request path of the HTTPS health check request. The
  9269. // default value is "/".
  9270. RequestPath string `json:"requestPath,omitempty"`
  9271. // SelfLink: [Output Only] Server-defined URL for the resource.
  9272. SelfLink string `json:"selfLink,omitempty"`
  9273. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  9274. // The default value is 5 seconds. It is invalid for timeoutSec to have
  9275. // a greater value than checkIntervalSec.
  9276. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  9277. // UnhealthyThreshold: A so-far healthy instance will be marked
  9278. // unhealthy after this many consecutive failures. The default value is
  9279. // 2.
  9280. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  9281. // ServerResponse contains the HTTP response code and headers from the
  9282. // server.
  9283. googleapi.ServerResponse `json:"-"`
  9284. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  9285. // unconditionally include in API requests. By default, fields with
  9286. // empty values are omitted from API requests. However, any non-pointer,
  9287. // non-interface field appearing in ForceSendFields will be sent to the
  9288. // server regardless of whether the field is empty or not. This may be
  9289. // used to include empty fields in Patch requests.
  9290. ForceSendFields []string `json:"-"`
  9291. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  9292. // include in API requests with the JSON null value. By default, fields
  9293. // with empty values are omitted from API requests. However, any field
  9294. // with an empty value appearing in NullFields will be sent to the
  9295. // server as null. It is an error if a field in this list has a
  9296. // non-empty value. This may be used to include null fields in Patch
  9297. // requests.
  9298. NullFields []string `json:"-"`
  9299. }
  9300. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  9301. type NoMethod HttpsHealthCheck
  9302. raw := NoMethod(*s)
  9303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9304. }
  9305. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  9306. type HttpsHealthCheckList struct {
  9307. // Id: [Output Only] Unique identifier for the resource; defined by the
  9308. // server.
  9309. Id string `json:"id,omitempty"`
  9310. // Items: A list of HttpsHealthCheck resources.
  9311. Items []*HttpsHealthCheck `json:"items,omitempty"`
  9312. // Kind: Type of resource.
  9313. Kind string `json:"kind,omitempty"`
  9314. // NextPageToken: [Output Only] This token allows you to get the next
  9315. // page of results for list requests. If the number of results is larger
  9316. // than maxResults, use the nextPageToken as a value for the query
  9317. // parameter pageToken in the next list request. Subsequent list
  9318. // requests will have their own nextPageToken to continue paging through
  9319. // the results.
  9320. NextPageToken string `json:"nextPageToken,omitempty"`
  9321. // SelfLink: [Output Only] Server-defined URL for this resource.
  9322. SelfLink string `json:"selfLink,omitempty"`
  9323. // Warning: [Output Only] Informational warning message.
  9324. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  9325. // ServerResponse contains the HTTP response code and headers from the
  9326. // server.
  9327. googleapi.ServerResponse `json:"-"`
  9328. // ForceSendFields is a list of field names (e.g. "Id") to
  9329. // unconditionally include in API requests. By default, fields with
  9330. // empty values are omitted from API requests. However, any non-pointer,
  9331. // non-interface field appearing in ForceSendFields will be sent to the
  9332. // server regardless of whether the field is empty or not. This may be
  9333. // used to include empty fields in Patch requests.
  9334. ForceSendFields []string `json:"-"`
  9335. // NullFields is a list of field names (e.g. "Id") to include in API
  9336. // requests with the JSON null value. By default, fields with empty
  9337. // values are omitted from API requests. However, any field with an
  9338. // empty value appearing in NullFields will be sent to the server as
  9339. // null. It is an error if a field in this list has a non-empty value.
  9340. // This may be used to include null fields in Patch requests.
  9341. NullFields []string `json:"-"`
  9342. }
  9343. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  9344. type NoMethod HttpsHealthCheckList
  9345. raw := NoMethod(*s)
  9346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9347. }
  9348. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  9349. // message.
  9350. type HttpsHealthCheckListWarning struct {
  9351. // Code: [Output Only] A warning code, if applicable. For example,
  9352. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9353. // the response.
  9354. //
  9355. // Possible values:
  9356. // "CLEANUP_FAILED"
  9357. // "DEPRECATED_RESOURCE_USED"
  9358. // "DEPRECATED_TYPE_USED"
  9359. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9360. // "EXPERIMENTAL_TYPE_USED"
  9361. // "EXTERNAL_API_WARNING"
  9362. // "FIELD_VALUE_OVERRIDEN"
  9363. // "INJECTED_KERNELS_DEPRECATED"
  9364. // "MISSING_TYPE_DEPENDENCY"
  9365. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9366. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9367. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9368. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9369. // "NEXT_HOP_NOT_RUNNING"
  9370. // "NOT_CRITICAL_ERROR"
  9371. // "NO_RESULTS_ON_PAGE"
  9372. // "REQUIRED_TOS_AGREEMENT"
  9373. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9374. // "RESOURCE_NOT_DELETED"
  9375. // "SCHEMA_VALIDATION_IGNORED"
  9376. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9377. // "UNDECLARED_PROPERTIES"
  9378. // "UNREACHABLE"
  9379. Code string `json:"code,omitempty"`
  9380. // Data: [Output Only] Metadata about this warning in key: value format.
  9381. // For example:
  9382. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9383. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  9384. // Message: [Output Only] A human-readable description of the warning
  9385. // code.
  9386. Message string `json:"message,omitempty"`
  9387. // ForceSendFields is a list of field names (e.g. "Code") to
  9388. // unconditionally include in API requests. By default, fields with
  9389. // empty values are omitted from API requests. However, any non-pointer,
  9390. // non-interface field appearing in ForceSendFields will be sent to the
  9391. // server regardless of whether the field is empty or not. This may be
  9392. // used to include empty fields in Patch requests.
  9393. ForceSendFields []string `json:"-"`
  9394. // NullFields is a list of field names (e.g. "Code") to include in API
  9395. // requests with the JSON null value. By default, fields with empty
  9396. // values are omitted from API requests. However, any field with an
  9397. // empty value appearing in NullFields will be sent to the server as
  9398. // null. It is an error if a field in this list has a non-empty value.
  9399. // This may be used to include null fields in Patch requests.
  9400. NullFields []string `json:"-"`
  9401. }
  9402. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  9403. type NoMethod HttpsHealthCheckListWarning
  9404. raw := NoMethod(*s)
  9405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9406. }
  9407. type HttpsHealthCheckListWarningData struct {
  9408. // Key: [Output Only] A key that provides more detail on the warning
  9409. // being returned. For example, for warnings where there are no results
  9410. // in a list request for a particular zone, this key might be scope and
  9411. // the key value might be the zone name. Other examples might be a key
  9412. // indicating a deprecated resource and a suggested replacement, or a
  9413. // warning about invalid network settings (for example, if an instance
  9414. // attempts to perform IP forwarding but is not enabled for IP
  9415. // forwarding).
  9416. Key string `json:"key,omitempty"`
  9417. // Value: [Output Only] A warning data value corresponding to the key.
  9418. Value string `json:"value,omitempty"`
  9419. // ForceSendFields is a list of field names (e.g. "Key") to
  9420. // unconditionally include in API requests. By default, fields with
  9421. // empty values are omitted from API requests. However, any non-pointer,
  9422. // non-interface field appearing in ForceSendFields will be sent to the
  9423. // server regardless of whether the field is empty or not. This may be
  9424. // used to include empty fields in Patch requests.
  9425. ForceSendFields []string `json:"-"`
  9426. // NullFields is a list of field names (e.g. "Key") to include in API
  9427. // requests with the JSON null value. By default, fields with empty
  9428. // values are omitted from API requests. However, any field with an
  9429. // empty value appearing in NullFields will be sent to the server as
  9430. // null. It is an error if a field in this list has a non-empty value.
  9431. // This may be used to include null fields in Patch requests.
  9432. NullFields []string `json:"-"`
  9433. }
  9434. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  9435. type NoMethod HttpsHealthCheckListWarningData
  9436. raw := NoMethod(*s)
  9437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9438. }
  9439. // Image: An Image resource. (== resource_for beta.images ==) (==
  9440. // resource_for v1.images ==)
  9441. type Image struct {
  9442. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  9443. // Cloud Storage (in bytes).
  9444. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  9445. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9446. // format.
  9447. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9448. // Deprecated: The deprecation status associated with this image.
  9449. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  9450. // Description: An optional description of this resource. Provide this
  9451. // property when you create the resource.
  9452. Description string `json:"description,omitempty"`
  9453. // DiskSizeGb: Size of the image when restored onto a persistent disk
  9454. // (in GB).
  9455. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  9456. // Family: The name of the image family to which this image belongs. You
  9457. // can create disks by specifying an image family instead of a specific
  9458. // image name. The image family always returns its latest image that is
  9459. // not deprecated. The name of the image family must comply with
  9460. // RFC1035.
  9461. Family string `json:"family,omitempty"`
  9462. // GuestOsFeatures: A list of features to enable on the guest operating
  9463. // system. Applicable only for bootable images. Read Enabling guest
  9464. // operating system features to see a list of available options.
  9465. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  9466. // Id: [Output Only] The unique identifier for the resource. This
  9467. // identifier is defined by the server.
  9468. Id uint64 `json:"id,omitempty,string"`
  9469. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  9470. // encryption key.
  9471. //
  9472. // After you encrypt an image with a customer-supplied key, you must
  9473. // provide the same key if you use the image later (e.g. to create a
  9474. // disk from the image).
  9475. //
  9476. // Customer-supplied encryption keys do not protect access to metadata
  9477. // of the disk.
  9478. //
  9479. // If you do not provide an encryption key when creating the image, then
  9480. // the disk will be encrypted using an automatically generated key and
  9481. // you do not need to provide a key to use the image later.
  9482. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  9483. // Kind: [Output Only] Type of the resource. Always compute#image for
  9484. // images.
  9485. Kind string `json:"kind,omitempty"`
  9486. // LabelFingerprint: A fingerprint for the labels being applied to this
  9487. // image, which is essentially a hash of the labels used for optimistic
  9488. // locking. The fingerprint is initially generated by Compute Engine and
  9489. // changes after every request to modify or update labels. You must
  9490. // always provide an up-to-date fingerprint hash in order to update or
  9491. // change labels, otherwise the request will fail with error 412
  9492. // conditionNotMet.
  9493. //
  9494. // To see the latest fingerprint, make a get() request to retrieve an
  9495. // image.
  9496. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  9497. // Labels: Labels to apply to this image. These can be later modified by
  9498. // the setLabels method.
  9499. Labels map[string]string `json:"labels,omitempty"`
  9500. // LicenseCodes: Integer license codes indicating which licenses are
  9501. // attached to this image.
  9502. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  9503. // Licenses: Any applicable license URI.
  9504. Licenses []string `json:"licenses,omitempty"`
  9505. // Name: Name of the resource; provided by the client when the resource
  9506. // is created. The name must be 1-63 characters long, and comply with
  9507. // RFC1035. Specifically, the name must be 1-63 characters long and
  9508. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9509. // the first character must be a lowercase letter, and all following
  9510. // characters must be a dash, lowercase letter, or digit, except the
  9511. // last character, which cannot be a dash.
  9512. Name string `json:"name,omitempty"`
  9513. // RawDisk: The parameters of the raw disk image.
  9514. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  9515. // SelfLink: [Output Only] Server-defined URL for the resource.
  9516. SelfLink string `json:"selfLink,omitempty"`
  9517. // SourceDisk: URL of the source disk used to create this image. This
  9518. // can be a full or valid partial URL. You must provide either this
  9519. // property or the rawDisk.source property but not both to create an
  9520. // image. For example, the following are valid values:
  9521. // -
  9522. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  9523. // - projects/project/zones/zone/disks/disk
  9524. // - zones/zone/disks/disk
  9525. SourceDisk string `json:"sourceDisk,omitempty"`
  9526. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  9527. // source disk. Required if the source disk is protected by a
  9528. // customer-supplied encryption key.
  9529. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  9530. // SourceDiskId: [Output Only] The ID value of the disk used to create
  9531. // this image. This value may be used to determine whether the image was
  9532. // taken from the current or a previous instance of a given disk name.
  9533. SourceDiskId string `json:"sourceDiskId,omitempty"`
  9534. // SourceImage: URL of the source image used to create this image. This
  9535. // can be a full or valid partial URL. You must provide exactly one of:
  9536. //
  9537. // - this property, or
  9538. // - the rawDisk.source property, or
  9539. // - the sourceDisk property in order to create an image.
  9540. SourceImage string `json:"sourceImage,omitempty"`
  9541. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  9542. // source image. Required if the source image is protected by a
  9543. // customer-supplied encryption key.
  9544. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  9545. // SourceImageId: [Output Only] The ID value of the image used to create
  9546. // this image. This value may be used to determine whether the image was
  9547. // taken from the current or a previous instance of a given image name.
  9548. SourceImageId string `json:"sourceImageId,omitempty"`
  9549. // SourceSnapshot: URL of the source snapshot used to create this image.
  9550. // This can be a full or valid partial URL. You must provide exactly one
  9551. // of:
  9552. // - this property, or
  9553. // - the sourceImage property, or
  9554. // - the rawDisk.source property, or
  9555. // - the sourceDisk property in order to create an image.
  9556. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  9557. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  9558. // the source snapshot. Required if the source snapshot is protected by
  9559. // a customer-supplied encryption key.
  9560. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  9561. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  9562. // create this image. This value may be used to determine whether the
  9563. // snapshot was taken from the current or a previous instance of a given
  9564. // snapshot name.
  9565. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  9566. // SourceType: The type of the image used to create this disk. The
  9567. // default and only value is RAW
  9568. //
  9569. // Possible values:
  9570. // "RAW" (default)
  9571. SourceType string `json:"sourceType,omitempty"`
  9572. // Status: [Output Only] The status of the image. An image can be used
  9573. // to create other resources, such as instances, only after the image
  9574. // has been successfully created and the status is set to READY.
  9575. // Possible values are FAILED, PENDING, or READY.
  9576. //
  9577. // Possible values:
  9578. // "DELETING"
  9579. // "FAILED"
  9580. // "PENDING"
  9581. // "READY"
  9582. Status string `json:"status,omitempty"`
  9583. // ServerResponse contains the HTTP response code and headers from the
  9584. // server.
  9585. googleapi.ServerResponse `json:"-"`
  9586. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  9587. // unconditionally include in API requests. By default, fields with
  9588. // empty values are omitted from API requests. However, any non-pointer,
  9589. // non-interface field appearing in ForceSendFields will be sent to the
  9590. // server regardless of whether the field is empty or not. This may be
  9591. // used to include empty fields in Patch requests.
  9592. ForceSendFields []string `json:"-"`
  9593. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  9594. // include in API requests with the JSON null value. By default, fields
  9595. // with empty values are omitted from API requests. However, any field
  9596. // with an empty value appearing in NullFields will be sent to the
  9597. // server as null. It is an error if a field in this list has a
  9598. // non-empty value. This may be used to include null fields in Patch
  9599. // requests.
  9600. NullFields []string `json:"-"`
  9601. }
  9602. func (s *Image) MarshalJSON() ([]byte, error) {
  9603. type NoMethod Image
  9604. raw := NoMethod(*s)
  9605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9606. }
  9607. // ImageRawDisk: The parameters of the raw disk image.
  9608. type ImageRawDisk struct {
  9609. // ContainerType: The format used to encode and transmit the block
  9610. // device, which should be TAR. This is just a container and
  9611. // transmission format and not a runtime format. Provided by the client
  9612. // when the disk image is created.
  9613. //
  9614. // Possible values:
  9615. // "TAR"
  9616. ContainerType string `json:"containerType,omitempty"`
  9617. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  9618. // unpackaging provided by the client when the disk image is created.
  9619. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  9620. // Source: The full Google Cloud Storage URL where the disk image is
  9621. // stored. You must provide either this property or the sourceDisk
  9622. // property but not both.
  9623. Source string `json:"source,omitempty"`
  9624. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  9625. // unconditionally include in API requests. By default, fields with
  9626. // empty values are omitted from API requests. However, any non-pointer,
  9627. // non-interface field appearing in ForceSendFields will be sent to the
  9628. // server regardless of whether the field is empty or not. This may be
  9629. // used to include empty fields in Patch requests.
  9630. ForceSendFields []string `json:"-"`
  9631. // NullFields is a list of field names (e.g. "ContainerType") to include
  9632. // in API requests with the JSON null value. By default, fields with
  9633. // empty values are omitted from API requests. However, any field with
  9634. // an empty value appearing in NullFields will be sent to the server as
  9635. // null. It is an error if a field in this list has a non-empty value.
  9636. // This may be used to include null fields in Patch requests.
  9637. NullFields []string `json:"-"`
  9638. }
  9639. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  9640. type NoMethod ImageRawDisk
  9641. raw := NoMethod(*s)
  9642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9643. }
  9644. // ImageList: Contains a list of images.
  9645. type ImageList struct {
  9646. // Id: [Output Only] Unique identifier for the resource; defined by the
  9647. // server.
  9648. Id string `json:"id,omitempty"`
  9649. // Items: A list of Image resources.
  9650. Items []*Image `json:"items,omitempty"`
  9651. // Kind: Type of resource.
  9652. Kind string `json:"kind,omitempty"`
  9653. // NextPageToken: [Output Only] This token allows you to get the next
  9654. // page of results for list requests. If the number of results is larger
  9655. // than maxResults, use the nextPageToken as a value for the query
  9656. // parameter pageToken in the next list request. Subsequent list
  9657. // requests will have their own nextPageToken to continue paging through
  9658. // the results.
  9659. NextPageToken string `json:"nextPageToken,omitempty"`
  9660. // SelfLink: [Output Only] Server-defined URL for this resource.
  9661. SelfLink string `json:"selfLink,omitempty"`
  9662. // Warning: [Output Only] Informational warning message.
  9663. Warning *ImageListWarning `json:"warning,omitempty"`
  9664. // ServerResponse contains the HTTP response code and headers from the
  9665. // server.
  9666. googleapi.ServerResponse `json:"-"`
  9667. // ForceSendFields is a list of field names (e.g. "Id") to
  9668. // unconditionally include in API requests. By default, fields with
  9669. // empty values are omitted from API requests. However, any non-pointer,
  9670. // non-interface field appearing in ForceSendFields will be sent to the
  9671. // server regardless of whether the field is empty or not. This may be
  9672. // used to include empty fields in Patch requests.
  9673. ForceSendFields []string `json:"-"`
  9674. // NullFields is a list of field names (e.g. "Id") to include in API
  9675. // requests with the JSON null value. By default, fields with empty
  9676. // values are omitted from API requests. However, any field with an
  9677. // empty value appearing in NullFields will be sent to the server as
  9678. // null. It is an error if a field in this list has a non-empty value.
  9679. // This may be used to include null fields in Patch requests.
  9680. NullFields []string `json:"-"`
  9681. }
  9682. func (s *ImageList) MarshalJSON() ([]byte, error) {
  9683. type NoMethod ImageList
  9684. raw := NoMethod(*s)
  9685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9686. }
  9687. // ImageListWarning: [Output Only] Informational warning message.
  9688. type ImageListWarning struct {
  9689. // Code: [Output Only] A warning code, if applicable. For example,
  9690. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9691. // the response.
  9692. //
  9693. // Possible values:
  9694. // "CLEANUP_FAILED"
  9695. // "DEPRECATED_RESOURCE_USED"
  9696. // "DEPRECATED_TYPE_USED"
  9697. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9698. // "EXPERIMENTAL_TYPE_USED"
  9699. // "EXTERNAL_API_WARNING"
  9700. // "FIELD_VALUE_OVERRIDEN"
  9701. // "INJECTED_KERNELS_DEPRECATED"
  9702. // "MISSING_TYPE_DEPENDENCY"
  9703. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9704. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9705. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9706. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9707. // "NEXT_HOP_NOT_RUNNING"
  9708. // "NOT_CRITICAL_ERROR"
  9709. // "NO_RESULTS_ON_PAGE"
  9710. // "REQUIRED_TOS_AGREEMENT"
  9711. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9712. // "RESOURCE_NOT_DELETED"
  9713. // "SCHEMA_VALIDATION_IGNORED"
  9714. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9715. // "UNDECLARED_PROPERTIES"
  9716. // "UNREACHABLE"
  9717. Code string `json:"code,omitempty"`
  9718. // Data: [Output Only] Metadata about this warning in key: value format.
  9719. // For example:
  9720. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9721. Data []*ImageListWarningData `json:"data,omitempty"`
  9722. // Message: [Output Only] A human-readable description of the warning
  9723. // code.
  9724. Message string `json:"message,omitempty"`
  9725. // ForceSendFields is a list of field names (e.g. "Code") to
  9726. // unconditionally include in API requests. By default, fields with
  9727. // empty values are omitted from API requests. However, any non-pointer,
  9728. // non-interface field appearing in ForceSendFields will be sent to the
  9729. // server regardless of whether the field is empty or not. This may be
  9730. // used to include empty fields in Patch requests.
  9731. ForceSendFields []string `json:"-"`
  9732. // NullFields is a list of field names (e.g. "Code") to include in API
  9733. // requests with the JSON null value. By default, fields with empty
  9734. // values are omitted from API requests. However, any field with an
  9735. // empty value appearing in NullFields will be sent to the server as
  9736. // null. It is an error if a field in this list has a non-empty value.
  9737. // This may be used to include null fields in Patch requests.
  9738. NullFields []string `json:"-"`
  9739. }
  9740. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  9741. type NoMethod ImageListWarning
  9742. raw := NoMethod(*s)
  9743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9744. }
  9745. type ImageListWarningData struct {
  9746. // Key: [Output Only] A key that provides more detail on the warning
  9747. // being returned. For example, for warnings where there are no results
  9748. // in a list request for a particular zone, this key might be scope and
  9749. // the key value might be the zone name. Other examples might be a key
  9750. // indicating a deprecated resource and a suggested replacement, or a
  9751. // warning about invalid network settings (for example, if an instance
  9752. // attempts to perform IP forwarding but is not enabled for IP
  9753. // forwarding).
  9754. Key string `json:"key,omitempty"`
  9755. // Value: [Output Only] A warning data value corresponding to the key.
  9756. Value string `json:"value,omitempty"`
  9757. // ForceSendFields is a list of field names (e.g. "Key") to
  9758. // unconditionally include in API requests. By default, fields with
  9759. // empty values are omitted from API requests. However, any non-pointer,
  9760. // non-interface field appearing in ForceSendFields will be sent to the
  9761. // server regardless of whether the field is empty or not. This may be
  9762. // used to include empty fields in Patch requests.
  9763. ForceSendFields []string `json:"-"`
  9764. // NullFields is a list of field names (e.g. "Key") to include in API
  9765. // requests with the JSON null value. By default, fields with empty
  9766. // values are omitted from API requests. However, any field with an
  9767. // empty value appearing in NullFields will be sent to the server as
  9768. // null. It is an error if a field in this list has a non-empty value.
  9769. // This may be used to include null fields in Patch requests.
  9770. NullFields []string `json:"-"`
  9771. }
  9772. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  9773. type NoMethod ImageListWarningData
  9774. raw := NoMethod(*s)
  9775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9776. }
  9777. // Instance: An Instance resource. (== resource_for beta.instances ==)
  9778. // (== resource_for v1.instances ==)
  9779. type Instance struct {
  9780. // AllocationAffinity: The configuration of desired allocations which
  9781. // this Instance could consume capacity from.
  9782. AllocationAffinity *AllocationAffinity `json:"allocationAffinity,omitempty"`
  9783. // CanIpForward: Allows this instance to send and receive packets with
  9784. // non-matching destination or source IPs. This is required if you plan
  9785. // to use this instance to forward routes. For more information, see
  9786. // Enabling IP Forwarding.
  9787. CanIpForward bool `json:"canIpForward,omitempty"`
  9788. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  9789. CpuPlatform string `json:"cpuPlatform,omitempty"`
  9790. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9791. // format.
  9792. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9793. // DeletionProtection: Whether the resource should be protected against
  9794. // deletion.
  9795. DeletionProtection bool `json:"deletionProtection,omitempty"`
  9796. // Description: An optional description of this resource. Provide this
  9797. // property when you create the resource.
  9798. Description string `json:"description,omitempty"`
  9799. // Disks: Array of disks associated with this instance. Persistent disks
  9800. // must be created before you can assign them.
  9801. Disks []*AttachedDisk `json:"disks,omitempty"`
  9802. // DisplayDevice: Enables display device for the instance.
  9803. DisplayDevice *DisplayDevice `json:"displayDevice,omitempty"`
  9804. // GuestAccelerators: A list of the type and count of accelerator cards
  9805. // attached to the instance.
  9806. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  9807. Hostname string `json:"hostname,omitempty"`
  9808. // Id: [Output Only] The unique identifier for the resource. This
  9809. // identifier is defined by the server.
  9810. Id uint64 `json:"id,omitempty,string"`
  9811. // Kind: [Output Only] Type of the resource. Always compute#instance for
  9812. // instances.
  9813. Kind string `json:"kind,omitempty"`
  9814. // LabelFingerprint: A fingerprint for this request, which is
  9815. // essentially a hash of the label's contents and used for optimistic
  9816. // locking. The fingerprint is initially generated by Compute Engine and
  9817. // changes after every request to modify or update labels. You must
  9818. // always provide an up-to-date fingerprint hash in order to update or
  9819. // change labels.
  9820. //
  9821. // To see the latest fingerprint, make get() request to the instance.
  9822. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  9823. // Labels: Labels to apply to this instance. These can be later modified
  9824. // by the setLabels method.
  9825. Labels map[string]string `json:"labels,omitempty"`
  9826. // MachineType: Full or partial URL of the machine type resource to use
  9827. // for this instance, in the format:
  9828. // zones/zone/machineTypes/machine-type. This is provided by the client
  9829. // when the instance is created. For example, the following is a valid
  9830. // partial url to a predefined machine
  9831. // type:
  9832. // zones/us-central1-f/machineTypes/n1-standard-1
  9833. //
  9834. //
  9835. // To create a custom machine type, provide a URL to a machine type in
  9836. // the following format, where CPUS is 1 or an even number up to 32 (2,
  9837. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  9838. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  9839. // 5 GB of memory is 5120
  9840. // MB):
  9841. // zones/zone/machineTypes/custom-CPUS-MEMORY
  9842. //
  9843. //
  9844. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  9845. //
  9846. // For a full list of restrictions, read the Specifications for custom
  9847. // machine types.
  9848. MachineType string `json:"machineType,omitempty"`
  9849. // Metadata: The metadata key/value pairs assigned to this instance.
  9850. // This includes custom metadata and predefined keys.
  9851. Metadata *Metadata `json:"metadata,omitempty"`
  9852. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  9853. // Applicable values are the friendly names of CPU platforms, such as
  9854. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  9855. // Bridge".
  9856. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  9857. // Name: The name of the resource, provided by the client when initially
  9858. // creating the resource. The resource name must be 1-63 characters
  9859. // long, and comply with RFC1035. Specifically, the name must be 1-63
  9860. // characters long and match the regular expression
  9861. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  9862. // a lowercase letter, and all following characters must be a dash,
  9863. // lowercase letter, or digit, except the last character, which cannot
  9864. // be a dash.
  9865. Name string `json:"name,omitempty"`
  9866. // NetworkInterfaces: An array of network configurations for this
  9867. // instance. These specify how interfaces are configured to interact
  9868. // with other network services, such as connecting to the internet.
  9869. // Multiple interfaces are supported per instance.
  9870. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  9871. // Scheduling: Sets the scheduling options for this instance.
  9872. Scheduling *Scheduling `json:"scheduling,omitempty"`
  9873. // SelfLink: [Output Only] Server-defined URL for this resource.
  9874. SelfLink string `json:"selfLink,omitempty"`
  9875. // ServiceAccounts: A list of service accounts, with their specified
  9876. // scopes, authorized for this instance. Only one service account per VM
  9877. // instance is supported.
  9878. //
  9879. // Service accounts generate access tokens that can be accessed through
  9880. // the metadata server and used to authenticate applications on the
  9881. // instance. See Service Accounts for more information.
  9882. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  9883. ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
  9884. ShieldedInstanceIntegrityPolicy *ShieldedInstanceIntegrityPolicy `json:"shieldedInstanceIntegrityPolicy,omitempty"`
  9885. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  9886. ShieldedVmIntegrityPolicy *ShieldedVmIntegrityPolicy `json:"shieldedVmIntegrityPolicy,omitempty"`
  9887. // StartRestricted: [Output Only] Whether a VM has been restricted for
  9888. // start because Compute Engine has detected suspicious activity.
  9889. StartRestricted bool `json:"startRestricted,omitempty"`
  9890. // Status: [Output Only] The status of the instance. One of the
  9891. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  9892. // SUSPENDING, SUSPENDED, and TERMINATED.
  9893. //
  9894. // Possible values:
  9895. // "PROVISIONING"
  9896. // "REPAIRING"
  9897. // "RUNNING"
  9898. // "STAGING"
  9899. // "STOPPED"
  9900. // "STOPPING"
  9901. // "SUSPENDED"
  9902. // "SUSPENDING"
  9903. // "TERMINATED"
  9904. Status string `json:"status,omitempty"`
  9905. // StatusMessage: [Output Only] An optional, human-readable explanation
  9906. // of the status.
  9907. StatusMessage string `json:"statusMessage,omitempty"`
  9908. // Tags: Tags to apply to this instance. Tags are used to identify valid
  9909. // sources or targets for network firewalls and are specified by the
  9910. // client during instance creation. The tags can be later modified by
  9911. // the setTags method. Each tag within the list must comply with
  9912. // RFC1035. Multiple tags can be specified via the 'tags.items' field.
  9913. Tags *Tags `json:"tags,omitempty"`
  9914. // Zone: [Output Only] URL of the zone where the instance resides. You
  9915. // must specify this field as part of the HTTP request URL. It is not
  9916. // settable as a field in the request body.
  9917. Zone string `json:"zone,omitempty"`
  9918. // ServerResponse contains the HTTP response code and headers from the
  9919. // server.
  9920. googleapi.ServerResponse `json:"-"`
  9921. // ForceSendFields is a list of field names (e.g. "AllocationAffinity")
  9922. // to unconditionally include in API requests. By default, fields with
  9923. // empty values are omitted from API requests. However, any non-pointer,
  9924. // non-interface field appearing in ForceSendFields will be sent to the
  9925. // server regardless of whether the field is empty or not. This may be
  9926. // used to include empty fields in Patch requests.
  9927. ForceSendFields []string `json:"-"`
  9928. // NullFields is a list of field names (e.g. "AllocationAffinity") to
  9929. // include in API requests with the JSON null value. By default, fields
  9930. // with empty values are omitted from API requests. However, any field
  9931. // with an empty value appearing in NullFields will be sent to the
  9932. // server as null. It is an error if a field in this list has a
  9933. // non-empty value. This may be used to include null fields in Patch
  9934. // requests.
  9935. NullFields []string `json:"-"`
  9936. }
  9937. func (s *Instance) MarshalJSON() ([]byte, error) {
  9938. type NoMethod Instance
  9939. raw := NoMethod(*s)
  9940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9941. }
  9942. type InstanceAggregatedList struct {
  9943. // Id: [Output Only] Unique identifier for the resource; defined by the
  9944. // server.
  9945. Id string `json:"id,omitempty"`
  9946. // Items: A list of InstancesScopedList resources.
  9947. Items map[string]InstancesScopedList `json:"items,omitempty"`
  9948. // Kind: [Output Only] Type of resource. Always
  9949. // compute#instanceAggregatedList for aggregated lists of Instance
  9950. // resources.
  9951. Kind string `json:"kind,omitempty"`
  9952. // NextPageToken: [Output Only] This token allows you to get the next
  9953. // page of results for list requests. If the number of results is larger
  9954. // than maxResults, use the nextPageToken as a value for the query
  9955. // parameter pageToken in the next list request. Subsequent list
  9956. // requests will have their own nextPageToken to continue paging through
  9957. // the results.
  9958. NextPageToken string `json:"nextPageToken,omitempty"`
  9959. // SelfLink: [Output Only] Server-defined URL for this resource.
  9960. SelfLink string `json:"selfLink,omitempty"`
  9961. // Warning: [Output Only] Informational warning message.
  9962. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  9963. // ServerResponse contains the HTTP response code and headers from the
  9964. // server.
  9965. googleapi.ServerResponse `json:"-"`
  9966. // ForceSendFields is a list of field names (e.g. "Id") to
  9967. // unconditionally include in API requests. By default, fields with
  9968. // empty values are omitted from API requests. However, any non-pointer,
  9969. // non-interface field appearing in ForceSendFields will be sent to the
  9970. // server regardless of whether the field is empty or not. This may be
  9971. // used to include empty fields in Patch requests.
  9972. ForceSendFields []string `json:"-"`
  9973. // NullFields is a list of field names (e.g. "Id") to include in API
  9974. // requests with the JSON null value. By default, fields with empty
  9975. // values are omitted from API requests. However, any field with an
  9976. // empty value appearing in NullFields will be sent to the server as
  9977. // null. It is an error if a field in this list has a non-empty value.
  9978. // This may be used to include null fields in Patch requests.
  9979. NullFields []string `json:"-"`
  9980. }
  9981. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  9982. type NoMethod InstanceAggregatedList
  9983. raw := NoMethod(*s)
  9984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9985. }
  9986. // InstanceAggregatedListWarning: [Output Only] Informational warning
  9987. // message.
  9988. type InstanceAggregatedListWarning struct {
  9989. // Code: [Output Only] A warning code, if applicable. For example,
  9990. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9991. // the response.
  9992. //
  9993. // Possible values:
  9994. // "CLEANUP_FAILED"
  9995. // "DEPRECATED_RESOURCE_USED"
  9996. // "DEPRECATED_TYPE_USED"
  9997. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9998. // "EXPERIMENTAL_TYPE_USED"
  9999. // "EXTERNAL_API_WARNING"
  10000. // "FIELD_VALUE_OVERRIDEN"
  10001. // "INJECTED_KERNELS_DEPRECATED"
  10002. // "MISSING_TYPE_DEPENDENCY"
  10003. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10004. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10005. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10006. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10007. // "NEXT_HOP_NOT_RUNNING"
  10008. // "NOT_CRITICAL_ERROR"
  10009. // "NO_RESULTS_ON_PAGE"
  10010. // "REQUIRED_TOS_AGREEMENT"
  10011. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10012. // "RESOURCE_NOT_DELETED"
  10013. // "SCHEMA_VALIDATION_IGNORED"
  10014. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10015. // "UNDECLARED_PROPERTIES"
  10016. // "UNREACHABLE"
  10017. Code string `json:"code,omitempty"`
  10018. // Data: [Output Only] Metadata about this warning in key: value format.
  10019. // For example:
  10020. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10021. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  10022. // Message: [Output Only] A human-readable description of the warning
  10023. // code.
  10024. Message string `json:"message,omitempty"`
  10025. // ForceSendFields is a list of field names (e.g. "Code") to
  10026. // unconditionally include in API requests. By default, fields with
  10027. // empty values are omitted from API requests. However, any non-pointer,
  10028. // non-interface field appearing in ForceSendFields will be sent to the
  10029. // server regardless of whether the field is empty or not. This may be
  10030. // used to include empty fields in Patch requests.
  10031. ForceSendFields []string `json:"-"`
  10032. // NullFields is a list of field names (e.g. "Code") to include in API
  10033. // requests with the JSON null value. By default, fields with empty
  10034. // values are omitted from API requests. However, any field with an
  10035. // empty value appearing in NullFields will be sent to the server as
  10036. // null. It is an error if a field in this list has a non-empty value.
  10037. // This may be used to include null fields in Patch requests.
  10038. NullFields []string `json:"-"`
  10039. }
  10040. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10041. type NoMethod InstanceAggregatedListWarning
  10042. raw := NoMethod(*s)
  10043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10044. }
  10045. type InstanceAggregatedListWarningData struct {
  10046. // Key: [Output Only] A key that provides more detail on the warning
  10047. // being returned. For example, for warnings where there are no results
  10048. // in a list request for a particular zone, this key might be scope and
  10049. // the key value might be the zone name. Other examples might be a key
  10050. // indicating a deprecated resource and a suggested replacement, or a
  10051. // warning about invalid network settings (for example, if an instance
  10052. // attempts to perform IP forwarding but is not enabled for IP
  10053. // forwarding).
  10054. Key string `json:"key,omitempty"`
  10055. // Value: [Output Only] A warning data value corresponding to the key.
  10056. Value string `json:"value,omitempty"`
  10057. // ForceSendFields is a list of field names (e.g. "Key") to
  10058. // unconditionally include in API requests. By default, fields with
  10059. // empty values are omitted from API requests. However, any non-pointer,
  10060. // non-interface field appearing in ForceSendFields will be sent to the
  10061. // server regardless of whether the field is empty or not. This may be
  10062. // used to include empty fields in Patch requests.
  10063. ForceSendFields []string `json:"-"`
  10064. // NullFields is a list of field names (e.g. "Key") to include in API
  10065. // requests with the JSON null value. By default, fields with empty
  10066. // values are omitted from API requests. However, any field with an
  10067. // empty value appearing in NullFields will be sent to the server as
  10068. // null. It is an error if a field in this list has a non-empty value.
  10069. // This may be used to include null fields in Patch requests.
  10070. NullFields []string `json:"-"`
  10071. }
  10072. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10073. type NoMethod InstanceAggregatedListWarningData
  10074. raw := NoMethod(*s)
  10075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10076. }
  10077. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  10078. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  10079. // beta.regionInstanceGroups ==) (== resource_for
  10080. // v1.regionInstanceGroups ==)
  10081. type InstanceGroup struct {
  10082. // CreationTimestamp: [Output Only] The creation timestamp for this
  10083. // instance group in RFC3339 text format.
  10084. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10085. // Description: An optional description of this resource. Provide this
  10086. // property when you create the resource.
  10087. Description string `json:"description,omitempty"`
  10088. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  10089. // system uses this fingerprint to detect conflicts when multiple users
  10090. // change the named ports concurrently.
  10091. Fingerprint string `json:"fingerprint,omitempty"`
  10092. // Id: [Output Only] A unique identifier for this instance group,
  10093. // generated by the server.
  10094. Id uint64 `json:"id,omitempty,string"`
  10095. // Kind: [Output Only] The resource type, which is always
  10096. // compute#instanceGroup for instance groups.
  10097. Kind string `json:"kind,omitempty"`
  10098. // Name: The name of the instance group. The name must be 1-63
  10099. // characters long, and comply with RFC1035.
  10100. Name string `json:"name,omitempty"`
  10101. // NamedPorts: Assigns a name to a port number. For example: {name:
  10102. // "http", port: 80}
  10103. //
  10104. // This allows the system to reference ports by the assigned name
  10105. // instead of a port number. Named ports can also contain multiple
  10106. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  10107. // 8080}]
  10108. //
  10109. // Named ports apply to all instances in this instance group.
  10110. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10111. // Network: The URL of the network to which all instances in the
  10112. // instance group belong.
  10113. Network string `json:"network,omitempty"`
  10114. // Region: [Output Only] The URL of the region where the instance group
  10115. // is located (for regional resources).
  10116. Region string `json:"region,omitempty"`
  10117. // SelfLink: [Output Only] The URL for this instance group. The server
  10118. // generates this URL.
  10119. SelfLink string `json:"selfLink,omitempty"`
  10120. // Size: [Output Only] The total number of instances in the instance
  10121. // group.
  10122. Size int64 `json:"size,omitempty"`
  10123. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  10124. // instances in the instance group belong.
  10125. Subnetwork string `json:"subnetwork,omitempty"`
  10126. // Zone: [Output Only] The URL of the zone where the instance group is
  10127. // located (for zonal resources).
  10128. Zone string `json:"zone,omitempty"`
  10129. // ServerResponse contains the HTTP response code and headers from the
  10130. // server.
  10131. googleapi.ServerResponse `json:"-"`
  10132. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10133. // to unconditionally include in API requests. By default, fields with
  10134. // empty values are omitted from API requests. However, any non-pointer,
  10135. // non-interface field appearing in ForceSendFields will be sent to the
  10136. // server regardless of whether the field is empty or not. This may be
  10137. // used to include empty fields in Patch requests.
  10138. ForceSendFields []string `json:"-"`
  10139. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10140. // include in API requests with the JSON null value. By default, fields
  10141. // with empty values are omitted from API requests. However, any field
  10142. // with an empty value appearing in NullFields will be sent to the
  10143. // server as null. It is an error if a field in this list has a
  10144. // non-empty value. This may be used to include null fields in Patch
  10145. // requests.
  10146. NullFields []string `json:"-"`
  10147. }
  10148. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  10149. type NoMethod InstanceGroup
  10150. raw := NoMethod(*s)
  10151. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10152. }
  10153. type InstanceGroupAggregatedList struct {
  10154. // Id: [Output Only] Unique identifier for the resource; defined by the
  10155. // server.
  10156. Id string `json:"id,omitempty"`
  10157. // Items: A list of InstanceGroupsScopedList resources.
  10158. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  10159. // Kind: [Output Only] The resource type, which is always
  10160. // compute#instanceGroupAggregatedList for aggregated lists of instance
  10161. // groups.
  10162. Kind string `json:"kind,omitempty"`
  10163. // NextPageToken: [Output Only] This token allows you to get the next
  10164. // page of results for list requests. If the number of results is larger
  10165. // than maxResults, use the nextPageToken as a value for the query
  10166. // parameter pageToken in the next list request. Subsequent list
  10167. // requests will have their own nextPageToken to continue paging through
  10168. // the results.
  10169. NextPageToken string `json:"nextPageToken,omitempty"`
  10170. // SelfLink: [Output Only] Server-defined URL for this resource.
  10171. SelfLink string `json:"selfLink,omitempty"`
  10172. // Warning: [Output Only] Informational warning message.
  10173. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  10174. // ServerResponse contains the HTTP response code and headers from the
  10175. // server.
  10176. googleapi.ServerResponse `json:"-"`
  10177. // ForceSendFields is a list of field names (e.g. "Id") to
  10178. // unconditionally include in API requests. By default, fields with
  10179. // empty values are omitted from API requests. However, any non-pointer,
  10180. // non-interface field appearing in ForceSendFields will be sent to the
  10181. // server regardless of whether the field is empty or not. This may be
  10182. // used to include empty fields in Patch requests.
  10183. ForceSendFields []string `json:"-"`
  10184. // NullFields is a list of field names (e.g. "Id") to include in API
  10185. // requests with the JSON null value. By default, fields with empty
  10186. // values are omitted from API requests. However, any field with an
  10187. // empty value appearing in NullFields will be sent to the server as
  10188. // null. It is an error if a field in this list has a non-empty value.
  10189. // This may be used to include null fields in Patch requests.
  10190. NullFields []string `json:"-"`
  10191. }
  10192. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  10193. type NoMethod InstanceGroupAggregatedList
  10194. raw := NoMethod(*s)
  10195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10196. }
  10197. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  10198. // warning message.
  10199. type InstanceGroupAggregatedListWarning struct {
  10200. // Code: [Output Only] A warning code, if applicable. For example,
  10201. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10202. // the response.
  10203. //
  10204. // Possible values:
  10205. // "CLEANUP_FAILED"
  10206. // "DEPRECATED_RESOURCE_USED"
  10207. // "DEPRECATED_TYPE_USED"
  10208. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10209. // "EXPERIMENTAL_TYPE_USED"
  10210. // "EXTERNAL_API_WARNING"
  10211. // "FIELD_VALUE_OVERRIDEN"
  10212. // "INJECTED_KERNELS_DEPRECATED"
  10213. // "MISSING_TYPE_DEPENDENCY"
  10214. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10215. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10216. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10217. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10218. // "NEXT_HOP_NOT_RUNNING"
  10219. // "NOT_CRITICAL_ERROR"
  10220. // "NO_RESULTS_ON_PAGE"
  10221. // "REQUIRED_TOS_AGREEMENT"
  10222. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10223. // "RESOURCE_NOT_DELETED"
  10224. // "SCHEMA_VALIDATION_IGNORED"
  10225. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10226. // "UNDECLARED_PROPERTIES"
  10227. // "UNREACHABLE"
  10228. Code string `json:"code,omitempty"`
  10229. // Data: [Output Only] Metadata about this warning in key: value format.
  10230. // For example:
  10231. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10232. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  10233. // Message: [Output Only] A human-readable description of the warning
  10234. // code.
  10235. Message string `json:"message,omitempty"`
  10236. // ForceSendFields is a list of field names (e.g. "Code") to
  10237. // unconditionally include in API requests. By default, fields with
  10238. // empty values are omitted from API requests. However, any non-pointer,
  10239. // non-interface field appearing in ForceSendFields will be sent to the
  10240. // server regardless of whether the field is empty or not. This may be
  10241. // used to include empty fields in Patch requests.
  10242. ForceSendFields []string `json:"-"`
  10243. // NullFields is a list of field names (e.g. "Code") to include in API
  10244. // requests with the JSON null value. By default, fields with empty
  10245. // values are omitted from API requests. However, any field with an
  10246. // empty value appearing in NullFields will be sent to the server as
  10247. // null. It is an error if a field in this list has a non-empty value.
  10248. // This may be used to include null fields in Patch requests.
  10249. NullFields []string `json:"-"`
  10250. }
  10251. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10252. type NoMethod InstanceGroupAggregatedListWarning
  10253. raw := NoMethod(*s)
  10254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10255. }
  10256. type InstanceGroupAggregatedListWarningData struct {
  10257. // Key: [Output Only] A key that provides more detail on the warning
  10258. // being returned. For example, for warnings where there are no results
  10259. // in a list request for a particular zone, this key might be scope and
  10260. // the key value might be the zone name. Other examples might be a key
  10261. // indicating a deprecated resource and a suggested replacement, or a
  10262. // warning about invalid network settings (for example, if an instance
  10263. // attempts to perform IP forwarding but is not enabled for IP
  10264. // forwarding).
  10265. Key string `json:"key,omitempty"`
  10266. // Value: [Output Only] A warning data value corresponding to the key.
  10267. Value string `json:"value,omitempty"`
  10268. // ForceSendFields is a list of field names (e.g. "Key") to
  10269. // unconditionally include in API requests. By default, fields with
  10270. // empty values are omitted from API requests. However, any non-pointer,
  10271. // non-interface field appearing in ForceSendFields will be sent to the
  10272. // server regardless of whether the field is empty or not. This may be
  10273. // used to include empty fields in Patch requests.
  10274. ForceSendFields []string `json:"-"`
  10275. // NullFields is a list of field names (e.g. "Key") to include in API
  10276. // requests with the JSON null value. By default, fields with empty
  10277. // values are omitted from API requests. However, any field with an
  10278. // empty value appearing in NullFields will be sent to the server as
  10279. // null. It is an error if a field in this list has a non-empty value.
  10280. // This may be used to include null fields in Patch requests.
  10281. NullFields []string `json:"-"`
  10282. }
  10283. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10284. type NoMethod InstanceGroupAggregatedListWarningData
  10285. raw := NoMethod(*s)
  10286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10287. }
  10288. // InstanceGroupList: A list of InstanceGroup resources.
  10289. type InstanceGroupList struct {
  10290. // Id: [Output Only] Unique identifier for the resource; defined by the
  10291. // server.
  10292. Id string `json:"id,omitempty"`
  10293. // Items: A list of InstanceGroup resources.
  10294. Items []*InstanceGroup `json:"items,omitempty"`
  10295. // Kind: [Output Only] The resource type, which is always
  10296. // compute#instanceGroupList for instance group lists.
  10297. Kind string `json:"kind,omitempty"`
  10298. // NextPageToken: [Output Only] This token allows you to get the next
  10299. // page of results for list requests. If the number of results is larger
  10300. // than maxResults, use the nextPageToken as a value for the query
  10301. // parameter pageToken in the next list request. Subsequent list
  10302. // requests will have their own nextPageToken to continue paging through
  10303. // the results.
  10304. NextPageToken string `json:"nextPageToken,omitempty"`
  10305. // SelfLink: [Output Only] Server-defined URL for this resource.
  10306. SelfLink string `json:"selfLink,omitempty"`
  10307. // Warning: [Output Only] Informational warning message.
  10308. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  10309. // ServerResponse contains the HTTP response code and headers from the
  10310. // server.
  10311. googleapi.ServerResponse `json:"-"`
  10312. // ForceSendFields is a list of field names (e.g. "Id") to
  10313. // unconditionally include in API requests. By default, fields with
  10314. // empty values are omitted from API requests. However, any non-pointer,
  10315. // non-interface field appearing in ForceSendFields will be sent to the
  10316. // server regardless of whether the field is empty or not. This may be
  10317. // used to include empty fields in Patch requests.
  10318. ForceSendFields []string `json:"-"`
  10319. // NullFields is a list of field names (e.g. "Id") to include in API
  10320. // requests with the JSON null value. By default, fields with empty
  10321. // values are omitted from API requests. However, any field with an
  10322. // empty value appearing in NullFields will be sent to the server as
  10323. // null. It is an error if a field in this list has a non-empty value.
  10324. // This may be used to include null fields in Patch requests.
  10325. NullFields []string `json:"-"`
  10326. }
  10327. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  10328. type NoMethod InstanceGroupList
  10329. raw := NoMethod(*s)
  10330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10331. }
  10332. // InstanceGroupListWarning: [Output Only] Informational warning
  10333. // message.
  10334. type InstanceGroupListWarning struct {
  10335. // Code: [Output Only] A warning code, if applicable. For example,
  10336. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10337. // the response.
  10338. //
  10339. // Possible values:
  10340. // "CLEANUP_FAILED"
  10341. // "DEPRECATED_RESOURCE_USED"
  10342. // "DEPRECATED_TYPE_USED"
  10343. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10344. // "EXPERIMENTAL_TYPE_USED"
  10345. // "EXTERNAL_API_WARNING"
  10346. // "FIELD_VALUE_OVERRIDEN"
  10347. // "INJECTED_KERNELS_DEPRECATED"
  10348. // "MISSING_TYPE_DEPENDENCY"
  10349. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10350. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10351. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10352. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10353. // "NEXT_HOP_NOT_RUNNING"
  10354. // "NOT_CRITICAL_ERROR"
  10355. // "NO_RESULTS_ON_PAGE"
  10356. // "REQUIRED_TOS_AGREEMENT"
  10357. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10358. // "RESOURCE_NOT_DELETED"
  10359. // "SCHEMA_VALIDATION_IGNORED"
  10360. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10361. // "UNDECLARED_PROPERTIES"
  10362. // "UNREACHABLE"
  10363. Code string `json:"code,omitempty"`
  10364. // Data: [Output Only] Metadata about this warning in key: value format.
  10365. // For example:
  10366. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10367. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  10368. // Message: [Output Only] A human-readable description of the warning
  10369. // code.
  10370. Message string `json:"message,omitempty"`
  10371. // ForceSendFields is a list of field names (e.g. "Code") to
  10372. // unconditionally include in API requests. By default, fields with
  10373. // empty values are omitted from API requests. However, any non-pointer,
  10374. // non-interface field appearing in ForceSendFields will be sent to the
  10375. // server regardless of whether the field is empty or not. This may be
  10376. // used to include empty fields in Patch requests.
  10377. ForceSendFields []string `json:"-"`
  10378. // NullFields is a list of field names (e.g. "Code") to include in API
  10379. // requests with the JSON null value. By default, fields with empty
  10380. // values are omitted from API requests. However, any field with an
  10381. // empty value appearing in NullFields will be sent to the server as
  10382. // null. It is an error if a field in this list has a non-empty value.
  10383. // This may be used to include null fields in Patch requests.
  10384. NullFields []string `json:"-"`
  10385. }
  10386. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  10387. type NoMethod InstanceGroupListWarning
  10388. raw := NoMethod(*s)
  10389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10390. }
  10391. type InstanceGroupListWarningData struct {
  10392. // Key: [Output Only] A key that provides more detail on the warning
  10393. // being returned. For example, for warnings where there are no results
  10394. // in a list request for a particular zone, this key might be scope and
  10395. // the key value might be the zone name. Other examples might be a key
  10396. // indicating a deprecated resource and a suggested replacement, or a
  10397. // warning about invalid network settings (for example, if an instance
  10398. // attempts to perform IP forwarding but is not enabled for IP
  10399. // forwarding).
  10400. Key string `json:"key,omitempty"`
  10401. // Value: [Output Only] A warning data value corresponding to the key.
  10402. Value string `json:"value,omitempty"`
  10403. // ForceSendFields is a list of field names (e.g. "Key") to
  10404. // unconditionally include in API requests. By default, fields with
  10405. // empty values are omitted from API requests. However, any non-pointer,
  10406. // non-interface field appearing in ForceSendFields will be sent to the
  10407. // server regardless of whether the field is empty or not. This may be
  10408. // used to include empty fields in Patch requests.
  10409. ForceSendFields []string `json:"-"`
  10410. // NullFields is a list of field names (e.g. "Key") to include in API
  10411. // requests with the JSON null value. By default, fields with empty
  10412. // values are omitted from API requests. However, any field with an
  10413. // empty value appearing in NullFields will be sent to the server as
  10414. // null. It is an error if a field in this list has a non-empty value.
  10415. // This may be used to include null fields in Patch requests.
  10416. NullFields []string `json:"-"`
  10417. }
  10418. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  10419. type NoMethod InstanceGroupListWarningData
  10420. raw := NoMethod(*s)
  10421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10422. }
  10423. // InstanceGroupManager: An Instance Group Manager resource. (==
  10424. // resource_for beta.instanceGroupManagers ==) (== resource_for
  10425. // v1.instanceGroupManagers ==) (== resource_for
  10426. // beta.regionInstanceGroupManagers ==) (== resource_for
  10427. // v1.regionInstanceGroupManagers ==)
  10428. type InstanceGroupManager struct {
  10429. // AutoHealingPolicies: The autohealing policy for this managed instance
  10430. // group. You can specify only one value.
  10431. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  10432. // BaseInstanceName: The base instance name to use for instances in this
  10433. // group. The value must be 1-58 characters long. Instances are named by
  10434. // appending a hyphen and a random four-character string to the base
  10435. // instance name. The base instance name must comply with RFC1035.
  10436. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  10437. // CreationTimestamp: [Output Only] The creation timestamp for this
  10438. // managed instance group in RFC3339 text format.
  10439. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10440. // CurrentActions: [Output Only] The list of instance actions and the
  10441. // number of instances in this managed instance group that are scheduled
  10442. // for each of those actions.
  10443. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  10444. // Description: An optional description of this resource. Provide this
  10445. // property when you create the resource.
  10446. Description string `json:"description,omitempty"`
  10447. // DistributionPolicy: Policy specifying intended distribution of
  10448. // instances in regional managed instance group.
  10449. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  10450. // FailoverAction: The action to perform in case of zone failure. Only
  10451. // one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
  10452. //
  10453. // Possible values:
  10454. // "NO_FAILOVER"
  10455. // "UNKNOWN"
  10456. FailoverAction string `json:"failoverAction,omitempty"`
  10457. // Fingerprint: Fingerprint of this resource. This field may be used in
  10458. // optimistic locking. It will be ignored when inserting an
  10459. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  10460. // order to update the InstanceGroupManager, otherwise the request will
  10461. // fail with error 412 conditionNotMet.
  10462. //
  10463. // To see the latest fingerprint, make a get() request to retrieve an
  10464. // InstanceGroupManager.
  10465. Fingerprint string `json:"fingerprint,omitempty"`
  10466. // Id: [Output Only] A unique identifier for this resource type. The
  10467. // server generates this identifier.
  10468. Id uint64 `json:"id,omitempty,string"`
  10469. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  10470. InstanceGroup string `json:"instanceGroup,omitempty"`
  10471. // InstanceTemplate: The URL of the instance template that is specified
  10472. // for this managed instance group. The group uses this template to
  10473. // create all new instances in the managed instance group.
  10474. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  10475. // Kind: [Output Only] The resource type, which is always
  10476. // compute#instanceGroupManager for managed instance groups.
  10477. Kind string `json:"kind,omitempty"`
  10478. // Name: The name of the managed instance group. The name must be 1-63
  10479. // characters long, and comply with RFC1035.
  10480. Name string `json:"name,omitempty"`
  10481. // NamedPorts: Named ports configured for the Instance Groups
  10482. // complementary to this Instance Group Manager.
  10483. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10484. // PendingActions: [Output Only] The list of instance actions and the
  10485. // number of instances in this managed instance group that are pending
  10486. // for each of those actions.
  10487. PendingActions *InstanceGroupManagerPendingActionsSummary `json:"pendingActions,omitempty"`
  10488. // Region: [Output Only] The URL of the region where the managed
  10489. // instance group resides (for regional resources).
  10490. Region string `json:"region,omitempty"`
  10491. // SelfLink: [Output Only] The URL for this managed instance group. The
  10492. // server defines this URL.
  10493. SelfLink string `json:"selfLink,omitempty"`
  10494. // ServiceAccount: The service account to be used as credentials for all
  10495. // operations performed by the managed instance group on instances. The
  10496. // service accounts needs all permissions required to create and delete
  10497. // instances. By default, the service account
  10498. // {projectNumber}@cloudservices.gserviceaccount.com is used.
  10499. ServiceAccount string `json:"serviceAccount,omitempty"`
  10500. // Status: [Output Only] The status of this managed instance group.
  10501. Status *InstanceGroupManagerStatus `json:"status,omitempty"`
  10502. // TargetPools: The URLs for all TargetPool resources to which instances
  10503. // in the instanceGroup field are added. The target pools automatically
  10504. // apply to all of the instances in the managed instance group.
  10505. TargetPools []string `json:"targetPools,omitempty"`
  10506. // TargetSize: The target number of running instances for this managed
  10507. // instance group. Deleting or abandoning instances reduces this number.
  10508. // Resizing the group changes this number.
  10509. TargetSize int64 `json:"targetSize,omitempty"`
  10510. // UpdatePolicy: The update policy for this managed instance group.
  10511. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
  10512. // Versions: Specifies the instance templates used by this managed
  10513. // instance group to create instances.
  10514. //
  10515. // Each version is defined by an instanceTemplate. Every template can
  10516. // appear at most once per instance group. This field overrides the
  10517. // top-level instanceTemplate field. Read more about the relationships
  10518. // between these fields. Exactly one version must leave the targetSize
  10519. // field unset. That version will be applied to all remaining instances.
  10520. // For more information, read about canary updates.
  10521. Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
  10522. // Zone: [Output Only] The URL of the zone where the managed instance
  10523. // group is located (for zonal resources).
  10524. Zone string `json:"zone,omitempty"`
  10525. // ServerResponse contains the HTTP response code and headers from the
  10526. // server.
  10527. googleapi.ServerResponse `json:"-"`
  10528. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  10529. // to unconditionally include in API requests. By default, fields with
  10530. // empty values are omitted from API requests. However, any non-pointer,
  10531. // non-interface field appearing in ForceSendFields will be sent to the
  10532. // server regardless of whether the field is empty or not. This may be
  10533. // used to include empty fields in Patch requests.
  10534. ForceSendFields []string `json:"-"`
  10535. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  10536. // include in API requests with the JSON null value. By default, fields
  10537. // with empty values are omitted from API requests. However, any field
  10538. // with an empty value appearing in NullFields will be sent to the
  10539. // server as null. It is an error if a field in this list has a
  10540. // non-empty value. This may be used to include null fields in Patch
  10541. // requests.
  10542. NullFields []string `json:"-"`
  10543. }
  10544. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  10545. type NoMethod InstanceGroupManager
  10546. raw := NoMethod(*s)
  10547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10548. }
  10549. type InstanceGroupManagerActionsSummary struct {
  10550. // Abandoning: [Output Only] The total number of instances in the
  10551. // managed instance group that are scheduled to be abandoned. Abandoning
  10552. // an instance removes it from the managed instance group without
  10553. // deleting it.
  10554. Abandoning int64 `json:"abandoning,omitempty"`
  10555. // Creating: [Output Only] The number of instances in the managed
  10556. // instance group that are scheduled to be created or are currently
  10557. // being created. If the group fails to create any of these instances,
  10558. // it tries again until it creates the instance successfully.
  10559. //
  10560. // If you have disabled creation retries, this field will not be
  10561. // populated; instead, the creatingWithoutRetries field will be
  10562. // populated.
  10563. Creating int64 `json:"creating,omitempty"`
  10564. // CreatingWithoutRetries: [Output Only] The number of instances that
  10565. // the managed instance group will attempt to create. The group attempts
  10566. // to create each instance only once. If the group fails to create any
  10567. // of these instances, it decreases the group's targetSize value
  10568. // accordingly.
  10569. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  10570. // Deleting: [Output Only] The number of instances in the managed
  10571. // instance group that are scheduled to be deleted or are currently
  10572. // being deleted.
  10573. Deleting int64 `json:"deleting,omitempty"`
  10574. // None: [Output Only] The number of instances in the managed instance
  10575. // group that are running and have no scheduled actions.
  10576. None int64 `json:"none,omitempty"`
  10577. // Recreating: [Output Only] The number of instances in the managed
  10578. // instance group that are scheduled to be recreated or are currently
  10579. // being being recreated. Recreating an instance deletes the existing
  10580. // root persistent disk and creates a new disk from the image that is
  10581. // defined in the instance template.
  10582. Recreating int64 `json:"recreating,omitempty"`
  10583. // Refreshing: [Output Only] The number of instances in the managed
  10584. // instance group that are being reconfigured with properties that do
  10585. // not require a restart or a recreate action. For example, setting or
  10586. // removing target pools for the instance.
  10587. Refreshing int64 `json:"refreshing,omitempty"`
  10588. // Restarting: [Output Only] The number of instances in the managed
  10589. // instance group that are scheduled to be restarted or are currently
  10590. // being restarted.
  10591. Restarting int64 `json:"restarting,omitempty"`
  10592. // Verifying: [Output Only] The number of instances in the managed
  10593. // instance group that are being verified. See the
  10594. // managedInstances[].currentAction property in the listManagedInstances
  10595. // method documentation.
  10596. Verifying int64 `json:"verifying,omitempty"`
  10597. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  10598. // unconditionally include in API requests. By default, fields with
  10599. // empty values are omitted from API requests. However, any non-pointer,
  10600. // non-interface field appearing in ForceSendFields will be sent to the
  10601. // server regardless of whether the field is empty or not. This may be
  10602. // used to include empty fields in Patch requests.
  10603. ForceSendFields []string `json:"-"`
  10604. // NullFields is a list of field names (e.g. "Abandoning") to include in
  10605. // API requests with the JSON null value. By default, fields with empty
  10606. // values are omitted from API requests. However, any field with an
  10607. // empty value appearing in NullFields will be sent to the server as
  10608. // null. It is an error if a field in this list has a non-empty value.
  10609. // This may be used to include null fields in Patch requests.
  10610. NullFields []string `json:"-"`
  10611. }
  10612. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  10613. type NoMethod InstanceGroupManagerActionsSummary
  10614. raw := NoMethod(*s)
  10615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10616. }
  10617. type InstanceGroupManagerAggregatedList struct {
  10618. // Id: [Output Only] Unique identifier for the resource; defined by the
  10619. // server.
  10620. Id string `json:"id,omitempty"`
  10621. // Items: A list of InstanceGroupManagersScopedList resources.
  10622. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  10623. // Kind: [Output Only] The resource type, which is always
  10624. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  10625. // managed instance groups.
  10626. Kind string `json:"kind,omitempty"`
  10627. // NextPageToken: [Output Only] This token allows you to get the next
  10628. // page of results for list requests. If the number of results is larger
  10629. // than maxResults, use the nextPageToken as a value for the query
  10630. // parameter pageToken in the next list request. Subsequent list
  10631. // requests will have their own nextPageToken to continue paging through
  10632. // the results.
  10633. NextPageToken string `json:"nextPageToken,omitempty"`
  10634. // SelfLink: [Output Only] Server-defined URL for this resource.
  10635. SelfLink string `json:"selfLink,omitempty"`
  10636. // Warning: [Output Only] Informational warning message.
  10637. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  10638. // ServerResponse contains the HTTP response code and headers from the
  10639. // server.
  10640. googleapi.ServerResponse `json:"-"`
  10641. // ForceSendFields is a list of field names (e.g. "Id") to
  10642. // unconditionally include in API requests. By default, fields with
  10643. // empty values are omitted from API requests. However, any non-pointer,
  10644. // non-interface field appearing in ForceSendFields will be sent to the
  10645. // server regardless of whether the field is empty or not. This may be
  10646. // used to include empty fields in Patch requests.
  10647. ForceSendFields []string `json:"-"`
  10648. // NullFields is a list of field names (e.g. "Id") to include in API
  10649. // requests with the JSON null value. By default, fields with empty
  10650. // values are omitted from API requests. However, any field with an
  10651. // empty value appearing in NullFields will be sent to the server as
  10652. // null. It is an error if a field in this list has a non-empty value.
  10653. // This may be used to include null fields in Patch requests.
  10654. NullFields []string `json:"-"`
  10655. }
  10656. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  10657. type NoMethod InstanceGroupManagerAggregatedList
  10658. raw := NoMethod(*s)
  10659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10660. }
  10661. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  10662. // Informational warning message.
  10663. type InstanceGroupManagerAggregatedListWarning struct {
  10664. // Code: [Output Only] A warning code, if applicable. For example,
  10665. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10666. // the response.
  10667. //
  10668. // Possible values:
  10669. // "CLEANUP_FAILED"
  10670. // "DEPRECATED_RESOURCE_USED"
  10671. // "DEPRECATED_TYPE_USED"
  10672. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10673. // "EXPERIMENTAL_TYPE_USED"
  10674. // "EXTERNAL_API_WARNING"
  10675. // "FIELD_VALUE_OVERRIDEN"
  10676. // "INJECTED_KERNELS_DEPRECATED"
  10677. // "MISSING_TYPE_DEPENDENCY"
  10678. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10679. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10680. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10681. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10682. // "NEXT_HOP_NOT_RUNNING"
  10683. // "NOT_CRITICAL_ERROR"
  10684. // "NO_RESULTS_ON_PAGE"
  10685. // "REQUIRED_TOS_AGREEMENT"
  10686. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10687. // "RESOURCE_NOT_DELETED"
  10688. // "SCHEMA_VALIDATION_IGNORED"
  10689. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10690. // "UNDECLARED_PROPERTIES"
  10691. // "UNREACHABLE"
  10692. Code string `json:"code,omitempty"`
  10693. // Data: [Output Only] Metadata about this warning in key: value format.
  10694. // For example:
  10695. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10696. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  10697. // Message: [Output Only] A human-readable description of the warning
  10698. // code.
  10699. Message string `json:"message,omitempty"`
  10700. // ForceSendFields is a list of field names (e.g. "Code") to
  10701. // unconditionally include in API requests. By default, fields with
  10702. // empty values are omitted from API requests. However, any non-pointer,
  10703. // non-interface field appearing in ForceSendFields will be sent to the
  10704. // server regardless of whether the field is empty or not. This may be
  10705. // used to include empty fields in Patch requests.
  10706. ForceSendFields []string `json:"-"`
  10707. // NullFields is a list of field names (e.g. "Code") to include in API
  10708. // requests with the JSON null value. By default, fields with empty
  10709. // values are omitted from API requests. However, any field with an
  10710. // empty value appearing in NullFields will be sent to the server as
  10711. // null. It is an error if a field in this list has a non-empty value.
  10712. // This may be used to include null fields in Patch requests.
  10713. NullFields []string `json:"-"`
  10714. }
  10715. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10716. type NoMethod InstanceGroupManagerAggregatedListWarning
  10717. raw := NoMethod(*s)
  10718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10719. }
  10720. type InstanceGroupManagerAggregatedListWarningData struct {
  10721. // Key: [Output Only] A key that provides more detail on the warning
  10722. // being returned. For example, for warnings where there are no results
  10723. // in a list request for a particular zone, this key might be scope and
  10724. // the key value might be the zone name. Other examples might be a key
  10725. // indicating a deprecated resource and a suggested replacement, or a
  10726. // warning about invalid network settings (for example, if an instance
  10727. // attempts to perform IP forwarding but is not enabled for IP
  10728. // forwarding).
  10729. Key string `json:"key,omitempty"`
  10730. // Value: [Output Only] A warning data value corresponding to the key.
  10731. Value string `json:"value,omitempty"`
  10732. // ForceSendFields is a list of field names (e.g. "Key") to
  10733. // unconditionally include in API requests. By default, fields with
  10734. // empty values are omitted from API requests. However, any non-pointer,
  10735. // non-interface field appearing in ForceSendFields will be sent to the
  10736. // server regardless of whether the field is empty or not. This may be
  10737. // used to include empty fields in Patch requests.
  10738. ForceSendFields []string `json:"-"`
  10739. // NullFields is a list of field names (e.g. "Key") to include in API
  10740. // requests with the JSON null value. By default, fields with empty
  10741. // values are omitted from API requests. However, any field with an
  10742. // empty value appearing in NullFields will be sent to the server as
  10743. // null. It is an error if a field in this list has a non-empty value.
  10744. // This may be used to include null fields in Patch requests.
  10745. NullFields []string `json:"-"`
  10746. }
  10747. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10748. type NoMethod InstanceGroupManagerAggregatedListWarningData
  10749. raw := NoMethod(*s)
  10750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10751. }
  10752. type InstanceGroupManagerAutoHealingPolicy struct {
  10753. // HealthCheck: The URL for the health check that signals autohealing.
  10754. HealthCheck string `json:"healthCheck,omitempty"`
  10755. // InitialDelaySec: The number of seconds that the managed instance
  10756. // group waits before it applies autohealing policies to new instances
  10757. // or recently recreated instances. This initial delay allows instances
  10758. // to initialize and run their startup scripts before the instance group
  10759. // determines that they are UNHEALTHY. This prevents the managed
  10760. // instance group from recreating its instances prematurely. This value
  10761. // must be from range [0, 3600].
  10762. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  10763. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  10764. // unconditionally include in API requests. By default, fields with
  10765. // empty values are omitted from API requests. However, any non-pointer,
  10766. // non-interface field appearing in ForceSendFields will be sent to the
  10767. // server regardless of whether the field is empty or not. This may be
  10768. // used to include empty fields in Patch requests.
  10769. ForceSendFields []string `json:"-"`
  10770. // NullFields is a list of field names (e.g. "HealthCheck") to include
  10771. // in API requests with the JSON null value. By default, fields with
  10772. // empty values are omitted from API requests. However, any field with
  10773. // an empty value appearing in NullFields will be sent to the server as
  10774. // null. It is an error if a field in this list has a non-empty value.
  10775. // This may be used to include null fields in Patch requests.
  10776. NullFields []string `json:"-"`
  10777. }
  10778. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  10779. type NoMethod InstanceGroupManagerAutoHealingPolicy
  10780. raw := NoMethod(*s)
  10781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10782. }
  10783. // InstanceGroupManagerList: [Output Only] A list of managed instance
  10784. // groups.
  10785. type InstanceGroupManagerList struct {
  10786. // Id: [Output Only] Unique identifier for the resource; defined by the
  10787. // server.
  10788. Id string `json:"id,omitempty"`
  10789. // Items: A list of InstanceGroupManager resources.
  10790. Items []*InstanceGroupManager `json:"items,omitempty"`
  10791. // Kind: [Output Only] The resource type, which is always
  10792. // compute#instanceGroupManagerList for a list of managed instance
  10793. // groups.
  10794. Kind string `json:"kind,omitempty"`
  10795. // NextPageToken: [Output Only] This token allows you to get the next
  10796. // page of results for list requests. If the number of results is larger
  10797. // than maxResults, use the nextPageToken as a value for the query
  10798. // parameter pageToken in the next list request. Subsequent list
  10799. // requests will have their own nextPageToken to continue paging through
  10800. // the results.
  10801. NextPageToken string `json:"nextPageToken,omitempty"`
  10802. // SelfLink: [Output Only] Server-defined URL for this resource.
  10803. SelfLink string `json:"selfLink,omitempty"`
  10804. // Warning: [Output Only] Informational warning message.
  10805. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  10806. // ServerResponse contains the HTTP response code and headers from the
  10807. // server.
  10808. googleapi.ServerResponse `json:"-"`
  10809. // ForceSendFields is a list of field names (e.g. "Id") to
  10810. // unconditionally include in API requests. By default, fields with
  10811. // empty values are omitted from API requests. However, any non-pointer,
  10812. // non-interface field appearing in ForceSendFields will be sent to the
  10813. // server regardless of whether the field is empty or not. This may be
  10814. // used to include empty fields in Patch requests.
  10815. ForceSendFields []string `json:"-"`
  10816. // NullFields is a list of field names (e.g. "Id") to include in API
  10817. // requests with the JSON null value. By default, fields with empty
  10818. // values are omitted from API requests. However, any field with an
  10819. // empty value appearing in NullFields will be sent to the server as
  10820. // null. It is an error if a field in this list has a non-empty value.
  10821. // This may be used to include null fields in Patch requests.
  10822. NullFields []string `json:"-"`
  10823. }
  10824. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  10825. type NoMethod InstanceGroupManagerList
  10826. raw := NoMethod(*s)
  10827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10828. }
  10829. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  10830. // message.
  10831. type InstanceGroupManagerListWarning struct {
  10832. // Code: [Output Only] A warning code, if applicable. For example,
  10833. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10834. // the response.
  10835. //
  10836. // Possible values:
  10837. // "CLEANUP_FAILED"
  10838. // "DEPRECATED_RESOURCE_USED"
  10839. // "DEPRECATED_TYPE_USED"
  10840. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10841. // "EXPERIMENTAL_TYPE_USED"
  10842. // "EXTERNAL_API_WARNING"
  10843. // "FIELD_VALUE_OVERRIDEN"
  10844. // "INJECTED_KERNELS_DEPRECATED"
  10845. // "MISSING_TYPE_DEPENDENCY"
  10846. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10847. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10848. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10849. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10850. // "NEXT_HOP_NOT_RUNNING"
  10851. // "NOT_CRITICAL_ERROR"
  10852. // "NO_RESULTS_ON_PAGE"
  10853. // "REQUIRED_TOS_AGREEMENT"
  10854. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10855. // "RESOURCE_NOT_DELETED"
  10856. // "SCHEMA_VALIDATION_IGNORED"
  10857. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10858. // "UNDECLARED_PROPERTIES"
  10859. // "UNREACHABLE"
  10860. Code string `json:"code,omitempty"`
  10861. // Data: [Output Only] Metadata about this warning in key: value format.
  10862. // For example:
  10863. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10864. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  10865. // Message: [Output Only] A human-readable description of the warning
  10866. // code.
  10867. Message string `json:"message,omitempty"`
  10868. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  10884. type NoMethod InstanceGroupManagerListWarning
  10885. raw := NoMethod(*s)
  10886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10887. }
  10888. type InstanceGroupManagerListWarningData struct {
  10889. // Key: [Output Only] A key that provides more detail on the warning
  10890. // being returned. For example, for warnings where there are no results
  10891. // in a list request for a particular zone, this key might be scope and
  10892. // the key value might be the zone name. Other examples might be a key
  10893. // indicating a deprecated resource and a suggested replacement, or a
  10894. // warning about invalid network settings (for example, if an instance
  10895. // attempts to perform IP forwarding but is not enabled for IP
  10896. // forwarding).
  10897. Key string `json:"key,omitempty"`
  10898. // Value: [Output Only] A warning data value corresponding to the key.
  10899. Value string `json:"value,omitempty"`
  10900. // ForceSendFields is a list of field names (e.g. "Key") to
  10901. // unconditionally include in API requests. By default, fields with
  10902. // empty values are omitted from API requests. However, any non-pointer,
  10903. // non-interface field appearing in ForceSendFields will be sent to the
  10904. // server regardless of whether the field is empty or not. This may be
  10905. // used to include empty fields in Patch requests.
  10906. ForceSendFields []string `json:"-"`
  10907. // NullFields is a list of field names (e.g. "Key") to include in API
  10908. // requests with the JSON null value. By default, fields with empty
  10909. // values are omitted from API requests. However, any field with an
  10910. // empty value appearing in NullFields will be sent to the server as
  10911. // null. It is an error if a field in this list has a non-empty value.
  10912. // This may be used to include null fields in Patch requests.
  10913. NullFields []string `json:"-"`
  10914. }
  10915. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  10916. type NoMethod InstanceGroupManagerListWarningData
  10917. raw := NoMethod(*s)
  10918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10919. }
  10920. type InstanceGroupManagerPendingActionsSummary struct {
  10921. // Creating: [Output Only] The number of instances in the managed
  10922. // instance group that are pending to be created.
  10923. Creating int64 `json:"creating,omitempty"`
  10924. // Deleting: [Output Only] The number of instances in the managed
  10925. // instance group that are pending to be deleted.
  10926. Deleting int64 `json:"deleting,omitempty"`
  10927. // Recreating: [Output Only] The number of instances in the managed
  10928. // instance group that are pending to be recreated.
  10929. Recreating int64 `json:"recreating,omitempty"`
  10930. // Restarting: [Output Only] The number of instances in the managed
  10931. // instance group that are pending to be restarted.
  10932. Restarting int64 `json:"restarting,omitempty"`
  10933. // ForceSendFields is a list of field names (e.g. "Creating") to
  10934. // unconditionally include in API requests. By default, fields with
  10935. // empty values are omitted from API requests. However, any non-pointer,
  10936. // non-interface field appearing in ForceSendFields will be sent to the
  10937. // server regardless of whether the field is empty or not. This may be
  10938. // used to include empty fields in Patch requests.
  10939. ForceSendFields []string `json:"-"`
  10940. // NullFields is a list of field names (e.g. "Creating") to include in
  10941. // API requests with the JSON null value. By default, fields with empty
  10942. // values are omitted from API requests. However, any field with an
  10943. // empty value appearing in NullFields will be sent to the server as
  10944. // null. It is an error if a field in this list has a non-empty value.
  10945. // This may be used to include null fields in Patch requests.
  10946. NullFields []string `json:"-"`
  10947. }
  10948. func (s *InstanceGroupManagerPendingActionsSummary) MarshalJSON() ([]byte, error) {
  10949. type NoMethod InstanceGroupManagerPendingActionsSummary
  10950. raw := NoMethod(*s)
  10951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10952. }
  10953. type InstanceGroupManagerStatus struct {
  10954. // IsStable: [Output Only] A bit indicating whether the managed instance
  10955. // group is in a stable state. A stable state means that: none of the
  10956. // instances in the managed instance group is currently undergoing any
  10957. // type of change (for example, creation, restart, or deletion); no
  10958. // future changes are scheduled for instances in the managed instance
  10959. // group; and the managed instance group itself is not being modified.
  10960. IsStable bool `json:"isStable,omitempty"`
  10961. // VersionTarget: [Output Only] A status of consistency of Instances'
  10962. // versions with their target version specified by version field on
  10963. // Instance Group Manager.
  10964. VersionTarget *InstanceGroupManagerStatusVersionTarget `json:"versionTarget,omitempty"`
  10965. // ForceSendFields is a list of field names (e.g. "IsStable") to
  10966. // unconditionally include in API requests. By default, fields with
  10967. // empty values are omitted from API requests. However, any non-pointer,
  10968. // non-interface field appearing in ForceSendFields will be sent to the
  10969. // server regardless of whether the field is empty or not. This may be
  10970. // used to include empty fields in Patch requests.
  10971. ForceSendFields []string `json:"-"`
  10972. // NullFields is a list of field names (e.g. "IsStable") to include in
  10973. // API requests with the JSON null value. By default, fields with empty
  10974. // values are omitted from API requests. However, any field with an
  10975. // empty value appearing in NullFields will be sent to the server as
  10976. // null. It is an error if a field in this list has a non-empty value.
  10977. // This may be used to include null fields in Patch requests.
  10978. NullFields []string `json:"-"`
  10979. }
  10980. func (s *InstanceGroupManagerStatus) MarshalJSON() ([]byte, error) {
  10981. type NoMethod InstanceGroupManagerStatus
  10982. raw := NoMethod(*s)
  10983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10984. }
  10985. type InstanceGroupManagerStatusVersionTarget struct {
  10986. // IsReached: [Output Only] A bit indicating whether version target has
  10987. // been reached in this managed instance group, i.e. all instances are
  10988. // in their target version. Instances' target version are specified by
  10989. // version field on Instance Group Manager.
  10990. IsReached bool `json:"isReached,omitempty"`
  10991. // ForceSendFields is a list of field names (e.g. "IsReached") to
  10992. // unconditionally include in API requests. By default, fields with
  10993. // empty values are omitted from API requests. However, any non-pointer,
  10994. // non-interface field appearing in ForceSendFields will be sent to the
  10995. // server regardless of whether the field is empty or not. This may be
  10996. // used to include empty fields in Patch requests.
  10997. ForceSendFields []string `json:"-"`
  10998. // NullFields is a list of field names (e.g. "IsReached") to include in
  10999. // API requests with the JSON null value. By default, fields with empty
  11000. // values are omitted from API requests. However, any field with an
  11001. // empty value appearing in NullFields will be sent to the server as
  11002. // null. It is an error if a field in this list has a non-empty value.
  11003. // This may be used to include null fields in Patch requests.
  11004. NullFields []string `json:"-"`
  11005. }
  11006. func (s *InstanceGroupManagerStatusVersionTarget) MarshalJSON() ([]byte, error) {
  11007. type NoMethod InstanceGroupManagerStatusVersionTarget
  11008. raw := NoMethod(*s)
  11009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11010. }
  11011. type InstanceGroupManagerUpdatePolicy struct {
  11012. // MaxSurge: The maximum number of instances that can be created above
  11013. // the specified targetSize during the update process. By default, a
  11014. // fixed value of 1 is used. This value can be either a fixed number or
  11015. // a percentage if the instance group has 10 or more instances. If you
  11016. // set a percentage, the number of instances will be rounded up if
  11017. // necessary.
  11018. //
  11019. // At least one of either maxSurge or maxUnavailable must be greater
  11020. // than 0. Learn more about maxSurge.
  11021. MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
  11022. // MaxUnavailable: The maximum number of instances that can be
  11023. // unavailable during the update process. An instance is considered
  11024. // available if all of the following conditions are satisfied:
  11025. //
  11026. //
  11027. // - The instance's status is RUNNING.
  11028. // - If there is a health check on the instance group, the instance's
  11029. // liveness health check result must be HEALTHY at least once. If there
  11030. // is no health check on the group, then the instance only needs to have
  11031. // a status of RUNNING to be considered available. By default, a fixed
  11032. // value of 1 is used. This value can be either a fixed number or a
  11033. // percentage if the instance group has 10 or more instances. If you set
  11034. // a percentage, the number of instances will be rounded up if
  11035. // necessary.
  11036. //
  11037. // At least one of either maxSurge or maxUnavailable must be greater
  11038. // than 0. Learn more about maxUnavailable.
  11039. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  11040. // MinReadySec: Minimum number of seconds to wait for after a newly
  11041. // created instance becomes available. This value must be from range [0,
  11042. // 3600].
  11043. MinReadySec int64 `json:"minReadySec,omitempty"`
  11044. // MinimalAction: Minimal action to be taken on an instance. You can
  11045. // specify either RESTART to restart existing instances or REPLACE to
  11046. // delete and create new instances from the target template. If you
  11047. // specify a RESTART, the Updater will attempt to perform that action
  11048. // only. However, if the Updater determines that the minimal action you
  11049. // specify is not enough to perform the update, it might perform a more
  11050. // disruptive action.
  11051. //
  11052. // Possible values:
  11053. // "REPLACE"
  11054. // "RESTART"
  11055. MinimalAction string `json:"minimalAction,omitempty"`
  11056. // Possible values:
  11057. // "OPPORTUNISTIC"
  11058. // "PROACTIVE"
  11059. Type string `json:"type,omitempty"`
  11060. // ForceSendFields is a list of field names (e.g. "MaxSurge") to
  11061. // unconditionally include in API requests. By default, fields with
  11062. // empty values are omitted from API requests. However, any non-pointer,
  11063. // non-interface field appearing in ForceSendFields will be sent to the
  11064. // server regardless of whether the field is empty or not. This may be
  11065. // used to include empty fields in Patch requests.
  11066. ForceSendFields []string `json:"-"`
  11067. // NullFields is a list of field names (e.g. "MaxSurge") to include in
  11068. // API requests with the JSON null value. By default, fields with empty
  11069. // values are omitted from API requests. However, any field with an
  11070. // empty value appearing in NullFields will be sent to the server as
  11071. // null. It is an error if a field in this list has a non-empty value.
  11072. // This may be used to include null fields in Patch requests.
  11073. NullFields []string `json:"-"`
  11074. }
  11075. func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
  11076. type NoMethod InstanceGroupManagerUpdatePolicy
  11077. raw := NoMethod(*s)
  11078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11079. }
  11080. type InstanceGroupManagerVersion struct {
  11081. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  11082. // Name: Name of the version. Unique among all versions in the scope of
  11083. // this managed instance group.
  11084. Name string `json:"name,omitempty"`
  11085. // TargetSize: Specifies the intended number of instances to be created
  11086. // from the instanceTemplate. The final number of instances created from
  11087. // the template will be equal to:
  11088. // - If expressed as a fixed number, the minimum of either
  11089. // targetSize.fixed or instanceGroupManager.targetSize is used.
  11090. // - if expressed as a percent, the targetSize would be
  11091. // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
  11092. // is a remainder, the number is rounded up. If unset, this version
  11093. // will update any remaining instances not updated by another version.
  11094. // Read Starting a canary update for more information.
  11095. TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
  11096. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  11097. // unconditionally include in API requests. By default, fields with
  11098. // empty values are omitted from API requests. However, any non-pointer,
  11099. // non-interface field appearing in ForceSendFields will be sent to the
  11100. // server regardless of whether the field is empty or not. This may be
  11101. // used to include empty fields in Patch requests.
  11102. ForceSendFields []string `json:"-"`
  11103. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  11104. // include in API requests with the JSON null value. By default, fields
  11105. // with empty values are omitted from API requests. However, any field
  11106. // with an empty value appearing in NullFields will be sent to the
  11107. // server as null. It is an error if a field in this list has a
  11108. // non-empty value. This may be used to include null fields in Patch
  11109. // requests.
  11110. NullFields []string `json:"-"`
  11111. }
  11112. func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
  11113. type NoMethod InstanceGroupManagerVersion
  11114. raw := NoMethod(*s)
  11115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11116. }
  11117. type InstanceGroupManagersAbandonInstancesRequest struct {
  11118. // Instances: The URLs of one or more instances to abandon. This can be
  11119. // a full URL or a partial URL, such as
  11120. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11121. Instances []string `json:"instances,omitempty"`
  11122. // ForceSendFields is a list of field names (e.g. "Instances") to
  11123. // unconditionally include in API requests. By default, fields with
  11124. // empty values are omitted from API requests. However, any non-pointer,
  11125. // non-interface field appearing in ForceSendFields will be sent to the
  11126. // server regardless of whether the field is empty or not. This may be
  11127. // used to include empty fields in Patch requests.
  11128. ForceSendFields []string `json:"-"`
  11129. // NullFields is a list of field names (e.g. "Instances") to include in
  11130. // API requests with the JSON null value. By default, fields with empty
  11131. // values are omitted from API requests. However, any field with an
  11132. // empty value appearing in NullFields will be sent to the server as
  11133. // null. It is an error if a field in this list has a non-empty value.
  11134. // This may be used to include null fields in Patch requests.
  11135. NullFields []string `json:"-"`
  11136. }
  11137. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  11138. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  11139. raw := NoMethod(*s)
  11140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11141. }
  11142. type InstanceGroupManagersDeleteInstancesRequest struct {
  11143. // Instances: The URLs of one or more instances to delete. This can be a
  11144. // full URL or a partial URL, such as
  11145. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11146. Instances []string `json:"instances,omitempty"`
  11147. // ForceSendFields is a list of field names (e.g. "Instances") to
  11148. // unconditionally include in API requests. By default, fields with
  11149. // empty values are omitted from API requests. However, any non-pointer,
  11150. // non-interface field appearing in ForceSendFields will be sent to the
  11151. // server regardless of whether the field is empty or not. This may be
  11152. // used to include empty fields in Patch requests.
  11153. ForceSendFields []string `json:"-"`
  11154. // NullFields is a list of field names (e.g. "Instances") to include in
  11155. // API requests with the JSON null value. By default, fields with empty
  11156. // values are omitted from API requests. However, any field with an
  11157. // empty value appearing in NullFields will be sent to the server as
  11158. // null. It is an error if a field in this list has a non-empty value.
  11159. // This may be used to include null fields in Patch requests.
  11160. NullFields []string `json:"-"`
  11161. }
  11162. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  11163. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  11164. raw := NoMethod(*s)
  11165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11166. }
  11167. type InstanceGroupManagersListManagedInstancesResponse struct {
  11168. // ManagedInstances: [Output Only] The list of instances in the managed
  11169. // instance group.
  11170. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  11171. // NextPageToken: [Output Only] This token allows you to get the next
  11172. // page of results for list requests. If the number of results is larger
  11173. // than maxResults, use the nextPageToken as a value for the query
  11174. // parameter pageToken in the next list request. Subsequent list
  11175. // requests will have their own nextPageToken to continue paging through
  11176. // the results.
  11177. NextPageToken string `json:"nextPageToken,omitempty"`
  11178. // ServerResponse contains the HTTP response code and headers from the
  11179. // server.
  11180. googleapi.ServerResponse `json:"-"`
  11181. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  11182. // unconditionally include in API requests. By default, fields with
  11183. // empty values are omitted from API requests. However, any non-pointer,
  11184. // non-interface field appearing in ForceSendFields will be sent to the
  11185. // server regardless of whether the field is empty or not. This may be
  11186. // used to include empty fields in Patch requests.
  11187. ForceSendFields []string `json:"-"`
  11188. // NullFields is a list of field names (e.g. "ManagedInstances") to
  11189. // include in API requests with the JSON null value. By default, fields
  11190. // with empty values are omitted from API requests. However, any field
  11191. // with an empty value appearing in NullFields will be sent to the
  11192. // server as null. It is an error if a field in this list has a
  11193. // non-empty value. This may be used to include null fields in Patch
  11194. // requests.
  11195. NullFields []string `json:"-"`
  11196. }
  11197. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  11198. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  11199. raw := NoMethod(*s)
  11200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11201. }
  11202. type InstanceGroupManagersRecreateInstancesRequest struct {
  11203. // Instances: The URLs of one or more instances to recreate. This can be
  11204. // a full URL or a partial URL, such as
  11205. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11206. Instances []string `json:"instances,omitempty"`
  11207. // ForceSendFields is a list of field names (e.g. "Instances") to
  11208. // unconditionally include in API requests. By default, fields with
  11209. // empty values are omitted from API requests. However, any non-pointer,
  11210. // non-interface field appearing in ForceSendFields will be sent to the
  11211. // server regardless of whether the field is empty or not. This may be
  11212. // used to include empty fields in Patch requests.
  11213. ForceSendFields []string `json:"-"`
  11214. // NullFields is a list of field names (e.g. "Instances") to include in
  11215. // API requests with the JSON null value. By default, fields with empty
  11216. // values are omitted from API requests. However, any field with an
  11217. // empty value appearing in NullFields will be sent to the server as
  11218. // null. It is an error if a field in this list has a non-empty value.
  11219. // This may be used to include null fields in Patch requests.
  11220. NullFields []string `json:"-"`
  11221. }
  11222. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  11223. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  11224. raw := NoMethod(*s)
  11225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11226. }
  11227. type InstanceGroupManagersResizeAdvancedRequest struct {
  11228. // NoCreationRetries: If this flag is true, the managed instance group
  11229. // attempts to create all instances initiated by this resize request
  11230. // only once. If there is an error during creation, the managed instance
  11231. // group does not retry create this instance, and we will decrease the
  11232. // targetSize of the request instead. If the flag is false, the group
  11233. // attempts to recreate each instance continuously until it
  11234. // succeeds.
  11235. //
  11236. // This flag matters only in the first attempt of creation of an
  11237. // instance. After an instance is successfully created while this flag
  11238. // is enabled, the instance behaves the same way as all the other
  11239. // instances created with a regular resize request. In particular, if a
  11240. // running instance dies unexpectedly at a later time and needs to be
  11241. // recreated, this mode does not affect the recreation behavior in that
  11242. // scenario.
  11243. //
  11244. // This flag is applicable only to the current resize request. It does
  11245. // not influence other resize requests in any way.
  11246. //
  11247. // You can see which instances is being creating in which mode by
  11248. // calling the get or listManagedInstances API.
  11249. NoCreationRetries bool `json:"noCreationRetries,omitempty"`
  11250. // TargetSize: The number of running instances that the managed instance
  11251. // group should maintain at any given time. The group automatically adds
  11252. // or removes instances to maintain the number of instances specified by
  11253. // this parameter.
  11254. TargetSize int64 `json:"targetSize,omitempty"`
  11255. // ForceSendFields is a list of field names (e.g. "NoCreationRetries")
  11256. // to unconditionally include in API requests. By default, fields with
  11257. // empty values are omitted from API requests. However, any non-pointer,
  11258. // non-interface field appearing in ForceSendFields will be sent to the
  11259. // server regardless of whether the field is empty or not. This may be
  11260. // used to include empty fields in Patch requests.
  11261. ForceSendFields []string `json:"-"`
  11262. // NullFields is a list of field names (e.g. "NoCreationRetries") to
  11263. // include in API requests with the JSON null value. By default, fields
  11264. // with empty values are omitted from API requests. However, any field
  11265. // with an empty value appearing in NullFields will be sent to the
  11266. // server as null. It is an error if a field in this list has a
  11267. // non-empty value. This may be used to include null fields in Patch
  11268. // requests.
  11269. NullFields []string `json:"-"`
  11270. }
  11271. func (s *InstanceGroupManagersResizeAdvancedRequest) MarshalJSON() ([]byte, error) {
  11272. type NoMethod InstanceGroupManagersResizeAdvancedRequest
  11273. raw := NoMethod(*s)
  11274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11275. }
  11276. type InstanceGroupManagersScopedList struct {
  11277. // InstanceGroupManagers: [Output Only] The list of managed instance
  11278. // groups that are contained in the specified project and zone.
  11279. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  11280. // Warning: [Output Only] The warning that replaces the list of managed
  11281. // instance groups when the list is empty.
  11282. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  11283. // ForceSendFields is a list of field names (e.g.
  11284. // "InstanceGroupManagers") to unconditionally include in API requests.
  11285. // By default, fields with empty values are omitted from API requests.
  11286. // However, any non-pointer, non-interface field appearing in
  11287. // ForceSendFields will be sent to the server regardless of whether the
  11288. // field is empty or not. This may be used to include empty fields in
  11289. // Patch requests.
  11290. ForceSendFields []string `json:"-"`
  11291. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  11292. // include in API requests with the JSON null value. By default, fields
  11293. // with empty values are omitted from API requests. However, any field
  11294. // with an empty value appearing in NullFields will be sent to the
  11295. // server as null. It is an error if a field in this list has a
  11296. // non-empty value. This may be used to include null fields in Patch
  11297. // requests.
  11298. NullFields []string `json:"-"`
  11299. }
  11300. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  11301. type NoMethod InstanceGroupManagersScopedList
  11302. raw := NoMethod(*s)
  11303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11304. }
  11305. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  11306. // that replaces the list of managed instance groups when the list is
  11307. // empty.
  11308. type InstanceGroupManagersScopedListWarning struct {
  11309. // Code: [Output Only] A warning code, if applicable. For example,
  11310. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11311. // the response.
  11312. //
  11313. // Possible values:
  11314. // "CLEANUP_FAILED"
  11315. // "DEPRECATED_RESOURCE_USED"
  11316. // "DEPRECATED_TYPE_USED"
  11317. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11318. // "EXPERIMENTAL_TYPE_USED"
  11319. // "EXTERNAL_API_WARNING"
  11320. // "FIELD_VALUE_OVERRIDEN"
  11321. // "INJECTED_KERNELS_DEPRECATED"
  11322. // "MISSING_TYPE_DEPENDENCY"
  11323. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11324. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11325. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11326. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11327. // "NEXT_HOP_NOT_RUNNING"
  11328. // "NOT_CRITICAL_ERROR"
  11329. // "NO_RESULTS_ON_PAGE"
  11330. // "REQUIRED_TOS_AGREEMENT"
  11331. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11332. // "RESOURCE_NOT_DELETED"
  11333. // "SCHEMA_VALIDATION_IGNORED"
  11334. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11335. // "UNDECLARED_PROPERTIES"
  11336. // "UNREACHABLE"
  11337. Code string `json:"code,omitempty"`
  11338. // Data: [Output Only] Metadata about this warning in key: value format.
  11339. // For example:
  11340. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11341. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  11342. // Message: [Output Only] A human-readable description of the warning
  11343. // code.
  11344. Message string `json:"message,omitempty"`
  11345. // ForceSendFields is a list of field names (e.g. "Code") to
  11346. // unconditionally include in API requests. By default, fields with
  11347. // empty values are omitted from API requests. However, any non-pointer,
  11348. // non-interface field appearing in ForceSendFields will be sent to the
  11349. // server regardless of whether the field is empty or not. This may be
  11350. // used to include empty fields in Patch requests.
  11351. ForceSendFields []string `json:"-"`
  11352. // NullFields is a list of field names (e.g. "Code") to include in API
  11353. // requests with the JSON null value. By default, fields with empty
  11354. // values are omitted from API requests. However, any field with an
  11355. // empty value appearing in NullFields will be sent to the server as
  11356. // null. It is an error if a field in this list has a non-empty value.
  11357. // This may be used to include null fields in Patch requests.
  11358. NullFields []string `json:"-"`
  11359. }
  11360. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  11361. type NoMethod InstanceGroupManagersScopedListWarning
  11362. raw := NoMethod(*s)
  11363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11364. }
  11365. type InstanceGroupManagersScopedListWarningData struct {
  11366. // Key: [Output Only] A key that provides more detail on the warning
  11367. // being returned. For example, for warnings where there are no results
  11368. // in a list request for a particular zone, this key might be scope and
  11369. // the key value might be the zone name. Other examples might be a key
  11370. // indicating a deprecated resource and a suggested replacement, or a
  11371. // warning about invalid network settings (for example, if an instance
  11372. // attempts to perform IP forwarding but is not enabled for IP
  11373. // forwarding).
  11374. Key string `json:"key,omitempty"`
  11375. // Value: [Output Only] A warning data value corresponding to the key.
  11376. Value string `json:"value,omitempty"`
  11377. // ForceSendFields is a list of field names (e.g. "Key") to
  11378. // unconditionally include in API requests. By default, fields with
  11379. // empty values are omitted from API requests. However, any non-pointer,
  11380. // non-interface field appearing in ForceSendFields will be sent to the
  11381. // server regardless of whether the field is empty or not. This may be
  11382. // used to include empty fields in Patch requests.
  11383. ForceSendFields []string `json:"-"`
  11384. // NullFields is a list of field names (e.g. "Key") to include in API
  11385. // requests with the JSON null value. By default, fields with empty
  11386. // values are omitted from API requests. However, any field with an
  11387. // empty value appearing in NullFields will be sent to the server as
  11388. // null. It is an error if a field in this list has a non-empty value.
  11389. // This may be used to include null fields in Patch requests.
  11390. NullFields []string `json:"-"`
  11391. }
  11392. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  11393. type NoMethod InstanceGroupManagersScopedListWarningData
  11394. raw := NoMethod(*s)
  11395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11396. }
  11397. type InstanceGroupManagersSetAutoHealingRequest struct {
  11398. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  11399. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  11400. // to unconditionally include in API requests. By default, fields with
  11401. // empty values are omitted from API requests. However, any non-pointer,
  11402. // non-interface field appearing in ForceSendFields will be sent to the
  11403. // server regardless of whether the field is empty or not. This may be
  11404. // used to include empty fields in Patch requests.
  11405. ForceSendFields []string `json:"-"`
  11406. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  11407. // include in API requests with the JSON null value. By default, fields
  11408. // with empty values are omitted from API requests. However, any field
  11409. // with an empty value appearing in NullFields will be sent to the
  11410. // server as null. It is an error if a field in this list has a
  11411. // non-empty value. This may be used to include null fields in Patch
  11412. // requests.
  11413. NullFields []string `json:"-"`
  11414. }
  11415. func (s *InstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  11416. type NoMethod InstanceGroupManagersSetAutoHealingRequest
  11417. raw := NoMethod(*s)
  11418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11419. }
  11420. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  11421. // InstanceTemplate: The URL of the instance template that is specified
  11422. // for this managed instance group. The group uses this template to
  11423. // create all new instances in the managed instance group.
  11424. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  11425. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  11426. // unconditionally include in API requests. By default, fields with
  11427. // empty values are omitted from API requests. However, any non-pointer,
  11428. // non-interface field appearing in ForceSendFields will be sent to the
  11429. // server regardless of whether the field is empty or not. This may be
  11430. // used to include empty fields in Patch requests.
  11431. ForceSendFields []string `json:"-"`
  11432. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  11433. // include in API requests with the JSON null value. By default, fields
  11434. // with empty values are omitted from API requests. However, any field
  11435. // with an empty value appearing in NullFields will be sent to the
  11436. // server as null. It is an error if a field in this list has a
  11437. // non-empty value. This may be used to include null fields in Patch
  11438. // requests.
  11439. NullFields []string `json:"-"`
  11440. }
  11441. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  11442. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  11443. raw := NoMethod(*s)
  11444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11445. }
  11446. type InstanceGroupManagersSetTargetPoolsRequest struct {
  11447. // Fingerprint: The fingerprint of the target pools information. Use
  11448. // this optional property to prevent conflicts when multiple users
  11449. // change the target pools settings concurrently. Obtain the fingerprint
  11450. // with the instanceGroupManagers.get method. Then, include the
  11451. // fingerprint in your request to ensure that you do not overwrite
  11452. // changes that were applied from another concurrent request.
  11453. Fingerprint string `json:"fingerprint,omitempty"`
  11454. // TargetPools: The list of target pool URLs that instances in this
  11455. // managed instance group belong to. The managed instance group applies
  11456. // these target pools to all of the instances in the group. Existing
  11457. // instances and new instances in the group all receive these target
  11458. // pool settings.
  11459. TargetPools []string `json:"targetPools,omitempty"`
  11460. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  11461. // unconditionally include in API requests. By default, fields with
  11462. // empty values are omitted from API requests. However, any non-pointer,
  11463. // non-interface field appearing in ForceSendFields will be sent to the
  11464. // server regardless of whether the field is empty or not. This may be
  11465. // used to include empty fields in Patch requests.
  11466. ForceSendFields []string `json:"-"`
  11467. // NullFields is a list of field names (e.g. "Fingerprint") to include
  11468. // in API requests with the JSON null value. By default, fields with
  11469. // empty values are omitted from API requests. However, any field with
  11470. // an empty value appearing in NullFields will be sent to the server as
  11471. // null. It is an error if a field in this list has a non-empty value.
  11472. // This may be used to include null fields in Patch requests.
  11473. NullFields []string `json:"-"`
  11474. }
  11475. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  11476. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  11477. raw := NoMethod(*s)
  11478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11479. }
  11480. type InstanceGroupsAddInstancesRequest struct {
  11481. // Instances: The list of instances to add to the instance group.
  11482. Instances []*InstanceReference `json:"instances,omitempty"`
  11483. // ForceSendFields is a list of field names (e.g. "Instances") to
  11484. // unconditionally include in API requests. By default, fields with
  11485. // empty values are omitted from API requests. However, any non-pointer,
  11486. // non-interface field appearing in ForceSendFields will be sent to the
  11487. // server regardless of whether the field is empty or not. This may be
  11488. // used to include empty fields in Patch requests.
  11489. ForceSendFields []string `json:"-"`
  11490. // NullFields is a list of field names (e.g. "Instances") to include in
  11491. // API requests with the JSON null value. By default, fields with empty
  11492. // values are omitted from API requests. However, any field with an
  11493. // empty value appearing in NullFields will be sent to the server as
  11494. // null. It is an error if a field in this list has a non-empty value.
  11495. // This may be used to include null fields in Patch requests.
  11496. NullFields []string `json:"-"`
  11497. }
  11498. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  11499. type NoMethod InstanceGroupsAddInstancesRequest
  11500. raw := NoMethod(*s)
  11501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11502. }
  11503. type InstanceGroupsListInstances struct {
  11504. // Id: [Output Only] Unique identifier for the resource; defined by the
  11505. // server.
  11506. Id string `json:"id,omitempty"`
  11507. // Items: A list of InstanceWithNamedPorts resources.
  11508. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  11509. // Kind: [Output Only] The resource type, which is always
  11510. // compute#instanceGroupsListInstances for the list of instances in the
  11511. // specified instance group.
  11512. Kind string `json:"kind,omitempty"`
  11513. // NextPageToken: [Output Only] This token allows you to get the next
  11514. // page of results for list requests. If the number of results is larger
  11515. // than maxResults, use the nextPageToken as a value for the query
  11516. // parameter pageToken in the next list request. Subsequent list
  11517. // requests will have their own nextPageToken to continue paging through
  11518. // the results.
  11519. NextPageToken string `json:"nextPageToken,omitempty"`
  11520. // SelfLink: [Output Only] Server-defined URL for this resource.
  11521. SelfLink string `json:"selfLink,omitempty"`
  11522. // Warning: [Output Only] Informational warning message.
  11523. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  11524. // ServerResponse contains the HTTP response code and headers from the
  11525. // server.
  11526. googleapi.ServerResponse `json:"-"`
  11527. // ForceSendFields is a list of field names (e.g. "Id") to
  11528. // unconditionally include in API requests. By default, fields with
  11529. // empty values are omitted from API requests. However, any non-pointer,
  11530. // non-interface field appearing in ForceSendFields will be sent to the
  11531. // server regardless of whether the field is empty or not. This may be
  11532. // used to include empty fields in Patch requests.
  11533. ForceSendFields []string `json:"-"`
  11534. // NullFields is a list of field names (e.g. "Id") to include in API
  11535. // requests with the JSON null value. By default, fields with empty
  11536. // values are omitted from API requests. However, any field with an
  11537. // empty value appearing in NullFields will be sent to the server as
  11538. // null. It is an error if a field in this list has a non-empty value.
  11539. // This may be used to include null fields in Patch requests.
  11540. NullFields []string `json:"-"`
  11541. }
  11542. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  11543. type NoMethod InstanceGroupsListInstances
  11544. raw := NoMethod(*s)
  11545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11546. }
  11547. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  11548. // warning message.
  11549. type InstanceGroupsListInstancesWarning struct {
  11550. // Code: [Output Only] A warning code, if applicable. For example,
  11551. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11552. // the response.
  11553. //
  11554. // Possible values:
  11555. // "CLEANUP_FAILED"
  11556. // "DEPRECATED_RESOURCE_USED"
  11557. // "DEPRECATED_TYPE_USED"
  11558. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11559. // "EXPERIMENTAL_TYPE_USED"
  11560. // "EXTERNAL_API_WARNING"
  11561. // "FIELD_VALUE_OVERRIDEN"
  11562. // "INJECTED_KERNELS_DEPRECATED"
  11563. // "MISSING_TYPE_DEPENDENCY"
  11564. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11565. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11566. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11567. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11568. // "NEXT_HOP_NOT_RUNNING"
  11569. // "NOT_CRITICAL_ERROR"
  11570. // "NO_RESULTS_ON_PAGE"
  11571. // "REQUIRED_TOS_AGREEMENT"
  11572. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11573. // "RESOURCE_NOT_DELETED"
  11574. // "SCHEMA_VALIDATION_IGNORED"
  11575. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11576. // "UNDECLARED_PROPERTIES"
  11577. // "UNREACHABLE"
  11578. Code string `json:"code,omitempty"`
  11579. // Data: [Output Only] Metadata about this warning in key: value format.
  11580. // For example:
  11581. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11582. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  11583. // Message: [Output Only] A human-readable description of the warning
  11584. // code.
  11585. Message string `json:"message,omitempty"`
  11586. // ForceSendFields is a list of field names (e.g. "Code") to
  11587. // unconditionally include in API requests. By default, fields with
  11588. // empty values are omitted from API requests. However, any non-pointer,
  11589. // non-interface field appearing in ForceSendFields will be sent to the
  11590. // server regardless of whether the field is empty or not. This may be
  11591. // used to include empty fields in Patch requests.
  11592. ForceSendFields []string `json:"-"`
  11593. // NullFields is a list of field names (e.g. "Code") to include in API
  11594. // requests with the JSON null value. By default, fields with empty
  11595. // values are omitted from API requests. However, any field with an
  11596. // empty value appearing in NullFields will be sent to the server as
  11597. // null. It is an error if a field in this list has a non-empty value.
  11598. // This may be used to include null fields in Patch requests.
  11599. NullFields []string `json:"-"`
  11600. }
  11601. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  11602. type NoMethod InstanceGroupsListInstancesWarning
  11603. raw := NoMethod(*s)
  11604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11605. }
  11606. type InstanceGroupsListInstancesWarningData struct {
  11607. // Key: [Output Only] A key that provides more detail on the warning
  11608. // being returned. For example, for warnings where there are no results
  11609. // in a list request for a particular zone, this key might be scope and
  11610. // the key value might be the zone name. Other examples might be a key
  11611. // indicating a deprecated resource and a suggested replacement, or a
  11612. // warning about invalid network settings (for example, if an instance
  11613. // attempts to perform IP forwarding but is not enabled for IP
  11614. // forwarding).
  11615. Key string `json:"key,omitempty"`
  11616. // Value: [Output Only] A warning data value corresponding to the key.
  11617. Value string `json:"value,omitempty"`
  11618. // ForceSendFields is a list of field names (e.g. "Key") to
  11619. // unconditionally include in API requests. By default, fields with
  11620. // empty values are omitted from API requests. However, any non-pointer,
  11621. // non-interface field appearing in ForceSendFields will be sent to the
  11622. // server regardless of whether the field is empty or not. This may be
  11623. // used to include empty fields in Patch requests.
  11624. ForceSendFields []string `json:"-"`
  11625. // NullFields is a list of field names (e.g. "Key") to include in API
  11626. // requests with the JSON null value. By default, fields with empty
  11627. // values are omitted from API requests. However, any field with an
  11628. // empty value appearing in NullFields will be sent to the server as
  11629. // null. It is an error if a field in this list has a non-empty value.
  11630. // This may be used to include null fields in Patch requests.
  11631. NullFields []string `json:"-"`
  11632. }
  11633. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  11634. type NoMethod InstanceGroupsListInstancesWarningData
  11635. raw := NoMethod(*s)
  11636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11637. }
  11638. type InstanceGroupsListInstancesRequest struct {
  11639. // InstanceState: A filter for the state of the instances in the
  11640. // instance group. Valid options are ALL or RUNNING. If you do not
  11641. // specify this parameter the list includes all instances regardless of
  11642. // their state.
  11643. //
  11644. // Possible values:
  11645. // "ALL"
  11646. // "RUNNING"
  11647. InstanceState string `json:"instanceState,omitempty"`
  11648. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  11649. // unconditionally include in API requests. By default, fields with
  11650. // empty values are omitted from API requests. However, any non-pointer,
  11651. // non-interface field appearing in ForceSendFields will be sent to the
  11652. // server regardless of whether the field is empty or not. This may be
  11653. // used to include empty fields in Patch requests.
  11654. ForceSendFields []string `json:"-"`
  11655. // NullFields is a list of field names (e.g. "InstanceState") to include
  11656. // in API requests with the JSON null value. By default, fields with
  11657. // empty values are omitted from API requests. However, any field with
  11658. // an empty value appearing in NullFields will be sent to the server as
  11659. // null. It is an error if a field in this list has a non-empty value.
  11660. // This may be used to include null fields in Patch requests.
  11661. NullFields []string `json:"-"`
  11662. }
  11663. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  11664. type NoMethod InstanceGroupsListInstancesRequest
  11665. raw := NoMethod(*s)
  11666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11667. }
  11668. type InstanceGroupsRemoveInstancesRequest struct {
  11669. // Instances: The list of instances to remove from the instance group.
  11670. Instances []*InstanceReference `json:"instances,omitempty"`
  11671. // ForceSendFields is a list of field names (e.g. "Instances") to
  11672. // unconditionally include in API requests. By default, fields with
  11673. // empty values are omitted from API requests. However, any non-pointer,
  11674. // non-interface field appearing in ForceSendFields will be sent to the
  11675. // server regardless of whether the field is empty or not. This may be
  11676. // used to include empty fields in Patch requests.
  11677. ForceSendFields []string `json:"-"`
  11678. // NullFields is a list of field names (e.g. "Instances") to include in
  11679. // API requests with the JSON null value. By default, fields with empty
  11680. // values are omitted from API requests. However, any field with an
  11681. // empty value appearing in NullFields will be sent to the server as
  11682. // null. It is an error if a field in this list has a non-empty value.
  11683. // This may be used to include null fields in Patch requests.
  11684. NullFields []string `json:"-"`
  11685. }
  11686. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  11687. type NoMethod InstanceGroupsRemoveInstancesRequest
  11688. raw := NoMethod(*s)
  11689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11690. }
  11691. type InstanceGroupsScopedList struct {
  11692. // InstanceGroups: [Output Only] The list of instance groups that are
  11693. // contained in this scope.
  11694. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  11695. // Warning: [Output Only] An informational warning that replaces the
  11696. // list of instance groups when the list is empty.
  11697. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  11698. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  11699. // unconditionally include in API requests. By default, fields with
  11700. // empty values are omitted from API requests. However, any non-pointer,
  11701. // non-interface field appearing in ForceSendFields will be sent to the
  11702. // server regardless of whether the field is empty or not. This may be
  11703. // used to include empty fields in Patch requests.
  11704. ForceSendFields []string `json:"-"`
  11705. // NullFields is a list of field names (e.g. "InstanceGroups") to
  11706. // include in API requests with the JSON null value. By default, fields
  11707. // with empty values are omitted from API requests. However, any field
  11708. // with an empty value appearing in NullFields will be sent to the
  11709. // server as null. It is an error if a field in this list has a
  11710. // non-empty value. This may be used to include null fields in Patch
  11711. // requests.
  11712. NullFields []string `json:"-"`
  11713. }
  11714. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  11715. type NoMethod InstanceGroupsScopedList
  11716. raw := NoMethod(*s)
  11717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11718. }
  11719. // InstanceGroupsScopedListWarning: [Output Only] An informational
  11720. // warning that replaces the list of instance groups when the list is
  11721. // empty.
  11722. type InstanceGroupsScopedListWarning struct {
  11723. // Code: [Output Only] A warning code, if applicable. For example,
  11724. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11725. // the response.
  11726. //
  11727. // Possible values:
  11728. // "CLEANUP_FAILED"
  11729. // "DEPRECATED_RESOURCE_USED"
  11730. // "DEPRECATED_TYPE_USED"
  11731. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11732. // "EXPERIMENTAL_TYPE_USED"
  11733. // "EXTERNAL_API_WARNING"
  11734. // "FIELD_VALUE_OVERRIDEN"
  11735. // "INJECTED_KERNELS_DEPRECATED"
  11736. // "MISSING_TYPE_DEPENDENCY"
  11737. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11738. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11739. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11740. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11741. // "NEXT_HOP_NOT_RUNNING"
  11742. // "NOT_CRITICAL_ERROR"
  11743. // "NO_RESULTS_ON_PAGE"
  11744. // "REQUIRED_TOS_AGREEMENT"
  11745. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11746. // "RESOURCE_NOT_DELETED"
  11747. // "SCHEMA_VALIDATION_IGNORED"
  11748. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11749. // "UNDECLARED_PROPERTIES"
  11750. // "UNREACHABLE"
  11751. Code string `json:"code,omitempty"`
  11752. // Data: [Output Only] Metadata about this warning in key: value format.
  11753. // For example:
  11754. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11755. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  11756. // Message: [Output Only] A human-readable description of the warning
  11757. // code.
  11758. Message string `json:"message,omitempty"`
  11759. // ForceSendFields is a list of field names (e.g. "Code") to
  11760. // unconditionally include in API requests. By default, fields with
  11761. // empty values are omitted from API requests. However, any non-pointer,
  11762. // non-interface field appearing in ForceSendFields will be sent to the
  11763. // server regardless of whether the field is empty or not. This may be
  11764. // used to include empty fields in Patch requests.
  11765. ForceSendFields []string `json:"-"`
  11766. // NullFields is a list of field names (e.g. "Code") to include in API
  11767. // requests with the JSON null value. By default, fields with empty
  11768. // values are omitted from API requests. However, any field with an
  11769. // empty value appearing in NullFields will be sent to the server as
  11770. // null. It is an error if a field in this list has a non-empty value.
  11771. // This may be used to include null fields in Patch requests.
  11772. NullFields []string `json:"-"`
  11773. }
  11774. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  11775. type NoMethod InstanceGroupsScopedListWarning
  11776. raw := NoMethod(*s)
  11777. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11778. }
  11779. type InstanceGroupsScopedListWarningData struct {
  11780. // Key: [Output Only] A key that provides more detail on the warning
  11781. // being returned. For example, for warnings where there are no results
  11782. // in a list request for a particular zone, this key might be scope and
  11783. // the key value might be the zone name. Other examples might be a key
  11784. // indicating a deprecated resource and a suggested replacement, or a
  11785. // warning about invalid network settings (for example, if an instance
  11786. // attempts to perform IP forwarding but is not enabled for IP
  11787. // forwarding).
  11788. Key string `json:"key,omitempty"`
  11789. // Value: [Output Only] A warning data value corresponding to the key.
  11790. Value string `json:"value,omitempty"`
  11791. // ForceSendFields is a list of field names (e.g. "Key") to
  11792. // unconditionally include in API requests. By default, fields with
  11793. // empty values are omitted from API requests. However, any non-pointer,
  11794. // non-interface field appearing in ForceSendFields will be sent to the
  11795. // server regardless of whether the field is empty or not. This may be
  11796. // used to include empty fields in Patch requests.
  11797. ForceSendFields []string `json:"-"`
  11798. // NullFields is a list of field names (e.g. "Key") to include in API
  11799. // requests with the JSON null value. By default, fields with empty
  11800. // values are omitted from API requests. However, any field with an
  11801. // empty value appearing in NullFields will be sent to the server as
  11802. // null. It is an error if a field in this list has a non-empty value.
  11803. // This may be used to include null fields in Patch requests.
  11804. NullFields []string `json:"-"`
  11805. }
  11806. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  11807. type NoMethod InstanceGroupsScopedListWarningData
  11808. raw := NoMethod(*s)
  11809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11810. }
  11811. type InstanceGroupsSetNamedPortsRequest struct {
  11812. // Fingerprint: The fingerprint of the named ports information for this
  11813. // instance group. Use this optional property to prevent conflicts when
  11814. // multiple users change the named ports settings concurrently. Obtain
  11815. // the fingerprint with the instanceGroups.get method. Then, include the
  11816. // fingerprint in your request to ensure that you do not overwrite
  11817. // changes that were applied from another concurrent request. A request
  11818. // with an incorrect fingerprint will fail with error 412
  11819. // conditionNotMet.
  11820. Fingerprint string `json:"fingerprint,omitempty"`
  11821. // NamedPorts: The list of named ports to set for this instance group.
  11822. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  11823. // ForceSendFields is a list of field names (e.g. "Fingerprint") 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. "Fingerprint") to include
  11831. // in API requests with the JSON null value. By default, fields with
  11832. // empty values are omitted from API requests. However, any field with
  11833. // an 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 *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  11839. type NoMethod InstanceGroupsSetNamedPortsRequest
  11840. raw := NoMethod(*s)
  11841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11842. }
  11843. // InstanceList: Contains a list of instances.
  11844. type InstanceList struct {
  11845. // Id: [Output Only] Unique identifier for the resource; defined by the
  11846. // server.
  11847. Id string `json:"id,omitempty"`
  11848. // Items: A list of Instance resources.
  11849. Items []*Instance `json:"items,omitempty"`
  11850. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  11851. // lists of Instance resources.
  11852. Kind string `json:"kind,omitempty"`
  11853. // NextPageToken: [Output Only] This token allows you to get the next
  11854. // page of results for list requests. If the number of results is larger
  11855. // than maxResults, use the nextPageToken as a value for the query
  11856. // parameter pageToken in the next list request. Subsequent list
  11857. // requests will have their own nextPageToken to continue paging through
  11858. // the results.
  11859. NextPageToken string `json:"nextPageToken,omitempty"`
  11860. // SelfLink: [Output Only] Server-defined URL for this resource.
  11861. SelfLink string `json:"selfLink,omitempty"`
  11862. // Warning: [Output Only] Informational warning message.
  11863. Warning *InstanceListWarning `json:"warning,omitempty"`
  11864. // ServerResponse contains the HTTP response code and headers from the
  11865. // server.
  11866. googleapi.ServerResponse `json:"-"`
  11867. // ForceSendFields is a list of field names (e.g. "Id") to
  11868. // unconditionally include in API requests. By default, fields with
  11869. // empty values are omitted from API requests. However, any non-pointer,
  11870. // non-interface field appearing in ForceSendFields will be sent to the
  11871. // server regardless of whether the field is empty or not. This may be
  11872. // used to include empty fields in Patch requests.
  11873. ForceSendFields []string `json:"-"`
  11874. // NullFields is a list of field names (e.g. "Id") to include in API
  11875. // requests with the JSON null value. By default, fields with empty
  11876. // values are omitted from API requests. However, any field with an
  11877. // empty value appearing in NullFields will be sent to the server as
  11878. // null. It is an error if a field in this list has a non-empty value.
  11879. // This may be used to include null fields in Patch requests.
  11880. NullFields []string `json:"-"`
  11881. }
  11882. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  11883. type NoMethod InstanceList
  11884. raw := NoMethod(*s)
  11885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11886. }
  11887. // InstanceListWarning: [Output Only] Informational warning message.
  11888. type InstanceListWarning struct {
  11889. // Code: [Output Only] A warning code, if applicable. For example,
  11890. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11891. // the response.
  11892. //
  11893. // Possible values:
  11894. // "CLEANUP_FAILED"
  11895. // "DEPRECATED_RESOURCE_USED"
  11896. // "DEPRECATED_TYPE_USED"
  11897. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11898. // "EXPERIMENTAL_TYPE_USED"
  11899. // "EXTERNAL_API_WARNING"
  11900. // "FIELD_VALUE_OVERRIDEN"
  11901. // "INJECTED_KERNELS_DEPRECATED"
  11902. // "MISSING_TYPE_DEPENDENCY"
  11903. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11904. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11905. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11906. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11907. // "NEXT_HOP_NOT_RUNNING"
  11908. // "NOT_CRITICAL_ERROR"
  11909. // "NO_RESULTS_ON_PAGE"
  11910. // "REQUIRED_TOS_AGREEMENT"
  11911. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11912. // "RESOURCE_NOT_DELETED"
  11913. // "SCHEMA_VALIDATION_IGNORED"
  11914. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11915. // "UNDECLARED_PROPERTIES"
  11916. // "UNREACHABLE"
  11917. Code string `json:"code,omitempty"`
  11918. // Data: [Output Only] Metadata about this warning in key: value format.
  11919. // For example:
  11920. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11921. Data []*InstanceListWarningData `json:"data,omitempty"`
  11922. // Message: [Output Only] A human-readable description of the warning
  11923. // code.
  11924. Message string `json:"message,omitempty"`
  11925. // ForceSendFields is a list of field names (e.g. "Code") to
  11926. // unconditionally include in API requests. By default, fields with
  11927. // empty values are omitted from API requests. However, any non-pointer,
  11928. // non-interface field appearing in ForceSendFields will be sent to the
  11929. // server regardless of whether the field is empty or not. This may be
  11930. // used to include empty fields in Patch requests.
  11931. ForceSendFields []string `json:"-"`
  11932. // NullFields is a list of field names (e.g. "Code") to include in API
  11933. // requests with the JSON null value. By default, fields with empty
  11934. // values are omitted from API requests. However, any field with an
  11935. // empty value appearing in NullFields will be sent to the server as
  11936. // null. It is an error if a field in this list has a non-empty value.
  11937. // This may be used to include null fields in Patch requests.
  11938. NullFields []string `json:"-"`
  11939. }
  11940. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  11941. type NoMethod InstanceListWarning
  11942. raw := NoMethod(*s)
  11943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11944. }
  11945. type InstanceListWarningData struct {
  11946. // Key: [Output Only] A key that provides more detail on the warning
  11947. // being returned. For example, for warnings where there are no results
  11948. // in a list request for a particular zone, this key might be scope and
  11949. // the key value might be the zone name. Other examples might be a key
  11950. // indicating a deprecated resource and a suggested replacement, or a
  11951. // warning about invalid network settings (for example, if an instance
  11952. // attempts to perform IP forwarding but is not enabled for IP
  11953. // forwarding).
  11954. Key string `json:"key,omitempty"`
  11955. // Value: [Output Only] A warning data value corresponding to the key.
  11956. Value string `json:"value,omitempty"`
  11957. // ForceSendFields is a list of field names (e.g. "Key") to
  11958. // unconditionally include in API requests. By default, fields with
  11959. // empty values are omitted from API requests. However, any non-pointer,
  11960. // non-interface field appearing in ForceSendFields will be sent to the
  11961. // server regardless of whether the field is empty or not. This may be
  11962. // used to include empty fields in Patch requests.
  11963. ForceSendFields []string `json:"-"`
  11964. // NullFields is a list of field names (e.g. "Key") to include in API
  11965. // requests with the JSON null value. By default, fields with empty
  11966. // values are omitted from API requests. However, any field with an
  11967. // empty value appearing in NullFields will be sent to the server as
  11968. // null. It is an error if a field in this list has a non-empty value.
  11969. // This may be used to include null fields in Patch requests.
  11970. NullFields []string `json:"-"`
  11971. }
  11972. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  11973. type NoMethod InstanceListWarningData
  11974. raw := NoMethod(*s)
  11975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11976. }
  11977. // InstanceListReferrers: Contains a list of instance referrers.
  11978. type InstanceListReferrers struct {
  11979. // Id: [Output Only] Unique identifier for the resource; defined by the
  11980. // server.
  11981. Id string `json:"id,omitempty"`
  11982. // Items: A list of Reference resources.
  11983. Items []*Reference `json:"items,omitempty"`
  11984. // Kind: [Output Only] Type of resource. Always
  11985. // compute#instanceListReferrers for lists of Instance referrers.
  11986. Kind string `json:"kind,omitempty"`
  11987. // NextPageToken: [Output Only] This token allows you to get the next
  11988. // page of results for list requests. If the number of results is larger
  11989. // than maxResults, use the nextPageToken as a value for the query
  11990. // parameter pageToken in the next list request. Subsequent list
  11991. // requests will have their own nextPageToken to continue paging through
  11992. // the results.
  11993. NextPageToken string `json:"nextPageToken,omitempty"`
  11994. // SelfLink: [Output Only] Server-defined URL for this resource.
  11995. SelfLink string `json:"selfLink,omitempty"`
  11996. // Warning: [Output Only] Informational warning message.
  11997. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  11998. // ServerResponse contains the HTTP response code and headers from the
  11999. // server.
  12000. googleapi.ServerResponse `json:"-"`
  12001. // ForceSendFields is a list of field names (e.g. "Id") to
  12002. // unconditionally include in API requests. By default, fields with
  12003. // empty values are omitted from API requests. However, any non-pointer,
  12004. // non-interface field appearing in ForceSendFields will be sent to the
  12005. // server regardless of whether the field is empty or not. This may be
  12006. // used to include empty fields in Patch requests.
  12007. ForceSendFields []string `json:"-"`
  12008. // NullFields is a list of field names (e.g. "Id") to include in API
  12009. // requests with the JSON null value. By default, fields with empty
  12010. // values are omitted from API requests. However, any field with an
  12011. // empty value appearing in NullFields will be sent to the server as
  12012. // null. It is an error if a field in this list has a non-empty value.
  12013. // This may be used to include null fields in Patch requests.
  12014. NullFields []string `json:"-"`
  12015. }
  12016. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  12017. type NoMethod InstanceListReferrers
  12018. raw := NoMethod(*s)
  12019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12020. }
  12021. // InstanceListReferrersWarning: [Output Only] Informational warning
  12022. // message.
  12023. type InstanceListReferrersWarning struct {
  12024. // Code: [Output Only] A warning code, if applicable. For example,
  12025. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12026. // the response.
  12027. //
  12028. // Possible values:
  12029. // "CLEANUP_FAILED"
  12030. // "DEPRECATED_RESOURCE_USED"
  12031. // "DEPRECATED_TYPE_USED"
  12032. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12033. // "EXPERIMENTAL_TYPE_USED"
  12034. // "EXTERNAL_API_WARNING"
  12035. // "FIELD_VALUE_OVERRIDEN"
  12036. // "INJECTED_KERNELS_DEPRECATED"
  12037. // "MISSING_TYPE_DEPENDENCY"
  12038. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12039. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12040. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12041. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12042. // "NEXT_HOP_NOT_RUNNING"
  12043. // "NOT_CRITICAL_ERROR"
  12044. // "NO_RESULTS_ON_PAGE"
  12045. // "REQUIRED_TOS_AGREEMENT"
  12046. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12047. // "RESOURCE_NOT_DELETED"
  12048. // "SCHEMA_VALIDATION_IGNORED"
  12049. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12050. // "UNDECLARED_PROPERTIES"
  12051. // "UNREACHABLE"
  12052. Code string `json:"code,omitempty"`
  12053. // Data: [Output Only] Metadata about this warning in key: value format.
  12054. // For example:
  12055. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12056. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  12057. // Message: [Output Only] A human-readable description of the warning
  12058. // code.
  12059. Message string `json:"message,omitempty"`
  12060. // ForceSendFields is a list of field names (e.g. "Code") to
  12061. // unconditionally include in API requests. By default, fields with
  12062. // empty values are omitted from API requests. However, any non-pointer,
  12063. // non-interface field appearing in ForceSendFields will be sent to the
  12064. // server regardless of whether the field is empty or not. This may be
  12065. // used to include empty fields in Patch requests.
  12066. ForceSendFields []string `json:"-"`
  12067. // NullFields is a list of field names (e.g. "Code") to include in API
  12068. // requests with the JSON null value. By default, fields with empty
  12069. // values are omitted from API requests. However, any field with an
  12070. // empty value appearing in NullFields will be sent to the server as
  12071. // null. It is an error if a field in this list has a non-empty value.
  12072. // This may be used to include null fields in Patch requests.
  12073. NullFields []string `json:"-"`
  12074. }
  12075. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  12076. type NoMethod InstanceListReferrersWarning
  12077. raw := NoMethod(*s)
  12078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12079. }
  12080. type InstanceListReferrersWarningData struct {
  12081. // Key: [Output Only] A key that provides more detail on the warning
  12082. // being returned. For example, for warnings where there are no results
  12083. // in a list request for a particular zone, this key might be scope and
  12084. // the key value might be the zone name. Other examples might be a key
  12085. // indicating a deprecated resource and a suggested replacement, or a
  12086. // warning about invalid network settings (for example, if an instance
  12087. // attempts to perform IP forwarding but is not enabled for IP
  12088. // forwarding).
  12089. Key string `json:"key,omitempty"`
  12090. // Value: [Output Only] A warning data value corresponding to the key.
  12091. Value string `json:"value,omitempty"`
  12092. // ForceSendFields is a list of field names (e.g. "Key") to
  12093. // unconditionally include in API requests. By default, fields with
  12094. // empty values are omitted from API requests. However, any non-pointer,
  12095. // non-interface field appearing in ForceSendFields will be sent to the
  12096. // server regardless of whether the field is empty or not. This may be
  12097. // used to include empty fields in Patch requests.
  12098. ForceSendFields []string `json:"-"`
  12099. // NullFields is a list of field names (e.g. "Key") to include in API
  12100. // requests with the JSON null value. By default, fields with empty
  12101. // values are omitted from API requests. However, any field with an
  12102. // empty value appearing in NullFields will be sent to the server as
  12103. // null. It is an error if a field in this list has a non-empty value.
  12104. // This may be used to include null fields in Patch requests.
  12105. NullFields []string `json:"-"`
  12106. }
  12107. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  12108. type NoMethod InstanceListReferrersWarningData
  12109. raw := NoMethod(*s)
  12110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12111. }
  12112. type InstanceMoveRequest struct {
  12113. // DestinationZone: The URL of the destination zone to move the
  12114. // instance. This can be a full or partial URL. For example, the
  12115. // following are all valid URLs to a zone:
  12116. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  12117. //
  12118. // - projects/project/zones/zone
  12119. // - zones/zone
  12120. DestinationZone string `json:"destinationZone,omitempty"`
  12121. // TargetInstance: The URL of the target instance to move. This can be a
  12122. // full or partial URL. For example, the following are all valid URLs to
  12123. // an instance:
  12124. // -
  12125. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  12126. // - projects/project/zones/zone/instances/instance
  12127. // - zones/zone/instances/instance
  12128. TargetInstance string `json:"targetInstance,omitempty"`
  12129. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  12130. // unconditionally include in API requests. By default, fields with
  12131. // empty values are omitted from API requests. However, any non-pointer,
  12132. // non-interface field appearing in ForceSendFields will be sent to the
  12133. // server regardless of whether the field is empty or not. This may be
  12134. // used to include empty fields in Patch requests.
  12135. ForceSendFields []string `json:"-"`
  12136. // NullFields is a list of field names (e.g. "DestinationZone") to
  12137. // include in API requests with the JSON null value. By default, fields
  12138. // with empty values are omitted from API requests. However, any field
  12139. // with an empty value appearing in NullFields will be sent to the
  12140. // server as null. It is an error if a field in this list has a
  12141. // non-empty value. This may be used to include null fields in Patch
  12142. // requests.
  12143. NullFields []string `json:"-"`
  12144. }
  12145. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  12146. type NoMethod InstanceMoveRequest
  12147. raw := NoMethod(*s)
  12148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12149. }
  12150. type InstanceProperties struct {
  12151. // AllocationAffinity: The configuration of desired allocations which
  12152. // this Instance could consume capacity from.
  12153. AllocationAffinity *AllocationAffinity `json:"allocationAffinity,omitempty"`
  12154. // CanIpForward: Enables instances created based on this template to
  12155. // send packets with source IP addresses other than their own and
  12156. // receive packets with destination IP addresses other than their own.
  12157. // If these instances will be used as an IP gateway or it will be set as
  12158. // the next-hop in a Route resource, specify true. If unsure, leave this
  12159. // set to false. See the Enable IP forwarding documentation for more
  12160. // information.
  12161. CanIpForward bool `json:"canIpForward,omitempty"`
  12162. // Description: An optional text description for the instances that are
  12163. // created from this instance template.
  12164. Description string `json:"description,omitempty"`
  12165. // Disks: An array of disks that are associated with the instances that
  12166. // are created from this template.
  12167. Disks []*AttachedDisk `json:"disks,omitempty"`
  12168. // DisplayDevice: Display Device properties to enable support for remote
  12169. // display products like: Teradici, VNC and TeamViewer
  12170. DisplayDevice *DisplayDevice `json:"displayDevice,omitempty"`
  12171. // GuestAccelerators: A list of guest accelerator cards' type and count
  12172. // to use for instances created from the instance template.
  12173. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  12174. // Labels: Labels to apply to instances that are created from this
  12175. // template.
  12176. Labels map[string]string `json:"labels,omitempty"`
  12177. // MachineType: The machine type to use for instances that are created
  12178. // from this template.
  12179. MachineType string `json:"machineType,omitempty"`
  12180. // Metadata: The metadata key/value pairs to assign to instances that
  12181. // are created from this template. These pairs can consist of custom
  12182. // metadata or predefined keys. See Project and instance metadata for
  12183. // more information.
  12184. Metadata *Metadata `json:"metadata,omitempty"`
  12185. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  12186. // instance may be scheduled on the specified or newer cpu/platform.
  12187. // Applicable values are the friendly names of CPU platforms, such as
  12188. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  12189. // Bridge". For more information, read Specifying a Minimum CPU
  12190. // Platform.
  12191. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  12192. // NetworkInterfaces: An array of network access configurations for this
  12193. // interface.
  12194. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  12195. // Scheduling: Specifies the scheduling options for the instances that
  12196. // are created from this template.
  12197. Scheduling *Scheduling `json:"scheduling,omitempty"`
  12198. // ServiceAccounts: A list of service accounts with specified scopes.
  12199. // Access tokens for these service accounts are available to the
  12200. // instances that are created from this template. Use metadata queries
  12201. // to obtain the access tokens for these instances.
  12202. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  12203. ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
  12204. // ShieldedVmConfig: Specifies the Shielded VM options for the instances
  12205. // that are created from this template.
  12206. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  12207. // Tags: A list of tags to apply to the instances that are created from
  12208. // this template. The tags identify valid sources or targets for network
  12209. // firewalls. The setTags method can modify this list of tags. Each tag
  12210. // within the list must comply with RFC1035.
  12211. Tags *Tags `json:"tags,omitempty"`
  12212. // ForceSendFields is a list of field names (e.g. "AllocationAffinity")
  12213. // to unconditionally include in API requests. By default, fields with
  12214. // empty values are omitted from API requests. However, any non-pointer,
  12215. // non-interface field appearing in ForceSendFields will be sent to the
  12216. // server regardless of whether the field is empty or not. This may be
  12217. // used to include empty fields in Patch requests.
  12218. ForceSendFields []string `json:"-"`
  12219. // NullFields is a list of field names (e.g. "AllocationAffinity") to
  12220. // include in API requests with the JSON null value. By default, fields
  12221. // with empty values are omitted from API requests. However, any field
  12222. // with an empty value appearing in NullFields will be sent to the
  12223. // server as null. It is an error if a field in this list has a
  12224. // non-empty value. This may be used to include null fields in Patch
  12225. // requests.
  12226. NullFields []string `json:"-"`
  12227. }
  12228. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  12229. type NoMethod InstanceProperties
  12230. raw := NoMethod(*s)
  12231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12232. }
  12233. type InstanceReference struct {
  12234. // Instance: The URL for a specific instance.
  12235. Instance string `json:"instance,omitempty"`
  12236. // ForceSendFields is a list of field names (e.g. "Instance") to
  12237. // unconditionally include in API requests. By default, fields with
  12238. // empty values are omitted from API requests. However, any non-pointer,
  12239. // non-interface field appearing in ForceSendFields will be sent to the
  12240. // server regardless of whether the field is empty or not. This may be
  12241. // used to include empty fields in Patch requests.
  12242. ForceSendFields []string `json:"-"`
  12243. // NullFields is a list of field names (e.g. "Instance") to include in
  12244. // API requests with the JSON null value. By default, fields with empty
  12245. // values are omitted from API requests. However, any field with an
  12246. // empty value appearing in NullFields will be sent to the server as
  12247. // null. It is an error if a field in this list has a non-empty value.
  12248. // This may be used to include null fields in Patch requests.
  12249. NullFields []string `json:"-"`
  12250. }
  12251. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  12252. type NoMethod InstanceReference
  12253. raw := NoMethod(*s)
  12254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12255. }
  12256. // InstanceTemplate: An Instance Template resource. (== resource_for
  12257. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  12258. type InstanceTemplate struct {
  12259. // CreationTimestamp: [Output Only] The creation timestamp for this
  12260. // instance template in RFC3339 text format.
  12261. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12262. // Description: An optional description of this resource. Provide this
  12263. // property when you create the resource.
  12264. Description string `json:"description,omitempty"`
  12265. // Id: [Output Only] A unique identifier for this instance template. The
  12266. // server defines this identifier.
  12267. Id uint64 `json:"id,omitempty,string"`
  12268. // Kind: [Output Only] The resource type, which is always
  12269. // compute#instanceTemplate for instance templates.
  12270. Kind string `json:"kind,omitempty"`
  12271. // Name: Name of the resource; provided by the client when the resource
  12272. // is created. The name must be 1-63 characters long, and comply with
  12273. // RFC1035. Specifically, the name must be 1-63 characters long and
  12274. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  12275. // the first character must be a lowercase letter, and all following
  12276. // characters must be a dash, lowercase letter, or digit, except the
  12277. // last character, which cannot be a dash.
  12278. Name string `json:"name,omitempty"`
  12279. // Properties: The instance properties for this instance template.
  12280. Properties *InstanceProperties `json:"properties,omitempty"`
  12281. // SelfLink: [Output Only] The URL for this instance template. The
  12282. // server defines this URL.
  12283. SelfLink string `json:"selfLink,omitempty"`
  12284. // SourceInstance: The source instance used to create the template. You
  12285. // can provide this as a partial or full URL to the resource. For
  12286. // example, the following are valid values:
  12287. // -
  12288. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  12289. // - projects/project/zones/zone/instances/instance
  12290. SourceInstance string `json:"sourceInstance,omitempty"`
  12291. // SourceInstanceParams: The source instance params to use to create
  12292. // this instance template.
  12293. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  12294. // ServerResponse contains the HTTP response code and headers from the
  12295. // server.
  12296. googleapi.ServerResponse `json:"-"`
  12297. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12298. // to unconditionally include in API requests. By default, fields with
  12299. // empty values are omitted from API requests. However, any non-pointer,
  12300. // non-interface field appearing in ForceSendFields will be sent to the
  12301. // server regardless of whether the field is empty or not. This may be
  12302. // used to include empty fields in Patch requests.
  12303. ForceSendFields []string `json:"-"`
  12304. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12305. // include in API requests with the JSON null value. By default, fields
  12306. // with empty values are omitted from API requests. However, any field
  12307. // with an empty value appearing in NullFields will be sent to the
  12308. // server as null. It is an error if a field in this list has a
  12309. // non-empty value. This may be used to include null fields in Patch
  12310. // requests.
  12311. NullFields []string `json:"-"`
  12312. }
  12313. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  12314. type NoMethod InstanceTemplate
  12315. raw := NoMethod(*s)
  12316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12317. }
  12318. // InstanceTemplateList: A list of instance templates.
  12319. type InstanceTemplateList struct {
  12320. // Id: [Output Only] Unique identifier for the resource; defined by the
  12321. // server.
  12322. Id string `json:"id,omitempty"`
  12323. // Items: A list of InstanceTemplate resources.
  12324. Items []*InstanceTemplate `json:"items,omitempty"`
  12325. // Kind: [Output Only] The resource type, which is always
  12326. // compute#instanceTemplatesListResponse for instance template lists.
  12327. Kind string `json:"kind,omitempty"`
  12328. // NextPageToken: [Output Only] This token allows you to get the next
  12329. // page of results for list requests. If the number of results is larger
  12330. // than maxResults, use the nextPageToken as a value for the query
  12331. // parameter pageToken in the next list request. Subsequent list
  12332. // requests will have their own nextPageToken to continue paging through
  12333. // the results.
  12334. NextPageToken string `json:"nextPageToken,omitempty"`
  12335. // SelfLink: [Output Only] Server-defined URL for this resource.
  12336. SelfLink string `json:"selfLink,omitempty"`
  12337. // Warning: [Output Only] Informational warning message.
  12338. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  12339. // ServerResponse contains the HTTP response code and headers from the
  12340. // server.
  12341. googleapi.ServerResponse `json:"-"`
  12342. // ForceSendFields is a list of field names (e.g. "Id") to
  12343. // unconditionally include in API requests. By default, fields with
  12344. // empty values are omitted from API requests. However, any non-pointer,
  12345. // non-interface field appearing in ForceSendFields will be sent to the
  12346. // server regardless of whether the field is empty or not. This may be
  12347. // used to include empty fields in Patch requests.
  12348. ForceSendFields []string `json:"-"`
  12349. // NullFields is a list of field names (e.g. "Id") to include in API
  12350. // requests with the JSON null value. By default, fields with empty
  12351. // values are omitted from API requests. However, any field with an
  12352. // empty value appearing in NullFields will be sent to the server as
  12353. // null. It is an error if a field in this list has a non-empty value.
  12354. // This may be used to include null fields in Patch requests.
  12355. NullFields []string `json:"-"`
  12356. }
  12357. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  12358. type NoMethod InstanceTemplateList
  12359. raw := NoMethod(*s)
  12360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12361. }
  12362. // InstanceTemplateListWarning: [Output Only] Informational warning
  12363. // message.
  12364. type InstanceTemplateListWarning struct {
  12365. // Code: [Output Only] A warning code, if applicable. For example,
  12366. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12367. // the response.
  12368. //
  12369. // Possible values:
  12370. // "CLEANUP_FAILED"
  12371. // "DEPRECATED_RESOURCE_USED"
  12372. // "DEPRECATED_TYPE_USED"
  12373. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12374. // "EXPERIMENTAL_TYPE_USED"
  12375. // "EXTERNAL_API_WARNING"
  12376. // "FIELD_VALUE_OVERRIDEN"
  12377. // "INJECTED_KERNELS_DEPRECATED"
  12378. // "MISSING_TYPE_DEPENDENCY"
  12379. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12380. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12381. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12382. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12383. // "NEXT_HOP_NOT_RUNNING"
  12384. // "NOT_CRITICAL_ERROR"
  12385. // "NO_RESULTS_ON_PAGE"
  12386. // "REQUIRED_TOS_AGREEMENT"
  12387. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12388. // "RESOURCE_NOT_DELETED"
  12389. // "SCHEMA_VALIDATION_IGNORED"
  12390. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12391. // "UNDECLARED_PROPERTIES"
  12392. // "UNREACHABLE"
  12393. Code string `json:"code,omitempty"`
  12394. // Data: [Output Only] Metadata about this warning in key: value format.
  12395. // For example:
  12396. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12397. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  12398. // Message: [Output Only] A human-readable description of the warning
  12399. // code.
  12400. Message string `json:"message,omitempty"`
  12401. // ForceSendFields is a list of field names (e.g. "Code") to
  12402. // unconditionally include in API requests. By default, fields with
  12403. // empty values are omitted from API requests. However, any non-pointer,
  12404. // non-interface field appearing in ForceSendFields will be sent to the
  12405. // server regardless of whether the field is empty or not. This may be
  12406. // used to include empty fields in Patch requests.
  12407. ForceSendFields []string `json:"-"`
  12408. // NullFields is a list of field names (e.g. "Code") to include in API
  12409. // requests with the JSON null value. By default, fields with empty
  12410. // values are omitted from API requests. However, any field with an
  12411. // empty value appearing in NullFields will be sent to the server as
  12412. // null. It is an error if a field in this list has a non-empty value.
  12413. // This may be used to include null fields in Patch requests.
  12414. NullFields []string `json:"-"`
  12415. }
  12416. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  12417. type NoMethod InstanceTemplateListWarning
  12418. raw := NoMethod(*s)
  12419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12420. }
  12421. type InstanceTemplateListWarningData struct {
  12422. // Key: [Output Only] A key that provides more detail on the warning
  12423. // being returned. For example, for warnings where there are no results
  12424. // in a list request for a particular zone, this key might be scope and
  12425. // the key value might be the zone name. Other examples might be a key
  12426. // indicating a deprecated resource and a suggested replacement, or a
  12427. // warning about invalid network settings (for example, if an instance
  12428. // attempts to perform IP forwarding but is not enabled for IP
  12429. // forwarding).
  12430. Key string `json:"key,omitempty"`
  12431. // Value: [Output Only] A warning data value corresponding to the key.
  12432. Value string `json:"value,omitempty"`
  12433. // ForceSendFields is a list of field names (e.g. "Key") to
  12434. // unconditionally include in API requests. By default, fields with
  12435. // empty values are omitted from API requests. However, any non-pointer,
  12436. // non-interface field appearing in ForceSendFields will be sent to the
  12437. // server regardless of whether the field is empty or not. This may be
  12438. // used to include empty fields in Patch requests.
  12439. ForceSendFields []string `json:"-"`
  12440. // NullFields is a list of field names (e.g. "Key") to include in API
  12441. // requests with the JSON null value. By default, fields with empty
  12442. // values are omitted from API requests. However, any field with an
  12443. // empty value appearing in NullFields will be sent to the server as
  12444. // null. It is an error if a field in this list has a non-empty value.
  12445. // This may be used to include null fields in Patch requests.
  12446. NullFields []string `json:"-"`
  12447. }
  12448. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  12449. type NoMethod InstanceTemplateListWarningData
  12450. raw := NoMethod(*s)
  12451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12452. }
  12453. type InstanceWithNamedPorts struct {
  12454. // Instance: [Output Only] The URL of the instance.
  12455. Instance string `json:"instance,omitempty"`
  12456. // NamedPorts: [Output Only] The named ports that belong to this
  12457. // instance group.
  12458. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  12459. // Status: [Output Only] The status of the instance.
  12460. //
  12461. // Possible values:
  12462. // "PROVISIONING"
  12463. // "REPAIRING"
  12464. // "RUNNING"
  12465. // "STAGING"
  12466. // "STOPPED"
  12467. // "STOPPING"
  12468. // "SUSPENDED"
  12469. // "SUSPENDING"
  12470. // "TERMINATED"
  12471. Status string `json:"status,omitempty"`
  12472. // ForceSendFields is a list of field names (e.g. "Instance") to
  12473. // unconditionally include in API requests. By default, fields with
  12474. // empty values are omitted from API requests. However, any non-pointer,
  12475. // non-interface field appearing in ForceSendFields will be sent to the
  12476. // server regardless of whether the field is empty or not. This may be
  12477. // used to include empty fields in Patch requests.
  12478. ForceSendFields []string `json:"-"`
  12479. // NullFields is a list of field names (e.g. "Instance") to include in
  12480. // API requests with the JSON null value. By default, fields with empty
  12481. // values are omitted from API requests. However, any field with an
  12482. // empty value appearing in NullFields will be sent to the server as
  12483. // null. It is an error if a field in this list has a non-empty value.
  12484. // This may be used to include null fields in Patch requests.
  12485. NullFields []string `json:"-"`
  12486. }
  12487. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  12488. type NoMethod InstanceWithNamedPorts
  12489. raw := NoMethod(*s)
  12490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12491. }
  12492. type InstancesResumeRequest struct {
  12493. // Disks: Array of disks associated with this instance that are
  12494. // protected with a customer-supplied encryption key.
  12495. //
  12496. // In order to resume the instance, the disk url and its corresponding
  12497. // key must be provided.
  12498. //
  12499. // If the disk is not protected with a customer-supplied encryption key
  12500. // it should not be specified.
  12501. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  12502. // InstanceEncryptionKey: Decrypts data associated with an instance that
  12503. // is protected with a customer-supplied encryption key.
  12504. //
  12505. // If the instance you are starting is protected with a
  12506. // customer-supplied encryption key, the correct key must be provided
  12507. // otherwise the instance resume will not succeed.
  12508. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  12509. // ForceSendFields is a list of field names (e.g. "Disks") to
  12510. // unconditionally include in API requests. By default, fields with
  12511. // empty values are omitted from API requests. However, any non-pointer,
  12512. // non-interface field appearing in ForceSendFields will be sent to the
  12513. // server regardless of whether the field is empty or not. This may be
  12514. // used to include empty fields in Patch requests.
  12515. ForceSendFields []string `json:"-"`
  12516. // NullFields is a list of field names (e.g. "Disks") to include in API
  12517. // requests with the JSON null value. By default, fields with empty
  12518. // values are omitted from API requests. However, any field with an
  12519. // empty value appearing in NullFields will be sent to the server as
  12520. // null. It is an error if a field in this list has a non-empty value.
  12521. // This may be used to include null fields in Patch requests.
  12522. NullFields []string `json:"-"`
  12523. }
  12524. func (s *InstancesResumeRequest) MarshalJSON() ([]byte, error) {
  12525. type NoMethod InstancesResumeRequest
  12526. raw := NoMethod(*s)
  12527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12528. }
  12529. type InstancesScopedList struct {
  12530. // Instances: [Output Only] A list of instances contained in this scope.
  12531. Instances []*Instance `json:"instances,omitempty"`
  12532. // Warning: [Output Only] Informational warning which replaces the list
  12533. // of instances when the list is empty.
  12534. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  12535. // ForceSendFields is a list of field names (e.g. "Instances") to
  12536. // unconditionally include in API requests. By default, fields with
  12537. // empty values are omitted from API requests. However, any non-pointer,
  12538. // non-interface field appearing in ForceSendFields will be sent to the
  12539. // server regardless of whether the field is empty or not. This may be
  12540. // used to include empty fields in Patch requests.
  12541. ForceSendFields []string `json:"-"`
  12542. // NullFields is a list of field names (e.g. "Instances") to include in
  12543. // API requests with the JSON null value. By default, fields with empty
  12544. // values are omitted from API requests. However, any field with an
  12545. // empty value appearing in NullFields will be sent to the server as
  12546. // null. It is an error if a field in this list has a non-empty value.
  12547. // This may be used to include null fields in Patch requests.
  12548. NullFields []string `json:"-"`
  12549. }
  12550. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  12551. type NoMethod InstancesScopedList
  12552. raw := NoMethod(*s)
  12553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12554. }
  12555. // InstancesScopedListWarning: [Output Only] Informational warning which
  12556. // replaces the list of instances when the list is empty.
  12557. type InstancesScopedListWarning struct {
  12558. // Code: [Output Only] A warning code, if applicable. For example,
  12559. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12560. // the response.
  12561. //
  12562. // Possible values:
  12563. // "CLEANUP_FAILED"
  12564. // "DEPRECATED_RESOURCE_USED"
  12565. // "DEPRECATED_TYPE_USED"
  12566. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12567. // "EXPERIMENTAL_TYPE_USED"
  12568. // "EXTERNAL_API_WARNING"
  12569. // "FIELD_VALUE_OVERRIDEN"
  12570. // "INJECTED_KERNELS_DEPRECATED"
  12571. // "MISSING_TYPE_DEPENDENCY"
  12572. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12573. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12574. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12575. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12576. // "NEXT_HOP_NOT_RUNNING"
  12577. // "NOT_CRITICAL_ERROR"
  12578. // "NO_RESULTS_ON_PAGE"
  12579. // "REQUIRED_TOS_AGREEMENT"
  12580. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12581. // "RESOURCE_NOT_DELETED"
  12582. // "SCHEMA_VALIDATION_IGNORED"
  12583. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12584. // "UNDECLARED_PROPERTIES"
  12585. // "UNREACHABLE"
  12586. Code string `json:"code,omitempty"`
  12587. // Data: [Output Only] Metadata about this warning in key: value format.
  12588. // For example:
  12589. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12590. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  12591. // Message: [Output Only] A human-readable description of the warning
  12592. // code.
  12593. Message string `json:"message,omitempty"`
  12594. // ForceSendFields is a list of field names (e.g. "Code") to
  12595. // unconditionally include in API requests. By default, fields with
  12596. // empty values are omitted from API requests. However, any non-pointer,
  12597. // non-interface field appearing in ForceSendFields will be sent to the
  12598. // server regardless of whether the field is empty or not. This may be
  12599. // used to include empty fields in Patch requests.
  12600. ForceSendFields []string `json:"-"`
  12601. // NullFields is a list of field names (e.g. "Code") to include in API
  12602. // requests with the JSON null value. By default, fields with empty
  12603. // values are omitted from API requests. However, any field with an
  12604. // empty value appearing in NullFields will be sent to the server as
  12605. // null. It is an error if a field in this list has a non-empty value.
  12606. // This may be used to include null fields in Patch requests.
  12607. NullFields []string `json:"-"`
  12608. }
  12609. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  12610. type NoMethod InstancesScopedListWarning
  12611. raw := NoMethod(*s)
  12612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12613. }
  12614. type InstancesScopedListWarningData struct {
  12615. // Key: [Output Only] A key that provides more detail on the warning
  12616. // being returned. For example, for warnings where there are no results
  12617. // in a list request for a particular zone, this key might be scope and
  12618. // the key value might be the zone name. Other examples might be a key
  12619. // indicating a deprecated resource and a suggested replacement, or a
  12620. // warning about invalid network settings (for example, if an instance
  12621. // attempts to perform IP forwarding but is not enabled for IP
  12622. // forwarding).
  12623. Key string `json:"key,omitempty"`
  12624. // Value: [Output Only] A warning data value corresponding to the key.
  12625. Value string `json:"value,omitempty"`
  12626. // ForceSendFields is a list of field names (e.g. "Key") to
  12627. // unconditionally include in API requests. By default, fields with
  12628. // empty values are omitted from API requests. However, any non-pointer,
  12629. // non-interface field appearing in ForceSendFields will be sent to the
  12630. // server regardless of whether the field is empty or not. This may be
  12631. // used to include empty fields in Patch requests.
  12632. ForceSendFields []string `json:"-"`
  12633. // NullFields is a list of field names (e.g. "Key") to include in API
  12634. // requests with the JSON null value. By default, fields with empty
  12635. // values are omitted from API requests. However, any field with an
  12636. // empty value appearing in NullFields will be sent to the server as
  12637. // null. It is an error if a field in this list has a non-empty value.
  12638. // This may be used to include null fields in Patch requests.
  12639. NullFields []string `json:"-"`
  12640. }
  12641. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  12642. type NoMethod InstancesScopedListWarningData
  12643. raw := NoMethod(*s)
  12644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12645. }
  12646. type InstancesSetLabelsRequest struct {
  12647. // LabelFingerprint: Fingerprint of the previous set of labels for this
  12648. // resource, used to prevent conflicts. Provide the latest fingerprint
  12649. // value when making a request to add or change labels.
  12650. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  12651. Labels map[string]string `json:"labels,omitempty"`
  12652. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  12653. // unconditionally include in API requests. By default, fields with
  12654. // empty values are omitted from API requests. However, any non-pointer,
  12655. // non-interface field appearing in ForceSendFields will be sent to the
  12656. // server regardless of whether the field is empty or not. This may be
  12657. // used to include empty fields in Patch requests.
  12658. ForceSendFields []string `json:"-"`
  12659. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  12660. // include in API requests with the JSON null value. By default, fields
  12661. // with empty values are omitted from API requests. However, any field
  12662. // with an empty value appearing in NullFields will be sent to the
  12663. // server as null. It is an error if a field in this list has a
  12664. // non-empty value. This may be used to include null fields in Patch
  12665. // requests.
  12666. NullFields []string `json:"-"`
  12667. }
  12668. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  12669. type NoMethod InstancesSetLabelsRequest
  12670. raw := NoMethod(*s)
  12671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12672. }
  12673. type InstancesSetMachineResourcesRequest struct {
  12674. // GuestAccelerators: A list of the type and count of accelerator cards
  12675. // attached to the instance.
  12676. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  12677. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  12678. // to unconditionally include in API requests. By default, fields with
  12679. // empty values are omitted from API requests. However, any non-pointer,
  12680. // non-interface field appearing in ForceSendFields will be sent to the
  12681. // server regardless of whether the field is empty or not. This may be
  12682. // used to include empty fields in Patch requests.
  12683. ForceSendFields []string `json:"-"`
  12684. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  12685. // include in API requests with the JSON null value. By default, fields
  12686. // with empty values are omitted from API requests. However, any field
  12687. // with an empty value appearing in NullFields will be sent to the
  12688. // server as null. It is an error if a field in this list has a
  12689. // non-empty value. This may be used to include null fields in Patch
  12690. // requests.
  12691. NullFields []string `json:"-"`
  12692. }
  12693. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  12694. type NoMethod InstancesSetMachineResourcesRequest
  12695. raw := NoMethod(*s)
  12696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12697. }
  12698. type InstancesSetMachineTypeRequest struct {
  12699. // MachineType: Full or partial URL of the machine type resource. See
  12700. // Machine Types for a full list of machine types. For example:
  12701. // zones/us-central1-f/machineTypes/n1-standard-1
  12702. MachineType string `json:"machineType,omitempty"`
  12703. // ForceSendFields is a list of field names (e.g. "MachineType") to
  12704. // unconditionally include in API requests. By default, fields with
  12705. // empty values are omitted from API requests. However, any non-pointer,
  12706. // non-interface field appearing in ForceSendFields will be sent to the
  12707. // server regardless of whether the field is empty or not. This may be
  12708. // used to include empty fields in Patch requests.
  12709. ForceSendFields []string `json:"-"`
  12710. // NullFields is a list of field names (e.g. "MachineType") to include
  12711. // in API requests with the JSON null value. By default, fields with
  12712. // empty values are omitted from API requests. However, any field with
  12713. // an empty value appearing in NullFields will be sent to the server as
  12714. // null. It is an error if a field in this list has a non-empty value.
  12715. // This may be used to include null fields in Patch requests.
  12716. NullFields []string `json:"-"`
  12717. }
  12718. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  12719. type NoMethod InstancesSetMachineTypeRequest
  12720. raw := NoMethod(*s)
  12721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12722. }
  12723. type InstancesSetMinCpuPlatformRequest struct {
  12724. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  12725. // at.
  12726. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  12727. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  12728. // unconditionally include in API requests. By default, fields with
  12729. // empty values are omitted from API requests. However, any non-pointer,
  12730. // non-interface field appearing in ForceSendFields will be sent to the
  12731. // server regardless of whether the field is empty or not. This may be
  12732. // used to include empty fields in Patch requests.
  12733. ForceSendFields []string `json:"-"`
  12734. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  12735. // include in API requests with the JSON null value. By default, fields
  12736. // with empty values are omitted from API requests. However, any field
  12737. // with an empty value appearing in NullFields will be sent to the
  12738. // server as null. It is an error if a field in this list has a
  12739. // non-empty value. This may be used to include null fields in Patch
  12740. // requests.
  12741. NullFields []string `json:"-"`
  12742. }
  12743. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  12744. type NoMethod InstancesSetMinCpuPlatformRequest
  12745. raw := NoMethod(*s)
  12746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12747. }
  12748. type InstancesSetServiceAccountRequest struct {
  12749. // Email: Email address of the service account.
  12750. Email string `json:"email,omitempty"`
  12751. // Scopes: The list of scopes to be made available for this service
  12752. // account.
  12753. Scopes []string `json:"scopes,omitempty"`
  12754. // ForceSendFields is a list of field names (e.g. "Email") to
  12755. // unconditionally include in API requests. By default, fields with
  12756. // empty values are omitted from API requests. However, any non-pointer,
  12757. // non-interface field appearing in ForceSendFields will be sent to the
  12758. // server regardless of whether the field is empty or not. This may be
  12759. // used to include empty fields in Patch requests.
  12760. ForceSendFields []string `json:"-"`
  12761. // NullFields is a list of field names (e.g. "Email") to include in API
  12762. // requests with the JSON null value. By default, fields with empty
  12763. // values are omitted from API requests. However, any field with an
  12764. // empty value appearing in NullFields will be sent to the server as
  12765. // null. It is an error if a field in this list has a non-empty value.
  12766. // This may be used to include null fields in Patch requests.
  12767. NullFields []string `json:"-"`
  12768. }
  12769. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  12770. type NoMethod InstancesSetServiceAccountRequest
  12771. raw := NoMethod(*s)
  12772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12773. }
  12774. type InstancesStartWithEncryptionKeyRequest struct {
  12775. // Disks: Array of disks associated with this instance that are
  12776. // protected with a customer-supplied encryption key.
  12777. //
  12778. // In order to start the instance, the disk url and its corresponding
  12779. // key must be provided.
  12780. //
  12781. // If the disk is not protected with a customer-supplied encryption key
  12782. // it should not be specified.
  12783. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  12784. // ForceSendFields is a list of field names (e.g. "Disks") to
  12785. // unconditionally include in API requests. By default, fields with
  12786. // empty values are omitted from API requests. However, any non-pointer,
  12787. // non-interface field appearing in ForceSendFields will be sent to the
  12788. // server regardless of whether the field is empty or not. This may be
  12789. // used to include empty fields in Patch requests.
  12790. ForceSendFields []string `json:"-"`
  12791. // NullFields is a list of field names (e.g. "Disks") to include in API
  12792. // requests with the JSON null value. By default, fields with empty
  12793. // values are omitted from API requests. However, any field with an
  12794. // empty value appearing in NullFields will be sent to the server as
  12795. // null. It is an error if a field in this list has a non-empty value.
  12796. // This may be used to include null fields in Patch requests.
  12797. NullFields []string `json:"-"`
  12798. }
  12799. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  12800. type NoMethod InstancesStartWithEncryptionKeyRequest
  12801. raw := NoMethod(*s)
  12802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12803. }
  12804. // Interconnect: Represents an Interconnects resource. The Interconnects
  12805. // resource is a dedicated connection between Google's network and your
  12806. // on-premises network. For more information, see the Dedicated
  12807. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  12808. // beta.interconnects ==)
  12809. type Interconnect struct {
  12810. // AdminEnabled: Administrative status of the interconnect. When this is
  12811. // set to true, the Interconnect is functional and can carry traffic.
  12812. // When set to false, no packets can be carried over the interconnect
  12813. // and no BGP routes are exchanged over it. By default, the status is
  12814. // set to true.
  12815. AdminEnabled bool `json:"adminEnabled,omitempty"`
  12816. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  12817. // describe the individual circuits in this LAG.
  12818. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  12819. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12820. // format.
  12821. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12822. // CustomerName: Customer name, to put in the Letter of Authorization as
  12823. // the party authorized to request a crossconnect.
  12824. CustomerName string `json:"customerName,omitempty"`
  12825. // Description: An optional description of this resource. Provide this
  12826. // property when you create the resource.
  12827. Description string `json:"description,omitempty"`
  12828. // ExpectedOutages: [Output Only] A list of outages expected for this
  12829. // Interconnect.
  12830. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  12831. // GoogleIpAddress: [Output Only] IP address configured on the Google
  12832. // side of the Interconnect link. This can be used only for ping tests.
  12833. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  12834. // GoogleReferenceId: [Output Only] Google reference ID to be used when
  12835. // raising support tickets with Google or otherwise to debug backend
  12836. // connectivity issues.
  12837. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  12838. // Id: [Output Only] The unique identifier for the resource. This
  12839. // identifier is defined by the server.
  12840. Id uint64 `json:"id,omitempty,string"`
  12841. // InterconnectAttachments: [Output Only] A list of the URLs of all
  12842. // InterconnectAttachments configured to use this Interconnect.
  12843. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  12844. // InterconnectType: Type of interconnect. Note that "IT_PRIVATE" has
  12845. // been deprecated in favor of "DEDICATED"
  12846. //
  12847. // Possible values:
  12848. // "DEDICATED"
  12849. // "IT_PRIVATE"
  12850. // "PARTNER"
  12851. InterconnectType string `json:"interconnectType,omitempty"`
  12852. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  12853. // for interconnects.
  12854. Kind string `json:"kind,omitempty"`
  12855. // LabelFingerprint: A fingerprint for the labels being applied to this
  12856. // Interconnect, which is essentially a hash of the labels set used for
  12857. // optimistic locking. The fingerprint is initially generated by Compute
  12858. // Engine and changes after every request to modify or update labels.
  12859. // You must always provide an up-to-date fingerprint hash in order to
  12860. // update or change labels, otherwise the request will fail with error
  12861. // 412 conditionNotMet.
  12862. //
  12863. // To see the latest fingerprint, make a get() request to retrieve an
  12864. // Interconnect.
  12865. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  12866. // Labels: Labels to apply to this Interconnect resource. These can be
  12867. // later modified by the setLabels method. Each label key/value must
  12868. // comply with RFC1035. Label values may be empty.
  12869. Labels map[string]string `json:"labels,omitempty"`
  12870. // LinkType: Type of link requested. This field indicates speed of each
  12871. // of the links in the bundle, not the entire bundle.
  12872. //
  12873. // Possible values:
  12874. // "LINK_TYPE_ETHERNET_10G_LR"
  12875. LinkType string `json:"linkType,omitempty"`
  12876. // Location: URL of the InterconnectLocation object that represents
  12877. // where this connection is to be provisioned.
  12878. Location string `json:"location,omitempty"`
  12879. // Name: Name of the resource. Provided by the client when the resource
  12880. // is created. The name must be 1-63 characters long, and comply with
  12881. // RFC1035. Specifically, the name must be 1-63 characters long and
  12882. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  12883. // the first character must be a lowercase letter, and all following
  12884. // characters must be a dash, lowercase letter, or digit, except the
  12885. // last character, which cannot be a dash.
  12886. Name string `json:"name,omitempty"`
  12887. // NocContactEmail: Email address to contact the customer NOC for
  12888. // operations and maintenance notifications regarding this Interconnect.
  12889. // If specified, this will be used for notifications in addition to all
  12890. // other forms described, such as Stackdriver logs alerting and Cloud
  12891. // Notifications.
  12892. NocContactEmail string `json:"nocContactEmail,omitempty"`
  12893. // OperationalStatus: [Output Only] The current status of whether or not
  12894. // this Interconnect is functional.
  12895. //
  12896. // Possible values:
  12897. // "OS_ACTIVE"
  12898. // "OS_UNPROVISIONED"
  12899. OperationalStatus string `json:"operationalStatus,omitempty"`
  12900. // PeerIpAddress: [Output Only] IP address configured on the customer
  12901. // side of the Interconnect link. The customer should configure this IP
  12902. // address during turnup when prompted by Google NOC. This can be used
  12903. // only for ping tests.
  12904. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  12905. // ProvisionedLinkCount: [Output Only] Number of links actually
  12906. // provisioned in this interconnect.
  12907. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  12908. // RequestedLinkCount: Target number of physical links in the link
  12909. // bundle, as requested by the customer.
  12910. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  12911. // SelfLink: [Output Only] Server-defined URL for the resource.
  12912. SelfLink string `json:"selfLink,omitempty"`
  12913. // State: [Output Only] The current state of whether or not this
  12914. // Interconnect is functional.
  12915. //
  12916. // Possible values:
  12917. // "ACTIVE"
  12918. // "UNPROVISIONED"
  12919. State string `json:"state,omitempty"`
  12920. // ServerResponse contains the HTTP response code and headers from the
  12921. // server.
  12922. googleapi.ServerResponse `json:"-"`
  12923. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  12924. // unconditionally include in API requests. By default, fields with
  12925. // empty values are omitted from API requests. However, any non-pointer,
  12926. // non-interface field appearing in ForceSendFields will be sent to the
  12927. // server regardless of whether the field is empty or not. This may be
  12928. // used to include empty fields in Patch requests.
  12929. ForceSendFields []string `json:"-"`
  12930. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  12931. // in API requests with the JSON null value. By default, fields with
  12932. // empty values are omitted from API requests. However, any field with
  12933. // an empty value appearing in NullFields will be sent to the server as
  12934. // null. It is an error if a field in this list has a non-empty value.
  12935. // This may be used to include null fields in Patch requests.
  12936. NullFields []string `json:"-"`
  12937. }
  12938. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  12939. type NoMethod Interconnect
  12940. raw := NoMethod(*s)
  12941. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12942. }
  12943. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  12944. // attachment) resource. For more information, see Creating VLAN
  12945. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  12946. // resource_for v1.interconnectAttachments ==)
  12947. type InterconnectAttachment struct {
  12948. // AdminEnabled: Determines whether this Attachment will carry packets.
  12949. // Not present for PARTNER_PROVIDER.
  12950. AdminEnabled bool `json:"adminEnabled,omitempty"`
  12951. // Bandwidth: Provisioned bandwidth capacity for the
  12952. // interconnectAttachment. Can be set by the partner to update the
  12953. // customer's provisioned bandwidth. Output only for PARTNER type,
  12954. // mutable for PARTNER_PROVIDER and DEDICATED.
  12955. //
  12956. // Possible values:
  12957. // "BPS_100M"
  12958. // "BPS_10G"
  12959. // "BPS_1G"
  12960. // "BPS_200M"
  12961. // "BPS_2G"
  12962. // "BPS_300M"
  12963. // "BPS_400M"
  12964. // "BPS_500M"
  12965. // "BPS_50M"
  12966. // "BPS_5G"
  12967. Bandwidth string `json:"bandwidth,omitempty"`
  12968. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  12969. // restrict the allocation of cloudRouterIpAddress and
  12970. // customerRouterIpAddress for this attachment. All prefixes must be
  12971. // within link-local address space (169.254.0.0/16) and must be /29 or
  12972. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  12973. // from the supplied candidate prefix(es). The request will fail if all
  12974. // possible /29s are in use on Google?s edge. If not supplied, Google
  12975. // will randomly select an unused /29 from all of link-local space.
  12976. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  12977. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  12978. // be configured on Cloud Router Interface for this interconnect
  12979. // attachment.
  12980. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  12981. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12982. // format.
  12983. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12984. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  12985. // to be configured on the customer router subinterface for this
  12986. // interconnect attachment.
  12987. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  12988. // Description: An optional description of this resource.
  12989. Description string `json:"description,omitempty"`
  12990. // EdgeAvailabilityDomain: Desired availability domain for the
  12991. // attachment. Only available for type PARTNER, at creation time. For
  12992. // improved reliability, customers should configure a pair of
  12993. // attachments with one per availability domain. The selected
  12994. // availability domain will be provided to the Partner via the pairing
  12995. // key so that the provisioned circuit will lie in the specified domain.
  12996. // If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.
  12997. //
  12998. // Possible values:
  12999. // "AVAILABILITY_DOMAIN_1"
  13000. // "AVAILABILITY_DOMAIN_2"
  13001. // "AVAILABILITY_DOMAIN_ANY"
  13002. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  13003. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  13004. // raising support tickets with Google or otherwise to debug backend
  13005. // connectivity issues.
  13006. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  13007. // Id: [Output Only] The unique identifier for the resource. This
  13008. // identifier is defined by the server.
  13009. Id uint64 `json:"id,omitempty,string"`
  13010. // Interconnect: URL of the underlying Interconnect object that this
  13011. // attachment's traffic will traverse through.
  13012. Interconnect string `json:"interconnect,omitempty"`
  13013. // Kind: [Output Only] Type of the resource. Always
  13014. // compute#interconnectAttachment for interconnect attachments.
  13015. Kind string `json:"kind,omitempty"`
  13016. // LabelFingerprint: A fingerprint for the labels being applied to this
  13017. // InterconnectAttachment, which is essentially a hash of the labels set
  13018. // used for optimistic locking. The fingerprint is initially generated
  13019. // by Compute Engine and changes after every request to modify or update
  13020. // labels. You must always provide an up-to-date fingerprint hash in
  13021. // order to update or change labels, otherwise the request will fail
  13022. // with error 412 conditionNotMet.
  13023. //
  13024. // To see the latest fingerprint, make a get() request to retrieve an
  13025. // InterconnectAttachment.
  13026. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  13027. // Labels: Labels to apply to this InterconnectAttachment resource.
  13028. // These can be later modified by the setLabels method. Each label
  13029. // key/value must comply with RFC1035. Label values may be empty.
  13030. Labels map[string]string `json:"labels,omitempty"`
  13031. // Name: Name of the resource. Provided by the client when the resource
  13032. // is created. The name must be 1-63 characters long, and comply with
  13033. // RFC1035. Specifically, the name must be 1-63 characters long and
  13034. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  13035. // the first character must be a lowercase letter, and all following
  13036. // characters must be a dash, lowercase letter, or digit, except the
  13037. // last character, which cannot be a dash.
  13038. Name string `json:"name,omitempty"`
  13039. // OperationalStatus: [Output Only] The current status of whether or not
  13040. // this interconnect attachment is functional.
  13041. //
  13042. // Possible values:
  13043. // "OS_ACTIVE"
  13044. // "OS_UNPROVISIONED"
  13045. OperationalStatus string `json:"operationalStatus,omitempty"`
  13046. // PairingKey: [Output only for type PARTNER. Input only for
  13047. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  13048. // of an PARTNER attachment used to initiate provisioning with a
  13049. // selected partner. Of the form "XXXXX/region/domain"
  13050. PairingKey string `json:"pairingKey,omitempty"`
  13051. // PartnerAsn: Optional BGP ASN for the router that should be supplied
  13052. // by a layer 3 Partner if they configured BGP on behalf of the
  13053. // customer. Output only for PARTNER type, input only for
  13054. // PARTNER_PROVIDER, not available for DEDICATED.
  13055. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  13056. // PartnerMetadata: Informational metadata about Partner attachments
  13057. // from Partners to display to customers. Output only for for PARTNER
  13058. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  13059. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  13060. // PrivateInterconnectInfo: [Output Only] Information specific to an
  13061. // InterconnectAttachment. This property is populated if the
  13062. // interconnect that this is attached to is of type DEDICATED.
  13063. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  13064. // Region: [Output Only] URL of the region where the regional
  13065. // interconnect attachment resides. You must specify this field as part
  13066. // of the HTTP request URL. It is not settable as a field in the request
  13067. // body.
  13068. Region string `json:"region,omitempty"`
  13069. // Router: URL of the Cloud Router to be used for dynamic routing. This
  13070. // router must be in the same region as this InterconnectAttachment. The
  13071. // InterconnectAttachment will automatically connect the Interconnect to
  13072. // the network & region within which the Cloud Router is configured.
  13073. Router string `json:"router,omitempty"`
  13074. // SelfLink: [Output Only] Server-defined URL for the resource.
  13075. SelfLink string `json:"selfLink,omitempty"`
  13076. // State: [Output Only] The current state of this attachment's
  13077. // functionality.
  13078. //
  13079. // Possible values:
  13080. // "ACTIVE"
  13081. // "DEFUNCT"
  13082. // "PARTNER_REQUEST_RECEIVED"
  13083. // "PENDING_CUSTOMER"
  13084. // "PENDING_PARTNER"
  13085. // "STATE_UNSPECIFIED"
  13086. // "UNPROVISIONED"
  13087. State string `json:"state,omitempty"`
  13088. // Possible values:
  13089. // "DEDICATED"
  13090. // "PARTNER"
  13091. // "PARTNER_PROVIDER"
  13092. Type string `json:"type,omitempty"`
  13093. // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the
  13094. // range 2-4094. Only specified at creation time.
  13095. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  13096. // ServerResponse contains the HTTP response code and headers from the
  13097. // server.
  13098. googleapi.ServerResponse `json:"-"`
  13099. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  13100. // unconditionally include in API requests. By default, fields with
  13101. // empty values are omitted from API requests. However, any non-pointer,
  13102. // non-interface field appearing in ForceSendFields will be sent to the
  13103. // server regardless of whether the field is empty or not. This may be
  13104. // used to include empty fields in Patch requests.
  13105. ForceSendFields []string `json:"-"`
  13106. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  13107. // in API requests with the JSON null value. By default, fields with
  13108. // empty values are omitted from API requests. However, any field with
  13109. // an empty value appearing in NullFields will be sent to the server as
  13110. // null. It is an error if a field in this list has a non-empty value.
  13111. // This may be used to include null fields in Patch requests.
  13112. NullFields []string `json:"-"`
  13113. }
  13114. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  13115. type NoMethod InterconnectAttachment
  13116. raw := NoMethod(*s)
  13117. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13118. }
  13119. type InterconnectAttachmentAggregatedList struct {
  13120. // Id: [Output Only] Unique identifier for the resource; defined by the
  13121. // server.
  13122. Id string `json:"id,omitempty"`
  13123. // Items: A list of InterconnectAttachmentsScopedList resources.
  13124. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  13125. // Kind: [Output Only] Type of resource. Always
  13126. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  13127. // interconnect attachments.
  13128. Kind string `json:"kind,omitempty"`
  13129. // NextPageToken: [Output Only] This token allows you to get the next
  13130. // page of results for list requests. If the number of results is larger
  13131. // than maxResults, use the nextPageToken as a value for the query
  13132. // parameter pageToken in the next list request. Subsequent list
  13133. // requests will have their own nextPageToken to continue paging through
  13134. // the results.
  13135. NextPageToken string `json:"nextPageToken,omitempty"`
  13136. // SelfLink: [Output Only] Server-defined URL for this resource.
  13137. SelfLink string `json:"selfLink,omitempty"`
  13138. // Warning: [Output Only] Informational warning message.
  13139. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  13140. // ServerResponse contains the HTTP response code and headers from the
  13141. // server.
  13142. googleapi.ServerResponse `json:"-"`
  13143. // ForceSendFields is a list of field names (e.g. "Id") to
  13144. // unconditionally include in API requests. By default, fields with
  13145. // empty values are omitted from API requests. However, any non-pointer,
  13146. // non-interface field appearing in ForceSendFields will be sent to the
  13147. // server regardless of whether the field is empty or not. This may be
  13148. // used to include empty fields in Patch requests.
  13149. ForceSendFields []string `json:"-"`
  13150. // NullFields is a list of field names (e.g. "Id") to include in API
  13151. // requests with the JSON null value. By default, fields with empty
  13152. // values are omitted from API requests. However, any field with an
  13153. // empty value appearing in NullFields will be sent to the server as
  13154. // null. It is an error if a field in this list has a non-empty value.
  13155. // This may be used to include null fields in Patch requests.
  13156. NullFields []string `json:"-"`
  13157. }
  13158. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  13159. type NoMethod InterconnectAttachmentAggregatedList
  13160. raw := NoMethod(*s)
  13161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13162. }
  13163. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  13164. // Informational warning message.
  13165. type InterconnectAttachmentAggregatedListWarning struct {
  13166. // Code: [Output Only] A warning code, if applicable. For example,
  13167. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13168. // the response.
  13169. //
  13170. // Possible values:
  13171. // "CLEANUP_FAILED"
  13172. // "DEPRECATED_RESOURCE_USED"
  13173. // "DEPRECATED_TYPE_USED"
  13174. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13175. // "EXPERIMENTAL_TYPE_USED"
  13176. // "EXTERNAL_API_WARNING"
  13177. // "FIELD_VALUE_OVERRIDEN"
  13178. // "INJECTED_KERNELS_DEPRECATED"
  13179. // "MISSING_TYPE_DEPENDENCY"
  13180. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13181. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13182. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13183. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13184. // "NEXT_HOP_NOT_RUNNING"
  13185. // "NOT_CRITICAL_ERROR"
  13186. // "NO_RESULTS_ON_PAGE"
  13187. // "REQUIRED_TOS_AGREEMENT"
  13188. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13189. // "RESOURCE_NOT_DELETED"
  13190. // "SCHEMA_VALIDATION_IGNORED"
  13191. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13192. // "UNDECLARED_PROPERTIES"
  13193. // "UNREACHABLE"
  13194. Code string `json:"code,omitempty"`
  13195. // Data: [Output Only] Metadata about this warning in key: value format.
  13196. // For example:
  13197. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13198. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  13199. // Message: [Output Only] A human-readable description of the warning
  13200. // code.
  13201. Message string `json:"message,omitempty"`
  13202. // ForceSendFields is a list of field names (e.g. "Code") to
  13203. // unconditionally include in API requests. By default, fields with
  13204. // empty values are omitted from API requests. However, any non-pointer,
  13205. // non-interface field appearing in ForceSendFields will be sent to the
  13206. // server regardless of whether the field is empty or not. This may be
  13207. // used to include empty fields in Patch requests.
  13208. ForceSendFields []string `json:"-"`
  13209. // NullFields is a list of field names (e.g. "Code") to include in API
  13210. // requests with the JSON null value. By default, fields with empty
  13211. // values are omitted from API requests. However, any field with an
  13212. // empty value appearing in NullFields will be sent to the server as
  13213. // null. It is an error if a field in this list has a non-empty value.
  13214. // This may be used to include null fields in Patch requests.
  13215. NullFields []string `json:"-"`
  13216. }
  13217. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  13218. type NoMethod InterconnectAttachmentAggregatedListWarning
  13219. raw := NoMethod(*s)
  13220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13221. }
  13222. type InterconnectAttachmentAggregatedListWarningData struct {
  13223. // Key: [Output Only] A key that provides more detail on the warning
  13224. // being returned. For example, for warnings where there are no results
  13225. // in a list request for a particular zone, this key might be scope and
  13226. // the key value might be the zone name. Other examples might be a key
  13227. // indicating a deprecated resource and a suggested replacement, or a
  13228. // warning about invalid network settings (for example, if an instance
  13229. // attempts to perform IP forwarding but is not enabled for IP
  13230. // forwarding).
  13231. Key string `json:"key,omitempty"`
  13232. // Value: [Output Only] A warning data value corresponding to the key.
  13233. Value string `json:"value,omitempty"`
  13234. // ForceSendFields is a list of field names (e.g. "Key") to
  13235. // unconditionally include in API requests. By default, fields with
  13236. // empty values are omitted from API requests. However, any non-pointer,
  13237. // non-interface field appearing in ForceSendFields will be sent to the
  13238. // server regardless of whether the field is empty or not. This may be
  13239. // used to include empty fields in Patch requests.
  13240. ForceSendFields []string `json:"-"`
  13241. // NullFields is a list of field names (e.g. "Key") to include in API
  13242. // requests with the JSON null value. By default, fields with empty
  13243. // values are omitted from API requests. However, any field with an
  13244. // empty value appearing in NullFields will be sent to the server as
  13245. // null. It is an error if a field in this list has a non-empty value.
  13246. // This may be used to include null fields in Patch requests.
  13247. NullFields []string `json:"-"`
  13248. }
  13249. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  13250. type NoMethod InterconnectAttachmentAggregatedListWarningData
  13251. raw := NoMethod(*s)
  13252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13253. }
  13254. // InterconnectAttachmentList: Response to the list request, and
  13255. // contains a list of interconnect attachments.
  13256. type InterconnectAttachmentList struct {
  13257. // Id: [Output Only] Unique identifier for the resource; defined by the
  13258. // server.
  13259. Id string `json:"id,omitempty"`
  13260. // Items: A list of InterconnectAttachment resources.
  13261. Items []*InterconnectAttachment `json:"items,omitempty"`
  13262. // Kind: [Output Only] Type of resource. Always
  13263. // compute#interconnectAttachmentList for lists of interconnect
  13264. // attachments.
  13265. Kind string `json:"kind,omitempty"`
  13266. // NextPageToken: [Output Only] This token allows you to get the next
  13267. // page of results for list requests. If the number of results is larger
  13268. // than maxResults, use the nextPageToken as a value for the query
  13269. // parameter pageToken in the next list request. Subsequent list
  13270. // requests will have their own nextPageToken to continue paging through
  13271. // the results.
  13272. NextPageToken string `json:"nextPageToken,omitempty"`
  13273. // SelfLink: [Output Only] Server-defined URL for this resource.
  13274. SelfLink string `json:"selfLink,omitempty"`
  13275. // Warning: [Output Only] Informational warning message.
  13276. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  13277. // ServerResponse contains the HTTP response code and headers from the
  13278. // server.
  13279. googleapi.ServerResponse `json:"-"`
  13280. // ForceSendFields is a list of field names (e.g. "Id") to
  13281. // unconditionally include in API requests. By default, fields with
  13282. // empty values are omitted from API requests. However, any non-pointer,
  13283. // non-interface field appearing in ForceSendFields will be sent to the
  13284. // server regardless of whether the field is empty or not. This may be
  13285. // used to include empty fields in Patch requests.
  13286. ForceSendFields []string `json:"-"`
  13287. // NullFields is a list of field names (e.g. "Id") to include in API
  13288. // requests with the JSON null value. By default, fields with empty
  13289. // values are omitted from API requests. However, any field with an
  13290. // empty value appearing in NullFields will be sent to the server as
  13291. // null. It is an error if a field in this list has a non-empty value.
  13292. // This may be used to include null fields in Patch requests.
  13293. NullFields []string `json:"-"`
  13294. }
  13295. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  13296. type NoMethod InterconnectAttachmentList
  13297. raw := NoMethod(*s)
  13298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13299. }
  13300. // InterconnectAttachmentListWarning: [Output Only] Informational
  13301. // warning message.
  13302. type InterconnectAttachmentListWarning struct {
  13303. // Code: [Output Only] A warning code, if applicable. For example,
  13304. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13305. // the response.
  13306. //
  13307. // Possible values:
  13308. // "CLEANUP_FAILED"
  13309. // "DEPRECATED_RESOURCE_USED"
  13310. // "DEPRECATED_TYPE_USED"
  13311. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13312. // "EXPERIMENTAL_TYPE_USED"
  13313. // "EXTERNAL_API_WARNING"
  13314. // "FIELD_VALUE_OVERRIDEN"
  13315. // "INJECTED_KERNELS_DEPRECATED"
  13316. // "MISSING_TYPE_DEPENDENCY"
  13317. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13318. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13319. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13320. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13321. // "NEXT_HOP_NOT_RUNNING"
  13322. // "NOT_CRITICAL_ERROR"
  13323. // "NO_RESULTS_ON_PAGE"
  13324. // "REQUIRED_TOS_AGREEMENT"
  13325. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13326. // "RESOURCE_NOT_DELETED"
  13327. // "SCHEMA_VALIDATION_IGNORED"
  13328. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13329. // "UNDECLARED_PROPERTIES"
  13330. // "UNREACHABLE"
  13331. Code string `json:"code,omitempty"`
  13332. // Data: [Output Only] Metadata about this warning in key: value format.
  13333. // For example:
  13334. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13335. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  13336. // Message: [Output Only] A human-readable description of the warning
  13337. // code.
  13338. Message string `json:"message,omitempty"`
  13339. // ForceSendFields is a list of field names (e.g. "Code") to
  13340. // unconditionally include in API requests. By default, fields with
  13341. // empty values are omitted from API requests. However, any non-pointer,
  13342. // non-interface field appearing in ForceSendFields will be sent to the
  13343. // server regardless of whether the field is empty or not. This may be
  13344. // used to include empty fields in Patch requests.
  13345. ForceSendFields []string `json:"-"`
  13346. // NullFields is a list of field names (e.g. "Code") to include in API
  13347. // requests with the JSON null value. By default, fields with empty
  13348. // values are omitted from API requests. However, any field with an
  13349. // empty value appearing in NullFields will be sent to the server as
  13350. // null. It is an error if a field in this list has a non-empty value.
  13351. // This may be used to include null fields in Patch requests.
  13352. NullFields []string `json:"-"`
  13353. }
  13354. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  13355. type NoMethod InterconnectAttachmentListWarning
  13356. raw := NoMethod(*s)
  13357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13358. }
  13359. type InterconnectAttachmentListWarningData struct {
  13360. // Key: [Output Only] A key that provides more detail on the warning
  13361. // being returned. For example, for warnings where there are no results
  13362. // in a list request for a particular zone, this key might be scope and
  13363. // the key value might be the zone name. Other examples might be a key
  13364. // indicating a deprecated resource and a suggested replacement, or a
  13365. // warning about invalid network settings (for example, if an instance
  13366. // attempts to perform IP forwarding but is not enabled for IP
  13367. // forwarding).
  13368. Key string `json:"key,omitempty"`
  13369. // Value: [Output Only] A warning data value corresponding to the key.
  13370. Value string `json:"value,omitempty"`
  13371. // ForceSendFields is a list of field names (e.g. "Key") to
  13372. // unconditionally include in API requests. By default, fields with
  13373. // empty values are omitted from API requests. However, any non-pointer,
  13374. // non-interface field appearing in ForceSendFields will be sent to the
  13375. // server regardless of whether the field is empty or not. This may be
  13376. // used to include empty fields in Patch requests.
  13377. ForceSendFields []string `json:"-"`
  13378. // NullFields is a list of field names (e.g. "Key") to include in API
  13379. // requests with the JSON null value. By default, fields with empty
  13380. // values are omitted from API requests. However, any field with an
  13381. // empty value appearing in NullFields will be sent to the server as
  13382. // null. It is an error if a field in this list has a non-empty value.
  13383. // This may be used to include null fields in Patch requests.
  13384. NullFields []string `json:"-"`
  13385. }
  13386. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  13387. type NoMethod InterconnectAttachmentListWarningData
  13388. raw := NoMethod(*s)
  13389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13390. }
  13391. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  13392. // Partner attachments from Partners to display to customers. These
  13393. // fields are propagated from PARTNER_PROVIDER attachments to their
  13394. // corresponding PARTNER attachments.
  13395. type InterconnectAttachmentPartnerMetadata struct {
  13396. // InterconnectName: Plain text name of the Interconnect this attachment
  13397. // is connected to, as displayed in the Partner?s portal. For instance
  13398. // "Chicago 1". This value may be validated to match approved Partner
  13399. // values.
  13400. InterconnectName string `json:"interconnectName,omitempty"`
  13401. // PartnerName: Plain text name of the Partner providing this
  13402. // attachment. This value may be validated to match approved Partner
  13403. // values.
  13404. PartnerName string `json:"partnerName,omitempty"`
  13405. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  13406. // may customise this to be a deep-link to the specific resource on the
  13407. // Partner portal. This value may be validated to match approved Partner
  13408. // values.
  13409. PortalUrl string `json:"portalUrl,omitempty"`
  13410. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  13411. // unconditionally include in API requests. By default, fields with
  13412. // empty values are omitted from API requests. However, any non-pointer,
  13413. // non-interface field appearing in ForceSendFields will be sent to the
  13414. // server regardless of whether the field is empty or not. This may be
  13415. // used to include empty fields in Patch requests.
  13416. ForceSendFields []string `json:"-"`
  13417. // NullFields is a list of field names (e.g. "InterconnectName") to
  13418. // include in API requests with the JSON null value. By default, fields
  13419. // with empty values are omitted from API requests. However, any field
  13420. // with an empty value appearing in NullFields will be sent to the
  13421. // server as null. It is an error if a field in this list has a
  13422. // non-empty value. This may be used to include null fields in Patch
  13423. // requests.
  13424. NullFields []string `json:"-"`
  13425. }
  13426. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  13427. type NoMethod InterconnectAttachmentPartnerMetadata
  13428. raw := NoMethod(*s)
  13429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13430. }
  13431. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  13432. // attachment when this belongs to an interconnect of type DEDICATED.
  13433. type InterconnectAttachmentPrivateInfo struct {
  13434. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  13435. // traffic between Google and the customer, going to and from this
  13436. // network and region.
  13437. Tag8021q int64 `json:"tag8021q,omitempty"`
  13438. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  13439. // unconditionally include in API requests. By default, fields with
  13440. // empty values are omitted from API requests. However, any non-pointer,
  13441. // non-interface field appearing in ForceSendFields will be sent to the
  13442. // server regardless of whether the field is empty or not. This may be
  13443. // used to include empty fields in Patch requests.
  13444. ForceSendFields []string `json:"-"`
  13445. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  13446. // API requests with the JSON null value. By default, fields with empty
  13447. // values are omitted from API requests. However, any field with an
  13448. // empty value appearing in NullFields will be sent to the server as
  13449. // null. It is an error if a field in this list has a non-empty value.
  13450. // This may be used to include null fields in Patch requests.
  13451. NullFields []string `json:"-"`
  13452. }
  13453. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  13454. type NoMethod InterconnectAttachmentPrivateInfo
  13455. raw := NoMethod(*s)
  13456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13457. }
  13458. type InterconnectAttachmentsScopedList struct {
  13459. // InterconnectAttachments: A list of interconnect attachments contained
  13460. // in this scope.
  13461. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  13462. // Warning: Informational warning which replaces the list of addresses
  13463. // when the list is empty.
  13464. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  13465. // ForceSendFields is a list of field names (e.g.
  13466. // "InterconnectAttachments") to unconditionally include in API
  13467. // requests. By default, fields with empty values are omitted from API
  13468. // requests. However, any non-pointer, non-interface field appearing in
  13469. // ForceSendFields will be sent to the server regardless of whether the
  13470. // field is empty or not. This may be used to include empty fields in
  13471. // Patch requests.
  13472. ForceSendFields []string `json:"-"`
  13473. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  13474. // to include in API requests with the JSON null value. By default,
  13475. // fields with empty values are omitted from API requests. However, any
  13476. // field with an empty value appearing in NullFields will be sent to the
  13477. // server as null. It is an error if a field in this list has a
  13478. // non-empty value. This may be used to include null fields in Patch
  13479. // requests.
  13480. NullFields []string `json:"-"`
  13481. }
  13482. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  13483. type NoMethod InterconnectAttachmentsScopedList
  13484. raw := NoMethod(*s)
  13485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13486. }
  13487. // InterconnectAttachmentsScopedListWarning: Informational warning which
  13488. // replaces the list of addresses when the list is empty.
  13489. type InterconnectAttachmentsScopedListWarning struct {
  13490. // Code: [Output Only] A warning code, if applicable. For example,
  13491. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13492. // the response.
  13493. //
  13494. // Possible values:
  13495. // "CLEANUP_FAILED"
  13496. // "DEPRECATED_RESOURCE_USED"
  13497. // "DEPRECATED_TYPE_USED"
  13498. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13499. // "EXPERIMENTAL_TYPE_USED"
  13500. // "EXTERNAL_API_WARNING"
  13501. // "FIELD_VALUE_OVERRIDEN"
  13502. // "INJECTED_KERNELS_DEPRECATED"
  13503. // "MISSING_TYPE_DEPENDENCY"
  13504. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13505. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13506. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13507. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13508. // "NEXT_HOP_NOT_RUNNING"
  13509. // "NOT_CRITICAL_ERROR"
  13510. // "NO_RESULTS_ON_PAGE"
  13511. // "REQUIRED_TOS_AGREEMENT"
  13512. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13513. // "RESOURCE_NOT_DELETED"
  13514. // "SCHEMA_VALIDATION_IGNORED"
  13515. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13516. // "UNDECLARED_PROPERTIES"
  13517. // "UNREACHABLE"
  13518. Code string `json:"code,omitempty"`
  13519. // Data: [Output Only] Metadata about this warning in key: value format.
  13520. // For example:
  13521. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13522. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  13523. // Message: [Output Only] A human-readable description of the warning
  13524. // code.
  13525. Message string `json:"message,omitempty"`
  13526. // ForceSendFields is a list of field names (e.g. "Code") to
  13527. // unconditionally include in API requests. By default, fields with
  13528. // empty values are omitted from API requests. However, any non-pointer,
  13529. // non-interface field appearing in ForceSendFields will be sent to the
  13530. // server regardless of whether the field is empty or not. This may be
  13531. // used to include empty fields in Patch requests.
  13532. ForceSendFields []string `json:"-"`
  13533. // NullFields is a list of field names (e.g. "Code") to include in API
  13534. // requests with the JSON null value. By default, fields with empty
  13535. // values are omitted from API requests. However, any field with an
  13536. // empty value appearing in NullFields will be sent to the server as
  13537. // null. It is an error if a field in this list has a non-empty value.
  13538. // This may be used to include null fields in Patch requests.
  13539. NullFields []string `json:"-"`
  13540. }
  13541. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  13542. type NoMethod InterconnectAttachmentsScopedListWarning
  13543. raw := NoMethod(*s)
  13544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13545. }
  13546. type InterconnectAttachmentsScopedListWarningData struct {
  13547. // Key: [Output Only] A key that provides more detail on the warning
  13548. // being returned. For example, for warnings where there are no results
  13549. // in a list request for a particular zone, this key might be scope and
  13550. // the key value might be the zone name. Other examples might be a key
  13551. // indicating a deprecated resource and a suggested replacement, or a
  13552. // warning about invalid network settings (for example, if an instance
  13553. // attempts to perform IP forwarding but is not enabled for IP
  13554. // forwarding).
  13555. Key string `json:"key,omitempty"`
  13556. // Value: [Output Only] A warning data value corresponding to the key.
  13557. Value string `json:"value,omitempty"`
  13558. // ForceSendFields is a list of field names (e.g. "Key") to
  13559. // unconditionally include in API requests. By default, fields with
  13560. // empty values are omitted from API requests. However, any non-pointer,
  13561. // non-interface field appearing in ForceSendFields will be sent to the
  13562. // server regardless of whether the field is empty or not. This may be
  13563. // used to include empty fields in Patch requests.
  13564. ForceSendFields []string `json:"-"`
  13565. // NullFields is a list of field names (e.g. "Key") to include in API
  13566. // requests with the JSON null value. By default, fields with empty
  13567. // values are omitted from API requests. However, any field with an
  13568. // empty value appearing in NullFields will be sent to the server as
  13569. // null. It is an error if a field in this list has a non-empty value.
  13570. // This may be used to include null fields in Patch requests.
  13571. NullFields []string `json:"-"`
  13572. }
  13573. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  13574. type NoMethod InterconnectAttachmentsScopedListWarningData
  13575. raw := NoMethod(*s)
  13576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13577. }
  13578. // InterconnectCircuitInfo: Describes a single physical circuit between
  13579. // the Customer and Google. CircuitInfo objects are created by Google,
  13580. // so all fields are output only. Next id: 4
  13581. type InterconnectCircuitInfo struct {
  13582. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  13583. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  13584. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  13585. // at circuit turn-up.
  13586. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  13587. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  13588. // circuit turn-up and provided by Google to the customer in the LOA.
  13589. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  13590. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  13591. // unconditionally include in API requests. By default, fields with
  13592. // empty values are omitted from API requests. However, any non-pointer,
  13593. // non-interface field appearing in ForceSendFields will be sent to the
  13594. // server regardless of whether the field is empty or not. This may be
  13595. // used to include empty fields in Patch requests.
  13596. ForceSendFields []string `json:"-"`
  13597. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  13598. // include in API requests with the JSON null value. By default, fields
  13599. // with empty values are omitted from API requests. However, any field
  13600. // with an empty value appearing in NullFields will be sent to the
  13601. // server as null. It is an error if a field in this list has a
  13602. // non-empty value. This may be used to include null fields in Patch
  13603. // requests.
  13604. NullFields []string `json:"-"`
  13605. }
  13606. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  13607. type NoMethod InterconnectCircuitInfo
  13608. raw := NoMethod(*s)
  13609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13610. }
  13611. // InterconnectDiagnostics: Diagnostics information about interconnect,
  13612. // contains detailed and current technical information about Google?s
  13613. // side of the connection.
  13614. type InterconnectDiagnostics struct {
  13615. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  13616. // describing individual neighbors currently seen by the Google router
  13617. // in the ARP cache for the Interconnect. This will be empty when the
  13618. // Interconnect is not bundled.
  13619. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  13620. // Links: A list of InterconnectDiagnostics.LinkStatus objects,
  13621. // describing the status for each link on the Interconnect.
  13622. Links []*InterconnectDiagnosticsLinkStatus `json:"links,omitempty"`
  13623. // MacAddress: The MAC address of the Interconnect's bundle interface.
  13624. MacAddress string `json:"macAddress,omitempty"`
  13625. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  13626. // unconditionally include in API requests. By default, fields with
  13627. // empty values are omitted from API requests. However, any non-pointer,
  13628. // non-interface field appearing in ForceSendFields will be sent to the
  13629. // server regardless of whether the field is empty or not. This may be
  13630. // used to include empty fields in Patch requests.
  13631. ForceSendFields []string `json:"-"`
  13632. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  13633. // API requests with the JSON null value. By default, fields with empty
  13634. // values are omitted from API requests. However, any field with an
  13635. // empty value appearing in NullFields will be sent to the server as
  13636. // null. It is an error if a field in this list has a non-empty value.
  13637. // This may be used to include null fields in Patch requests.
  13638. NullFields []string `json:"-"`
  13639. }
  13640. func (s *InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
  13641. type NoMethod InterconnectDiagnostics
  13642. raw := NoMethod(*s)
  13643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13644. }
  13645. // InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries
  13646. // seen on this link
  13647. type InterconnectDiagnosticsARPEntry struct {
  13648. // IpAddress: The IP address of this ARP neighbor.
  13649. IpAddress string `json:"ipAddress,omitempty"`
  13650. // MacAddress: The MAC address of this ARP neighbor.
  13651. MacAddress string `json:"macAddress,omitempty"`
  13652. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  13653. // unconditionally include in API requests. By default, fields with
  13654. // empty values are omitted from API requests. However, any non-pointer,
  13655. // non-interface field appearing in ForceSendFields will be sent to the
  13656. // server regardless of whether the field is empty or not. This may be
  13657. // used to include empty fields in Patch requests.
  13658. ForceSendFields []string `json:"-"`
  13659. // NullFields is a list of field names (e.g. "IpAddress") to include in
  13660. // API requests with the JSON null value. By default, fields with empty
  13661. // values are omitted from API requests. However, any field with an
  13662. // empty value appearing in NullFields will be sent to the server as
  13663. // null. It is an error if a field in this list has a non-empty value.
  13664. // This may be used to include null fields in Patch requests.
  13665. NullFields []string `json:"-"`
  13666. }
  13667. func (s *InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
  13668. type NoMethod InterconnectDiagnosticsARPEntry
  13669. raw := NoMethod(*s)
  13670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13671. }
  13672. type InterconnectDiagnosticsLinkLACPStatus struct {
  13673. // GoogleSystemId: System ID of the port on Google?s side of the LACP
  13674. // exchange.
  13675. GoogleSystemId string `json:"googleSystemId,omitempty"`
  13676. // NeighborSystemId: System ID of the port on the neighbor?s side of the
  13677. // LACP exchange.
  13678. NeighborSystemId string `json:"neighborSystemId,omitempty"`
  13679. // Possible values:
  13680. // "ACTIVE"
  13681. // "DETACHED"
  13682. State string `json:"state,omitempty"`
  13683. // ForceSendFields is a list of field names (e.g. "GoogleSystemId") to
  13684. // unconditionally include in API requests. By default, fields with
  13685. // empty values are omitted from API requests. However, any non-pointer,
  13686. // non-interface field appearing in ForceSendFields will be sent to the
  13687. // server regardless of whether the field is empty or not. This may be
  13688. // used to include empty fields in Patch requests.
  13689. ForceSendFields []string `json:"-"`
  13690. // NullFields is a list of field names (e.g. "GoogleSystemId") to
  13691. // include in API requests with the JSON null value. By default, fields
  13692. // with empty values are omitted from API requests. However, any field
  13693. // with an empty value appearing in NullFields will be sent to the
  13694. // server as null. It is an error if a field in this list has a
  13695. // non-empty value. This may be used to include null fields in Patch
  13696. // requests.
  13697. NullFields []string `json:"-"`
  13698. }
  13699. func (s *InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
  13700. type NoMethod InterconnectDiagnosticsLinkLACPStatus
  13701. raw := NoMethod(*s)
  13702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13703. }
  13704. type InterconnectDiagnosticsLinkOpticalPower struct {
  13705. // State: The status of the current value when compared to the warning
  13706. // and alarm levels for the receiving or transmitting transceiver.
  13707. // Possible states include:
  13708. // - OK: The value has not crossed a warning threshold.
  13709. // - LOW_WARNING: The value has crossed below the low warning threshold.
  13710. //
  13711. // - HIGH_WARNING: The value has crossed above the high warning
  13712. // threshold.
  13713. // - LOW_ALARM: The value has crossed below the low alarm threshold.
  13714. // - HIGH_ALARM: The value has crossed above the high alarm threshold.
  13715. //
  13716. // Possible values:
  13717. // "HIGH_ALARM"
  13718. // "HIGH_WARNING"
  13719. // "LOW_ALARM"
  13720. // "LOW_WARNING"
  13721. // "OK"
  13722. State string `json:"state,omitempty"`
  13723. // Value: Value of the current receiving or transmitting optical power,
  13724. // read in dBm. Take a known good optical value, give it a 10% margin
  13725. // and trigger warnings relative to that value. In general, a -7dBm
  13726. // warning and a -11dBm alarm are good optical value estimates for most
  13727. // links.
  13728. Value float64 `json:"value,omitempty"`
  13729. // ForceSendFields is a list of field names (e.g. "State") to
  13730. // unconditionally include in API requests. By default, fields with
  13731. // empty values are omitted from API requests. However, any non-pointer,
  13732. // non-interface field appearing in ForceSendFields will be sent to the
  13733. // server regardless of whether the field is empty or not. This may be
  13734. // used to include empty fields in Patch requests.
  13735. ForceSendFields []string `json:"-"`
  13736. // NullFields is a list of field names (e.g. "State") to include in API
  13737. // requests with the JSON null value. By default, fields with empty
  13738. // values are omitted from API requests. However, any field with an
  13739. // empty value appearing in NullFields will be sent to the server as
  13740. // null. It is an error if a field in this list has a non-empty value.
  13741. // This may be used to include null fields in Patch requests.
  13742. NullFields []string `json:"-"`
  13743. }
  13744. func (s *InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
  13745. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  13746. raw := NoMethod(*s)
  13747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13748. }
  13749. func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) error {
  13750. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  13751. var s1 struct {
  13752. Value gensupport.JSONFloat64 `json:"value"`
  13753. *NoMethod
  13754. }
  13755. s1.NoMethod = (*NoMethod)(s)
  13756. if err := json.Unmarshal(data, &s1); err != nil {
  13757. return err
  13758. }
  13759. s.Value = float64(s1.Value)
  13760. return nil
  13761. }
  13762. type InterconnectDiagnosticsLinkStatus struct {
  13763. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  13764. // describing the ARP neighbor entries seen on this link. This will be
  13765. // empty if the link is bundled
  13766. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  13767. // CircuitId: The unique ID for this link assigned during turn up by
  13768. // Google.
  13769. CircuitId string `json:"circuitId,omitempty"`
  13770. // GoogleDemarc: The Demarc address assigned by Google and provided in
  13771. // the LoA.
  13772. GoogleDemarc string `json:"googleDemarc,omitempty"`
  13773. LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
  13774. // ReceivingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  13775. // object, describing the current value and status of the received light
  13776. // level.
  13777. ReceivingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"receivingOpticalPower,omitempty"`
  13778. // TransmittingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  13779. // object, describing the current value and status of the transmitted
  13780. // light level.
  13781. TransmittingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"transmittingOpticalPower,omitempty"`
  13782. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  13783. // unconditionally include in API requests. By default, fields with
  13784. // empty values are omitted from API requests. However, any non-pointer,
  13785. // non-interface field appearing in ForceSendFields will be sent to the
  13786. // server regardless of whether the field is empty or not. This may be
  13787. // used to include empty fields in Patch requests.
  13788. ForceSendFields []string `json:"-"`
  13789. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  13790. // API requests with the JSON null value. By default, fields with empty
  13791. // values are omitted from API requests. However, any field with an
  13792. // empty value appearing in NullFields will be sent to the server as
  13793. // null. It is an error if a field in this list has a non-empty value.
  13794. // This may be used to include null fields in Patch requests.
  13795. NullFields []string `json:"-"`
  13796. }
  13797. func (s *InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
  13798. type NoMethod InterconnectDiagnosticsLinkStatus
  13799. raw := NoMethod(*s)
  13800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13801. }
  13802. // InterconnectList: Response to the list request, and contains a list
  13803. // of interconnects.
  13804. type InterconnectList struct {
  13805. // Id: [Output Only] Unique identifier for the resource; defined by the
  13806. // server.
  13807. Id string `json:"id,omitempty"`
  13808. // Items: A list of Interconnect resources.
  13809. Items []*Interconnect `json:"items,omitempty"`
  13810. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  13811. // for lists of interconnects.
  13812. Kind string `json:"kind,omitempty"`
  13813. // NextPageToken: [Output Only] This token allows you to get the next
  13814. // page of results for list requests. If the number of results is larger
  13815. // than maxResults, use the nextPageToken as a value for the query
  13816. // parameter pageToken in the next list request. Subsequent list
  13817. // requests will have their own nextPageToken to continue paging through
  13818. // the results.
  13819. NextPageToken string `json:"nextPageToken,omitempty"`
  13820. // SelfLink: [Output Only] Server-defined URL for this resource.
  13821. SelfLink string `json:"selfLink,omitempty"`
  13822. // Warning: [Output Only] Informational warning message.
  13823. Warning *InterconnectListWarning `json:"warning,omitempty"`
  13824. // ServerResponse contains the HTTP response code and headers from the
  13825. // server.
  13826. googleapi.ServerResponse `json:"-"`
  13827. // ForceSendFields is a list of field names (e.g. "Id") to
  13828. // unconditionally include in API requests. By default, fields with
  13829. // empty values are omitted from API requests. However, any non-pointer,
  13830. // non-interface field appearing in ForceSendFields will be sent to the
  13831. // server regardless of whether the field is empty or not. This may be
  13832. // used to include empty fields in Patch requests.
  13833. ForceSendFields []string `json:"-"`
  13834. // NullFields is a list of field names (e.g. "Id") to include in API
  13835. // requests with the JSON null value. By default, fields with empty
  13836. // values are omitted from API requests. However, any field with an
  13837. // empty value appearing in NullFields will be sent to the server as
  13838. // null. It is an error if a field in this list has a non-empty value.
  13839. // This may be used to include null fields in Patch requests.
  13840. NullFields []string `json:"-"`
  13841. }
  13842. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  13843. type NoMethod InterconnectList
  13844. raw := NoMethod(*s)
  13845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13846. }
  13847. // InterconnectListWarning: [Output Only] Informational warning message.
  13848. type InterconnectListWarning struct {
  13849. // Code: [Output Only] A warning code, if applicable. For example,
  13850. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13851. // the response.
  13852. //
  13853. // Possible values:
  13854. // "CLEANUP_FAILED"
  13855. // "DEPRECATED_RESOURCE_USED"
  13856. // "DEPRECATED_TYPE_USED"
  13857. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13858. // "EXPERIMENTAL_TYPE_USED"
  13859. // "EXTERNAL_API_WARNING"
  13860. // "FIELD_VALUE_OVERRIDEN"
  13861. // "INJECTED_KERNELS_DEPRECATED"
  13862. // "MISSING_TYPE_DEPENDENCY"
  13863. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13864. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13865. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13866. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13867. // "NEXT_HOP_NOT_RUNNING"
  13868. // "NOT_CRITICAL_ERROR"
  13869. // "NO_RESULTS_ON_PAGE"
  13870. // "REQUIRED_TOS_AGREEMENT"
  13871. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13872. // "RESOURCE_NOT_DELETED"
  13873. // "SCHEMA_VALIDATION_IGNORED"
  13874. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13875. // "UNDECLARED_PROPERTIES"
  13876. // "UNREACHABLE"
  13877. Code string `json:"code,omitempty"`
  13878. // Data: [Output Only] Metadata about this warning in key: value format.
  13879. // For example:
  13880. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13881. Data []*InterconnectListWarningData `json:"data,omitempty"`
  13882. // Message: [Output Only] A human-readable description of the warning
  13883. // code.
  13884. Message string `json:"message,omitempty"`
  13885. // ForceSendFields is a list of field names (e.g. "Code") to
  13886. // unconditionally include in API requests. By default, fields with
  13887. // empty values are omitted from API requests. However, any non-pointer,
  13888. // non-interface field appearing in ForceSendFields will be sent to the
  13889. // server regardless of whether the field is empty or not. This may be
  13890. // used to include empty fields in Patch requests.
  13891. ForceSendFields []string `json:"-"`
  13892. // NullFields is a list of field names (e.g. "Code") to include in API
  13893. // requests with the JSON null value. By default, fields with empty
  13894. // values are omitted from API requests. However, any field with an
  13895. // empty value appearing in NullFields will be sent to the server as
  13896. // null. It is an error if a field in this list has a non-empty value.
  13897. // This may be used to include null fields in Patch requests.
  13898. NullFields []string `json:"-"`
  13899. }
  13900. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  13901. type NoMethod InterconnectListWarning
  13902. raw := NoMethod(*s)
  13903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13904. }
  13905. type InterconnectListWarningData struct {
  13906. // Key: [Output Only] A key that provides more detail on the warning
  13907. // being returned. For example, for warnings where there are no results
  13908. // in a list request for a particular zone, this key might be scope and
  13909. // the key value might be the zone name. Other examples might be a key
  13910. // indicating a deprecated resource and a suggested replacement, or a
  13911. // warning about invalid network settings (for example, if an instance
  13912. // attempts to perform IP forwarding but is not enabled for IP
  13913. // forwarding).
  13914. Key string `json:"key,omitempty"`
  13915. // Value: [Output Only] A warning data value corresponding to the key.
  13916. Value string `json:"value,omitempty"`
  13917. // ForceSendFields is a list of field names (e.g. "Key") to
  13918. // unconditionally include in API requests. By default, fields with
  13919. // empty values are omitted from API requests. However, any non-pointer,
  13920. // non-interface field appearing in ForceSendFields will be sent to the
  13921. // server regardless of whether the field is empty or not. This may be
  13922. // used to include empty fields in Patch requests.
  13923. ForceSendFields []string `json:"-"`
  13924. // NullFields is a list of field names (e.g. "Key") to include in API
  13925. // requests with the JSON null value. By default, fields with empty
  13926. // values are omitted from API requests. However, any field with an
  13927. // empty value appearing in NullFields will be sent to the server as
  13928. // null. It is an error if a field in this list has a non-empty value.
  13929. // This may be used to include null fields in Patch requests.
  13930. NullFields []string `json:"-"`
  13931. }
  13932. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  13933. type NoMethod InterconnectListWarningData
  13934. raw := NoMethod(*s)
  13935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13936. }
  13937. // InterconnectLocation: Represents an InterconnectLocations resource.
  13938. // The InterconnectLocations resource describes the locations where you
  13939. // can connect to Google's networks. For more information, see
  13940. // Colocation Facilities.
  13941. type InterconnectLocation struct {
  13942. // Address: [Output Only] The postal address of the Point of Presence,
  13943. // each line in the address is separated by a newline character.
  13944. Address string `json:"address,omitempty"`
  13945. // AvailabilityZone: [Output Only] Availability zone for this
  13946. // InterconnectLocation. Within a metropolitan area (metro), maintenance
  13947. // will not be simultaneously scheduled in more than one availability
  13948. // zone. Example: "zone1" or "zone2".
  13949. AvailabilityZone string `json:"availabilityZone,omitempty"`
  13950. // City: [Output Only] Metropolitan area designator that indicates which
  13951. // city an interconnect is located. For example: "Chicago, IL",
  13952. // "Amsterdam, Netherlands".
  13953. City string `json:"city,omitempty"`
  13954. // Continent: [Output Only] Continent for this location.
  13955. //
  13956. // Possible values:
  13957. // "AFRICA"
  13958. // "ASIA_PAC"
  13959. // "C_AFRICA"
  13960. // "C_ASIA_PAC"
  13961. // "C_EUROPE"
  13962. // "C_NORTH_AMERICA"
  13963. // "C_SOUTH_AMERICA"
  13964. // "EUROPE"
  13965. // "NORTH_AMERICA"
  13966. // "SOUTH_AMERICA"
  13967. Continent string `json:"continent,omitempty"`
  13968. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13969. // format.
  13970. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13971. // Description: [Output Only] An optional description of the resource.
  13972. Description string `json:"description,omitempty"`
  13973. // FacilityProvider: [Output Only] The name of the provider for this
  13974. // facility (e.g., EQUINIX).
  13975. FacilityProvider string `json:"facilityProvider,omitempty"`
  13976. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  13977. // Identifier for this facility (e.g., Ashburn-DC1).
  13978. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  13979. // Id: [Output Only] The unique identifier for the resource. This
  13980. // identifier is defined by the server.
  13981. Id uint64 `json:"id,omitempty,string"`
  13982. // Kind: [Output Only] Type of the resource. Always
  13983. // compute#interconnectLocation for interconnect locations.
  13984. Kind string `json:"kind,omitempty"`
  13985. // Name: [Output Only] Name of the resource.
  13986. Name string `json:"name,omitempty"`
  13987. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  13988. // facility (corresponding with a netfac type in peeringdb).
  13989. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  13990. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  13991. // objects, that describe parameters pertaining to the relation between
  13992. // this InterconnectLocation and various Google Cloud regions.
  13993. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  13994. // SelfLink: [Output Only] Server-defined URL for the resource.
  13995. SelfLink string `json:"selfLink,omitempty"`
  13996. // Status: [Output Only] The status of this InterconnectLocation. If the
  13997. // status is AVAILABLE, new Interconnects may be provisioned in this
  13998. // InterconnectLocation. Otherwise, no new Interconnects may be
  13999. // provisioned.
  14000. //
  14001. // Possible values:
  14002. // "AVAILABLE"
  14003. // "CLOSED"
  14004. Status string `json:"status,omitempty"`
  14005. // ServerResponse contains the HTTP response code and headers from the
  14006. // server.
  14007. googleapi.ServerResponse `json:"-"`
  14008. // ForceSendFields is a list of field names (e.g. "Address") to
  14009. // unconditionally include in API requests. By default, fields with
  14010. // empty values are omitted from API requests. However, any non-pointer,
  14011. // non-interface field appearing in ForceSendFields will be sent to the
  14012. // server regardless of whether the field is empty or not. This may be
  14013. // used to include empty fields in Patch requests.
  14014. ForceSendFields []string `json:"-"`
  14015. // NullFields is a list of field names (e.g. "Address") to include in
  14016. // API requests with the JSON null value. By default, fields with empty
  14017. // values are omitted from API requests. However, any field with an
  14018. // empty value appearing in NullFields will be sent to the server as
  14019. // null. It is an error if a field in this list has a non-empty value.
  14020. // This may be used to include null fields in Patch requests.
  14021. NullFields []string `json:"-"`
  14022. }
  14023. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  14024. type NoMethod InterconnectLocation
  14025. raw := NoMethod(*s)
  14026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14027. }
  14028. // InterconnectLocationList: Response to the list request, and contains
  14029. // a list of interconnect locations.
  14030. type InterconnectLocationList struct {
  14031. // Id: [Output Only] Unique identifier for the resource; defined by the
  14032. // server.
  14033. Id string `json:"id,omitempty"`
  14034. // Items: A list of InterconnectLocation resources.
  14035. Items []*InterconnectLocation `json:"items,omitempty"`
  14036. // Kind: [Output Only] Type of resource. Always
  14037. // compute#interconnectLocationList for lists of interconnect locations.
  14038. Kind string `json:"kind,omitempty"`
  14039. // NextPageToken: [Output Only] This token allows you to get the next
  14040. // page of results for list requests. If the number of results is larger
  14041. // than maxResults, use the nextPageToken as a value for the query
  14042. // parameter pageToken in the next list request. Subsequent list
  14043. // requests will have their own nextPageToken to continue paging through
  14044. // the results.
  14045. NextPageToken string `json:"nextPageToken,omitempty"`
  14046. // SelfLink: [Output Only] Server-defined URL for this resource.
  14047. SelfLink string `json:"selfLink,omitempty"`
  14048. // Warning: [Output Only] Informational warning message.
  14049. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  14050. // ServerResponse contains the HTTP response code and headers from the
  14051. // server.
  14052. googleapi.ServerResponse `json:"-"`
  14053. // ForceSendFields is a list of field names (e.g. "Id") to
  14054. // unconditionally include in API requests. By default, fields with
  14055. // empty values are omitted from API requests. However, any non-pointer,
  14056. // non-interface field appearing in ForceSendFields will be sent to the
  14057. // server regardless of whether the field is empty or not. This may be
  14058. // used to include empty fields in Patch requests.
  14059. ForceSendFields []string `json:"-"`
  14060. // NullFields is a list of field names (e.g. "Id") to include in API
  14061. // requests with the JSON null value. By default, fields with empty
  14062. // values are omitted from API requests. However, any field with an
  14063. // empty value appearing in NullFields will be sent to the server as
  14064. // null. It is an error if a field in this list has a non-empty value.
  14065. // This may be used to include null fields in Patch requests.
  14066. NullFields []string `json:"-"`
  14067. }
  14068. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  14069. type NoMethod InterconnectLocationList
  14070. raw := NoMethod(*s)
  14071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14072. }
  14073. // InterconnectLocationListWarning: [Output Only] Informational warning
  14074. // message.
  14075. type InterconnectLocationListWarning struct {
  14076. // Code: [Output Only] A warning code, if applicable. For example,
  14077. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14078. // the response.
  14079. //
  14080. // Possible values:
  14081. // "CLEANUP_FAILED"
  14082. // "DEPRECATED_RESOURCE_USED"
  14083. // "DEPRECATED_TYPE_USED"
  14084. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14085. // "EXPERIMENTAL_TYPE_USED"
  14086. // "EXTERNAL_API_WARNING"
  14087. // "FIELD_VALUE_OVERRIDEN"
  14088. // "INJECTED_KERNELS_DEPRECATED"
  14089. // "MISSING_TYPE_DEPENDENCY"
  14090. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14091. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14092. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14093. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14094. // "NEXT_HOP_NOT_RUNNING"
  14095. // "NOT_CRITICAL_ERROR"
  14096. // "NO_RESULTS_ON_PAGE"
  14097. // "REQUIRED_TOS_AGREEMENT"
  14098. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14099. // "RESOURCE_NOT_DELETED"
  14100. // "SCHEMA_VALIDATION_IGNORED"
  14101. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14102. // "UNDECLARED_PROPERTIES"
  14103. // "UNREACHABLE"
  14104. Code string `json:"code,omitempty"`
  14105. // Data: [Output Only] Metadata about this warning in key: value format.
  14106. // For example:
  14107. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14108. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  14109. // Message: [Output Only] A human-readable description of the warning
  14110. // code.
  14111. Message string `json:"message,omitempty"`
  14112. // ForceSendFields is a list of field names (e.g. "Code") to
  14113. // unconditionally include in API requests. By default, fields with
  14114. // empty values are omitted from API requests. However, any non-pointer,
  14115. // non-interface field appearing in ForceSendFields will be sent to the
  14116. // server regardless of whether the field is empty or not. This may be
  14117. // used to include empty fields in Patch requests.
  14118. ForceSendFields []string `json:"-"`
  14119. // NullFields is a list of field names (e.g. "Code") to include in API
  14120. // requests with the JSON null value. By default, fields with empty
  14121. // values are omitted from API requests. However, any field with an
  14122. // empty value appearing in NullFields will be sent to the server as
  14123. // null. It is an error if a field in this list has a non-empty value.
  14124. // This may be used to include null fields in Patch requests.
  14125. NullFields []string `json:"-"`
  14126. }
  14127. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  14128. type NoMethod InterconnectLocationListWarning
  14129. raw := NoMethod(*s)
  14130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14131. }
  14132. type InterconnectLocationListWarningData struct {
  14133. // Key: [Output Only] A key that provides more detail on the warning
  14134. // being returned. For example, for warnings where there are no results
  14135. // in a list request for a particular zone, this key might be scope and
  14136. // the key value might be the zone name. Other examples might be a key
  14137. // indicating a deprecated resource and a suggested replacement, or a
  14138. // warning about invalid network settings (for example, if an instance
  14139. // attempts to perform IP forwarding but is not enabled for IP
  14140. // forwarding).
  14141. Key string `json:"key,omitempty"`
  14142. // Value: [Output Only] A warning data value corresponding to the key.
  14143. Value string `json:"value,omitempty"`
  14144. // ForceSendFields is a list of field names (e.g. "Key") to
  14145. // unconditionally include in API requests. By default, fields with
  14146. // empty values are omitted from API requests. However, any non-pointer,
  14147. // non-interface field appearing in ForceSendFields will be sent to the
  14148. // server regardless of whether the field is empty or not. This may be
  14149. // used to include empty fields in Patch requests.
  14150. ForceSendFields []string `json:"-"`
  14151. // NullFields is a list of field names (e.g. "Key") to include in API
  14152. // requests with the JSON null value. By default, fields with empty
  14153. // values are omitted from API requests. However, any field with an
  14154. // empty value appearing in NullFields will be sent to the server as
  14155. // null. It is an error if a field in this list has a non-empty value.
  14156. // This may be used to include null fields in Patch requests.
  14157. NullFields []string `json:"-"`
  14158. }
  14159. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  14160. type NoMethod InterconnectLocationListWarningData
  14161. raw := NoMethod(*s)
  14162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14163. }
  14164. // InterconnectLocationRegionInfo: Information about any potential
  14165. // InterconnectAttachments between an Interconnect at a specific
  14166. // InterconnectLocation, and a specific Cloud Region.
  14167. type InterconnectLocationRegionInfo struct {
  14168. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  14169. // InterconnectLocation to a VM in this region.
  14170. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  14171. // LocationPresence: Identifies the network presence of this location.
  14172. //
  14173. // Possible values:
  14174. // "GLOBAL"
  14175. // "LOCAL_REGION"
  14176. // "LP_GLOBAL"
  14177. // "LP_LOCAL_REGION"
  14178. LocationPresence string `json:"locationPresence,omitempty"`
  14179. // Region: URL for the region of this location.
  14180. Region string `json:"region,omitempty"`
  14181. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  14182. // unconditionally include in API requests. By default, fields with
  14183. // empty values are omitted from API requests. However, any non-pointer,
  14184. // non-interface field appearing in ForceSendFields will be sent to the
  14185. // server regardless of whether the field is empty or not. This may be
  14186. // used to include empty fields in Patch requests.
  14187. ForceSendFields []string `json:"-"`
  14188. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  14189. // in API requests with the JSON null value. By default, fields with
  14190. // empty values are omitted from API requests. However, any field with
  14191. // an empty value appearing in NullFields will be sent to the server as
  14192. // null. It is an error if a field in this list has a non-empty value.
  14193. // This may be used to include null fields in Patch requests.
  14194. NullFields []string `json:"-"`
  14195. }
  14196. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  14197. type NoMethod InterconnectLocationRegionInfo
  14198. raw := NoMethod(*s)
  14199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14200. }
  14201. // InterconnectOutageNotification: Description of a planned outage on
  14202. // this Interconnect. Next id: 9
  14203. type InterconnectOutageNotification struct {
  14204. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  14205. // Google-side circuit IDs that will be affected.
  14206. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  14207. // Description: A description about the purpose of the outage.
  14208. Description string `json:"description,omitempty"`
  14209. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  14210. // epoch).
  14211. EndTime int64 `json:"endTime,omitempty,string"`
  14212. // IssueType: Form this outage is expected to take. Note that the "IT_"
  14213. // versions of this enum have been deprecated in favor of the unprefixed
  14214. // values.
  14215. //
  14216. // Possible values:
  14217. // "IT_OUTAGE"
  14218. // "IT_PARTIAL_OUTAGE"
  14219. // "OUTAGE"
  14220. // "PARTIAL_OUTAGE"
  14221. IssueType string `json:"issueType,omitempty"`
  14222. // Name: Unique identifier for this outage notification.
  14223. Name string `json:"name,omitempty"`
  14224. // Source: The party that generated this notification. Note that
  14225. // "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE"
  14226. //
  14227. // Possible values:
  14228. // "GOOGLE"
  14229. // "NSRC_GOOGLE"
  14230. Source string `json:"source,omitempty"`
  14231. // StartTime: Scheduled start time for the outage (milliseconds since
  14232. // Unix epoch).
  14233. StartTime int64 `json:"startTime,omitempty,string"`
  14234. // State: State of this notification. Note that the "NS_" versions of
  14235. // this enum have been deprecated in favor of the unprefixed values.
  14236. //
  14237. // Possible values:
  14238. // "ACTIVE"
  14239. // "CANCELLED"
  14240. // "NS_ACTIVE"
  14241. // "NS_CANCELED"
  14242. State string `json:"state,omitempty"`
  14243. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  14244. // unconditionally include in API requests. By default, fields with
  14245. // empty values are omitted from API requests. However, any non-pointer,
  14246. // non-interface field appearing in ForceSendFields will be sent to the
  14247. // server regardless of whether the field is empty or not. This may be
  14248. // used to include empty fields in Patch requests.
  14249. ForceSendFields []string `json:"-"`
  14250. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  14251. // include in API requests with the JSON null value. By default, fields
  14252. // with empty values are omitted from API requests. However, any field
  14253. // with an empty value appearing in NullFields will be sent to the
  14254. // server as null. It is an error if a field in this list has a
  14255. // non-empty value. This may be used to include null fields in Patch
  14256. // requests.
  14257. NullFields []string `json:"-"`
  14258. }
  14259. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  14260. type NoMethod InterconnectOutageNotification
  14261. raw := NoMethod(*s)
  14262. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14263. }
  14264. // InterconnectsGetDiagnosticsResponse: Response for the
  14265. // InterconnectsGetDiagnosticsRequest.
  14266. type InterconnectsGetDiagnosticsResponse struct {
  14267. Result *InterconnectDiagnostics `json:"result,omitempty"`
  14268. // ServerResponse contains the HTTP response code and headers from the
  14269. // server.
  14270. googleapi.ServerResponse `json:"-"`
  14271. // ForceSendFields is a list of field names (e.g. "Result") to
  14272. // unconditionally include in API requests. By default, fields with
  14273. // empty values are omitted from API requests. However, any non-pointer,
  14274. // non-interface field appearing in ForceSendFields will be sent to the
  14275. // server regardless of whether the field is empty or not. This may be
  14276. // used to include empty fields in Patch requests.
  14277. ForceSendFields []string `json:"-"`
  14278. // NullFields is a list of field names (e.g. "Result") to include in API
  14279. // requests with the JSON null value. By default, fields with empty
  14280. // values are omitted from API requests. However, any field with an
  14281. // empty value appearing in NullFields will be sent to the server as
  14282. // null. It is an error if a field in this list has a non-empty value.
  14283. // This may be used to include null fields in Patch requests.
  14284. NullFields []string `json:"-"`
  14285. }
  14286. func (s *InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
  14287. type NoMethod InterconnectsGetDiagnosticsResponse
  14288. raw := NoMethod(*s)
  14289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14290. }
  14291. // License: A license resource.
  14292. type License struct {
  14293. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  14294. // reflects whether a license charges a usage fee.
  14295. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  14296. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14297. // format.
  14298. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14299. // Description: An optional textual description of the resource;
  14300. // provided by the client when the resource is created.
  14301. Description string `json:"description,omitempty"`
  14302. // Id: [Output Only] The unique identifier for the resource. This
  14303. // identifier is defined by the server.
  14304. Id uint64 `json:"id,omitempty,string"`
  14305. // Kind: [Output Only] Type of resource. Always compute#license for
  14306. // licenses.
  14307. Kind string `json:"kind,omitempty"`
  14308. // LicenseCode: [Output Only] The unique code used to attach this
  14309. // license to images, snapshots, and disks.
  14310. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  14311. // Name: Name of the resource. The name must be 1-63 characters long and
  14312. // comply with RFC1035.
  14313. Name string `json:"name,omitempty"`
  14314. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  14315. // SelfLink: [Output Only] Server-defined URL for the resource.
  14316. SelfLink string `json:"selfLink,omitempty"`
  14317. // Transferable: If false, licenses will not be copied from the source
  14318. // resource when creating an image from a disk, disk from snapshot, or
  14319. // snapshot from disk.
  14320. Transferable bool `json:"transferable,omitempty"`
  14321. // ServerResponse contains the HTTP response code and headers from the
  14322. // server.
  14323. googleapi.ServerResponse `json:"-"`
  14324. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  14325. // unconditionally include in API requests. By default, fields with
  14326. // empty values are omitted from API requests. However, any non-pointer,
  14327. // non-interface field appearing in ForceSendFields will be sent to the
  14328. // server regardless of whether the field is empty or not. This may be
  14329. // used to include empty fields in Patch requests.
  14330. ForceSendFields []string `json:"-"`
  14331. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  14332. // in API requests with the JSON null value. By default, fields with
  14333. // empty values are omitted from API requests. However, any field with
  14334. // an empty value appearing in NullFields will be sent to the server as
  14335. // null. It is an error if a field in this list has a non-empty value.
  14336. // This may be used to include null fields in Patch requests.
  14337. NullFields []string `json:"-"`
  14338. }
  14339. func (s *License) MarshalJSON() ([]byte, error) {
  14340. type NoMethod License
  14341. raw := NoMethod(*s)
  14342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14343. }
  14344. type LicenseCode struct {
  14345. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14346. // format.
  14347. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14348. // Description: [Output Only] Description of this License Code.
  14349. Description string `json:"description,omitempty"`
  14350. // Id: [Output Only] The unique identifier for the resource. This
  14351. // identifier is defined by the server.
  14352. Id uint64 `json:"id,omitempty,string"`
  14353. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  14354. // licenses.
  14355. Kind string `json:"kind,omitempty"`
  14356. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  14357. // with the same License Code.
  14358. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  14359. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  14360. // long and must be a valid 64 bit integer.
  14361. Name string `json:"name,omitempty"`
  14362. // SelfLink: [Output Only] Server-defined URL for the resource.
  14363. SelfLink string `json:"selfLink,omitempty"`
  14364. // State: [Output Only] Current state of this License Code.
  14365. //
  14366. // Possible values:
  14367. // "DISABLED"
  14368. // "ENABLED"
  14369. // "RESTRICTED"
  14370. // "STATE_UNSPECIFIED"
  14371. // "TERMINATED"
  14372. State string `json:"state,omitempty"`
  14373. // Transferable: [Output Only] If true, the license will remain attached
  14374. // when creating images or snapshots from disks. Otherwise, the license
  14375. // is not transferred.
  14376. Transferable bool `json:"transferable,omitempty"`
  14377. // ServerResponse contains the HTTP response code and headers from the
  14378. // server.
  14379. googleapi.ServerResponse `json:"-"`
  14380. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14381. // to unconditionally include in API requests. By default, fields with
  14382. // empty values are omitted from API requests. However, any non-pointer,
  14383. // non-interface field appearing in ForceSendFields will be sent to the
  14384. // server regardless of whether the field is empty or not. This may be
  14385. // used to include empty fields in Patch requests.
  14386. ForceSendFields []string `json:"-"`
  14387. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14388. // include in API requests with the JSON null value. By default, fields
  14389. // with empty values are omitted from API requests. However, any field
  14390. // with an empty value appearing in NullFields will be sent to the
  14391. // server as null. It is an error if a field in this list has a
  14392. // non-empty value. This may be used to include null fields in Patch
  14393. // requests.
  14394. NullFields []string `json:"-"`
  14395. }
  14396. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  14397. type NoMethod LicenseCode
  14398. raw := NoMethod(*s)
  14399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14400. }
  14401. type LicenseCodeLicenseAlias struct {
  14402. // Description: [Output Only] Description of this License Code.
  14403. Description string `json:"description,omitempty"`
  14404. // SelfLink: [Output Only] URL of license corresponding to this License
  14405. // Code.
  14406. SelfLink string `json:"selfLink,omitempty"`
  14407. // ForceSendFields is a list of field names (e.g. "Description") to
  14408. // unconditionally include in API requests. By default, fields with
  14409. // empty values are omitted from API requests. However, any non-pointer,
  14410. // non-interface field appearing in ForceSendFields will be sent to the
  14411. // server regardless of whether the field is empty or not. This may be
  14412. // used to include empty fields in Patch requests.
  14413. ForceSendFields []string `json:"-"`
  14414. // NullFields is a list of field names (e.g. "Description") to include
  14415. // in API requests with the JSON null value. By default, fields with
  14416. // empty values are omitted from API requests. However, any field with
  14417. // an empty value appearing in NullFields will be sent to the server as
  14418. // null. It is an error if a field in this list has a non-empty value.
  14419. // This may be used to include null fields in Patch requests.
  14420. NullFields []string `json:"-"`
  14421. }
  14422. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  14423. type NoMethod LicenseCodeLicenseAlias
  14424. raw := NoMethod(*s)
  14425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14426. }
  14427. type LicenseResourceRequirements struct {
  14428. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  14429. // Instance. Enforced at Instance creation and Instance start.
  14430. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  14431. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  14432. // Instance creation and Instance start.
  14433. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  14434. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  14435. // unconditionally include in API requests. By default, fields with
  14436. // empty values are omitted from API requests. However, any non-pointer,
  14437. // non-interface field appearing in ForceSendFields will be sent to the
  14438. // server regardless of whether the field is empty or not. This may be
  14439. // used to include empty fields in Patch requests.
  14440. ForceSendFields []string `json:"-"`
  14441. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  14442. // include in API requests with the JSON null value. By default, fields
  14443. // with empty values are omitted from API requests. However, any field
  14444. // with an empty value appearing in NullFields will be sent to the
  14445. // server as null. It is an error if a field in this list has a
  14446. // non-empty value. This may be used to include null fields in Patch
  14447. // requests.
  14448. NullFields []string `json:"-"`
  14449. }
  14450. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  14451. type NoMethod LicenseResourceRequirements
  14452. raw := NoMethod(*s)
  14453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14454. }
  14455. type LicensesListResponse struct {
  14456. // Id: [Output Only] Unique identifier for the resource; defined by the
  14457. // server.
  14458. Id string `json:"id,omitempty"`
  14459. // Items: A list of License resources.
  14460. Items []*License `json:"items,omitempty"`
  14461. // NextPageToken: [Output Only] This token allows you to get the next
  14462. // page of results for list requests. If the number of results is larger
  14463. // than maxResults, use the nextPageToken as a value for the query
  14464. // parameter pageToken in the next list request. Subsequent list
  14465. // requests will have their own nextPageToken to continue paging through
  14466. // the results.
  14467. NextPageToken string `json:"nextPageToken,omitempty"`
  14468. // SelfLink: [Output Only] Server-defined URL for this resource.
  14469. SelfLink string `json:"selfLink,omitempty"`
  14470. // Warning: [Output Only] Informational warning message.
  14471. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  14472. // ServerResponse contains the HTTP response code and headers from the
  14473. // server.
  14474. googleapi.ServerResponse `json:"-"`
  14475. // ForceSendFields is a list of field names (e.g. "Id") to
  14476. // unconditionally include in API requests. By default, fields with
  14477. // empty values are omitted from API requests. However, any non-pointer,
  14478. // non-interface field appearing in ForceSendFields will be sent to the
  14479. // server regardless of whether the field is empty or not. This may be
  14480. // used to include empty fields in Patch requests.
  14481. ForceSendFields []string `json:"-"`
  14482. // NullFields is a list of field names (e.g. "Id") to include in API
  14483. // requests with the JSON null value. By default, fields with empty
  14484. // values are omitted from API requests. However, any field with an
  14485. // empty value appearing in NullFields will be sent to the server as
  14486. // null. It is an error if a field in this list has a non-empty value.
  14487. // This may be used to include null fields in Patch requests.
  14488. NullFields []string `json:"-"`
  14489. }
  14490. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  14491. type NoMethod LicensesListResponse
  14492. raw := NoMethod(*s)
  14493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14494. }
  14495. // LicensesListResponseWarning: [Output Only] Informational warning
  14496. // message.
  14497. type LicensesListResponseWarning struct {
  14498. // Code: [Output Only] A warning code, if applicable. For example,
  14499. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14500. // the response.
  14501. //
  14502. // Possible values:
  14503. // "CLEANUP_FAILED"
  14504. // "DEPRECATED_RESOURCE_USED"
  14505. // "DEPRECATED_TYPE_USED"
  14506. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14507. // "EXPERIMENTAL_TYPE_USED"
  14508. // "EXTERNAL_API_WARNING"
  14509. // "FIELD_VALUE_OVERRIDEN"
  14510. // "INJECTED_KERNELS_DEPRECATED"
  14511. // "MISSING_TYPE_DEPENDENCY"
  14512. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14513. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14514. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14515. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14516. // "NEXT_HOP_NOT_RUNNING"
  14517. // "NOT_CRITICAL_ERROR"
  14518. // "NO_RESULTS_ON_PAGE"
  14519. // "REQUIRED_TOS_AGREEMENT"
  14520. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14521. // "RESOURCE_NOT_DELETED"
  14522. // "SCHEMA_VALIDATION_IGNORED"
  14523. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14524. // "UNDECLARED_PROPERTIES"
  14525. // "UNREACHABLE"
  14526. Code string `json:"code,omitempty"`
  14527. // Data: [Output Only] Metadata about this warning in key: value format.
  14528. // For example:
  14529. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14530. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  14531. // Message: [Output Only] A human-readable description of the warning
  14532. // code.
  14533. Message string `json:"message,omitempty"`
  14534. // ForceSendFields is a list of field names (e.g. "Code") to
  14535. // unconditionally include in API requests. By default, fields with
  14536. // empty values are omitted from API requests. However, any non-pointer,
  14537. // non-interface field appearing in ForceSendFields will be sent to the
  14538. // server regardless of whether the field is empty or not. This may be
  14539. // used to include empty fields in Patch requests.
  14540. ForceSendFields []string `json:"-"`
  14541. // NullFields is a list of field names (e.g. "Code") to include in API
  14542. // requests with the JSON null value. By default, fields with empty
  14543. // values are omitted from API requests. However, any field with an
  14544. // empty value appearing in NullFields will be sent to the server as
  14545. // null. It is an error if a field in this list has a non-empty value.
  14546. // This may be used to include null fields in Patch requests.
  14547. NullFields []string `json:"-"`
  14548. }
  14549. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  14550. type NoMethod LicensesListResponseWarning
  14551. raw := NoMethod(*s)
  14552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14553. }
  14554. type LicensesListResponseWarningData struct {
  14555. // Key: [Output Only] A key that provides more detail on the warning
  14556. // being returned. For example, for warnings where there are no results
  14557. // in a list request for a particular zone, this key might be scope and
  14558. // the key value might be the zone name. Other examples might be a key
  14559. // indicating a deprecated resource and a suggested replacement, or a
  14560. // warning about invalid network settings (for example, if an instance
  14561. // attempts to perform IP forwarding but is not enabled for IP
  14562. // forwarding).
  14563. Key string `json:"key,omitempty"`
  14564. // Value: [Output Only] A warning data value corresponding to the key.
  14565. Value string `json:"value,omitempty"`
  14566. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  14574. // requests with the JSON null value. By default, fields with empty
  14575. // values are omitted from API requests. However, any field with an
  14576. // empty value appearing in NullFields will be sent to the server as
  14577. // null. It is an error if a field in this list has a non-empty value.
  14578. // This may be used to include null fields in Patch requests.
  14579. NullFields []string `json:"-"`
  14580. }
  14581. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  14582. type NoMethod LicensesListResponseWarningData
  14583. raw := NoMethod(*s)
  14584. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14585. }
  14586. // LogConfig: Specifies what kind of log the caller must write
  14587. type LogConfig struct {
  14588. // CloudAudit: Cloud audit options.
  14589. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  14590. // Counter: Counter options.
  14591. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  14592. // DataAccess: Data access options.
  14593. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  14594. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  14595. // unconditionally include in API requests. By default, fields with
  14596. // empty values are omitted from API requests. However, any non-pointer,
  14597. // non-interface field appearing in ForceSendFields will be sent to the
  14598. // server regardless of whether the field is empty or not. This may be
  14599. // used to include empty fields in Patch requests.
  14600. ForceSendFields []string `json:"-"`
  14601. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  14602. // API requests with the JSON null value. By default, fields with empty
  14603. // values are omitted from API requests. However, any field with an
  14604. // empty value appearing in NullFields will be sent to the server as
  14605. // null. It is an error if a field in this list has a non-empty value.
  14606. // This may be used to include null fields in Patch requests.
  14607. NullFields []string `json:"-"`
  14608. }
  14609. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  14610. type NoMethod LogConfig
  14611. raw := NoMethod(*s)
  14612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14613. }
  14614. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  14615. type LogConfigCloudAuditOptions struct {
  14616. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  14617. // Logging pipeline.
  14618. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  14619. // LogName: The log_name to populate in the Cloud Audit Record.
  14620. //
  14621. // Possible values:
  14622. // "ADMIN_ACTIVITY"
  14623. // "DATA_ACCESS"
  14624. // "UNSPECIFIED_LOG_NAME"
  14625. LogName string `json:"logName,omitempty"`
  14626. // ForceSendFields is a list of field names (e.g.
  14627. // "AuthorizationLoggingOptions") to unconditionally include in API
  14628. // requests. By default, fields with empty values are omitted from API
  14629. // requests. However, any non-pointer, non-interface field appearing in
  14630. // ForceSendFields will be sent to the server regardless of whether the
  14631. // field is empty or not. This may be used to include empty fields in
  14632. // Patch requests.
  14633. ForceSendFields []string `json:"-"`
  14634. // NullFields is a list of field names (e.g.
  14635. // "AuthorizationLoggingOptions") to include in API requests with the
  14636. // JSON null value. By default, fields with empty values are omitted
  14637. // from API requests. However, any field with an empty value appearing
  14638. // in NullFields will be sent to the server as null. It is an error if a
  14639. // field in this list has a non-empty value. This may be used to include
  14640. // null fields in Patch requests.
  14641. NullFields []string `json:"-"`
  14642. }
  14643. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  14644. type NoMethod LogConfigCloudAuditOptions
  14645. raw := NoMethod(*s)
  14646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14647. }
  14648. // LogConfigCounterOptions: Increment a streamz counter with the
  14649. // specified metric and field names.
  14650. //
  14651. // Metric names should start with a '/', generally be lowercase-only,
  14652. // and end in "_count". Field names should not contain an initial slash.
  14653. // The actual exported metric names will have "/iam/policy"
  14654. // prepended.
  14655. //
  14656. // Field names correspond to IAM request parameters and field values are
  14657. // their respective values.
  14658. //
  14659. // Supported field names: - "authority", which is "[token]" if
  14660. // IAMContext.token is present, otherwise the value of
  14661. // IAMContext.authority_selector if present, and otherwise a
  14662. // representation of IAMContext.principal; or - "iam_principal", a
  14663. // representation of IAMContext.principal even if a token or authority
  14664. // selector is present; or - "" (empty string), resulting in a counter
  14665. // with no fields.
  14666. //
  14667. // Examples: counter { metric: "/debug_access_count" field:
  14668. // "iam_principal" } ==> increment counter
  14669. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  14670. // IAMContext.principal]}
  14671. //
  14672. // At this time we do not support multiple field names (though this may
  14673. // be supported in the future).
  14674. type LogConfigCounterOptions struct {
  14675. // Field: The field value to attribute.
  14676. Field string `json:"field,omitempty"`
  14677. // Metric: The metric to update.
  14678. Metric string `json:"metric,omitempty"`
  14679. // ForceSendFields is a list of field names (e.g. "Field") to
  14680. // unconditionally include in API requests. By default, fields with
  14681. // empty values are omitted from API requests. However, any non-pointer,
  14682. // non-interface field appearing in ForceSendFields will be sent to the
  14683. // server regardless of whether the field is empty or not. This may be
  14684. // used to include empty fields in Patch requests.
  14685. ForceSendFields []string `json:"-"`
  14686. // NullFields is a list of field names (e.g. "Field") to include in API
  14687. // requests with the JSON null value. By default, fields with empty
  14688. // values are omitted from API requests. However, any field with an
  14689. // empty value appearing in NullFields will be sent to the server as
  14690. // null. It is an error if a field in this list has a non-empty value.
  14691. // This may be used to include null fields in Patch requests.
  14692. NullFields []string `json:"-"`
  14693. }
  14694. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  14695. type NoMethod LogConfigCounterOptions
  14696. raw := NoMethod(*s)
  14697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14698. }
  14699. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  14700. type LogConfigDataAccessOptions struct {
  14701. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  14702. // the caller. This is relevant only in the LocalIAM implementation, for
  14703. // now.
  14704. //
  14705. // NOTE: Logging to Gin in a fail-closed manner is currently unsupported
  14706. // while work is being done to satisfy the requirements of go/345.
  14707. // Currently, setting LOG_FAIL_CLOSED mode will have no effect, but
  14708. // still exists because there is active work being done to support it
  14709. // (b/115874152).
  14710. //
  14711. // Possible values:
  14712. // "LOG_FAIL_CLOSED"
  14713. // "LOG_MODE_UNSPECIFIED"
  14714. LogMode string `json:"logMode,omitempty"`
  14715. // ForceSendFields is a list of field names (e.g. "LogMode") to
  14716. // unconditionally include in API requests. By default, fields with
  14717. // empty values are omitted from API requests. However, any non-pointer,
  14718. // non-interface field appearing in ForceSendFields will be sent to the
  14719. // server regardless of whether the field is empty or not. This may be
  14720. // used to include empty fields in Patch requests.
  14721. ForceSendFields []string `json:"-"`
  14722. // NullFields is a list of field names (e.g. "LogMode") to include in
  14723. // API requests with the JSON null value. By default, fields with empty
  14724. // values are omitted from API requests. However, any field with an
  14725. // empty value appearing in NullFields will be sent to the server as
  14726. // null. It is an error if a field in this list has a non-empty value.
  14727. // This may be used to include null fields in Patch requests.
  14728. NullFields []string `json:"-"`
  14729. }
  14730. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  14731. type NoMethod LogConfigDataAccessOptions
  14732. raw := NoMethod(*s)
  14733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14734. }
  14735. // MachineType: A Machine Type resource. (== resource_for
  14736. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  14737. type MachineType struct {
  14738. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14739. // format.
  14740. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14741. // Deprecated: [Output Only] The deprecation status associated with this
  14742. // machine type.
  14743. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  14744. // Description: [Output Only] An optional textual description of the
  14745. // resource.
  14746. Description string `json:"description,omitempty"`
  14747. // GuestCpus: [Output Only] The number of virtual CPUs that are
  14748. // available to the instance.
  14749. GuestCpus int64 `json:"guestCpus,omitempty"`
  14750. // Id: [Output Only] The unique identifier for the resource. This
  14751. // identifier is defined by the server.
  14752. Id uint64 `json:"id,omitempty,string"`
  14753. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  14754. // CPU. See Shared-core machine types for more information.
  14755. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  14756. // Kind: [Output Only] The type of the resource. Always
  14757. // compute#machineType for machine types.
  14758. Kind string `json:"kind,omitempty"`
  14759. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  14760. // allowed.
  14761. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  14762. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  14763. // disks size (GB) allowed.
  14764. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  14765. // MemoryMb: [Output Only] The amount of physical memory available to
  14766. // the instance, defined in MB.
  14767. MemoryMb int64 `json:"memoryMb,omitempty"`
  14768. // Name: [Output Only] Name of the resource.
  14769. Name string `json:"name,omitempty"`
  14770. // SelfLink: [Output Only] Server-defined URL for the resource.
  14771. SelfLink string `json:"selfLink,omitempty"`
  14772. // Zone: [Output Only] The name of the zone where the machine type
  14773. // resides, such as us-central1-a.
  14774. Zone string `json:"zone,omitempty"`
  14775. // ServerResponse contains the HTTP response code and headers from the
  14776. // server.
  14777. googleapi.ServerResponse `json:"-"`
  14778. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14779. // to unconditionally include in API requests. By default, fields with
  14780. // empty values are omitted from API requests. However, any non-pointer,
  14781. // non-interface field appearing in ForceSendFields will be sent to the
  14782. // server regardless of whether the field is empty or not. This may be
  14783. // used to include empty fields in Patch requests.
  14784. ForceSendFields []string `json:"-"`
  14785. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14786. // include in API requests with the JSON null value. By default, fields
  14787. // with empty values are omitted from API requests. However, any field
  14788. // with an empty value appearing in NullFields will be sent to the
  14789. // server as null. It is an error if a field in this list has a
  14790. // non-empty value. This may be used to include null fields in Patch
  14791. // requests.
  14792. NullFields []string `json:"-"`
  14793. }
  14794. func (s *MachineType) MarshalJSON() ([]byte, error) {
  14795. type NoMethod MachineType
  14796. raw := NoMethod(*s)
  14797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14798. }
  14799. type MachineTypeAggregatedList struct {
  14800. // Id: [Output Only] Unique identifier for the resource; defined by the
  14801. // server.
  14802. Id string `json:"id,omitempty"`
  14803. // Items: A list of MachineTypesScopedList resources.
  14804. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  14805. // Kind: [Output Only] Type of resource. Always
  14806. // compute#machineTypeAggregatedList for aggregated lists of machine
  14807. // types.
  14808. Kind string `json:"kind,omitempty"`
  14809. // NextPageToken: [Output Only] This token allows you to get the next
  14810. // page of results for list requests. If the number of results is larger
  14811. // than maxResults, use the nextPageToken as a value for the query
  14812. // parameter pageToken in the next list request. Subsequent list
  14813. // requests will have their own nextPageToken to continue paging through
  14814. // the results.
  14815. NextPageToken string `json:"nextPageToken,omitempty"`
  14816. // SelfLink: [Output Only] Server-defined URL for this resource.
  14817. SelfLink string `json:"selfLink,omitempty"`
  14818. // Warning: [Output Only] Informational warning message.
  14819. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  14820. // ServerResponse contains the HTTP response code and headers from the
  14821. // server.
  14822. googleapi.ServerResponse `json:"-"`
  14823. // ForceSendFields is a list of field names (e.g. "Id") to
  14824. // unconditionally include in API requests. By default, fields with
  14825. // empty values are omitted from API requests. However, any non-pointer,
  14826. // non-interface field appearing in ForceSendFields will be sent to the
  14827. // server regardless of whether the field is empty or not. This may be
  14828. // used to include empty fields in Patch requests.
  14829. ForceSendFields []string `json:"-"`
  14830. // NullFields is a list of field names (e.g. "Id") to include in API
  14831. // requests with the JSON null value. By default, fields with empty
  14832. // values are omitted from API requests. However, any field with an
  14833. // empty value appearing in NullFields will be sent to the server as
  14834. // null. It is an error if a field in this list has a non-empty value.
  14835. // This may be used to include null fields in Patch requests.
  14836. NullFields []string `json:"-"`
  14837. }
  14838. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  14839. type NoMethod MachineTypeAggregatedList
  14840. raw := NoMethod(*s)
  14841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14842. }
  14843. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  14844. // message.
  14845. type MachineTypeAggregatedListWarning struct {
  14846. // Code: [Output Only] A warning code, if applicable. For example,
  14847. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14848. // the response.
  14849. //
  14850. // Possible values:
  14851. // "CLEANUP_FAILED"
  14852. // "DEPRECATED_RESOURCE_USED"
  14853. // "DEPRECATED_TYPE_USED"
  14854. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14855. // "EXPERIMENTAL_TYPE_USED"
  14856. // "EXTERNAL_API_WARNING"
  14857. // "FIELD_VALUE_OVERRIDEN"
  14858. // "INJECTED_KERNELS_DEPRECATED"
  14859. // "MISSING_TYPE_DEPENDENCY"
  14860. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14861. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14862. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14863. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14864. // "NEXT_HOP_NOT_RUNNING"
  14865. // "NOT_CRITICAL_ERROR"
  14866. // "NO_RESULTS_ON_PAGE"
  14867. // "REQUIRED_TOS_AGREEMENT"
  14868. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14869. // "RESOURCE_NOT_DELETED"
  14870. // "SCHEMA_VALIDATION_IGNORED"
  14871. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14872. // "UNDECLARED_PROPERTIES"
  14873. // "UNREACHABLE"
  14874. Code string `json:"code,omitempty"`
  14875. // Data: [Output Only] Metadata about this warning in key: value format.
  14876. // For example:
  14877. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14878. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  14879. // Message: [Output Only] A human-readable description of the warning
  14880. // code.
  14881. Message string `json:"message,omitempty"`
  14882. // ForceSendFields is a list of field names (e.g. "Code") to
  14883. // unconditionally include in API requests. By default, fields with
  14884. // empty values are omitted from API requests. However, any non-pointer,
  14885. // non-interface field appearing in ForceSendFields will be sent to the
  14886. // server regardless of whether the field is empty or not. This may be
  14887. // used to include empty fields in Patch requests.
  14888. ForceSendFields []string `json:"-"`
  14889. // NullFields is a list of field names (e.g. "Code") to include in API
  14890. // requests with the JSON null value. By default, fields with empty
  14891. // values are omitted from API requests. However, any field with an
  14892. // empty value appearing in NullFields will be sent to the server as
  14893. // null. It is an error if a field in this list has a non-empty value.
  14894. // This may be used to include null fields in Patch requests.
  14895. NullFields []string `json:"-"`
  14896. }
  14897. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  14898. type NoMethod MachineTypeAggregatedListWarning
  14899. raw := NoMethod(*s)
  14900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14901. }
  14902. type MachineTypeAggregatedListWarningData struct {
  14903. // Key: [Output Only] A key that provides more detail on the warning
  14904. // being returned. For example, for warnings where there are no results
  14905. // in a list request for a particular zone, this key might be scope and
  14906. // the key value might be the zone name. Other examples might be a key
  14907. // indicating a deprecated resource and a suggested replacement, or a
  14908. // warning about invalid network settings (for example, if an instance
  14909. // attempts to perform IP forwarding but is not enabled for IP
  14910. // forwarding).
  14911. Key string `json:"key,omitempty"`
  14912. // Value: [Output Only] A warning data value corresponding to the key.
  14913. Value string `json:"value,omitempty"`
  14914. // ForceSendFields is a list of field names (e.g. "Key") to
  14915. // unconditionally include in API requests. By default, fields with
  14916. // empty values are omitted from API requests. However, any non-pointer,
  14917. // non-interface field appearing in ForceSendFields will be sent to the
  14918. // server regardless of whether the field is empty or not. This may be
  14919. // used to include empty fields in Patch requests.
  14920. ForceSendFields []string `json:"-"`
  14921. // NullFields is a list of field names (e.g. "Key") to include in API
  14922. // requests with the JSON null value. By default, fields with empty
  14923. // values are omitted from API requests. However, any field with an
  14924. // empty value appearing in NullFields will be sent to the server as
  14925. // null. It is an error if a field in this list has a non-empty value.
  14926. // This may be used to include null fields in Patch requests.
  14927. NullFields []string `json:"-"`
  14928. }
  14929. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  14930. type NoMethod MachineTypeAggregatedListWarningData
  14931. raw := NoMethod(*s)
  14932. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14933. }
  14934. // MachineTypeList: Contains a list of machine types.
  14935. type MachineTypeList struct {
  14936. // Id: [Output Only] Unique identifier for the resource; defined by the
  14937. // server.
  14938. Id string `json:"id,omitempty"`
  14939. // Items: A list of MachineType resources.
  14940. Items []*MachineType `json:"items,omitempty"`
  14941. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  14942. // for lists of machine types.
  14943. Kind string `json:"kind,omitempty"`
  14944. // NextPageToken: [Output Only] This token allows you to get the next
  14945. // page of results for list requests. If the number of results is larger
  14946. // than maxResults, use the nextPageToken as a value for the query
  14947. // parameter pageToken in the next list request. Subsequent list
  14948. // requests will have their own nextPageToken to continue paging through
  14949. // the results.
  14950. NextPageToken string `json:"nextPageToken,omitempty"`
  14951. // SelfLink: [Output Only] Server-defined URL for this resource.
  14952. SelfLink string `json:"selfLink,omitempty"`
  14953. // Warning: [Output Only] Informational warning message.
  14954. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  14955. // ServerResponse contains the HTTP response code and headers from the
  14956. // server.
  14957. googleapi.ServerResponse `json:"-"`
  14958. // ForceSendFields is a list of field names (e.g. "Id") to
  14959. // unconditionally include in API requests. By default, fields with
  14960. // empty values are omitted from API requests. However, any non-pointer,
  14961. // non-interface field appearing in ForceSendFields will be sent to the
  14962. // server regardless of whether the field is empty or not. This may be
  14963. // used to include empty fields in Patch requests.
  14964. ForceSendFields []string `json:"-"`
  14965. // NullFields is a list of field names (e.g. "Id") to include in API
  14966. // requests with the JSON null value. By default, fields with empty
  14967. // values are omitted from API requests. However, any field with an
  14968. // empty value appearing in NullFields will be sent to the server as
  14969. // null. It is an error if a field in this list has a non-empty value.
  14970. // This may be used to include null fields in Patch requests.
  14971. NullFields []string `json:"-"`
  14972. }
  14973. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  14974. type NoMethod MachineTypeList
  14975. raw := NoMethod(*s)
  14976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14977. }
  14978. // MachineTypeListWarning: [Output Only] Informational warning message.
  14979. type MachineTypeListWarning struct {
  14980. // Code: [Output Only] A warning code, if applicable. For example,
  14981. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14982. // the response.
  14983. //
  14984. // Possible values:
  14985. // "CLEANUP_FAILED"
  14986. // "DEPRECATED_RESOURCE_USED"
  14987. // "DEPRECATED_TYPE_USED"
  14988. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14989. // "EXPERIMENTAL_TYPE_USED"
  14990. // "EXTERNAL_API_WARNING"
  14991. // "FIELD_VALUE_OVERRIDEN"
  14992. // "INJECTED_KERNELS_DEPRECATED"
  14993. // "MISSING_TYPE_DEPENDENCY"
  14994. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14995. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14996. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14997. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14998. // "NEXT_HOP_NOT_RUNNING"
  14999. // "NOT_CRITICAL_ERROR"
  15000. // "NO_RESULTS_ON_PAGE"
  15001. // "REQUIRED_TOS_AGREEMENT"
  15002. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15003. // "RESOURCE_NOT_DELETED"
  15004. // "SCHEMA_VALIDATION_IGNORED"
  15005. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15006. // "UNDECLARED_PROPERTIES"
  15007. // "UNREACHABLE"
  15008. Code string `json:"code,omitempty"`
  15009. // Data: [Output Only] Metadata about this warning in key: value format.
  15010. // For example:
  15011. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15012. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  15013. // Message: [Output Only] A human-readable description of the warning
  15014. // code.
  15015. Message string `json:"message,omitempty"`
  15016. // ForceSendFields is a list of field names (e.g. "Code") to
  15017. // unconditionally include in API requests. By default, fields with
  15018. // empty values are omitted from API requests. However, any non-pointer,
  15019. // non-interface field appearing in ForceSendFields will be sent to the
  15020. // server regardless of whether the field is empty or not. This may be
  15021. // used to include empty fields in Patch requests.
  15022. ForceSendFields []string `json:"-"`
  15023. // NullFields is a list of field names (e.g. "Code") to include in API
  15024. // requests with the JSON null value. By default, fields with empty
  15025. // values are omitted from API requests. However, any field with an
  15026. // empty value appearing in NullFields will be sent to the server as
  15027. // null. It is an error if a field in this list has a non-empty value.
  15028. // This may be used to include null fields in Patch requests.
  15029. NullFields []string `json:"-"`
  15030. }
  15031. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  15032. type NoMethod MachineTypeListWarning
  15033. raw := NoMethod(*s)
  15034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15035. }
  15036. type MachineTypeListWarningData struct {
  15037. // Key: [Output Only] A key that provides more detail on the warning
  15038. // being returned. For example, for warnings where there are no results
  15039. // in a list request for a particular zone, this key might be scope and
  15040. // the key value might be the zone name. Other examples might be a key
  15041. // indicating a deprecated resource and a suggested replacement, or a
  15042. // warning about invalid network settings (for example, if an instance
  15043. // attempts to perform IP forwarding but is not enabled for IP
  15044. // forwarding).
  15045. Key string `json:"key,omitempty"`
  15046. // Value: [Output Only] A warning data value corresponding to the key.
  15047. Value string `json:"value,omitempty"`
  15048. // ForceSendFields is a list of field names (e.g. "Key") to
  15049. // unconditionally include in API requests. By default, fields with
  15050. // empty values are omitted from API requests. However, any non-pointer,
  15051. // non-interface field appearing in ForceSendFields will be sent to the
  15052. // server regardless of whether the field is empty or not. This may be
  15053. // used to include empty fields in Patch requests.
  15054. ForceSendFields []string `json:"-"`
  15055. // NullFields is a list of field names (e.g. "Key") to include in API
  15056. // requests with the JSON null value. By default, fields with empty
  15057. // values are omitted from API requests. However, any field with an
  15058. // empty value appearing in NullFields will be sent to the server as
  15059. // null. It is an error if a field in this list has a non-empty value.
  15060. // This may be used to include null fields in Patch requests.
  15061. NullFields []string `json:"-"`
  15062. }
  15063. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  15064. type NoMethod MachineTypeListWarningData
  15065. raw := NoMethod(*s)
  15066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15067. }
  15068. type MachineTypesScopedList struct {
  15069. // MachineTypes: [Output Only] A list of machine types contained in this
  15070. // scope.
  15071. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  15072. // Warning: [Output Only] An informational warning that appears when the
  15073. // machine types list is empty.
  15074. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  15075. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  15076. // unconditionally include in API requests. By default, fields with
  15077. // empty values are omitted from API requests. However, any non-pointer,
  15078. // non-interface field appearing in ForceSendFields will be sent to the
  15079. // server regardless of whether the field is empty or not. This may be
  15080. // used to include empty fields in Patch requests.
  15081. ForceSendFields []string `json:"-"`
  15082. // NullFields is a list of field names (e.g. "MachineTypes") to include
  15083. // in API requests with the JSON null value. By default, fields with
  15084. // empty values are omitted from API requests. However, any field with
  15085. // an empty value appearing in NullFields will be sent to the server as
  15086. // null. It is an error if a field in this list has a non-empty value.
  15087. // This may be used to include null fields in Patch requests.
  15088. NullFields []string `json:"-"`
  15089. }
  15090. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  15091. type NoMethod MachineTypesScopedList
  15092. raw := NoMethod(*s)
  15093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15094. }
  15095. // MachineTypesScopedListWarning: [Output Only] An informational warning
  15096. // that appears when the machine types list is empty.
  15097. type MachineTypesScopedListWarning struct {
  15098. // Code: [Output Only] A warning code, if applicable. For example,
  15099. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15100. // the response.
  15101. //
  15102. // Possible values:
  15103. // "CLEANUP_FAILED"
  15104. // "DEPRECATED_RESOURCE_USED"
  15105. // "DEPRECATED_TYPE_USED"
  15106. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15107. // "EXPERIMENTAL_TYPE_USED"
  15108. // "EXTERNAL_API_WARNING"
  15109. // "FIELD_VALUE_OVERRIDEN"
  15110. // "INJECTED_KERNELS_DEPRECATED"
  15111. // "MISSING_TYPE_DEPENDENCY"
  15112. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15113. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15114. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15115. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15116. // "NEXT_HOP_NOT_RUNNING"
  15117. // "NOT_CRITICAL_ERROR"
  15118. // "NO_RESULTS_ON_PAGE"
  15119. // "REQUIRED_TOS_AGREEMENT"
  15120. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15121. // "RESOURCE_NOT_DELETED"
  15122. // "SCHEMA_VALIDATION_IGNORED"
  15123. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15124. // "UNDECLARED_PROPERTIES"
  15125. // "UNREACHABLE"
  15126. Code string `json:"code,omitempty"`
  15127. // Data: [Output Only] Metadata about this warning in key: value format.
  15128. // For example:
  15129. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15130. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  15131. // Message: [Output Only] A human-readable description of the warning
  15132. // code.
  15133. Message string `json:"message,omitempty"`
  15134. // ForceSendFields is a list of field names (e.g. "Code") to
  15135. // unconditionally include in API requests. By default, fields with
  15136. // empty values are omitted from API requests. However, any non-pointer,
  15137. // non-interface field appearing in ForceSendFields will be sent to the
  15138. // server regardless of whether the field is empty or not. This may be
  15139. // used to include empty fields in Patch requests.
  15140. ForceSendFields []string `json:"-"`
  15141. // NullFields is a list of field names (e.g. "Code") to include in API
  15142. // requests with the JSON null value. By default, fields with empty
  15143. // values are omitted from API requests. However, any field with an
  15144. // empty value appearing in NullFields will be sent to the server as
  15145. // null. It is an error if a field in this list has a non-empty value.
  15146. // This may be used to include null fields in Patch requests.
  15147. NullFields []string `json:"-"`
  15148. }
  15149. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  15150. type NoMethod MachineTypesScopedListWarning
  15151. raw := NoMethod(*s)
  15152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15153. }
  15154. type MachineTypesScopedListWarningData struct {
  15155. // Key: [Output Only] A key that provides more detail on the warning
  15156. // being returned. For example, for warnings where there are no results
  15157. // in a list request for a particular zone, this key might be scope and
  15158. // the key value might be the zone name. Other examples might be a key
  15159. // indicating a deprecated resource and a suggested replacement, or a
  15160. // warning about invalid network settings (for example, if an instance
  15161. // attempts to perform IP forwarding but is not enabled for IP
  15162. // forwarding).
  15163. Key string `json:"key,omitempty"`
  15164. // Value: [Output Only] A warning data value corresponding to the key.
  15165. Value string `json:"value,omitempty"`
  15166. // ForceSendFields is a list of field names (e.g. "Key") to
  15167. // unconditionally include in API requests. By default, fields with
  15168. // empty values are omitted from API requests. However, any non-pointer,
  15169. // non-interface field appearing in ForceSendFields will be sent to the
  15170. // server regardless of whether the field is empty or not. This may be
  15171. // used to include empty fields in Patch requests.
  15172. ForceSendFields []string `json:"-"`
  15173. // NullFields is a list of field names (e.g. "Key") to include in API
  15174. // requests with the JSON null value. By default, fields with empty
  15175. // values are omitted from API requests. However, any field with an
  15176. // empty value appearing in NullFields will be sent to the server as
  15177. // null. It is an error if a field in this list has a non-empty value.
  15178. // This may be used to include null fields in Patch requests.
  15179. NullFields []string `json:"-"`
  15180. }
  15181. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  15182. type NoMethod MachineTypesScopedListWarningData
  15183. raw := NoMethod(*s)
  15184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15185. }
  15186. // ManagedInstance: A Managed Instance resource.
  15187. type ManagedInstance struct {
  15188. // CurrentAction: [Output Only] The current action that the managed
  15189. // instance group has scheduled for the instance. Possible values:
  15190. // - NONE The instance is running, and the managed instance group does
  15191. // not have any scheduled actions for this instance.
  15192. // - CREATING The managed instance group is creating this instance. If
  15193. // the group fails to create this instance, it will try again until it
  15194. // is successful.
  15195. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  15196. // to create this instance only once. If the group fails to create this
  15197. // instance, it does not try again and the group's targetSize value is
  15198. // decreased instead.
  15199. // - RECREATING The managed instance group is recreating this instance.
  15200. //
  15201. // - DELETING The managed instance group is permanently deleting this
  15202. // instance.
  15203. // - ABANDONING The managed instance group is abandoning this instance.
  15204. // The instance will be removed from the instance group and from any
  15205. // target pools that are associated with this group.
  15206. // - RESTARTING The managed instance group is restarting the instance.
  15207. //
  15208. // - REFRESHING The managed instance group is applying configuration
  15209. // changes to the instance without stopping it. For example, the group
  15210. // can update the target pool list for an instance without stopping that
  15211. // instance.
  15212. // - VERIFYING The managed instance group has created the instance and
  15213. // it is in the process of being verified.
  15214. //
  15215. // Possible values:
  15216. // "ABANDONING"
  15217. // "CREATING"
  15218. // "CREATING_WITHOUT_RETRIES"
  15219. // "DELETING"
  15220. // "NONE"
  15221. // "RECREATING"
  15222. // "REFRESHING"
  15223. // "RESTARTING"
  15224. // "VERIFYING"
  15225. CurrentAction string `json:"currentAction,omitempty"`
  15226. // Id: [Output only] The unique identifier for this resource. This field
  15227. // is empty when instance does not exist.
  15228. Id uint64 `json:"id,omitempty,string"`
  15229. // Instance: [Output Only] The URL of the instance. The URL can exist
  15230. // even if the instance has not yet been created.
  15231. Instance string `json:"instance,omitempty"`
  15232. // InstanceStatus: [Output Only] The status of the instance. This field
  15233. // is empty when the instance does not exist.
  15234. //
  15235. // Possible values:
  15236. // "PROVISIONING"
  15237. // "REPAIRING"
  15238. // "RUNNING"
  15239. // "STAGING"
  15240. // "STOPPED"
  15241. // "STOPPING"
  15242. // "SUSPENDED"
  15243. // "SUSPENDING"
  15244. // "TERMINATED"
  15245. InstanceStatus string `json:"instanceStatus,omitempty"`
  15246. // LastAttempt: [Output Only] Information about the last attempt to
  15247. // create or delete the instance.
  15248. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  15249. // Version: [Output Only] Intended version of this instance.
  15250. Version *ManagedInstanceVersion `json:"version,omitempty"`
  15251. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  15252. // unconditionally include in API requests. By default, fields with
  15253. // empty values are omitted from API requests. However, any non-pointer,
  15254. // non-interface field appearing in ForceSendFields will be sent to the
  15255. // server regardless of whether the field is empty or not. This may be
  15256. // used to include empty fields in Patch requests.
  15257. ForceSendFields []string `json:"-"`
  15258. // NullFields is a list of field names (e.g. "CurrentAction") to include
  15259. // in API requests with the JSON null value. By default, fields with
  15260. // empty values are omitted from API requests. However, any field with
  15261. // an empty value appearing in NullFields will be sent to the server as
  15262. // null. It is an error if a field in this list has a non-empty value.
  15263. // This may be used to include null fields in Patch requests.
  15264. NullFields []string `json:"-"`
  15265. }
  15266. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  15267. type NoMethod ManagedInstance
  15268. raw := NoMethod(*s)
  15269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15270. }
  15271. type ManagedInstanceLastAttempt struct {
  15272. // Errors: [Output Only] Encountered errors during the last attempt to
  15273. // create or delete the instance.
  15274. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  15275. // ForceSendFields is a list of field names (e.g. "Errors") to
  15276. // unconditionally include in API requests. By default, fields with
  15277. // empty values are omitted from API requests. However, any non-pointer,
  15278. // non-interface field appearing in ForceSendFields will be sent to the
  15279. // server regardless of whether the field is empty or not. This may be
  15280. // used to include empty fields in Patch requests.
  15281. ForceSendFields []string `json:"-"`
  15282. // NullFields is a list of field names (e.g. "Errors") to include in API
  15283. // requests with the JSON null value. By default, fields with empty
  15284. // values are omitted from API requests. However, any field with an
  15285. // empty value appearing in NullFields will be sent to the server as
  15286. // null. It is an error if a field in this list has a non-empty value.
  15287. // This may be used to include null fields in Patch requests.
  15288. NullFields []string `json:"-"`
  15289. }
  15290. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  15291. type NoMethod ManagedInstanceLastAttempt
  15292. raw := NoMethod(*s)
  15293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15294. }
  15295. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  15296. // during the last attempt to create or delete the instance.
  15297. type ManagedInstanceLastAttemptErrors struct {
  15298. // Errors: [Output Only] The array of errors encountered while
  15299. // processing this operation.
  15300. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  15301. // ForceSendFields is a list of field names (e.g. "Errors") to
  15302. // unconditionally include in API requests. By default, fields with
  15303. // empty values are omitted from API requests. However, any non-pointer,
  15304. // non-interface field appearing in ForceSendFields will be sent to the
  15305. // server regardless of whether the field is empty or not. This may be
  15306. // used to include empty fields in Patch requests.
  15307. ForceSendFields []string `json:"-"`
  15308. // NullFields is a list of field names (e.g. "Errors") to include in API
  15309. // requests with the JSON null value. By default, fields with empty
  15310. // values are omitted from API requests. However, any field with an
  15311. // empty value appearing in NullFields will be sent to the server as
  15312. // null. It is an error if a field in this list has a non-empty value.
  15313. // This may be used to include null fields in Patch requests.
  15314. NullFields []string `json:"-"`
  15315. }
  15316. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  15317. type NoMethod ManagedInstanceLastAttemptErrors
  15318. raw := NoMethod(*s)
  15319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15320. }
  15321. type ManagedInstanceLastAttemptErrorsErrors struct {
  15322. // Code: [Output Only] The error type identifier for this error.
  15323. Code string `json:"code,omitempty"`
  15324. // Location: [Output Only] Indicates the field in the request that
  15325. // caused the error. This property is optional.
  15326. Location string `json:"location,omitempty"`
  15327. // Message: [Output Only] An optional, human-readable error message.
  15328. Message string `json:"message,omitempty"`
  15329. // ForceSendFields is a list of field names (e.g. "Code") to
  15330. // unconditionally include in API requests. By default, fields with
  15331. // empty values are omitted from API requests. However, any non-pointer,
  15332. // non-interface field appearing in ForceSendFields will be sent to the
  15333. // server regardless of whether the field is empty or not. This may be
  15334. // used to include empty fields in Patch requests.
  15335. ForceSendFields []string `json:"-"`
  15336. // NullFields is a list of field names (e.g. "Code") to include in API
  15337. // requests with the JSON null value. By default, fields with empty
  15338. // values are omitted from API requests. However, any field with an
  15339. // empty value appearing in NullFields will be sent to the server as
  15340. // null. It is an error if a field in this list has a non-empty value.
  15341. // This may be used to include null fields in Patch requests.
  15342. NullFields []string `json:"-"`
  15343. }
  15344. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  15345. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  15346. raw := NoMethod(*s)
  15347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15348. }
  15349. type ManagedInstanceVersion struct {
  15350. // InstanceTemplate: [Output Only] The intended template of the
  15351. // instance. This field is empty when current_action is one of {
  15352. // DELETING, ABANDONING }.
  15353. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  15354. // Name: [Output Only] Name of the version.
  15355. Name string `json:"name,omitempty"`
  15356. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  15357. // unconditionally include in API requests. By default, fields with
  15358. // empty values are omitted from API requests. However, any non-pointer,
  15359. // non-interface field appearing in ForceSendFields will be sent to the
  15360. // server regardless of whether the field is empty or not. This may be
  15361. // used to include empty fields in Patch requests.
  15362. ForceSendFields []string `json:"-"`
  15363. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  15364. // include in API requests with the JSON null value. By default, fields
  15365. // with empty values are omitted from API requests. However, any field
  15366. // with an empty value appearing in NullFields will be sent to the
  15367. // server as null. It is an error if a field in this list has a
  15368. // non-empty value. This may be used to include null fields in Patch
  15369. // requests.
  15370. NullFields []string `json:"-"`
  15371. }
  15372. func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
  15373. type NoMethod ManagedInstanceVersion
  15374. raw := NoMethod(*s)
  15375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15376. }
  15377. // Metadata: A metadata key/value entry.
  15378. type Metadata struct {
  15379. // Fingerprint: Specifies a fingerprint for this request, which is
  15380. // essentially a hash of the metadata's contents and used for optimistic
  15381. // locking. The fingerprint is initially generated by Compute Engine and
  15382. // changes after every request to modify or update metadata. You must
  15383. // always provide an up-to-date fingerprint hash in order to update or
  15384. // change metadata, otherwise the request will fail with error 412
  15385. // conditionNotMet.
  15386. //
  15387. // To see the latest fingerprint, make a get() request to retrieve the
  15388. // resource.
  15389. Fingerprint string `json:"fingerprint,omitempty"`
  15390. // Items: Array of key/value pairs. The total size of all keys and
  15391. // values must be less than 512 KB.
  15392. Items []*MetadataItems `json:"items,omitempty"`
  15393. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  15394. // metadata.
  15395. Kind string `json:"kind,omitempty"`
  15396. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  15397. // unconditionally include in API requests. By default, fields with
  15398. // empty values are omitted from API requests. However, any non-pointer,
  15399. // non-interface field appearing in ForceSendFields will be sent to the
  15400. // server regardless of whether the field is empty or not. This may be
  15401. // used to include empty fields in Patch requests.
  15402. ForceSendFields []string `json:"-"`
  15403. // NullFields is a list of field names (e.g. "Fingerprint") to include
  15404. // in API requests with the JSON null value. By default, fields with
  15405. // empty values are omitted from API requests. However, any field with
  15406. // an empty value appearing in NullFields will be sent to the server as
  15407. // null. It is an error if a field in this list has a non-empty value.
  15408. // This may be used to include null fields in Patch requests.
  15409. NullFields []string `json:"-"`
  15410. }
  15411. func (s *Metadata) MarshalJSON() ([]byte, error) {
  15412. type NoMethod Metadata
  15413. raw := NoMethod(*s)
  15414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15415. }
  15416. type MetadataItems struct {
  15417. // Key: Key for the metadata entry. Keys must conform to the following
  15418. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  15419. // reflected as part of a URL in the metadata server. Additionally, to
  15420. // avoid ambiguity, keys must not conflict with any other metadata keys
  15421. // for the project.
  15422. Key string `json:"key,omitempty"`
  15423. // Value: Value for the metadata entry. These are free-form strings, and
  15424. // only have meaning as interpreted by the image running in the
  15425. // instance. The only restriction placed on values is that their size
  15426. // must be less than or equal to 262144 bytes (256 KiB).
  15427. Value *string `json:"value,omitempty"`
  15428. // ForceSendFields is a list of field names (e.g. "Key") to
  15429. // unconditionally include in API requests. By default, fields with
  15430. // empty values are omitted from API requests. However, any non-pointer,
  15431. // non-interface field appearing in ForceSendFields will be sent to the
  15432. // server regardless of whether the field is empty or not. This may be
  15433. // used to include empty fields in Patch requests.
  15434. ForceSendFields []string `json:"-"`
  15435. // NullFields is a list of field names (e.g. "Key") to include in API
  15436. // requests with the JSON null value. By default, fields with empty
  15437. // values are omitted from API requests. However, any field with an
  15438. // empty value appearing in NullFields will be sent to the server as
  15439. // null. It is an error if a field in this list has a non-empty value.
  15440. // This may be used to include null fields in Patch requests.
  15441. NullFields []string `json:"-"`
  15442. }
  15443. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  15444. type NoMethod MetadataItems
  15445. raw := NoMethod(*s)
  15446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15447. }
  15448. // NamedPort: The named port. For example: .
  15449. type NamedPort struct {
  15450. // Name: The name for this named port. The name must be 1-63 characters
  15451. // long, and comply with RFC1035.
  15452. Name string `json:"name,omitempty"`
  15453. // Port: The port number, which can be a value between 1 and 65535.
  15454. Port int64 `json:"port,omitempty"`
  15455. // ForceSendFields is a list of field names (e.g. "Name") to
  15456. // unconditionally include in API requests. By default, fields with
  15457. // empty values are omitted from API requests. However, any non-pointer,
  15458. // non-interface field appearing in ForceSendFields will be sent to the
  15459. // server regardless of whether the field is empty or not. This may be
  15460. // used to include empty fields in Patch requests.
  15461. ForceSendFields []string `json:"-"`
  15462. // NullFields is a list of field names (e.g. "Name") to include in API
  15463. // requests with the JSON null value. By default, fields with empty
  15464. // values are omitted from API requests. However, any field with an
  15465. // empty value appearing in NullFields will be sent to the server as
  15466. // null. It is an error if a field in this list has a non-empty value.
  15467. // This may be used to include null fields in Patch requests.
  15468. NullFields []string `json:"-"`
  15469. }
  15470. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  15471. type NoMethod NamedPort
  15472. raw := NoMethod(*s)
  15473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15474. }
  15475. // Network: Represents a Network resource. Read Virtual Private Cloud
  15476. // (VPC) Network Overview for more information. (== resource_for
  15477. // v1.networks ==) (== resource_for beta.networks ==)
  15478. type Network struct {
  15479. // IPv4Range: Deprecated in favor of subnet mode networks. The range of
  15480. // internal addresses that are legal on this network. This range is a
  15481. // CIDR specification, for example: 192.168.0.0/16. Provided by the
  15482. // client when the network is created.
  15483. IPv4Range string `json:"IPv4Range,omitempty"`
  15484. // AutoCreateSubnetworks: When set to true, the VPC network is created
  15485. // in "auto" mode. When set to false, the VPC network is created in
  15486. // "custom" mode.
  15487. //
  15488. // An auto mode VPC network starts with one subnet per region. Each
  15489. // subnet has a predetermined range as described in Auto mode VPC
  15490. // network IP ranges.
  15491. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  15492. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15493. // format.
  15494. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15495. // Description: An optional description of this resource. Provide this
  15496. // property when you create the resource.
  15497. Description string `json:"description,omitempty"`
  15498. // GatewayIPv4: [Output Only] The gateway address for default routing
  15499. // out of the network. This value is read only and is selected by GCP.
  15500. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  15501. // Id: [Output Only] The unique identifier for the resource. This
  15502. // identifier is defined by the server.
  15503. Id uint64 `json:"id,omitempty,string"`
  15504. // Kind: [Output Only] Type of the resource. Always compute#network for
  15505. // networks.
  15506. Kind string `json:"kind,omitempty"`
  15507. // Name: Name of the resource. Provided by the client when the resource
  15508. // is created. The name must be 1-63 characters long, and comply with
  15509. // RFC1035. Specifically, the name must be 1-63 characters long and
  15510. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15511. // the first character must be a lowercase letter, and all following
  15512. // characters must be a dash, lowercase letter, or digit, except the
  15513. // last character, which cannot be a dash.
  15514. Name string `json:"name,omitempty"`
  15515. // Peerings: [Output Only] A list of network peerings for the resource.
  15516. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  15517. // RoutingConfig: The network-level routing configuration for this
  15518. // network. Used by Cloud Router to determine what type of network-wide
  15519. // routing behavior to enforce.
  15520. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  15521. // SelfLink: [Output Only] Server-defined URL for the resource.
  15522. SelfLink string `json:"selfLink,omitempty"`
  15523. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  15524. // all subnetworks in this VPC network.
  15525. Subnetworks []string `json:"subnetworks,omitempty"`
  15526. // ServerResponse contains the HTTP response code and headers from the
  15527. // server.
  15528. googleapi.ServerResponse `json:"-"`
  15529. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  15530. // unconditionally include in API requests. By default, fields with
  15531. // empty values are omitted from API requests. However, any non-pointer,
  15532. // non-interface field appearing in ForceSendFields will be sent to the
  15533. // server regardless of whether the field is empty or not. This may be
  15534. // used to include empty fields in Patch requests.
  15535. ForceSendFields []string `json:"-"`
  15536. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  15537. // API requests with the JSON null value. By default, fields with empty
  15538. // values are omitted from API requests. However, any field with an
  15539. // empty value appearing in NullFields will be sent to the server as
  15540. // null. It is an error if a field in this list has a non-empty value.
  15541. // This may be used to include null fields in Patch requests.
  15542. NullFields []string `json:"-"`
  15543. }
  15544. func (s *Network) MarshalJSON() ([]byte, error) {
  15545. type NoMethod Network
  15546. raw := NoMethod(*s)
  15547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15548. }
  15549. // NetworkEndpoint: The network endpoint.
  15550. type NetworkEndpoint struct {
  15551. // Instance: The name for a specific VM instance that the IP address
  15552. // belongs to. This is required for network endpoints of type
  15553. // GCE_VM_IP_PORT. The instance must be in the same zone of network
  15554. // endpoint group.
  15555. //
  15556. // The name must be 1-63 characters long, and comply with RFC1035.
  15557. Instance string `json:"instance,omitempty"`
  15558. // IpAddress: Optional IPv4 address of network endpoint. The IP address
  15559. // must belong to a VM in GCE (either the primary IP or as part of an
  15560. // aliased IP range). If the IP address is not specified, then the
  15561. // primary IP address for the VM instance in the network that the
  15562. // network endpoint group belongs to will be used.
  15563. IpAddress string `json:"ipAddress,omitempty"`
  15564. // Port: Optional port number of network endpoint. If not specified and
  15565. // the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the
  15566. // defaultPort for the network endpoint group will be used.
  15567. Port int64 `json:"port,omitempty"`
  15568. // ForceSendFields is a list of field names (e.g. "Instance") to
  15569. // unconditionally include in API requests. By default, fields with
  15570. // empty values are omitted from API requests. However, any non-pointer,
  15571. // non-interface field appearing in ForceSendFields will be sent to the
  15572. // server regardless of whether the field is empty or not. This may be
  15573. // used to include empty fields in Patch requests.
  15574. ForceSendFields []string `json:"-"`
  15575. // NullFields is a list of field names (e.g. "Instance") to include in
  15576. // API requests with the JSON null value. By default, fields with empty
  15577. // values are omitted from API requests. However, any field with an
  15578. // empty value appearing in NullFields will be sent to the server as
  15579. // null. It is an error if a field in this list has a non-empty value.
  15580. // This may be used to include null fields in Patch requests.
  15581. NullFields []string `json:"-"`
  15582. }
  15583. func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
  15584. type NoMethod NetworkEndpoint
  15585. raw := NoMethod(*s)
  15586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15587. }
  15588. // NetworkEndpointGroup: Represents a collection of network endpoints.
  15589. type NetworkEndpointGroup struct {
  15590. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15591. // format.
  15592. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15593. // DefaultPort: The default port used if the port number is not
  15594. // specified in the network endpoint.
  15595. DefaultPort int64 `json:"defaultPort,omitempty"`
  15596. // Description: An optional description of this resource. Provide this
  15597. // property when you create the resource.
  15598. Description string `json:"description,omitempty"`
  15599. // Id: [Output Only] The unique identifier for the resource. This
  15600. // identifier is defined by the server.
  15601. Id uint64 `json:"id,omitempty,string"`
  15602. // Kind: [Output Only] Type of the resource. Always
  15603. // compute#networkEndpointGroup for network endpoint group.
  15604. Kind string `json:"kind,omitempty"`
  15605. // LoadBalancer: This field is only valid when the network endpoint
  15606. // group is used for load balancing. [Deprecated] This field is
  15607. // deprecated.
  15608. LoadBalancer *NetworkEndpointGroupLbNetworkEndpointGroup `json:"loadBalancer,omitempty"`
  15609. // Name: Name of the resource; provided by the client when the resource
  15610. // is created. The name must be 1-63 characters long, and comply with
  15611. // RFC1035. Specifically, the name must be 1-63 characters long and
  15612. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15613. // the first character must be a lowercase letter, and all following
  15614. // characters must be a dash, lowercase letter, or digit, except the
  15615. // last character, which cannot be a dash.
  15616. Name string `json:"name,omitempty"`
  15617. // Network: The URL of the network to which all network endpoints in the
  15618. // NEG belong. Uses "default" project network if unspecified.
  15619. Network string `json:"network,omitempty"`
  15620. // NetworkEndpointType: Type of network endpoints in this network
  15621. // endpoint group. Currently the only supported value is GCE_VM_IP_PORT.
  15622. //
  15623. // Possible values:
  15624. // "GCE_VM_IP_PORT"
  15625. NetworkEndpointType string `json:"networkEndpointType,omitempty"`
  15626. // SelfLink: [Output Only] Server-defined URL for the resource.
  15627. SelfLink string `json:"selfLink,omitempty"`
  15628. // Size: [Output only] Number of network endpoints in the network
  15629. // endpoint group.
  15630. Size int64 `json:"size,omitempty"`
  15631. // Subnetwork: Optional URL of the subnetwork to which all network
  15632. // endpoints in the NEG belong.
  15633. Subnetwork string `json:"subnetwork,omitempty"`
  15634. // Zone: [Output Only] The URL of the zone where the network endpoint
  15635. // group is located.
  15636. Zone string `json:"zone,omitempty"`
  15637. // ServerResponse contains the HTTP response code and headers from the
  15638. // server.
  15639. googleapi.ServerResponse `json:"-"`
  15640. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  15641. // to unconditionally include in API requests. By default, fields with
  15642. // empty values are omitted from API requests. However, any non-pointer,
  15643. // non-interface field appearing in ForceSendFields will be sent to the
  15644. // server regardless of whether the field is empty or not. This may be
  15645. // used to include empty fields in Patch requests.
  15646. ForceSendFields []string `json:"-"`
  15647. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  15648. // include in API requests with the JSON null value. By default, fields
  15649. // with empty values are omitted from API requests. However, any field
  15650. // with an empty value appearing in NullFields will be sent to the
  15651. // server as null. It is an error if a field in this list has a
  15652. // non-empty value. This may be used to include null fields in Patch
  15653. // requests.
  15654. NullFields []string `json:"-"`
  15655. }
  15656. func (s *NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  15657. type NoMethod NetworkEndpointGroup
  15658. raw := NoMethod(*s)
  15659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15660. }
  15661. type NetworkEndpointGroupAggregatedList struct {
  15662. // Id: [Output Only] Unique identifier for the resource; defined by the
  15663. // server.
  15664. Id string `json:"id,omitempty"`
  15665. // Items: A list of NetworkEndpointGroupsScopedList resources.
  15666. Items map[string]NetworkEndpointGroupsScopedList `json:"items,omitempty"`
  15667. // Kind: [Output Only] The resource type, which is always
  15668. // compute#networkEndpointGroupAggregatedList for aggregated lists of
  15669. // network endpoint groups.
  15670. Kind string `json:"kind,omitempty"`
  15671. // NextPageToken: [Output Only] This token allows you to get the next
  15672. // page of results for list requests. If the number of results is larger
  15673. // than maxResults, use the nextPageToken as a value for the query
  15674. // parameter pageToken in the next list request. Subsequent list
  15675. // requests will have their own nextPageToken to continue paging through
  15676. // the results.
  15677. NextPageToken string `json:"nextPageToken,omitempty"`
  15678. // SelfLink: [Output Only] Server-defined URL for this resource.
  15679. SelfLink string `json:"selfLink,omitempty"`
  15680. // Warning: [Output Only] Informational warning message.
  15681. Warning *NetworkEndpointGroupAggregatedListWarning `json:"warning,omitempty"`
  15682. // ServerResponse contains the HTTP response code and headers from the
  15683. // server.
  15684. googleapi.ServerResponse `json:"-"`
  15685. // ForceSendFields is a list of field names (e.g. "Id") to
  15686. // unconditionally include in API requests. By default, fields with
  15687. // empty values are omitted from API requests. However, any non-pointer,
  15688. // non-interface field appearing in ForceSendFields will be sent to the
  15689. // server regardless of whether the field is empty or not. This may be
  15690. // used to include empty fields in Patch requests.
  15691. ForceSendFields []string `json:"-"`
  15692. // NullFields is a list of field names (e.g. "Id") to include in API
  15693. // requests with the JSON null value. By default, fields with empty
  15694. // values are omitted from API requests. However, any field with an
  15695. // empty value appearing in NullFields will be sent to the server as
  15696. // null. It is an error if a field in this list has a non-empty value.
  15697. // This may be used to include null fields in Patch requests.
  15698. NullFields []string `json:"-"`
  15699. }
  15700. func (s *NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
  15701. type NoMethod NetworkEndpointGroupAggregatedList
  15702. raw := NoMethod(*s)
  15703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15704. }
  15705. // NetworkEndpointGroupAggregatedListWarning: [Output Only]
  15706. // Informational warning message.
  15707. type NetworkEndpointGroupAggregatedListWarning struct {
  15708. // Code: [Output Only] A warning code, if applicable. For example,
  15709. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15710. // the response.
  15711. //
  15712. // Possible values:
  15713. // "CLEANUP_FAILED"
  15714. // "DEPRECATED_RESOURCE_USED"
  15715. // "DEPRECATED_TYPE_USED"
  15716. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15717. // "EXPERIMENTAL_TYPE_USED"
  15718. // "EXTERNAL_API_WARNING"
  15719. // "FIELD_VALUE_OVERRIDEN"
  15720. // "INJECTED_KERNELS_DEPRECATED"
  15721. // "MISSING_TYPE_DEPENDENCY"
  15722. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15723. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15724. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15725. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15726. // "NEXT_HOP_NOT_RUNNING"
  15727. // "NOT_CRITICAL_ERROR"
  15728. // "NO_RESULTS_ON_PAGE"
  15729. // "REQUIRED_TOS_AGREEMENT"
  15730. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15731. // "RESOURCE_NOT_DELETED"
  15732. // "SCHEMA_VALIDATION_IGNORED"
  15733. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15734. // "UNDECLARED_PROPERTIES"
  15735. // "UNREACHABLE"
  15736. Code string `json:"code,omitempty"`
  15737. // Data: [Output Only] Metadata about this warning in key: value format.
  15738. // For example:
  15739. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15740. Data []*NetworkEndpointGroupAggregatedListWarningData `json:"data,omitempty"`
  15741. // Message: [Output Only] A human-readable description of the warning
  15742. // code.
  15743. Message string `json:"message,omitempty"`
  15744. // ForceSendFields is a list of field names (e.g. "Code") to
  15745. // unconditionally include in API requests. By default, fields with
  15746. // empty values are omitted from API requests. However, any non-pointer,
  15747. // non-interface field appearing in ForceSendFields will be sent to the
  15748. // server regardless of whether the field is empty or not. This may be
  15749. // used to include empty fields in Patch requests.
  15750. ForceSendFields []string `json:"-"`
  15751. // NullFields is a list of field names (e.g. "Code") to include in API
  15752. // requests with the JSON null value. By default, fields with empty
  15753. // values are omitted from API requests. However, any field with an
  15754. // empty value appearing in NullFields will be sent to the server as
  15755. // null. It is an error if a field in this list has a non-empty value.
  15756. // This may be used to include null fields in Patch requests.
  15757. NullFields []string `json:"-"`
  15758. }
  15759. func (s *NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15760. type NoMethod NetworkEndpointGroupAggregatedListWarning
  15761. raw := NoMethod(*s)
  15762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15763. }
  15764. type NetworkEndpointGroupAggregatedListWarningData struct {
  15765. // Key: [Output Only] A key that provides more detail on the warning
  15766. // being returned. For example, for warnings where there are no results
  15767. // in a list request for a particular zone, this key might be scope and
  15768. // the key value might be the zone name. Other examples might be a key
  15769. // indicating a deprecated resource and a suggested replacement, or a
  15770. // warning about invalid network settings (for example, if an instance
  15771. // attempts to perform IP forwarding but is not enabled for IP
  15772. // forwarding).
  15773. Key string `json:"key,omitempty"`
  15774. // Value: [Output Only] A warning data value corresponding to the key.
  15775. Value string `json:"value,omitempty"`
  15776. // ForceSendFields is a list of field names (e.g. "Key") to
  15777. // unconditionally include in API requests. By default, fields with
  15778. // empty values are omitted from API requests. However, any non-pointer,
  15779. // non-interface field appearing in ForceSendFields will be sent to the
  15780. // server regardless of whether the field is empty or not. This may be
  15781. // used to include empty fields in Patch requests.
  15782. ForceSendFields []string `json:"-"`
  15783. // NullFields is a list of field names (e.g. "Key") to include in API
  15784. // requests with the JSON null value. By default, fields with empty
  15785. // values are omitted from API requests. However, any field with an
  15786. // empty value appearing in NullFields will be sent to the server as
  15787. // null. It is an error if a field in this list has a non-empty value.
  15788. // This may be used to include null fields in Patch requests.
  15789. NullFields []string `json:"-"`
  15790. }
  15791. func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15792. type NoMethod NetworkEndpointGroupAggregatedListWarningData
  15793. raw := NoMethod(*s)
  15794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15795. }
  15796. // NetworkEndpointGroupLbNetworkEndpointGroup: Load balancing specific
  15797. // fields for network endpoint group.
  15798. type NetworkEndpointGroupLbNetworkEndpointGroup struct {
  15799. // DefaultPort: The default port used if the port number is not
  15800. // specified in the network endpoint. [Deprecated] This field is
  15801. // deprecated.
  15802. DefaultPort int64 `json:"defaultPort,omitempty"`
  15803. // Network: The URL of the network to which all network endpoints in the
  15804. // NEG belong. Uses "default" project network if unspecified.
  15805. // [Deprecated] This field is deprecated.
  15806. Network string `json:"network,omitempty"`
  15807. // Subnetwork: Optional URL of the subnetwork to which all network
  15808. // endpoints in the NEG belong. [Deprecated] This field is deprecated.
  15809. Subnetwork string `json:"subnetwork,omitempty"`
  15810. // Zone: [Output Only] The URL of the zone where the network endpoint
  15811. // group is located. [Deprecated] This field is deprecated.
  15812. Zone string `json:"zone,omitempty"`
  15813. // ForceSendFields is a list of field names (e.g. "DefaultPort") to
  15814. // unconditionally include in API requests. By default, fields with
  15815. // empty values are omitted from API requests. However, any non-pointer,
  15816. // non-interface field appearing in ForceSendFields will be sent to the
  15817. // server regardless of whether the field is empty or not. This may be
  15818. // used to include empty fields in Patch requests.
  15819. ForceSendFields []string `json:"-"`
  15820. // NullFields is a list of field names (e.g. "DefaultPort") to include
  15821. // in API requests with the JSON null value. By default, fields with
  15822. // empty values are omitted from API requests. However, any field with
  15823. // an empty value appearing in NullFields will be sent to the server as
  15824. // null. It is an error if a field in this list has a non-empty value.
  15825. // This may be used to include null fields in Patch requests.
  15826. NullFields []string `json:"-"`
  15827. }
  15828. func (s *NetworkEndpointGroupLbNetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  15829. type NoMethod NetworkEndpointGroupLbNetworkEndpointGroup
  15830. raw := NoMethod(*s)
  15831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15832. }
  15833. type NetworkEndpointGroupList struct {
  15834. // Id: [Output Only] Unique identifier for the resource; defined by the
  15835. // server.
  15836. Id string `json:"id,omitempty"`
  15837. // Items: A list of NetworkEndpointGroup resources.
  15838. Items []*NetworkEndpointGroup `json:"items,omitempty"`
  15839. // Kind: [Output Only] The resource type, which is always
  15840. // compute#networkEndpointGroupList for network endpoint group lists.
  15841. Kind string `json:"kind,omitempty"`
  15842. // NextPageToken: [Output Only] This token allows you to get the next
  15843. // page of results for list requests. If the number of results is larger
  15844. // than maxResults, use the nextPageToken as a value for the query
  15845. // parameter pageToken in the next list request. Subsequent list
  15846. // requests will have their own nextPageToken to continue paging through
  15847. // the results.
  15848. NextPageToken string `json:"nextPageToken,omitempty"`
  15849. // SelfLink: [Output Only] Server-defined URL for this resource.
  15850. SelfLink string `json:"selfLink,omitempty"`
  15851. // Warning: [Output Only] Informational warning message.
  15852. Warning *NetworkEndpointGroupListWarning `json:"warning,omitempty"`
  15853. // ServerResponse contains the HTTP response code and headers from the
  15854. // server.
  15855. googleapi.ServerResponse `json:"-"`
  15856. // ForceSendFields is a list of field names (e.g. "Id") to
  15857. // unconditionally include in API requests. By default, fields with
  15858. // empty values are omitted from API requests. However, any non-pointer,
  15859. // non-interface field appearing in ForceSendFields will be sent to the
  15860. // server regardless of whether the field is empty or not. This may be
  15861. // used to include empty fields in Patch requests.
  15862. ForceSendFields []string `json:"-"`
  15863. // NullFields is a list of field names (e.g. "Id") to include in API
  15864. // requests with the JSON null value. By default, fields with empty
  15865. // values are omitted from API requests. However, any field with an
  15866. // empty value appearing in NullFields will be sent to the server as
  15867. // null. It is an error if a field in this list has a non-empty value.
  15868. // This may be used to include null fields in Patch requests.
  15869. NullFields []string `json:"-"`
  15870. }
  15871. func (s *NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
  15872. type NoMethod NetworkEndpointGroupList
  15873. raw := NoMethod(*s)
  15874. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15875. }
  15876. // NetworkEndpointGroupListWarning: [Output Only] Informational warning
  15877. // message.
  15878. type NetworkEndpointGroupListWarning struct {
  15879. // Code: [Output Only] A warning code, if applicable. For example,
  15880. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15881. // the response.
  15882. //
  15883. // Possible values:
  15884. // "CLEANUP_FAILED"
  15885. // "DEPRECATED_RESOURCE_USED"
  15886. // "DEPRECATED_TYPE_USED"
  15887. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15888. // "EXPERIMENTAL_TYPE_USED"
  15889. // "EXTERNAL_API_WARNING"
  15890. // "FIELD_VALUE_OVERRIDEN"
  15891. // "INJECTED_KERNELS_DEPRECATED"
  15892. // "MISSING_TYPE_DEPENDENCY"
  15893. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15894. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15895. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15896. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15897. // "NEXT_HOP_NOT_RUNNING"
  15898. // "NOT_CRITICAL_ERROR"
  15899. // "NO_RESULTS_ON_PAGE"
  15900. // "REQUIRED_TOS_AGREEMENT"
  15901. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15902. // "RESOURCE_NOT_DELETED"
  15903. // "SCHEMA_VALIDATION_IGNORED"
  15904. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15905. // "UNDECLARED_PROPERTIES"
  15906. // "UNREACHABLE"
  15907. Code string `json:"code,omitempty"`
  15908. // Data: [Output Only] Metadata about this warning in key: value format.
  15909. // For example:
  15910. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15911. Data []*NetworkEndpointGroupListWarningData `json:"data,omitempty"`
  15912. // Message: [Output Only] A human-readable description of the warning
  15913. // code.
  15914. Message string `json:"message,omitempty"`
  15915. // ForceSendFields is a list of field names (e.g. "Code") to
  15916. // unconditionally include in API requests. By default, fields with
  15917. // empty values are omitted from API requests. However, any non-pointer,
  15918. // non-interface field appearing in ForceSendFields will be sent to the
  15919. // server regardless of whether the field is empty or not. This may be
  15920. // used to include empty fields in Patch requests.
  15921. ForceSendFields []string `json:"-"`
  15922. // NullFields is a list of field names (e.g. "Code") to include in API
  15923. // requests with the JSON null value. By default, fields with empty
  15924. // values are omitted from API requests. However, any field with an
  15925. // empty value appearing in NullFields will be sent to the server as
  15926. // null. It is an error if a field in this list has a non-empty value.
  15927. // This may be used to include null fields in Patch requests.
  15928. NullFields []string `json:"-"`
  15929. }
  15930. func (s *NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
  15931. type NoMethod NetworkEndpointGroupListWarning
  15932. raw := NoMethod(*s)
  15933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15934. }
  15935. type NetworkEndpointGroupListWarningData struct {
  15936. // Key: [Output Only] A key that provides more detail on the warning
  15937. // being returned. For example, for warnings where there are no results
  15938. // in a list request for a particular zone, this key might be scope and
  15939. // the key value might be the zone name. Other examples might be a key
  15940. // indicating a deprecated resource and a suggested replacement, or a
  15941. // warning about invalid network settings (for example, if an instance
  15942. // attempts to perform IP forwarding but is not enabled for IP
  15943. // forwarding).
  15944. Key string `json:"key,omitempty"`
  15945. // Value: [Output Only] A warning data value corresponding to the key.
  15946. Value string `json:"value,omitempty"`
  15947. // ForceSendFields is a list of field names (e.g. "Key") to
  15948. // unconditionally include in API requests. By default, fields with
  15949. // empty values are omitted from API requests. However, any non-pointer,
  15950. // non-interface field appearing in ForceSendFields will be sent to the
  15951. // server regardless of whether the field is empty or not. This may be
  15952. // used to include empty fields in Patch requests.
  15953. ForceSendFields []string `json:"-"`
  15954. // NullFields is a list of field names (e.g. "Key") to include in API
  15955. // requests with the JSON null value. By default, fields with empty
  15956. // values are omitted from API requests. However, any field with an
  15957. // empty value appearing in NullFields will be sent to the server as
  15958. // null. It is an error if a field in this list has a non-empty value.
  15959. // This may be used to include null fields in Patch requests.
  15960. NullFields []string `json:"-"`
  15961. }
  15962. func (s *NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
  15963. type NoMethod NetworkEndpointGroupListWarningData
  15964. raw := NoMethod(*s)
  15965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15966. }
  15967. type NetworkEndpointGroupsAttachEndpointsRequest struct {
  15968. // NetworkEndpoints: The list of network endpoints to be attached.
  15969. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  15970. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  15971. // unconditionally include in API requests. By default, fields with
  15972. // empty values are omitted from API requests. However, any non-pointer,
  15973. // non-interface field appearing in ForceSendFields will be sent to the
  15974. // server regardless of whether the field is empty or not. This may be
  15975. // used to include empty fields in Patch requests.
  15976. ForceSendFields []string `json:"-"`
  15977. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  15978. // include in API requests with the JSON null value. By default, fields
  15979. // with empty values are omitted from API requests. However, any field
  15980. // with an empty value appearing in NullFields will be sent to the
  15981. // server as null. It is an error if a field in this list has a
  15982. // non-empty value. This may be used to include null fields in Patch
  15983. // requests.
  15984. NullFields []string `json:"-"`
  15985. }
  15986. func (s *NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
  15987. type NoMethod NetworkEndpointGroupsAttachEndpointsRequest
  15988. raw := NoMethod(*s)
  15989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15990. }
  15991. type NetworkEndpointGroupsDetachEndpointsRequest struct {
  15992. // NetworkEndpoints: The list of network endpoints to be detached.
  15993. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  15994. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  15995. // unconditionally include in API requests. By default, fields with
  15996. // empty values are omitted from API requests. However, any non-pointer,
  15997. // non-interface field appearing in ForceSendFields will be sent to the
  15998. // server regardless of whether the field is empty or not. This may be
  15999. // used to include empty fields in Patch requests.
  16000. ForceSendFields []string `json:"-"`
  16001. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  16002. // include in API requests with the JSON null value. By default, fields
  16003. // with empty values are omitted from API requests. However, any field
  16004. // with an empty value appearing in NullFields will be sent to the
  16005. // server as null. It is an error if a field in this list has a
  16006. // non-empty value. This may be used to include null fields in Patch
  16007. // requests.
  16008. NullFields []string `json:"-"`
  16009. }
  16010. func (s *NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
  16011. type NoMethod NetworkEndpointGroupsDetachEndpointsRequest
  16012. raw := NoMethod(*s)
  16013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16014. }
  16015. type NetworkEndpointGroupsListEndpointsRequest struct {
  16016. // HealthStatus: Optional query parameter for showing the health status
  16017. // of each network endpoint. Valid options are SKIP or SHOW. If you
  16018. // don't specifiy this parameter, the health status of network endpoints
  16019. // will not be provided.
  16020. //
  16021. // Possible values:
  16022. // "SHOW"
  16023. // "SKIP"
  16024. HealthStatus string `json:"healthStatus,omitempty"`
  16025. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  16026. // unconditionally include in API requests. By default, fields with
  16027. // empty values are omitted from API requests. However, any non-pointer,
  16028. // non-interface field appearing in ForceSendFields will be sent to the
  16029. // server regardless of whether the field is empty or not. This may be
  16030. // used to include empty fields in Patch requests.
  16031. ForceSendFields []string `json:"-"`
  16032. // NullFields is a list of field names (e.g. "HealthStatus") to include
  16033. // in API requests with the JSON null value. By default, fields with
  16034. // empty values are omitted from API requests. However, any field with
  16035. // an empty value appearing in NullFields will be sent to the server as
  16036. // null. It is an error if a field in this list has a non-empty value.
  16037. // This may be used to include null fields in Patch requests.
  16038. NullFields []string `json:"-"`
  16039. }
  16040. func (s *NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
  16041. type NoMethod NetworkEndpointGroupsListEndpointsRequest
  16042. raw := NoMethod(*s)
  16043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16044. }
  16045. type NetworkEndpointGroupsListNetworkEndpoints struct {
  16046. // Id: [Output Only] Unique identifier for the resource; defined by the
  16047. // server.
  16048. Id string `json:"id,omitempty"`
  16049. // Items: A list of NetworkEndpointWithHealthStatus resources.
  16050. Items []*NetworkEndpointWithHealthStatus `json:"items,omitempty"`
  16051. // Kind: [Output Only] The resource type, which is always
  16052. // compute#networkEndpointGroupsListNetworkEndpoints for the list of
  16053. // network endpoints in the specified network endpoint group.
  16054. Kind string `json:"kind,omitempty"`
  16055. // NextPageToken: [Output Only] This token allows you to get the next
  16056. // page of results for list requests. If the number of results is larger
  16057. // than maxResults, use the nextPageToken as a value for the query
  16058. // parameter pageToken in the next list request. Subsequent list
  16059. // requests will have their own nextPageToken to continue paging through
  16060. // the results.
  16061. NextPageToken string `json:"nextPageToken,omitempty"`
  16062. // Warning: [Output Only] Informational warning message.
  16063. Warning *NetworkEndpointGroupsListNetworkEndpointsWarning `json:"warning,omitempty"`
  16064. // ServerResponse contains the HTTP response code and headers from the
  16065. // server.
  16066. googleapi.ServerResponse `json:"-"`
  16067. // ForceSendFields is a list of field names (e.g. "Id") to
  16068. // unconditionally include in API requests. By default, fields with
  16069. // empty values are omitted from API requests. However, any non-pointer,
  16070. // non-interface field appearing in ForceSendFields will be sent to the
  16071. // server regardless of whether the field is empty or not. This may be
  16072. // used to include empty fields in Patch requests.
  16073. ForceSendFields []string `json:"-"`
  16074. // NullFields is a list of field names (e.g. "Id") to include in API
  16075. // requests with the JSON null value. By default, fields with empty
  16076. // values are omitted from API requests. However, any field with an
  16077. // empty value appearing in NullFields will be sent to the server as
  16078. // null. It is an error if a field in this list has a non-empty value.
  16079. // This may be used to include null fields in Patch requests.
  16080. NullFields []string `json:"-"`
  16081. }
  16082. func (s *NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
  16083. type NoMethod NetworkEndpointGroupsListNetworkEndpoints
  16084. raw := NoMethod(*s)
  16085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16086. }
  16087. // NetworkEndpointGroupsListNetworkEndpointsWarning: [Output Only]
  16088. // Informational warning message.
  16089. type NetworkEndpointGroupsListNetworkEndpointsWarning struct {
  16090. // Code: [Output Only] A warning code, if applicable. For example,
  16091. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16092. // the response.
  16093. //
  16094. // Possible values:
  16095. // "CLEANUP_FAILED"
  16096. // "DEPRECATED_RESOURCE_USED"
  16097. // "DEPRECATED_TYPE_USED"
  16098. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16099. // "EXPERIMENTAL_TYPE_USED"
  16100. // "EXTERNAL_API_WARNING"
  16101. // "FIELD_VALUE_OVERRIDEN"
  16102. // "INJECTED_KERNELS_DEPRECATED"
  16103. // "MISSING_TYPE_DEPENDENCY"
  16104. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16105. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16106. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16107. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16108. // "NEXT_HOP_NOT_RUNNING"
  16109. // "NOT_CRITICAL_ERROR"
  16110. // "NO_RESULTS_ON_PAGE"
  16111. // "REQUIRED_TOS_AGREEMENT"
  16112. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16113. // "RESOURCE_NOT_DELETED"
  16114. // "SCHEMA_VALIDATION_IGNORED"
  16115. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16116. // "UNDECLARED_PROPERTIES"
  16117. // "UNREACHABLE"
  16118. Code string `json:"code,omitempty"`
  16119. // Data: [Output Only] Metadata about this warning in key: value format.
  16120. // For example:
  16121. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16122. Data []*NetworkEndpointGroupsListNetworkEndpointsWarningData `json:"data,omitempty"`
  16123. // Message: [Output Only] A human-readable description of the warning
  16124. // code.
  16125. Message string `json:"message,omitempty"`
  16126. // ForceSendFields is a list of field names (e.g. "Code") to
  16127. // unconditionally include in API requests. By default, fields with
  16128. // empty values are omitted from API requests. However, any non-pointer,
  16129. // non-interface field appearing in ForceSendFields will be sent to the
  16130. // server regardless of whether the field is empty or not. This may be
  16131. // used to include empty fields in Patch requests.
  16132. ForceSendFields []string `json:"-"`
  16133. // NullFields is a list of field names (e.g. "Code") to include in API
  16134. // requests with the JSON null value. By default, fields with empty
  16135. // values are omitted from API requests. However, any field with an
  16136. // empty value appearing in NullFields will be sent to the server as
  16137. // null. It is an error if a field in this list has a non-empty value.
  16138. // This may be used to include null fields in Patch requests.
  16139. NullFields []string `json:"-"`
  16140. }
  16141. func (s *NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
  16142. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarning
  16143. raw := NoMethod(*s)
  16144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16145. }
  16146. type NetworkEndpointGroupsListNetworkEndpointsWarningData struct {
  16147. // Key: [Output Only] A key that provides more detail on the warning
  16148. // being returned. For example, for warnings where there are no results
  16149. // in a list request for a particular zone, this key might be scope and
  16150. // the key value might be the zone name. Other examples might be a key
  16151. // indicating a deprecated resource and a suggested replacement, or a
  16152. // warning about invalid network settings (for example, if an instance
  16153. // attempts to perform IP forwarding but is not enabled for IP
  16154. // forwarding).
  16155. Key string `json:"key,omitempty"`
  16156. // Value: [Output Only] A warning data value corresponding to the key.
  16157. Value string `json:"value,omitempty"`
  16158. // ForceSendFields is a list of field names (e.g. "Key") to
  16159. // unconditionally include in API requests. By default, fields with
  16160. // empty values are omitted from API requests. However, any non-pointer,
  16161. // non-interface field appearing in ForceSendFields will be sent to the
  16162. // server regardless of whether the field is empty or not. This may be
  16163. // used to include empty fields in Patch requests.
  16164. ForceSendFields []string `json:"-"`
  16165. // NullFields is a list of field names (e.g. "Key") to include in API
  16166. // requests with the JSON null value. By default, fields with empty
  16167. // values are omitted from API requests. However, any field with an
  16168. // empty value appearing in NullFields will be sent to the server as
  16169. // null. It is an error if a field in this list has a non-empty value.
  16170. // This may be used to include null fields in Patch requests.
  16171. NullFields []string `json:"-"`
  16172. }
  16173. func (s *NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
  16174. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarningData
  16175. raw := NoMethod(*s)
  16176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16177. }
  16178. type NetworkEndpointGroupsScopedList struct {
  16179. // NetworkEndpointGroups: [Output Only] The list of network endpoint
  16180. // groups that are contained in this scope.
  16181. NetworkEndpointGroups []*NetworkEndpointGroup `json:"networkEndpointGroups,omitempty"`
  16182. // Warning: [Output Only] An informational warning that replaces the
  16183. // list of network endpoint groups when the list is empty.
  16184. Warning *NetworkEndpointGroupsScopedListWarning `json:"warning,omitempty"`
  16185. // ForceSendFields is a list of field names (e.g.
  16186. // "NetworkEndpointGroups") to unconditionally include in API requests.
  16187. // By default, fields with empty values are omitted from API requests.
  16188. // However, any non-pointer, non-interface field appearing in
  16189. // ForceSendFields will be sent to the server regardless of whether the
  16190. // field is empty or not. This may be used to include empty fields in
  16191. // Patch requests.
  16192. ForceSendFields []string `json:"-"`
  16193. // NullFields is a list of field names (e.g. "NetworkEndpointGroups") to
  16194. // include in API requests with the JSON null value. By default, fields
  16195. // with empty values are omitted from API requests. However, any field
  16196. // with an empty value appearing in NullFields will be sent to the
  16197. // server as null. It is an error if a field in this list has a
  16198. // non-empty value. This may be used to include null fields in Patch
  16199. // requests.
  16200. NullFields []string `json:"-"`
  16201. }
  16202. func (s *NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
  16203. type NoMethod NetworkEndpointGroupsScopedList
  16204. raw := NoMethod(*s)
  16205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16206. }
  16207. // NetworkEndpointGroupsScopedListWarning: [Output Only] An
  16208. // informational warning that replaces the list of network endpoint
  16209. // groups when the list is empty.
  16210. type NetworkEndpointGroupsScopedListWarning struct {
  16211. // Code: [Output Only] A warning code, if applicable. For example,
  16212. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16213. // the response.
  16214. //
  16215. // Possible values:
  16216. // "CLEANUP_FAILED"
  16217. // "DEPRECATED_RESOURCE_USED"
  16218. // "DEPRECATED_TYPE_USED"
  16219. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16220. // "EXPERIMENTAL_TYPE_USED"
  16221. // "EXTERNAL_API_WARNING"
  16222. // "FIELD_VALUE_OVERRIDEN"
  16223. // "INJECTED_KERNELS_DEPRECATED"
  16224. // "MISSING_TYPE_DEPENDENCY"
  16225. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16226. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16227. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16228. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16229. // "NEXT_HOP_NOT_RUNNING"
  16230. // "NOT_CRITICAL_ERROR"
  16231. // "NO_RESULTS_ON_PAGE"
  16232. // "REQUIRED_TOS_AGREEMENT"
  16233. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16234. // "RESOURCE_NOT_DELETED"
  16235. // "SCHEMA_VALIDATION_IGNORED"
  16236. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16237. // "UNDECLARED_PROPERTIES"
  16238. // "UNREACHABLE"
  16239. Code string `json:"code,omitempty"`
  16240. // Data: [Output Only] Metadata about this warning in key: value format.
  16241. // For example:
  16242. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16243. Data []*NetworkEndpointGroupsScopedListWarningData `json:"data,omitempty"`
  16244. // Message: [Output Only] A human-readable description of the warning
  16245. // code.
  16246. Message string `json:"message,omitempty"`
  16247. // ForceSendFields is a list of field names (e.g. "Code") to
  16248. // unconditionally include in API requests. By default, fields with
  16249. // empty values are omitted from API requests. However, any non-pointer,
  16250. // non-interface field appearing in ForceSendFields will be sent to the
  16251. // server regardless of whether the field is empty or not. This may be
  16252. // used to include empty fields in Patch requests.
  16253. ForceSendFields []string `json:"-"`
  16254. // NullFields is a list of field names (e.g. "Code") to include in API
  16255. // requests with the JSON null value. By default, fields with empty
  16256. // values are omitted from API requests. However, any field with an
  16257. // empty value appearing in NullFields will be sent to the server as
  16258. // null. It is an error if a field in this list has a non-empty value.
  16259. // This may be used to include null fields in Patch requests.
  16260. NullFields []string `json:"-"`
  16261. }
  16262. func (s *NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  16263. type NoMethod NetworkEndpointGroupsScopedListWarning
  16264. raw := NoMethod(*s)
  16265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16266. }
  16267. type NetworkEndpointGroupsScopedListWarningData struct {
  16268. // Key: [Output Only] A key that provides more detail on the warning
  16269. // being returned. For example, for warnings where there are no results
  16270. // in a list request for a particular zone, this key might be scope and
  16271. // the key value might be the zone name. Other examples might be a key
  16272. // indicating a deprecated resource and a suggested replacement, or a
  16273. // warning about invalid network settings (for example, if an instance
  16274. // attempts to perform IP forwarding but is not enabled for IP
  16275. // forwarding).
  16276. Key string `json:"key,omitempty"`
  16277. // Value: [Output Only] A warning data value corresponding to the key.
  16278. Value string `json:"value,omitempty"`
  16279. // ForceSendFields is a list of field names (e.g. "Key") to
  16280. // unconditionally include in API requests. By default, fields with
  16281. // empty values are omitted from API requests. However, any non-pointer,
  16282. // non-interface field appearing in ForceSendFields will be sent to the
  16283. // server regardless of whether the field is empty or not. This may be
  16284. // used to include empty fields in Patch requests.
  16285. ForceSendFields []string `json:"-"`
  16286. // NullFields is a list of field names (e.g. "Key") to include in API
  16287. // requests with the JSON null value. By default, fields with empty
  16288. // values are omitted from API requests. However, any field with an
  16289. // empty value appearing in NullFields will be sent to the server as
  16290. // null. It is an error if a field in this list has a non-empty value.
  16291. // This may be used to include null fields in Patch requests.
  16292. NullFields []string `json:"-"`
  16293. }
  16294. func (s *NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  16295. type NoMethod NetworkEndpointGroupsScopedListWarningData
  16296. raw := NoMethod(*s)
  16297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16298. }
  16299. type NetworkEndpointWithHealthStatus struct {
  16300. // Healths: [Output only] The health status of network endpoint;
  16301. Healths []*HealthStatusForNetworkEndpoint `json:"healths,omitempty"`
  16302. // NetworkEndpoint: [Output only] The network endpoint;
  16303. NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
  16304. // ForceSendFields is a list of field names (e.g. "Healths") to
  16305. // unconditionally include in API requests. By default, fields with
  16306. // empty values are omitted from API requests. However, any non-pointer,
  16307. // non-interface field appearing in ForceSendFields will be sent to the
  16308. // server regardless of whether the field is empty or not. This may be
  16309. // used to include empty fields in Patch requests.
  16310. ForceSendFields []string `json:"-"`
  16311. // NullFields is a list of field names (e.g. "Healths") to include in
  16312. // API requests with the JSON null value. By default, fields with empty
  16313. // values are omitted from API requests. However, any field with an
  16314. // empty value appearing in NullFields will be sent to the server as
  16315. // null. It is an error if a field in this list has a non-empty value.
  16316. // This may be used to include null fields in Patch requests.
  16317. NullFields []string `json:"-"`
  16318. }
  16319. func (s *NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
  16320. type NoMethod NetworkEndpointWithHealthStatus
  16321. raw := NoMethod(*s)
  16322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16323. }
  16324. // NetworkInterface: A network interface resource attached to an
  16325. // instance.
  16326. type NetworkInterface struct {
  16327. // AccessConfigs: An array of configurations for this interface.
  16328. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  16329. // there are no accessConfigs specified, then this instance will have no
  16330. // external internet access.
  16331. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  16332. // AliasIpRanges: An array of alias IP ranges for this network
  16333. // interface. Can only be specified for network interfaces on
  16334. // subnet-mode networks.
  16335. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  16336. // Fingerprint: Fingerprint hash of contents stored in this network
  16337. // interface. This field will be ignored when inserting an Instance or
  16338. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  16339. // in order to update the NetworkInterface, otherwise the request will
  16340. // fail with error 412 conditionNotMet.
  16341. Fingerprint string `json:"fingerprint,omitempty"`
  16342. // Kind: [Output Only] Type of the resource. Always
  16343. // compute#networkInterface for network interfaces.
  16344. Kind string `json:"kind,omitempty"`
  16345. // Name: [Output Only] The name of the network interface, generated by
  16346. // the server. For network devices, these are eth0, eth1, etc.
  16347. Name string `json:"name,omitempty"`
  16348. // Network: URL of the network resource for this instance. When creating
  16349. // an instance, if neither the network nor the subnetwork is specified,
  16350. // the default network global/networks/default is used; if the network
  16351. // is not specified but the subnetwork is specified, the network is
  16352. // inferred.
  16353. //
  16354. // This field is optional when creating a firewall rule. If not
  16355. // specified when creating a firewall rule, the default network
  16356. // global/networks/default is used.
  16357. //
  16358. // If you specify this property, you can specify the network as a full
  16359. // or partial URL. For example, the following are all valid URLs:
  16360. // -
  16361. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  16362. // - projects/project/global/networks/network
  16363. // - global/networks/default
  16364. Network string `json:"network,omitempty"`
  16365. // NetworkIP: An IPv4 internal network address to assign to the instance
  16366. // for this network interface. If not specified by the user, an unused
  16367. // internal IP is assigned by the system.
  16368. NetworkIP string `json:"networkIP,omitempty"`
  16369. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  16370. // the network resource is in legacy mode, do not provide this property.
  16371. // If the network is in auto subnet mode, providing the subnetwork is
  16372. // optional. If the network is in custom subnet mode, then this field
  16373. // should be specified. If you specify this property, you can specify
  16374. // the subnetwork as a full or partial URL. For example, the following
  16375. // are all valid URLs:
  16376. // -
  16377. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  16378. // - regions/region/subnetworks/subnetwork
  16379. Subnetwork string `json:"subnetwork,omitempty"`
  16380. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  16381. // unconditionally include in API requests. By default, fields with
  16382. // empty values are omitted from API requests. However, any non-pointer,
  16383. // non-interface field appearing in ForceSendFields will be sent to the
  16384. // server regardless of whether the field is empty or not. This may be
  16385. // used to include empty fields in Patch requests.
  16386. ForceSendFields []string `json:"-"`
  16387. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  16388. // in API requests with the JSON null value. By default, fields with
  16389. // empty values are omitted from API requests. However, any field with
  16390. // an empty value appearing in NullFields will be sent to the server as
  16391. // null. It is an error if a field in this list has a non-empty value.
  16392. // This may be used to include null fields in Patch requests.
  16393. NullFields []string `json:"-"`
  16394. }
  16395. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  16396. type NoMethod NetworkInterface
  16397. raw := NoMethod(*s)
  16398. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16399. }
  16400. // NetworkList: Contains a list of networks.
  16401. type NetworkList struct {
  16402. // Id: [Output Only] Unique identifier for the resource; defined by the
  16403. // server.
  16404. Id string `json:"id,omitempty"`
  16405. // Items: A list of Network resources.
  16406. Items []*Network `json:"items,omitempty"`
  16407. // Kind: [Output Only] Type of resource. Always compute#networkList for
  16408. // lists of networks.
  16409. Kind string `json:"kind,omitempty"`
  16410. // NextPageToken: [Output Only] This token allows you to get the next
  16411. // page of results for list requests. If the number of results is larger
  16412. // than maxResults, use the nextPageToken as a value for the query
  16413. // parameter pageToken in the next list request. Subsequent list
  16414. // requests will have their own nextPageToken to continue paging through
  16415. // the results.
  16416. NextPageToken string `json:"nextPageToken,omitempty"`
  16417. // SelfLink: [Output Only] Server-defined URL for this resource.
  16418. SelfLink string `json:"selfLink,omitempty"`
  16419. // Warning: [Output Only] Informational warning message.
  16420. Warning *NetworkListWarning `json:"warning,omitempty"`
  16421. // ServerResponse contains the HTTP response code and headers from the
  16422. // server.
  16423. googleapi.ServerResponse `json:"-"`
  16424. // ForceSendFields is a list of field names (e.g. "Id") to
  16425. // unconditionally include in API requests. By default, fields with
  16426. // empty values are omitted from API requests. However, any non-pointer,
  16427. // non-interface field appearing in ForceSendFields will be sent to the
  16428. // server regardless of whether the field is empty or not. This may be
  16429. // used to include empty fields in Patch requests.
  16430. ForceSendFields []string `json:"-"`
  16431. // NullFields is a list of field names (e.g. "Id") to include in API
  16432. // requests with the JSON null value. By default, fields with empty
  16433. // values are omitted from API requests. However, any field with an
  16434. // empty value appearing in NullFields will be sent to the server as
  16435. // null. It is an error if a field in this list has a non-empty value.
  16436. // This may be used to include null fields in Patch requests.
  16437. NullFields []string `json:"-"`
  16438. }
  16439. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  16440. type NoMethod NetworkList
  16441. raw := NoMethod(*s)
  16442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16443. }
  16444. // NetworkListWarning: [Output Only] Informational warning message.
  16445. type NetworkListWarning struct {
  16446. // Code: [Output Only] A warning code, if applicable. For example,
  16447. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16448. // the response.
  16449. //
  16450. // Possible values:
  16451. // "CLEANUP_FAILED"
  16452. // "DEPRECATED_RESOURCE_USED"
  16453. // "DEPRECATED_TYPE_USED"
  16454. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16455. // "EXPERIMENTAL_TYPE_USED"
  16456. // "EXTERNAL_API_WARNING"
  16457. // "FIELD_VALUE_OVERRIDEN"
  16458. // "INJECTED_KERNELS_DEPRECATED"
  16459. // "MISSING_TYPE_DEPENDENCY"
  16460. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16461. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16462. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16463. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16464. // "NEXT_HOP_NOT_RUNNING"
  16465. // "NOT_CRITICAL_ERROR"
  16466. // "NO_RESULTS_ON_PAGE"
  16467. // "REQUIRED_TOS_AGREEMENT"
  16468. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16469. // "RESOURCE_NOT_DELETED"
  16470. // "SCHEMA_VALIDATION_IGNORED"
  16471. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16472. // "UNDECLARED_PROPERTIES"
  16473. // "UNREACHABLE"
  16474. Code string `json:"code,omitempty"`
  16475. // Data: [Output Only] Metadata about this warning in key: value format.
  16476. // For example:
  16477. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16478. Data []*NetworkListWarningData `json:"data,omitempty"`
  16479. // Message: [Output Only] A human-readable description of the warning
  16480. // code.
  16481. Message string `json:"message,omitempty"`
  16482. // ForceSendFields is a list of field names (e.g. "Code") to
  16483. // unconditionally include in API requests. By default, fields with
  16484. // empty values are omitted from API requests. However, any non-pointer,
  16485. // non-interface field appearing in ForceSendFields will be sent to the
  16486. // server regardless of whether the field is empty or not. This may be
  16487. // used to include empty fields in Patch requests.
  16488. ForceSendFields []string `json:"-"`
  16489. // NullFields is a list of field names (e.g. "Code") to include in API
  16490. // requests with the JSON null value. By default, fields with empty
  16491. // values are omitted from API requests. However, any field with an
  16492. // empty value appearing in NullFields will be sent to the server as
  16493. // null. It is an error if a field in this list has a non-empty value.
  16494. // This may be used to include null fields in Patch requests.
  16495. NullFields []string `json:"-"`
  16496. }
  16497. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  16498. type NoMethod NetworkListWarning
  16499. raw := NoMethod(*s)
  16500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16501. }
  16502. type NetworkListWarningData struct {
  16503. // Key: [Output Only] A key that provides more detail on the warning
  16504. // being returned. For example, for warnings where there are no results
  16505. // in a list request for a particular zone, this key might be scope and
  16506. // the key value might be the zone name. Other examples might be a key
  16507. // indicating a deprecated resource and a suggested replacement, or a
  16508. // warning about invalid network settings (for example, if an instance
  16509. // attempts to perform IP forwarding but is not enabled for IP
  16510. // forwarding).
  16511. Key string `json:"key,omitempty"`
  16512. // Value: [Output Only] A warning data value corresponding to the key.
  16513. Value string `json:"value,omitempty"`
  16514. // ForceSendFields is a list of field names (e.g. "Key") to
  16515. // unconditionally include in API requests. By default, fields with
  16516. // empty values are omitted from API requests. However, any non-pointer,
  16517. // non-interface field appearing in ForceSendFields will be sent to the
  16518. // server regardless of whether the field is empty or not. This may be
  16519. // used to include empty fields in Patch requests.
  16520. ForceSendFields []string `json:"-"`
  16521. // NullFields is a list of field names (e.g. "Key") to include in API
  16522. // requests with the JSON null value. By default, fields with empty
  16523. // values are omitted from API requests. However, any field with an
  16524. // empty value appearing in NullFields will be sent to the server as
  16525. // null. It is an error if a field in this list has a non-empty value.
  16526. // This may be used to include null fields in Patch requests.
  16527. NullFields []string `json:"-"`
  16528. }
  16529. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  16530. type NoMethod NetworkListWarningData
  16531. raw := NoMethod(*s)
  16532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16533. }
  16534. // NetworkPeering: A network peering attached to a network resource. The
  16535. // message includes the peering name, peer network, peering state, and a
  16536. // flag indicating whether Google Compute Engine should automatically
  16537. // create routes for the peering.
  16538. type NetworkPeering struct {
  16539. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  16540. // exchange_subnet_routes instead. Indicates whether full mesh
  16541. // connectivity is created and managed automatically. When it is set to
  16542. // true, Google Compute Engine will automatically create and manage the
  16543. // routes between two networks when the state is ACTIVE. Otherwise, user
  16544. // needs to create routes manually to route packets to peer network.
  16545. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  16546. // ExchangeSubnetRoutes: Whether full mesh connectivity is created and
  16547. // managed automatically. When it is set to true, Google Compute Engine
  16548. // will automatically create and manage the routes between two networks
  16549. // when the peering state is ACTIVE. Otherwise, user needs to create
  16550. // routes manually to route packets to peer network.
  16551. ExchangeSubnetRoutes bool `json:"exchangeSubnetRoutes,omitempty"`
  16552. // ExportCustomRoutes: Whether to export the custom routes to peer
  16553. // network.
  16554. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  16555. // ImportCustomRoutes: Whether to import the custom routes from peer
  16556. // network.
  16557. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  16558. // Name: Name of this peering. Provided by the client when the peering
  16559. // is created. The name must comply with RFC1035. Specifically, the name
  16560. // must be 1-63 characters long and match regular expression
  16561. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  16562. // a lowercase letter, and all the following characters must be a dash,
  16563. // lowercase letter, or digit, except the last character, which cannot
  16564. // be a dash.
  16565. Name string `json:"name,omitempty"`
  16566. // Network: The URL of the peer network. It can be either full URL or
  16567. // partial URL. The peer network may belong to a different project. If
  16568. // the partial URL does not contain project, it is assumed that the peer
  16569. // network is in the same project as the current network.
  16570. Network string `json:"network,omitempty"`
  16571. // State: [Output Only] State for the peering.
  16572. //
  16573. // Possible values:
  16574. // "ACTIVE"
  16575. // "INACTIVE"
  16576. State string `json:"state,omitempty"`
  16577. // StateDetails: [Output Only] Details about the current state of the
  16578. // peering.
  16579. StateDetails string `json:"stateDetails,omitempty"`
  16580. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  16581. // unconditionally include in API requests. By default, fields with
  16582. // empty values are omitted from API requests. However, any non-pointer,
  16583. // non-interface field appearing in ForceSendFields will be sent to the
  16584. // server regardless of whether the field is empty or not. This may be
  16585. // used to include empty fields in Patch requests.
  16586. ForceSendFields []string `json:"-"`
  16587. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  16588. // include in API requests with the JSON null value. By default, fields
  16589. // with empty values are omitted from API requests. However, any field
  16590. // with an empty value appearing in NullFields will be sent to the
  16591. // server as null. It is an error if a field in this list has a
  16592. // non-empty value. This may be used to include null fields in Patch
  16593. // requests.
  16594. NullFields []string `json:"-"`
  16595. }
  16596. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  16597. type NoMethod NetworkPeering
  16598. raw := NoMethod(*s)
  16599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16600. }
  16601. // NetworkRoutingConfig: A routing configuration attached to a network
  16602. // resource. The message includes the list of routers associated with
  16603. // the network, and a flag indicating the type of routing behavior to
  16604. // enforce network-wide.
  16605. type NetworkRoutingConfig struct {
  16606. // RoutingMode: The network-wide routing mode to use. If set to
  16607. // REGIONAL, this network's cloud routers will only advertise routes
  16608. // with subnets of this network in the same region as the router. If set
  16609. // to GLOBAL, this network's cloud routers will advertise routes with
  16610. // all subnets of this network, across regions.
  16611. //
  16612. // Possible values:
  16613. // "GLOBAL"
  16614. // "REGIONAL"
  16615. RoutingMode string `json:"routingMode,omitempty"`
  16616. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  16617. // unconditionally include in API requests. By default, fields with
  16618. // empty values are omitted from API requests. However, any non-pointer,
  16619. // non-interface field appearing in ForceSendFields will be sent to the
  16620. // server regardless of whether the field is empty or not. This may be
  16621. // used to include empty fields in Patch requests.
  16622. ForceSendFields []string `json:"-"`
  16623. // NullFields is a list of field names (e.g. "RoutingMode") to include
  16624. // in API requests with the JSON null value. By default, fields with
  16625. // empty values are omitted from API requests. However, any field with
  16626. // an empty value appearing in NullFields will be sent to the server as
  16627. // null. It is an error if a field in this list has a non-empty value.
  16628. // This may be used to include null fields in Patch requests.
  16629. NullFields []string `json:"-"`
  16630. }
  16631. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  16632. type NoMethod NetworkRoutingConfig
  16633. raw := NoMethod(*s)
  16634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16635. }
  16636. type NetworksAddPeeringRequest struct {
  16637. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  16638. // exchange_subnet_routes in network_peering instead. Whether Google
  16639. // Compute Engine manages the routes automatically.
  16640. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  16641. // Name: Name of the peering, which should conform to RFC1035.
  16642. Name string `json:"name,omitempty"`
  16643. // NetworkPeering: Network peering parameters. In order to specify route
  16644. // policies for peering using import/export custom routes, you will have
  16645. // to fill all peering related parameters (name, peer network,
  16646. // exchange_subnet_routes) in network_peeringfield. Corresponding fields
  16647. // in NetworksAddPeeringRequest will be deprecated soon.
  16648. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  16649. // PeerNetwork: URL of the peer network. It can be either full URL or
  16650. // partial URL. The peer network may belong to a different project. If
  16651. // the partial URL does not contain project, it is assumed that the peer
  16652. // network is in the same project as the current network.
  16653. PeerNetwork string `json:"peerNetwork,omitempty"`
  16654. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  16655. // unconditionally include in API requests. By default, fields with
  16656. // empty values are omitted from API requests. However, any non-pointer,
  16657. // non-interface field appearing in ForceSendFields will be sent to the
  16658. // server regardless of whether the field is empty or not. This may be
  16659. // used to include empty fields in Patch requests.
  16660. ForceSendFields []string `json:"-"`
  16661. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  16662. // include in API requests with the JSON null value. By default, fields
  16663. // with empty values are omitted from API requests. However, any field
  16664. // with an empty value appearing in NullFields will be sent to the
  16665. // server as null. It is an error if a field in this list has a
  16666. // non-empty value. This may be used to include null fields in Patch
  16667. // requests.
  16668. NullFields []string `json:"-"`
  16669. }
  16670. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  16671. type NoMethod NetworksAddPeeringRequest
  16672. raw := NoMethod(*s)
  16673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16674. }
  16675. type NetworksRemovePeeringRequest struct {
  16676. // Name: Name of the peering, which should conform to RFC1035.
  16677. Name string `json:"name,omitempty"`
  16678. // ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  16694. type NoMethod NetworksRemovePeeringRequest
  16695. raw := NoMethod(*s)
  16696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16697. }
  16698. type NetworksUpdatePeeringRequest struct {
  16699. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  16700. // ForceSendFields is a list of field names (e.g. "NetworkPeering") to
  16701. // unconditionally include in API requests. By default, fields with
  16702. // empty values are omitted from API requests. However, any non-pointer,
  16703. // non-interface field appearing in ForceSendFields will be sent to the
  16704. // server regardless of whether the field is empty or not. This may be
  16705. // used to include empty fields in Patch requests.
  16706. ForceSendFields []string `json:"-"`
  16707. // NullFields is a list of field names (e.g. "NetworkPeering") to
  16708. // include in API requests with the JSON null value. By default, fields
  16709. // with empty values are omitted from API requests. However, any field
  16710. // with an empty value appearing in NullFields will be sent to the
  16711. // server as null. It is an error if a field in this list has a
  16712. // non-empty value. This may be used to include null fields in Patch
  16713. // requests.
  16714. NullFields []string `json:"-"`
  16715. }
  16716. func (s *NetworksUpdatePeeringRequest) MarshalJSON() ([]byte, error) {
  16717. type NoMethod NetworksUpdatePeeringRequest
  16718. raw := NoMethod(*s)
  16719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16720. }
  16721. // NodeGroup: A NodeGroup resource.
  16722. type NodeGroup struct {
  16723. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16724. // format.
  16725. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16726. // Description: An optional description of this resource. Provide this
  16727. // property when you create the resource.
  16728. Description string `json:"description,omitempty"`
  16729. // Id: [Output Only] The unique identifier for the resource. This
  16730. // identifier is defined by the server.
  16731. Id uint64 `json:"id,omitempty,string"`
  16732. // Kind: [Output Only] The type of the resource. Always
  16733. // compute#nodeGroup for node group.
  16734. Kind string `json:"kind,omitempty"`
  16735. // Name: The name of the resource, provided by the client when initially
  16736. // creating the resource. The resource name must be 1-63 characters
  16737. // long, and comply with RFC1035. Specifically, the name must be 1-63
  16738. // characters long and match the regular expression
  16739. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  16740. // a lowercase letter, and all following characters must be a dash,
  16741. // lowercase letter, or digit, except the last character, which cannot
  16742. // be a dash.
  16743. Name string `json:"name,omitempty"`
  16744. // NodeTemplate: The URL of the node template to which this node group
  16745. // belongs.
  16746. NodeTemplate string `json:"nodeTemplate,omitempty"`
  16747. // SelfLink: [Output Only] Server-defined URL for the resource.
  16748. SelfLink string `json:"selfLink,omitempty"`
  16749. // Size: [Output Only] The total number of nodes in the node group.
  16750. Size int64 `json:"size,omitempty"`
  16751. // Possible values:
  16752. // "CREATING"
  16753. // "DELETING"
  16754. // "INVALID"
  16755. // "READY"
  16756. Status string `json:"status,omitempty"`
  16757. // Zone: [Output Only] The name of the zone where the node group
  16758. // resides, such as us-central1-a.
  16759. Zone string `json:"zone,omitempty"`
  16760. // ServerResponse contains the HTTP response code and headers from the
  16761. // server.
  16762. googleapi.ServerResponse `json:"-"`
  16763. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  16764. // to unconditionally include in API requests. By default, fields with
  16765. // empty values are omitted from API requests. However, any non-pointer,
  16766. // non-interface field appearing in ForceSendFields will be sent to the
  16767. // server regardless of whether the field is empty or not. This may be
  16768. // used to include empty fields in Patch requests.
  16769. ForceSendFields []string `json:"-"`
  16770. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  16771. // include in API requests with the JSON null value. By default, fields
  16772. // with empty values are omitted from API requests. However, any field
  16773. // with an empty value appearing in NullFields will be sent to the
  16774. // server as null. It is an error if a field in this list has a
  16775. // non-empty value. This may be used to include null fields in Patch
  16776. // requests.
  16777. NullFields []string `json:"-"`
  16778. }
  16779. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  16780. type NoMethod NodeGroup
  16781. raw := NoMethod(*s)
  16782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16783. }
  16784. type NodeGroupAggregatedList struct {
  16785. // Id: [Output Only] Unique identifier for the resource; defined by the
  16786. // server.
  16787. Id string `json:"id,omitempty"`
  16788. // Items: A list of NodeGroupsScopedList resources.
  16789. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  16790. // Kind: [Output Only] Type of resource.Always
  16791. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  16792. Kind string `json:"kind,omitempty"`
  16793. // NextPageToken: [Output Only] This token allows you to get the next
  16794. // page of results for list requests. If the number of results is larger
  16795. // than maxResults, use the nextPageToken as a value for the query
  16796. // parameter pageToken in the next list request. Subsequent list
  16797. // requests will have their own nextPageToken to continue paging through
  16798. // the results.
  16799. NextPageToken string `json:"nextPageToken,omitempty"`
  16800. // SelfLink: [Output Only] Server-defined URL for this resource.
  16801. SelfLink string `json:"selfLink,omitempty"`
  16802. // Warning: [Output Only] Informational warning message.
  16803. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  16804. // ServerResponse contains the HTTP response code and headers from the
  16805. // server.
  16806. googleapi.ServerResponse `json:"-"`
  16807. // ForceSendFields is a list of field names (e.g. "Id") to
  16808. // unconditionally include in API requests. By default, fields with
  16809. // empty values are omitted from API requests. However, any non-pointer,
  16810. // non-interface field appearing in ForceSendFields will be sent to the
  16811. // server regardless of whether the field is empty or not. This may be
  16812. // used to include empty fields in Patch requests.
  16813. ForceSendFields []string `json:"-"`
  16814. // NullFields is a list of field names (e.g. "Id") to include in API
  16815. // requests with the JSON null value. By default, fields with empty
  16816. // values are omitted from API requests. However, any field with an
  16817. // empty value appearing in NullFields will be sent to the server as
  16818. // null. It is an error if a field in this list has a non-empty value.
  16819. // This may be used to include null fields in Patch requests.
  16820. NullFields []string `json:"-"`
  16821. }
  16822. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  16823. type NoMethod NodeGroupAggregatedList
  16824. raw := NoMethod(*s)
  16825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16826. }
  16827. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  16828. // message.
  16829. type NodeGroupAggregatedListWarning struct {
  16830. // Code: [Output Only] A warning code, if applicable. For example,
  16831. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16832. // the response.
  16833. //
  16834. // Possible values:
  16835. // "CLEANUP_FAILED"
  16836. // "DEPRECATED_RESOURCE_USED"
  16837. // "DEPRECATED_TYPE_USED"
  16838. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16839. // "EXPERIMENTAL_TYPE_USED"
  16840. // "EXTERNAL_API_WARNING"
  16841. // "FIELD_VALUE_OVERRIDEN"
  16842. // "INJECTED_KERNELS_DEPRECATED"
  16843. // "MISSING_TYPE_DEPENDENCY"
  16844. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16845. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16846. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16847. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16848. // "NEXT_HOP_NOT_RUNNING"
  16849. // "NOT_CRITICAL_ERROR"
  16850. // "NO_RESULTS_ON_PAGE"
  16851. // "REQUIRED_TOS_AGREEMENT"
  16852. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16853. // "RESOURCE_NOT_DELETED"
  16854. // "SCHEMA_VALIDATION_IGNORED"
  16855. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16856. // "UNDECLARED_PROPERTIES"
  16857. // "UNREACHABLE"
  16858. Code string `json:"code,omitempty"`
  16859. // Data: [Output Only] Metadata about this warning in key: value format.
  16860. // For example:
  16861. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16862. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  16863. // Message: [Output Only] A human-readable description of the warning
  16864. // code.
  16865. Message string `json:"message,omitempty"`
  16866. // ForceSendFields is a list of field names (e.g. "Code") to
  16867. // unconditionally include in API requests. By default, fields with
  16868. // empty values are omitted from API requests. However, any non-pointer,
  16869. // non-interface field appearing in ForceSendFields will be sent to the
  16870. // server regardless of whether the field is empty or not. This may be
  16871. // used to include empty fields in Patch requests.
  16872. ForceSendFields []string `json:"-"`
  16873. // NullFields is a list of field names (e.g. "Code") to include in API
  16874. // requests with the JSON null value. By default, fields with empty
  16875. // values are omitted from API requests. However, any field with an
  16876. // empty value appearing in NullFields will be sent to the server as
  16877. // null. It is an error if a field in this list has a non-empty value.
  16878. // This may be used to include null fields in Patch requests.
  16879. NullFields []string `json:"-"`
  16880. }
  16881. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  16882. type NoMethod NodeGroupAggregatedListWarning
  16883. raw := NoMethod(*s)
  16884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16885. }
  16886. type NodeGroupAggregatedListWarningData struct {
  16887. // Key: [Output Only] A key that provides more detail on the warning
  16888. // being returned. For example, for warnings where there are no results
  16889. // in a list request for a particular zone, this key might be scope and
  16890. // the key value might be the zone name. Other examples might be a key
  16891. // indicating a deprecated resource and a suggested replacement, or a
  16892. // warning about invalid network settings (for example, if an instance
  16893. // attempts to perform IP forwarding but is not enabled for IP
  16894. // forwarding).
  16895. Key string `json:"key,omitempty"`
  16896. // Value: [Output Only] A warning data value corresponding to the key.
  16897. Value string `json:"value,omitempty"`
  16898. // ForceSendFields is a list of field names (e.g. "Key") to
  16899. // unconditionally include in API requests. By default, fields with
  16900. // empty values are omitted from API requests. However, any non-pointer,
  16901. // non-interface field appearing in ForceSendFields will be sent to the
  16902. // server regardless of whether the field is empty or not. This may be
  16903. // used to include empty fields in Patch requests.
  16904. ForceSendFields []string `json:"-"`
  16905. // NullFields is a list of field names (e.g. "Key") to include in API
  16906. // requests with the JSON null value. By default, fields with empty
  16907. // values are omitted from API requests. However, any field with an
  16908. // empty value appearing in NullFields will be sent to the server as
  16909. // null. It is an error if a field in this list has a non-empty value.
  16910. // This may be used to include null fields in Patch requests.
  16911. NullFields []string `json:"-"`
  16912. }
  16913. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  16914. type NoMethod NodeGroupAggregatedListWarningData
  16915. raw := NoMethod(*s)
  16916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16917. }
  16918. // NodeGroupList: Contains a list of nodeGroups.
  16919. type NodeGroupList struct {
  16920. // Id: [Output Only] Unique identifier for the resource; defined by the
  16921. // server.
  16922. Id string `json:"id,omitempty"`
  16923. // Items: A list of NodeGroup resources.
  16924. Items []*NodeGroup `json:"items,omitempty"`
  16925. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  16926. // lists of node groups.
  16927. Kind string `json:"kind,omitempty"`
  16928. // NextPageToken: [Output Only] This token allows you to get the next
  16929. // page of results for list requests. If the number of results is larger
  16930. // than maxResults, use the nextPageToken as a value for the query
  16931. // parameter pageToken in the next list request. Subsequent list
  16932. // requests will have their own nextPageToken to continue paging through
  16933. // the results.
  16934. NextPageToken string `json:"nextPageToken,omitempty"`
  16935. // SelfLink: [Output Only] Server-defined URL for this resource.
  16936. SelfLink string `json:"selfLink,omitempty"`
  16937. // Warning: [Output Only] Informational warning message.
  16938. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  16939. // ServerResponse contains the HTTP response code and headers from the
  16940. // server.
  16941. googleapi.ServerResponse `json:"-"`
  16942. // ForceSendFields is a list of field names (e.g. "Id") to
  16943. // unconditionally include in API requests. By default, fields with
  16944. // empty values are omitted from API requests. However, any non-pointer,
  16945. // non-interface field appearing in ForceSendFields will be sent to the
  16946. // server regardless of whether the field is empty or not. This may be
  16947. // used to include empty fields in Patch requests.
  16948. ForceSendFields []string `json:"-"`
  16949. // NullFields is a list of field names (e.g. "Id") to include in API
  16950. // requests with the JSON null value. By default, fields with empty
  16951. // values are omitted from API requests. However, any field with an
  16952. // empty value appearing in NullFields will be sent to the server as
  16953. // null. It is an error if a field in this list has a non-empty value.
  16954. // This may be used to include null fields in Patch requests.
  16955. NullFields []string `json:"-"`
  16956. }
  16957. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  16958. type NoMethod NodeGroupList
  16959. raw := NoMethod(*s)
  16960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16961. }
  16962. // NodeGroupListWarning: [Output Only] Informational warning message.
  16963. type NodeGroupListWarning struct {
  16964. // Code: [Output Only] A warning code, if applicable. For example,
  16965. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16966. // the response.
  16967. //
  16968. // Possible values:
  16969. // "CLEANUP_FAILED"
  16970. // "DEPRECATED_RESOURCE_USED"
  16971. // "DEPRECATED_TYPE_USED"
  16972. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16973. // "EXPERIMENTAL_TYPE_USED"
  16974. // "EXTERNAL_API_WARNING"
  16975. // "FIELD_VALUE_OVERRIDEN"
  16976. // "INJECTED_KERNELS_DEPRECATED"
  16977. // "MISSING_TYPE_DEPENDENCY"
  16978. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16979. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16980. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16981. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16982. // "NEXT_HOP_NOT_RUNNING"
  16983. // "NOT_CRITICAL_ERROR"
  16984. // "NO_RESULTS_ON_PAGE"
  16985. // "REQUIRED_TOS_AGREEMENT"
  16986. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16987. // "RESOURCE_NOT_DELETED"
  16988. // "SCHEMA_VALIDATION_IGNORED"
  16989. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16990. // "UNDECLARED_PROPERTIES"
  16991. // "UNREACHABLE"
  16992. Code string `json:"code,omitempty"`
  16993. // Data: [Output Only] Metadata about this warning in key: value format.
  16994. // For example:
  16995. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16996. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  16997. // Message: [Output Only] A human-readable description of the warning
  16998. // code.
  16999. Message string `json:"message,omitempty"`
  17000. // ForceSendFields is a list of field names (e.g. "Code") to
  17001. // unconditionally include in API requests. By default, fields with
  17002. // empty values are omitted from API requests. However, any non-pointer,
  17003. // non-interface field appearing in ForceSendFields will be sent to the
  17004. // server regardless of whether the field is empty or not. This may be
  17005. // used to include empty fields in Patch requests.
  17006. ForceSendFields []string `json:"-"`
  17007. // NullFields is a list of field names (e.g. "Code") to include in API
  17008. // requests with the JSON null value. By default, fields with empty
  17009. // values are omitted from API requests. However, any field with an
  17010. // empty value appearing in NullFields will be sent to the server as
  17011. // null. It is an error if a field in this list has a non-empty value.
  17012. // This may be used to include null fields in Patch requests.
  17013. NullFields []string `json:"-"`
  17014. }
  17015. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  17016. type NoMethod NodeGroupListWarning
  17017. raw := NoMethod(*s)
  17018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17019. }
  17020. type NodeGroupListWarningData struct {
  17021. // Key: [Output Only] A key that provides more detail on the warning
  17022. // being returned. For example, for warnings where there are no results
  17023. // in a list request for a particular zone, this key might be scope and
  17024. // the key value might be the zone name. Other examples might be a key
  17025. // indicating a deprecated resource and a suggested replacement, or a
  17026. // warning about invalid network settings (for example, if an instance
  17027. // attempts to perform IP forwarding but is not enabled for IP
  17028. // forwarding).
  17029. Key string `json:"key,omitempty"`
  17030. // Value: [Output Only] A warning data value corresponding to the key.
  17031. Value string `json:"value,omitempty"`
  17032. // ForceSendFields is a list of field names (e.g. "Key") to
  17033. // unconditionally include in API requests. By default, fields with
  17034. // empty values are omitted from API requests. However, any non-pointer,
  17035. // non-interface field appearing in ForceSendFields will be sent to the
  17036. // server regardless of whether the field is empty or not. This may be
  17037. // used to include empty fields in Patch requests.
  17038. ForceSendFields []string `json:"-"`
  17039. // NullFields is a list of field names (e.g. "Key") to include in API
  17040. // requests with the JSON null value. By default, fields with empty
  17041. // values are omitted from API requests. However, any field with an
  17042. // empty value appearing in NullFields will be sent to the server as
  17043. // null. It is an error if a field in this list has a non-empty value.
  17044. // This may be used to include null fields in Patch requests.
  17045. NullFields []string `json:"-"`
  17046. }
  17047. func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  17048. type NoMethod NodeGroupListWarningData
  17049. raw := NoMethod(*s)
  17050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17051. }
  17052. type NodeGroupNode struct {
  17053. // Instances: Instances scheduled on this node.
  17054. Instances []string `json:"instances,omitempty"`
  17055. // Name: The name of the node.
  17056. Name string `json:"name,omitempty"`
  17057. // NodeType: The type of this node.
  17058. NodeType string `json:"nodeType,omitempty"`
  17059. // ServerBinding: Binding properties for the physical server.
  17060. ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
  17061. // Possible values:
  17062. // "CREATING"
  17063. // "DELETING"
  17064. // "INVALID"
  17065. // "READY"
  17066. // "REPAIRING"
  17067. Status string `json:"status,omitempty"`
  17068. // ForceSendFields is a list of field names (e.g. "Instances") to
  17069. // unconditionally include in API requests. By default, fields with
  17070. // empty values are omitted from API requests. However, any non-pointer,
  17071. // non-interface field appearing in ForceSendFields will be sent to the
  17072. // server regardless of whether the field is empty or not. This may be
  17073. // used to include empty fields in Patch requests.
  17074. ForceSendFields []string `json:"-"`
  17075. // NullFields is a list of field names (e.g. "Instances") to include in
  17076. // API requests with the JSON null value. By default, fields with empty
  17077. // values are omitted from API requests. However, any field with an
  17078. // empty value appearing in NullFields will be sent to the server as
  17079. // null. It is an error if a field in this list has a non-empty value.
  17080. // This may be used to include null fields in Patch requests.
  17081. NullFields []string `json:"-"`
  17082. }
  17083. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  17084. type NoMethod NodeGroupNode
  17085. raw := NoMethod(*s)
  17086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17087. }
  17088. type NodeGroupsAddNodesRequest struct {
  17089. // AdditionalNodeCount: Count of additional nodes to be added to the
  17090. // node group.
  17091. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  17092. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  17093. // to unconditionally include in API requests. By default, fields with
  17094. // empty values are omitted from API requests. However, any non-pointer,
  17095. // non-interface field appearing in ForceSendFields will be sent to the
  17096. // server regardless of whether the field is empty or not. This may be
  17097. // used to include empty fields in Patch requests.
  17098. ForceSendFields []string `json:"-"`
  17099. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  17100. // include in API requests with the JSON null value. By default, fields
  17101. // with empty values are omitted from API requests. However, any field
  17102. // with an empty value appearing in NullFields will be sent to the
  17103. // server as null. It is an error if a field in this list has a
  17104. // non-empty value. This may be used to include null fields in Patch
  17105. // requests.
  17106. NullFields []string `json:"-"`
  17107. }
  17108. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  17109. type NoMethod NodeGroupsAddNodesRequest
  17110. raw := NoMethod(*s)
  17111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17112. }
  17113. type NodeGroupsDeleteNodesRequest struct {
  17114. Nodes []string `json:"nodes,omitempty"`
  17115. // ForceSendFields is a list of field names (e.g. "Nodes") to
  17116. // unconditionally include in API requests. By default, fields with
  17117. // empty values are omitted from API requests. However, any non-pointer,
  17118. // non-interface field appearing in ForceSendFields will be sent to the
  17119. // server regardless of whether the field is empty or not. This may be
  17120. // used to include empty fields in Patch requests.
  17121. ForceSendFields []string `json:"-"`
  17122. // NullFields is a list of field names (e.g. "Nodes") to include in API
  17123. // requests with the JSON null value. By default, fields with empty
  17124. // values are omitted from API requests. However, any field with an
  17125. // empty value appearing in NullFields will be sent to the server as
  17126. // null. It is an error if a field in this list has a non-empty value.
  17127. // This may be used to include null fields in Patch requests.
  17128. NullFields []string `json:"-"`
  17129. }
  17130. func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  17131. type NoMethod NodeGroupsDeleteNodesRequest
  17132. raw := NoMethod(*s)
  17133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17134. }
  17135. type NodeGroupsListNodes struct {
  17136. // Id: [Output Only] Unique identifier for the resource; defined by the
  17137. // server.
  17138. Id string `json:"id,omitempty"`
  17139. // Items: A list of Node resources.
  17140. Items []*NodeGroupNode `json:"items,omitempty"`
  17141. // Kind: [Output Only] The resource type, which is always
  17142. // compute.nodeGroupsListNodes for the list of nodes in the specified
  17143. // node group.
  17144. Kind string `json:"kind,omitempty"`
  17145. // NextPageToken: [Output Only] This token allows you to get the next
  17146. // page of results for list requests. If the number of results is larger
  17147. // than maxResults, use the nextPageToken as a value for the query
  17148. // parameter pageToken in the next list request. Subsequent list
  17149. // requests will have their own nextPageToken to continue paging through
  17150. // the results.
  17151. NextPageToken string `json:"nextPageToken,omitempty"`
  17152. // SelfLink: [Output Only] Server-defined URL for this resource.
  17153. SelfLink string `json:"selfLink,omitempty"`
  17154. // Warning: [Output Only] Informational warning message.
  17155. Warning *NodeGroupsListNodesWarning `json:"warning,omitempty"`
  17156. // ServerResponse contains the HTTP response code and headers from the
  17157. // server.
  17158. googleapi.ServerResponse `json:"-"`
  17159. // ForceSendFields is a list of field names (e.g. "Id") to
  17160. // unconditionally include in API requests. By default, fields with
  17161. // empty values are omitted from API requests. However, any non-pointer,
  17162. // non-interface field appearing in ForceSendFields will be sent to the
  17163. // server regardless of whether the field is empty or not. This may be
  17164. // used to include empty fields in Patch requests.
  17165. ForceSendFields []string `json:"-"`
  17166. // NullFields is a list of field names (e.g. "Id") to include in API
  17167. // requests with the JSON null value. By default, fields with empty
  17168. // values are omitted from API requests. However, any field with an
  17169. // empty value appearing in NullFields will be sent to the server as
  17170. // null. It is an error if a field in this list has a non-empty value.
  17171. // This may be used to include null fields in Patch requests.
  17172. NullFields []string `json:"-"`
  17173. }
  17174. func (s *NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
  17175. type NoMethod NodeGroupsListNodes
  17176. raw := NoMethod(*s)
  17177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17178. }
  17179. // NodeGroupsListNodesWarning: [Output Only] Informational warning
  17180. // message.
  17181. type NodeGroupsListNodesWarning struct {
  17182. // Code: [Output Only] A warning code, if applicable. For example,
  17183. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17184. // the response.
  17185. //
  17186. // Possible values:
  17187. // "CLEANUP_FAILED"
  17188. // "DEPRECATED_RESOURCE_USED"
  17189. // "DEPRECATED_TYPE_USED"
  17190. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17191. // "EXPERIMENTAL_TYPE_USED"
  17192. // "EXTERNAL_API_WARNING"
  17193. // "FIELD_VALUE_OVERRIDEN"
  17194. // "INJECTED_KERNELS_DEPRECATED"
  17195. // "MISSING_TYPE_DEPENDENCY"
  17196. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17197. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17198. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17199. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17200. // "NEXT_HOP_NOT_RUNNING"
  17201. // "NOT_CRITICAL_ERROR"
  17202. // "NO_RESULTS_ON_PAGE"
  17203. // "REQUIRED_TOS_AGREEMENT"
  17204. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17205. // "RESOURCE_NOT_DELETED"
  17206. // "SCHEMA_VALIDATION_IGNORED"
  17207. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17208. // "UNDECLARED_PROPERTIES"
  17209. // "UNREACHABLE"
  17210. Code string `json:"code,omitempty"`
  17211. // Data: [Output Only] Metadata about this warning in key: value format.
  17212. // For example:
  17213. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17214. Data []*NodeGroupsListNodesWarningData `json:"data,omitempty"`
  17215. // Message: [Output Only] A human-readable description of the warning
  17216. // code.
  17217. Message string `json:"message,omitempty"`
  17218. // ForceSendFields is a list of field names (e.g. "Code") to
  17219. // unconditionally include in API requests. By default, fields with
  17220. // empty values are omitted from API requests. However, any non-pointer,
  17221. // non-interface field appearing in ForceSendFields will be sent to the
  17222. // server regardless of whether the field is empty or not. This may be
  17223. // used to include empty fields in Patch requests.
  17224. ForceSendFields []string `json:"-"`
  17225. // NullFields is a list of field names (e.g. "Code") to include in API
  17226. // requests with the JSON null value. By default, fields with empty
  17227. // values are omitted from API requests. However, any field with an
  17228. // empty value appearing in NullFields will be sent to the server as
  17229. // null. It is an error if a field in this list has a non-empty value.
  17230. // This may be used to include null fields in Patch requests.
  17231. NullFields []string `json:"-"`
  17232. }
  17233. func (s *NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
  17234. type NoMethod NodeGroupsListNodesWarning
  17235. raw := NoMethod(*s)
  17236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17237. }
  17238. type NodeGroupsListNodesWarningData struct {
  17239. // Key: [Output Only] A key that provides more detail on the warning
  17240. // being returned. For example, for warnings where there are no results
  17241. // in a list request for a particular zone, this key might be scope and
  17242. // the key value might be the zone name. Other examples might be a key
  17243. // indicating a deprecated resource and a suggested replacement, or a
  17244. // warning about invalid network settings (for example, if an instance
  17245. // attempts to perform IP forwarding but is not enabled for IP
  17246. // forwarding).
  17247. Key string `json:"key,omitempty"`
  17248. // Value: [Output Only] A warning data value corresponding to the key.
  17249. Value string `json:"value,omitempty"`
  17250. // ForceSendFields is a list of field names (e.g. "Key") to
  17251. // unconditionally include in API requests. By default, fields with
  17252. // empty values are omitted from API requests. However, any non-pointer,
  17253. // non-interface field appearing in ForceSendFields will be sent to the
  17254. // server regardless of whether the field is empty or not. This may be
  17255. // used to include empty fields in Patch requests.
  17256. ForceSendFields []string `json:"-"`
  17257. // NullFields is a list of field names (e.g. "Key") to include in API
  17258. // requests with the JSON null value. By default, fields with empty
  17259. // values are omitted from API requests. However, any field with an
  17260. // empty value appearing in NullFields will be sent to the server as
  17261. // null. It is an error if a field in this list has a non-empty value.
  17262. // This may be used to include null fields in Patch requests.
  17263. NullFields []string `json:"-"`
  17264. }
  17265. func (s *NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
  17266. type NoMethod NodeGroupsListNodesWarningData
  17267. raw := NoMethod(*s)
  17268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17269. }
  17270. type NodeGroupsScopedList struct {
  17271. // NodeGroups: [Output Only] A list of node groups contained in this
  17272. // scope.
  17273. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  17274. // Warning: [Output Only] An informational warning that appears when the
  17275. // nodeGroup list is empty.
  17276. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  17277. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  17278. // unconditionally include in API requests. By default, fields with
  17279. // empty values are omitted from API requests. However, any non-pointer,
  17280. // non-interface field appearing in ForceSendFields will be sent to the
  17281. // server regardless of whether the field is empty or not. This may be
  17282. // used to include empty fields in Patch requests.
  17283. ForceSendFields []string `json:"-"`
  17284. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  17285. // API requests with the JSON null value. By default, fields with empty
  17286. // values are omitted from API requests. However, any field with an
  17287. // empty value appearing in NullFields will be sent to the server as
  17288. // null. It is an error if a field in this list has a non-empty value.
  17289. // This may be used to include null fields in Patch requests.
  17290. NullFields []string `json:"-"`
  17291. }
  17292. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  17293. type NoMethod NodeGroupsScopedList
  17294. raw := NoMethod(*s)
  17295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17296. }
  17297. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  17298. // that appears when the nodeGroup list is empty.
  17299. type NodeGroupsScopedListWarning struct {
  17300. // Code: [Output Only] A warning code, if applicable. For example,
  17301. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17302. // the response.
  17303. //
  17304. // Possible values:
  17305. // "CLEANUP_FAILED"
  17306. // "DEPRECATED_RESOURCE_USED"
  17307. // "DEPRECATED_TYPE_USED"
  17308. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17309. // "EXPERIMENTAL_TYPE_USED"
  17310. // "EXTERNAL_API_WARNING"
  17311. // "FIELD_VALUE_OVERRIDEN"
  17312. // "INJECTED_KERNELS_DEPRECATED"
  17313. // "MISSING_TYPE_DEPENDENCY"
  17314. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17315. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17316. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17317. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17318. // "NEXT_HOP_NOT_RUNNING"
  17319. // "NOT_CRITICAL_ERROR"
  17320. // "NO_RESULTS_ON_PAGE"
  17321. // "REQUIRED_TOS_AGREEMENT"
  17322. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17323. // "RESOURCE_NOT_DELETED"
  17324. // "SCHEMA_VALIDATION_IGNORED"
  17325. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17326. // "UNDECLARED_PROPERTIES"
  17327. // "UNREACHABLE"
  17328. Code string `json:"code,omitempty"`
  17329. // Data: [Output Only] Metadata about this warning in key: value format.
  17330. // For example:
  17331. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17332. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  17333. // Message: [Output Only] A human-readable description of the warning
  17334. // code.
  17335. Message string `json:"message,omitempty"`
  17336. // ForceSendFields is a list of field names (e.g. "Code") to
  17337. // unconditionally include in API requests. By default, fields with
  17338. // empty values are omitted from API requests. However, any non-pointer,
  17339. // non-interface field appearing in ForceSendFields will be sent to the
  17340. // server regardless of whether the field is empty or not. This may be
  17341. // used to include empty fields in Patch requests.
  17342. ForceSendFields []string `json:"-"`
  17343. // NullFields is a list of field names (e.g. "Code") to include in API
  17344. // requests with the JSON null value. By default, fields with empty
  17345. // values are omitted from API requests. However, any field with an
  17346. // empty value appearing in NullFields will be sent to the server as
  17347. // null. It is an error if a field in this list has a non-empty value.
  17348. // This may be used to include null fields in Patch requests.
  17349. NullFields []string `json:"-"`
  17350. }
  17351. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  17352. type NoMethod NodeGroupsScopedListWarning
  17353. raw := NoMethod(*s)
  17354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17355. }
  17356. type NodeGroupsScopedListWarningData struct {
  17357. // Key: [Output Only] A key that provides more detail on the warning
  17358. // being returned. For example, for warnings where there are no results
  17359. // in a list request for a particular zone, this key might be scope and
  17360. // the key value might be the zone name. Other examples might be a key
  17361. // indicating a deprecated resource and a suggested replacement, or a
  17362. // warning about invalid network settings (for example, if an instance
  17363. // attempts to perform IP forwarding but is not enabled for IP
  17364. // forwarding).
  17365. Key string `json:"key,omitempty"`
  17366. // Value: [Output Only] A warning data value corresponding to the key.
  17367. Value string `json:"value,omitempty"`
  17368. // ForceSendFields is a list of field names (e.g. "Key") to
  17369. // unconditionally include in API requests. By default, fields with
  17370. // empty values are omitted from API requests. However, any non-pointer,
  17371. // non-interface field appearing in ForceSendFields will be sent to the
  17372. // server regardless of whether the field is empty or not. This may be
  17373. // used to include empty fields in Patch requests.
  17374. ForceSendFields []string `json:"-"`
  17375. // NullFields is a list of field names (e.g. "Key") to include in API
  17376. // requests with the JSON null value. By default, fields with empty
  17377. // values are omitted from API requests. However, any field with an
  17378. // empty value appearing in NullFields will be sent to the server as
  17379. // null. It is an error if a field in this list has a non-empty value.
  17380. // This may be used to include null fields in Patch requests.
  17381. NullFields []string `json:"-"`
  17382. }
  17383. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  17384. type NoMethod NodeGroupsScopedListWarningData
  17385. raw := NoMethod(*s)
  17386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17387. }
  17388. type NodeGroupsSetNodeTemplateRequest struct {
  17389. // NodeTemplate: Full or partial URL of the node template resource to be
  17390. // updated for this node group.
  17391. NodeTemplate string `json:"nodeTemplate,omitempty"`
  17392. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  17393. // unconditionally include in API requests. By default, fields with
  17394. // empty values are omitted from API requests. However, any non-pointer,
  17395. // non-interface field appearing in ForceSendFields will be sent to the
  17396. // server regardless of whether the field is empty or not. This may be
  17397. // used to include empty fields in Patch requests.
  17398. ForceSendFields []string `json:"-"`
  17399. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  17400. // in API requests with the JSON null value. By default, fields with
  17401. // empty values are omitted from API requests. However, any field with
  17402. // an empty value appearing in NullFields will be sent to the server as
  17403. // null. It is an error if a field in this list has a non-empty value.
  17404. // This may be used to include null fields in Patch requests.
  17405. NullFields []string `json:"-"`
  17406. }
  17407. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  17408. type NoMethod NodeGroupsSetNodeTemplateRequest
  17409. raw := NoMethod(*s)
  17410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17411. }
  17412. // NodeTemplate: A Node Template resource.
  17413. type NodeTemplate struct {
  17414. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17415. // format.
  17416. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17417. // Description: An optional description of this resource. Provide this
  17418. // property when you create the resource.
  17419. Description string `json:"description,omitempty"`
  17420. // Id: [Output Only] The unique identifier for the resource. This
  17421. // identifier is defined by the server.
  17422. Id uint64 `json:"id,omitempty,string"`
  17423. // Kind: [Output Only] The type of the resource. Always
  17424. // compute#nodeTemplate for node templates.
  17425. Kind string `json:"kind,omitempty"`
  17426. // Name: The name of the resource, provided by the client when initially
  17427. // creating the resource. The resource name must be 1-63 characters
  17428. // long, and comply with RFC1035. Specifically, the name must be 1-63
  17429. // characters long and match the regular expression
  17430. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  17431. // a lowercase letter, and all following characters must be a dash,
  17432. // lowercase letter, or digit, except the last character, which cannot
  17433. // be a dash.
  17434. Name string `json:"name,omitempty"`
  17435. // NodeAffinityLabels: Labels to use for node affinity, which will be
  17436. // used in instance scheduling.
  17437. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  17438. // NodeType: The node type to use for nodes group that are created from
  17439. // this template.
  17440. NodeType string `json:"nodeType,omitempty"`
  17441. // NodeTypeFlexibility: The flexible properties of the desired node
  17442. // type. Node groups that use this node template will create nodes of a
  17443. // type that matches these properties.
  17444. //
  17445. // This field is mutually exclusive with the node_type property; you can
  17446. // only define one or the other, but not both.
  17447. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  17448. // Region: [Output Only] The name of the region where the node template
  17449. // resides, such as us-central1.
  17450. Region string `json:"region,omitempty"`
  17451. // SelfLink: [Output Only] Server-defined URL for the resource.
  17452. SelfLink string `json:"selfLink,omitempty"`
  17453. // ServerBinding: Binding properties for the physical server.
  17454. ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
  17455. // Status: [Output Only] The status of the node template. One of the
  17456. // following values: CREATING, READY, and DELETING.
  17457. //
  17458. // Possible values:
  17459. // "CREATING"
  17460. // "DELETING"
  17461. // "INVALID"
  17462. // "READY"
  17463. Status string `json:"status,omitempty"`
  17464. // StatusMessage: [Output Only] An optional, human-readable explanation
  17465. // of the status.
  17466. StatusMessage string `json:"statusMessage,omitempty"`
  17467. // ServerResponse contains the HTTP response code and headers from the
  17468. // server.
  17469. googleapi.ServerResponse `json:"-"`
  17470. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17471. // to unconditionally include in API requests. By default, fields with
  17472. // empty values are omitted from API requests. However, any non-pointer,
  17473. // non-interface field appearing in ForceSendFields will be sent to the
  17474. // server regardless of whether the field is empty or not. This may be
  17475. // used to include empty fields in Patch requests.
  17476. ForceSendFields []string `json:"-"`
  17477. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17478. // include in API requests with the JSON null value. By default, fields
  17479. // with empty values are omitted from API requests. However, any field
  17480. // with an empty value appearing in NullFields will be sent to the
  17481. // server as null. It is an error if a field in this list has a
  17482. // non-empty value. This may be used to include null fields in Patch
  17483. // requests.
  17484. NullFields []string `json:"-"`
  17485. }
  17486. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  17487. type NoMethod NodeTemplate
  17488. raw := NoMethod(*s)
  17489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17490. }
  17491. type NodeTemplateAggregatedList struct {
  17492. // Id: [Output Only] Unique identifier for the resource; defined by the
  17493. // server.
  17494. Id string `json:"id,omitempty"`
  17495. // Items: A list of NodeTemplatesScopedList resources.
  17496. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  17497. // Kind: [Output Only] Type of resource.Always
  17498. // compute#nodeTemplateAggregatedList for aggregated lists of node
  17499. // templates.
  17500. Kind string `json:"kind,omitempty"`
  17501. // NextPageToken: [Output Only] This token allows you to get the next
  17502. // page of results for list requests. If the number of results is larger
  17503. // than maxResults, use the nextPageToken as a value for the query
  17504. // parameter pageToken in the next list request. Subsequent list
  17505. // requests will have their own nextPageToken to continue paging through
  17506. // the results.
  17507. NextPageToken string `json:"nextPageToken,omitempty"`
  17508. // SelfLink: [Output Only] Server-defined URL for this resource.
  17509. SelfLink string `json:"selfLink,omitempty"`
  17510. // Warning: [Output Only] Informational warning message.
  17511. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  17512. // ServerResponse contains the HTTP response code and headers from the
  17513. // server.
  17514. googleapi.ServerResponse `json:"-"`
  17515. // ForceSendFields is a list of field names (e.g. "Id") to
  17516. // unconditionally include in API requests. By default, fields with
  17517. // empty values are omitted from API requests. However, any non-pointer,
  17518. // non-interface field appearing in ForceSendFields will be sent to the
  17519. // server regardless of whether the field is empty or not. This may be
  17520. // used to include empty fields in Patch requests.
  17521. ForceSendFields []string `json:"-"`
  17522. // NullFields is a list of field names (e.g. "Id") to include in API
  17523. // requests with the JSON null value. By default, fields with empty
  17524. // values are omitted from API requests. However, any field with an
  17525. // empty value appearing in NullFields will be sent to the server as
  17526. // null. It is an error if a field in this list has a non-empty value.
  17527. // This may be used to include null fields in Patch requests.
  17528. NullFields []string `json:"-"`
  17529. }
  17530. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  17531. type NoMethod NodeTemplateAggregatedList
  17532. raw := NoMethod(*s)
  17533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17534. }
  17535. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  17536. // warning message.
  17537. type NodeTemplateAggregatedListWarning struct {
  17538. // Code: [Output Only] A warning code, if applicable. For example,
  17539. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17540. // the response.
  17541. //
  17542. // Possible values:
  17543. // "CLEANUP_FAILED"
  17544. // "DEPRECATED_RESOURCE_USED"
  17545. // "DEPRECATED_TYPE_USED"
  17546. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17547. // "EXPERIMENTAL_TYPE_USED"
  17548. // "EXTERNAL_API_WARNING"
  17549. // "FIELD_VALUE_OVERRIDEN"
  17550. // "INJECTED_KERNELS_DEPRECATED"
  17551. // "MISSING_TYPE_DEPENDENCY"
  17552. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17553. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17554. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17555. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17556. // "NEXT_HOP_NOT_RUNNING"
  17557. // "NOT_CRITICAL_ERROR"
  17558. // "NO_RESULTS_ON_PAGE"
  17559. // "REQUIRED_TOS_AGREEMENT"
  17560. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17561. // "RESOURCE_NOT_DELETED"
  17562. // "SCHEMA_VALIDATION_IGNORED"
  17563. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17564. // "UNDECLARED_PROPERTIES"
  17565. // "UNREACHABLE"
  17566. Code string `json:"code,omitempty"`
  17567. // Data: [Output Only] Metadata about this warning in key: value format.
  17568. // For example:
  17569. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17570. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  17571. // Message: [Output Only] A human-readable description of the warning
  17572. // code.
  17573. Message string `json:"message,omitempty"`
  17574. // ForceSendFields is a list of field names (e.g. "Code") to
  17575. // unconditionally include in API requests. By default, fields with
  17576. // empty values are omitted from API requests. However, any non-pointer,
  17577. // non-interface field appearing in ForceSendFields will be sent to the
  17578. // server regardless of whether the field is empty or not. This may be
  17579. // used to include empty fields in Patch requests.
  17580. ForceSendFields []string `json:"-"`
  17581. // NullFields is a list of field names (e.g. "Code") to include in API
  17582. // requests with the JSON null value. By default, fields with empty
  17583. // values are omitted from API requests. However, any field with an
  17584. // empty value appearing in NullFields will be sent to the server as
  17585. // null. It is an error if a field in this list has a non-empty value.
  17586. // This may be used to include null fields in Patch requests.
  17587. NullFields []string `json:"-"`
  17588. }
  17589. func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  17590. type NoMethod NodeTemplateAggregatedListWarning
  17591. raw := NoMethod(*s)
  17592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17593. }
  17594. type NodeTemplateAggregatedListWarningData struct {
  17595. // Key: [Output Only] A key that provides more detail on the warning
  17596. // being returned. For example, for warnings where there are no results
  17597. // in a list request for a particular zone, this key might be scope and
  17598. // the key value might be the zone name. Other examples might be a key
  17599. // indicating a deprecated resource and a suggested replacement, or a
  17600. // warning about invalid network settings (for example, if an instance
  17601. // attempts to perform IP forwarding but is not enabled for IP
  17602. // forwarding).
  17603. Key string `json:"key,omitempty"`
  17604. // Value: [Output Only] A warning data value corresponding to the key.
  17605. Value string `json:"value,omitempty"`
  17606. // ForceSendFields is a list of field names (e.g. "Key") to
  17607. // unconditionally include in API requests. By default, fields with
  17608. // empty values are omitted from API requests. However, any non-pointer,
  17609. // non-interface field appearing in ForceSendFields will be sent to the
  17610. // server regardless of whether the field is empty or not. This may be
  17611. // used to include empty fields in Patch requests.
  17612. ForceSendFields []string `json:"-"`
  17613. // NullFields is a list of field names (e.g. "Key") to include in API
  17614. // requests with the JSON null value. By default, fields with empty
  17615. // values are omitted from API requests. However, any field with an
  17616. // empty value appearing in NullFields will be sent to the server as
  17617. // null. It is an error if a field in this list has a non-empty value.
  17618. // This may be used to include null fields in Patch requests.
  17619. NullFields []string `json:"-"`
  17620. }
  17621. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  17622. type NoMethod NodeTemplateAggregatedListWarningData
  17623. raw := NoMethod(*s)
  17624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17625. }
  17626. // NodeTemplateList: Contains a list of node templates.
  17627. type NodeTemplateList struct {
  17628. // Id: [Output Only] Unique identifier for the resource; defined by the
  17629. // server.
  17630. Id string `json:"id,omitempty"`
  17631. // Items: A list of NodeTemplate resources.
  17632. Items []*NodeTemplate `json:"items,omitempty"`
  17633. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  17634. // for lists of node templates.
  17635. Kind string `json:"kind,omitempty"`
  17636. // NextPageToken: [Output Only] This token allows you to get the next
  17637. // page of results for list requests. If the number of results is larger
  17638. // than maxResults, use the nextPageToken as a value for the query
  17639. // parameter pageToken in the next list request. Subsequent list
  17640. // requests will have their own nextPageToken to continue paging through
  17641. // the results.
  17642. NextPageToken string `json:"nextPageToken,omitempty"`
  17643. // SelfLink: [Output Only] Server-defined URL for this resource.
  17644. SelfLink string `json:"selfLink,omitempty"`
  17645. // Warning: [Output Only] Informational warning message.
  17646. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  17647. // ServerResponse contains the HTTP response code and headers from the
  17648. // server.
  17649. googleapi.ServerResponse `json:"-"`
  17650. // ForceSendFields is a list of field names (e.g. "Id") to
  17651. // unconditionally include in API requests. By default, fields with
  17652. // empty values are omitted from API requests. However, any non-pointer,
  17653. // non-interface field appearing in ForceSendFields will be sent to the
  17654. // server regardless of whether the field is empty or not. This may be
  17655. // used to include empty fields in Patch requests.
  17656. ForceSendFields []string `json:"-"`
  17657. // NullFields is a list of field names (e.g. "Id") to include in API
  17658. // requests with the JSON null value. By default, fields with empty
  17659. // values are omitted from API requests. However, any field with an
  17660. // empty value appearing in NullFields will be sent to the server as
  17661. // null. It is an error if a field in this list has a non-empty value.
  17662. // This may be used to include null fields in Patch requests.
  17663. NullFields []string `json:"-"`
  17664. }
  17665. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  17666. type NoMethod NodeTemplateList
  17667. raw := NoMethod(*s)
  17668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17669. }
  17670. // NodeTemplateListWarning: [Output Only] Informational warning message.
  17671. type NodeTemplateListWarning struct {
  17672. // Code: [Output Only] A warning code, if applicable. For example,
  17673. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17674. // the response.
  17675. //
  17676. // Possible values:
  17677. // "CLEANUP_FAILED"
  17678. // "DEPRECATED_RESOURCE_USED"
  17679. // "DEPRECATED_TYPE_USED"
  17680. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17681. // "EXPERIMENTAL_TYPE_USED"
  17682. // "EXTERNAL_API_WARNING"
  17683. // "FIELD_VALUE_OVERRIDEN"
  17684. // "INJECTED_KERNELS_DEPRECATED"
  17685. // "MISSING_TYPE_DEPENDENCY"
  17686. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17687. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17688. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17689. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17690. // "NEXT_HOP_NOT_RUNNING"
  17691. // "NOT_CRITICAL_ERROR"
  17692. // "NO_RESULTS_ON_PAGE"
  17693. // "REQUIRED_TOS_AGREEMENT"
  17694. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17695. // "RESOURCE_NOT_DELETED"
  17696. // "SCHEMA_VALIDATION_IGNORED"
  17697. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17698. // "UNDECLARED_PROPERTIES"
  17699. // "UNREACHABLE"
  17700. Code string `json:"code,omitempty"`
  17701. // Data: [Output Only] Metadata about this warning in key: value format.
  17702. // For example:
  17703. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17704. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  17705. // Message: [Output Only] A human-readable description of the warning
  17706. // code.
  17707. Message string `json:"message,omitempty"`
  17708. // ForceSendFields is a list of field names (e.g. "Code") to
  17709. // unconditionally include in API requests. By default, fields with
  17710. // empty values are omitted from API requests. However, any non-pointer,
  17711. // non-interface field appearing in ForceSendFields will be sent to the
  17712. // server regardless of whether the field is empty or not. This may be
  17713. // used to include empty fields in Patch requests.
  17714. ForceSendFields []string `json:"-"`
  17715. // NullFields is a list of field names (e.g. "Code") to include in API
  17716. // requests with the JSON null value. By default, fields with empty
  17717. // values are omitted from API requests. However, any field with an
  17718. // empty value appearing in NullFields will be sent to the server as
  17719. // null. It is an error if a field in this list has a non-empty value.
  17720. // This may be used to include null fields in Patch requests.
  17721. NullFields []string `json:"-"`
  17722. }
  17723. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  17724. type NoMethod NodeTemplateListWarning
  17725. raw := NoMethod(*s)
  17726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17727. }
  17728. type NodeTemplateListWarningData struct {
  17729. // Key: [Output Only] A key that provides more detail on the warning
  17730. // being returned. For example, for warnings where there are no results
  17731. // in a list request for a particular zone, this key might be scope and
  17732. // the key value might be the zone name. Other examples might be a key
  17733. // indicating a deprecated resource and a suggested replacement, or a
  17734. // warning about invalid network settings (for example, if an instance
  17735. // attempts to perform IP forwarding but is not enabled for IP
  17736. // forwarding).
  17737. Key string `json:"key,omitempty"`
  17738. // Value: [Output Only] A warning data value corresponding to the key.
  17739. Value string `json:"value,omitempty"`
  17740. // ForceSendFields is a list of field names (e.g. "Key") to
  17741. // unconditionally include in API requests. By default, fields with
  17742. // empty values are omitted from API requests. However, any non-pointer,
  17743. // non-interface field appearing in ForceSendFields will be sent to the
  17744. // server regardless of whether the field is empty or not. This may be
  17745. // used to include empty fields in Patch requests.
  17746. ForceSendFields []string `json:"-"`
  17747. // NullFields is a list of field names (e.g. "Key") to include in API
  17748. // requests with the JSON null value. By default, fields with empty
  17749. // values are omitted from API requests. However, any field with an
  17750. // empty value appearing in NullFields will be sent to the server as
  17751. // null. It is an error if a field in this list has a non-empty value.
  17752. // This may be used to include null fields in Patch requests.
  17753. NullFields []string `json:"-"`
  17754. }
  17755. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  17756. type NoMethod NodeTemplateListWarningData
  17757. raw := NoMethod(*s)
  17758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17759. }
  17760. type NodeTemplateNodeTypeFlexibility struct {
  17761. Cpus string `json:"cpus,omitempty"`
  17762. LocalSsd string `json:"localSsd,omitempty"`
  17763. Memory string `json:"memory,omitempty"`
  17764. // ForceSendFields is a list of field names (e.g. "Cpus") to
  17765. // unconditionally include in API requests. By default, fields with
  17766. // empty values are omitted from API requests. However, any non-pointer,
  17767. // non-interface field appearing in ForceSendFields will be sent to the
  17768. // server regardless of whether the field is empty or not. This may be
  17769. // used to include empty fields in Patch requests.
  17770. ForceSendFields []string `json:"-"`
  17771. // NullFields is a list of field names (e.g. "Cpus") to include in API
  17772. // requests with the JSON null value. By default, fields with empty
  17773. // values are omitted from API requests. However, any field with an
  17774. // empty value appearing in NullFields will be sent to the server as
  17775. // null. It is an error if a field in this list has a non-empty value.
  17776. // This may be used to include null fields in Patch requests.
  17777. NullFields []string `json:"-"`
  17778. }
  17779. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  17780. type NoMethod NodeTemplateNodeTypeFlexibility
  17781. raw := NoMethod(*s)
  17782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17783. }
  17784. type NodeTemplatesScopedList struct {
  17785. // NodeTemplates: [Output Only] A list of node templates contained in
  17786. // this scope.
  17787. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  17788. // Warning: [Output Only] An informational warning that appears when the
  17789. // node templates list is empty.
  17790. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  17791. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  17792. // unconditionally include in API requests. By default, fields with
  17793. // empty values are omitted from API requests. However, any non-pointer,
  17794. // non-interface field appearing in ForceSendFields will be sent to the
  17795. // server regardless of whether the field is empty or not. This may be
  17796. // used to include empty fields in Patch requests.
  17797. ForceSendFields []string `json:"-"`
  17798. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  17799. // in API requests with the JSON null value. By default, fields with
  17800. // empty values are omitted from API requests. However, any field with
  17801. // an empty value appearing in NullFields will be sent to the server as
  17802. // null. It is an error if a field in this list has a non-empty value.
  17803. // This may be used to include null fields in Patch requests.
  17804. NullFields []string `json:"-"`
  17805. }
  17806. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  17807. type NoMethod NodeTemplatesScopedList
  17808. raw := NoMethod(*s)
  17809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17810. }
  17811. // NodeTemplatesScopedListWarning: [Output Only] An informational
  17812. // warning that appears when the node templates list is empty.
  17813. type NodeTemplatesScopedListWarning struct {
  17814. // Code: [Output Only] A warning code, if applicable. For example,
  17815. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17816. // the response.
  17817. //
  17818. // Possible values:
  17819. // "CLEANUP_FAILED"
  17820. // "DEPRECATED_RESOURCE_USED"
  17821. // "DEPRECATED_TYPE_USED"
  17822. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17823. // "EXPERIMENTAL_TYPE_USED"
  17824. // "EXTERNAL_API_WARNING"
  17825. // "FIELD_VALUE_OVERRIDEN"
  17826. // "INJECTED_KERNELS_DEPRECATED"
  17827. // "MISSING_TYPE_DEPENDENCY"
  17828. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17829. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17830. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17831. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17832. // "NEXT_HOP_NOT_RUNNING"
  17833. // "NOT_CRITICAL_ERROR"
  17834. // "NO_RESULTS_ON_PAGE"
  17835. // "REQUIRED_TOS_AGREEMENT"
  17836. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17837. // "RESOURCE_NOT_DELETED"
  17838. // "SCHEMA_VALIDATION_IGNORED"
  17839. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17840. // "UNDECLARED_PROPERTIES"
  17841. // "UNREACHABLE"
  17842. Code string `json:"code,omitempty"`
  17843. // Data: [Output Only] Metadata about this warning in key: value format.
  17844. // For example:
  17845. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17846. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  17847. // Message: [Output Only] A human-readable description of the warning
  17848. // code.
  17849. Message string `json:"message,omitempty"`
  17850. // ForceSendFields is a list of field names (e.g. "Code") to
  17851. // unconditionally include in API requests. By default, fields with
  17852. // empty values are omitted from API requests. However, any non-pointer,
  17853. // non-interface field appearing in ForceSendFields will be sent to the
  17854. // server regardless of whether the field is empty or not. This may be
  17855. // used to include empty fields in Patch requests.
  17856. ForceSendFields []string `json:"-"`
  17857. // NullFields is a list of field names (e.g. "Code") to include in API
  17858. // requests with the JSON null value. By default, fields with empty
  17859. // values are omitted from API requests. However, any field with an
  17860. // empty value appearing in NullFields will be sent to the server as
  17861. // null. It is an error if a field in this list has a non-empty value.
  17862. // This may be used to include null fields in Patch requests.
  17863. NullFields []string `json:"-"`
  17864. }
  17865. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  17866. type NoMethod NodeTemplatesScopedListWarning
  17867. raw := NoMethod(*s)
  17868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17869. }
  17870. type NodeTemplatesScopedListWarningData struct {
  17871. // Key: [Output Only] A key that provides more detail on the warning
  17872. // being returned. For example, for warnings where there are no results
  17873. // in a list request for a particular zone, this key might be scope and
  17874. // the key value might be the zone name. Other examples might be a key
  17875. // indicating a deprecated resource and a suggested replacement, or a
  17876. // warning about invalid network settings (for example, if an instance
  17877. // attempts to perform IP forwarding but is not enabled for IP
  17878. // forwarding).
  17879. Key string `json:"key,omitempty"`
  17880. // Value: [Output Only] A warning data value corresponding to the key.
  17881. Value string `json:"value,omitempty"`
  17882. // ForceSendFields is a list of field names (e.g. "Key") to
  17883. // unconditionally include in API requests. By default, fields with
  17884. // empty values are omitted from API requests. However, any non-pointer,
  17885. // non-interface field appearing in ForceSendFields will be sent to the
  17886. // server regardless of whether the field is empty or not. This may be
  17887. // used to include empty fields in Patch requests.
  17888. ForceSendFields []string `json:"-"`
  17889. // NullFields is a list of field names (e.g. "Key") to include in API
  17890. // requests with the JSON null value. By default, fields with empty
  17891. // values are omitted from API requests. However, any field with an
  17892. // empty value appearing in NullFields will be sent to the server as
  17893. // null. It is an error if a field in this list has a non-empty value.
  17894. // This may be used to include null fields in Patch requests.
  17895. NullFields []string `json:"-"`
  17896. }
  17897. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  17898. type NoMethod NodeTemplatesScopedListWarningData
  17899. raw := NoMethod(*s)
  17900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17901. }
  17902. // NodeType: A Node Type resource.
  17903. type NodeType struct {
  17904. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  17905. CpuPlatform string `json:"cpuPlatform,omitempty"`
  17906. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17907. // format.
  17908. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17909. // Deprecated: [Output Only] The deprecation status associated with this
  17910. // node type.
  17911. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  17912. // Description: [Output Only] An optional textual description of the
  17913. // resource.
  17914. Description string `json:"description,omitempty"`
  17915. // GuestCpus: [Output Only] The number of virtual CPUs that are
  17916. // available to the node type.
  17917. GuestCpus int64 `json:"guestCpus,omitempty"`
  17918. // Id: [Output Only] The unique identifier for the resource. This
  17919. // identifier is defined by the server.
  17920. Id uint64 `json:"id,omitempty,string"`
  17921. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  17922. // for node types.
  17923. Kind string `json:"kind,omitempty"`
  17924. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  17925. // defined in GB.
  17926. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  17927. // MemoryMb: [Output Only] The amount of physical memory available to
  17928. // the node type, defined in MB.
  17929. MemoryMb int64 `json:"memoryMb,omitempty"`
  17930. // Name: [Output Only] Name of the resource.
  17931. Name string `json:"name,omitempty"`
  17932. // SelfLink: [Output Only] Server-defined URL for the resource.
  17933. SelfLink string `json:"selfLink,omitempty"`
  17934. // Zone: [Output Only] The name of the zone where the node type resides,
  17935. // such as us-central1-a.
  17936. Zone string `json:"zone,omitempty"`
  17937. // ServerResponse contains the HTTP response code and headers from the
  17938. // server.
  17939. googleapi.ServerResponse `json:"-"`
  17940. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  17941. // unconditionally include in API requests. By default, fields with
  17942. // empty values are omitted from API requests. However, any non-pointer,
  17943. // non-interface field appearing in ForceSendFields will be sent to the
  17944. // server regardless of whether the field is empty or not. This may be
  17945. // used to include empty fields in Patch requests.
  17946. ForceSendFields []string `json:"-"`
  17947. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  17948. // in API requests with the JSON null value. By default, fields with
  17949. // empty values are omitted from API requests. However, any field with
  17950. // an empty value appearing in NullFields will be sent to the server as
  17951. // null. It is an error if a field in this list has a non-empty value.
  17952. // This may be used to include null fields in Patch requests.
  17953. NullFields []string `json:"-"`
  17954. }
  17955. func (s *NodeType) MarshalJSON() ([]byte, error) {
  17956. type NoMethod NodeType
  17957. raw := NoMethod(*s)
  17958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17959. }
  17960. type NodeTypeAggregatedList struct {
  17961. // Id: [Output Only] Unique identifier for the resource; defined by the
  17962. // server.
  17963. Id string `json:"id,omitempty"`
  17964. // Items: A list of NodeTypesScopedList resources.
  17965. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  17966. // Kind: [Output Only] Type of resource.Always
  17967. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  17968. Kind string `json:"kind,omitempty"`
  17969. // NextPageToken: [Output Only] This token allows you to get the next
  17970. // page of results for list requests. If the number of results is larger
  17971. // than maxResults, use the nextPageToken as a value for the query
  17972. // parameter pageToken in the next list request. Subsequent list
  17973. // requests will have their own nextPageToken to continue paging through
  17974. // the results.
  17975. NextPageToken string `json:"nextPageToken,omitempty"`
  17976. // SelfLink: [Output Only] Server-defined URL for this resource.
  17977. SelfLink string `json:"selfLink,omitempty"`
  17978. // Warning: [Output Only] Informational warning message.
  17979. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  17980. // ServerResponse contains the HTTP response code and headers from the
  17981. // server.
  17982. googleapi.ServerResponse `json:"-"`
  17983. // ForceSendFields is a list of field names (e.g. "Id") to
  17984. // unconditionally include in API requests. By default, fields with
  17985. // empty values are omitted from API requests. However, any non-pointer,
  17986. // non-interface field appearing in ForceSendFields will be sent to the
  17987. // server regardless of whether the field is empty or not. This may be
  17988. // used to include empty fields in Patch requests.
  17989. ForceSendFields []string `json:"-"`
  17990. // NullFields is a list of field names (e.g. "Id") to include in API
  17991. // requests with the JSON null value. By default, fields with empty
  17992. // values are omitted from API requests. However, any field with an
  17993. // empty value appearing in NullFields will be sent to the server as
  17994. // null. It is an error if a field in this list has a non-empty value.
  17995. // This may be used to include null fields in Patch requests.
  17996. NullFields []string `json:"-"`
  17997. }
  17998. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  17999. type NoMethod NodeTypeAggregatedList
  18000. raw := NoMethod(*s)
  18001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18002. }
  18003. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  18004. // message.
  18005. type NodeTypeAggregatedListWarning struct {
  18006. // Code: [Output Only] A warning code, if applicable. For example,
  18007. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18008. // the response.
  18009. //
  18010. // Possible values:
  18011. // "CLEANUP_FAILED"
  18012. // "DEPRECATED_RESOURCE_USED"
  18013. // "DEPRECATED_TYPE_USED"
  18014. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18015. // "EXPERIMENTAL_TYPE_USED"
  18016. // "EXTERNAL_API_WARNING"
  18017. // "FIELD_VALUE_OVERRIDEN"
  18018. // "INJECTED_KERNELS_DEPRECATED"
  18019. // "MISSING_TYPE_DEPENDENCY"
  18020. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18021. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18022. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18023. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18024. // "NEXT_HOP_NOT_RUNNING"
  18025. // "NOT_CRITICAL_ERROR"
  18026. // "NO_RESULTS_ON_PAGE"
  18027. // "REQUIRED_TOS_AGREEMENT"
  18028. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18029. // "RESOURCE_NOT_DELETED"
  18030. // "SCHEMA_VALIDATION_IGNORED"
  18031. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18032. // "UNDECLARED_PROPERTIES"
  18033. // "UNREACHABLE"
  18034. Code string `json:"code,omitempty"`
  18035. // Data: [Output Only] Metadata about this warning in key: value format.
  18036. // For example:
  18037. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18038. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  18039. // Message: [Output Only] A human-readable description of the warning
  18040. // code.
  18041. Message string `json:"message,omitempty"`
  18042. // ForceSendFields is a list of field names (e.g. "Code") to
  18043. // unconditionally include in API requests. By default, fields with
  18044. // empty values are omitted from API requests. However, any non-pointer,
  18045. // non-interface field appearing in ForceSendFields will be sent to the
  18046. // server regardless of whether the field is empty or not. This may be
  18047. // used to include empty fields in Patch requests.
  18048. ForceSendFields []string `json:"-"`
  18049. // NullFields is a list of field names (e.g. "Code") to include in API
  18050. // requests with the JSON null value. By default, fields with empty
  18051. // values are omitted from API requests. However, any field with an
  18052. // empty value appearing in NullFields will be sent to the server as
  18053. // null. It is an error if a field in this list has a non-empty value.
  18054. // This may be used to include null fields in Patch requests.
  18055. NullFields []string `json:"-"`
  18056. }
  18057. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18058. type NoMethod NodeTypeAggregatedListWarning
  18059. raw := NoMethod(*s)
  18060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18061. }
  18062. type NodeTypeAggregatedListWarningData struct {
  18063. // Key: [Output Only] A key that provides more detail on the warning
  18064. // being returned. For example, for warnings where there are no results
  18065. // in a list request for a particular zone, this key might be scope and
  18066. // the key value might be the zone name. Other examples might be a key
  18067. // indicating a deprecated resource and a suggested replacement, or a
  18068. // warning about invalid network settings (for example, if an instance
  18069. // attempts to perform IP forwarding but is not enabled for IP
  18070. // forwarding).
  18071. Key string `json:"key,omitempty"`
  18072. // Value: [Output Only] A warning data value corresponding to the key.
  18073. Value string `json:"value,omitempty"`
  18074. // ForceSendFields is a list of field names (e.g. "Key") to
  18075. // unconditionally include in API requests. By default, fields with
  18076. // empty values are omitted from API requests. However, any non-pointer,
  18077. // non-interface field appearing in ForceSendFields will be sent to the
  18078. // server regardless of whether the field is empty or not. This may be
  18079. // used to include empty fields in Patch requests.
  18080. ForceSendFields []string `json:"-"`
  18081. // NullFields is a list of field names (e.g. "Key") to include in API
  18082. // requests with the JSON null value. By default, fields with empty
  18083. // values are omitted from API requests. However, any field with an
  18084. // empty value appearing in NullFields will be sent to the server as
  18085. // null. It is an error if a field in this list has a non-empty value.
  18086. // This may be used to include null fields in Patch requests.
  18087. NullFields []string `json:"-"`
  18088. }
  18089. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18090. type NoMethod NodeTypeAggregatedListWarningData
  18091. raw := NoMethod(*s)
  18092. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18093. }
  18094. // NodeTypeList: Contains a list of node types.
  18095. type NodeTypeList struct {
  18096. // Id: [Output Only] Unique identifier for the resource; defined by the
  18097. // server.
  18098. Id string `json:"id,omitempty"`
  18099. // Items: A list of NodeType resources.
  18100. Items []*NodeType `json:"items,omitempty"`
  18101. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  18102. // lists of node types.
  18103. Kind string `json:"kind,omitempty"`
  18104. // NextPageToken: [Output Only] This token allows you to get the next
  18105. // page of results for list requests. If the number of results is larger
  18106. // than maxResults, use the nextPageToken as a value for the query
  18107. // parameter pageToken in the next list request. Subsequent list
  18108. // requests will have their own nextPageToken to continue paging through
  18109. // the results.
  18110. NextPageToken string `json:"nextPageToken,omitempty"`
  18111. // SelfLink: [Output Only] Server-defined URL for this resource.
  18112. SelfLink string `json:"selfLink,omitempty"`
  18113. // Warning: [Output Only] Informational warning message.
  18114. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  18115. // ServerResponse contains the HTTP response code and headers from the
  18116. // server.
  18117. googleapi.ServerResponse `json:"-"`
  18118. // ForceSendFields is a list of field names (e.g. "Id") to
  18119. // unconditionally include in API requests. By default, fields with
  18120. // empty values are omitted from API requests. However, any non-pointer,
  18121. // non-interface field appearing in ForceSendFields will be sent to the
  18122. // server regardless of whether the field is empty or not. This may be
  18123. // used to include empty fields in Patch requests.
  18124. ForceSendFields []string `json:"-"`
  18125. // NullFields is a list of field names (e.g. "Id") to include in API
  18126. // requests with the JSON null value. By default, fields with empty
  18127. // values are omitted from API requests. However, any field with an
  18128. // empty value appearing in NullFields will be sent to the server as
  18129. // null. It is an error if a field in this list has a non-empty value.
  18130. // This may be used to include null fields in Patch requests.
  18131. NullFields []string `json:"-"`
  18132. }
  18133. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  18134. type NoMethod NodeTypeList
  18135. raw := NoMethod(*s)
  18136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18137. }
  18138. // NodeTypeListWarning: [Output Only] Informational warning message.
  18139. type NodeTypeListWarning struct {
  18140. // Code: [Output Only] A warning code, if applicable. For example,
  18141. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18142. // the response.
  18143. //
  18144. // Possible values:
  18145. // "CLEANUP_FAILED"
  18146. // "DEPRECATED_RESOURCE_USED"
  18147. // "DEPRECATED_TYPE_USED"
  18148. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18149. // "EXPERIMENTAL_TYPE_USED"
  18150. // "EXTERNAL_API_WARNING"
  18151. // "FIELD_VALUE_OVERRIDEN"
  18152. // "INJECTED_KERNELS_DEPRECATED"
  18153. // "MISSING_TYPE_DEPENDENCY"
  18154. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18155. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18156. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18157. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18158. // "NEXT_HOP_NOT_RUNNING"
  18159. // "NOT_CRITICAL_ERROR"
  18160. // "NO_RESULTS_ON_PAGE"
  18161. // "REQUIRED_TOS_AGREEMENT"
  18162. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18163. // "RESOURCE_NOT_DELETED"
  18164. // "SCHEMA_VALIDATION_IGNORED"
  18165. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18166. // "UNDECLARED_PROPERTIES"
  18167. // "UNREACHABLE"
  18168. Code string `json:"code,omitempty"`
  18169. // Data: [Output Only] Metadata about this warning in key: value format.
  18170. // For example:
  18171. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18172. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  18173. // Message: [Output Only] A human-readable description of the warning
  18174. // code.
  18175. Message string `json:"message,omitempty"`
  18176. // ForceSendFields is a list of field names (e.g. "Code") to
  18177. // unconditionally include in API requests. By default, fields with
  18178. // empty values are omitted from API requests. However, any non-pointer,
  18179. // non-interface field appearing in ForceSendFields will be sent to the
  18180. // server regardless of whether the field is empty or not. This may be
  18181. // used to include empty fields in Patch requests.
  18182. ForceSendFields []string `json:"-"`
  18183. // NullFields is a list of field names (e.g. "Code") to include in API
  18184. // requests with the JSON null value. By default, fields with empty
  18185. // values are omitted from API requests. However, any field with an
  18186. // empty value appearing in NullFields will be sent to the server as
  18187. // null. It is an error if a field in this list has a non-empty value.
  18188. // This may be used to include null fields in Patch requests.
  18189. NullFields []string `json:"-"`
  18190. }
  18191. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  18192. type NoMethod NodeTypeListWarning
  18193. raw := NoMethod(*s)
  18194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18195. }
  18196. type NodeTypeListWarningData struct {
  18197. // Key: [Output Only] A key that provides more detail on the warning
  18198. // being returned. For example, for warnings where there are no results
  18199. // in a list request for a particular zone, this key might be scope and
  18200. // the key value might be the zone name. Other examples might be a key
  18201. // indicating a deprecated resource and a suggested replacement, or a
  18202. // warning about invalid network settings (for example, if an instance
  18203. // attempts to perform IP forwarding but is not enabled for IP
  18204. // forwarding).
  18205. Key string `json:"key,omitempty"`
  18206. // Value: [Output Only] A warning data value corresponding to the key.
  18207. Value string `json:"value,omitempty"`
  18208. // ForceSendFields is a list of field names (e.g. "Key") to
  18209. // unconditionally include in API requests. By default, fields with
  18210. // empty values are omitted from API requests. However, any non-pointer,
  18211. // non-interface field appearing in ForceSendFields will be sent to the
  18212. // server regardless of whether the field is empty or not. This may be
  18213. // used to include empty fields in Patch requests.
  18214. ForceSendFields []string `json:"-"`
  18215. // NullFields is a list of field names (e.g. "Key") to include in API
  18216. // requests with the JSON null value. By default, fields with empty
  18217. // values are omitted from API requests. However, any field with an
  18218. // empty value appearing in NullFields will be sent to the server as
  18219. // null. It is an error if a field in this list has a non-empty value.
  18220. // This may be used to include null fields in Patch requests.
  18221. NullFields []string `json:"-"`
  18222. }
  18223. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  18224. type NoMethod NodeTypeListWarningData
  18225. raw := NoMethod(*s)
  18226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18227. }
  18228. type NodeTypesScopedList struct {
  18229. // NodeTypes: [Output Only] A list of node types contained in this
  18230. // scope.
  18231. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  18232. // Warning: [Output Only] An informational warning that appears when the
  18233. // node types list is empty.
  18234. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  18235. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  18236. // unconditionally include in API requests. By default, fields with
  18237. // empty values are omitted from API requests. However, any non-pointer,
  18238. // non-interface field appearing in ForceSendFields will be sent to the
  18239. // server regardless of whether the field is empty or not. This may be
  18240. // used to include empty fields in Patch requests.
  18241. ForceSendFields []string `json:"-"`
  18242. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  18243. // API requests with the JSON null value. By default, fields with empty
  18244. // values are omitted from API requests. However, any field with an
  18245. // empty value appearing in NullFields will be sent to the server as
  18246. // null. It is an error if a field in this list has a non-empty value.
  18247. // This may be used to include null fields in Patch requests.
  18248. NullFields []string `json:"-"`
  18249. }
  18250. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  18251. type NoMethod NodeTypesScopedList
  18252. raw := NoMethod(*s)
  18253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18254. }
  18255. // NodeTypesScopedListWarning: [Output Only] An informational warning
  18256. // that appears when the node types list is empty.
  18257. type NodeTypesScopedListWarning struct {
  18258. // Code: [Output Only] A warning code, if applicable. For example,
  18259. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18260. // the response.
  18261. //
  18262. // Possible values:
  18263. // "CLEANUP_FAILED"
  18264. // "DEPRECATED_RESOURCE_USED"
  18265. // "DEPRECATED_TYPE_USED"
  18266. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18267. // "EXPERIMENTAL_TYPE_USED"
  18268. // "EXTERNAL_API_WARNING"
  18269. // "FIELD_VALUE_OVERRIDEN"
  18270. // "INJECTED_KERNELS_DEPRECATED"
  18271. // "MISSING_TYPE_DEPENDENCY"
  18272. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18273. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18274. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18275. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18276. // "NEXT_HOP_NOT_RUNNING"
  18277. // "NOT_CRITICAL_ERROR"
  18278. // "NO_RESULTS_ON_PAGE"
  18279. // "REQUIRED_TOS_AGREEMENT"
  18280. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18281. // "RESOURCE_NOT_DELETED"
  18282. // "SCHEMA_VALIDATION_IGNORED"
  18283. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18284. // "UNDECLARED_PROPERTIES"
  18285. // "UNREACHABLE"
  18286. Code string `json:"code,omitempty"`
  18287. // Data: [Output Only] Metadata about this warning in key: value format.
  18288. // For example:
  18289. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18290. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  18291. // Message: [Output Only] A human-readable description of the warning
  18292. // code.
  18293. Message string `json:"message,omitempty"`
  18294. // ForceSendFields is a list of field names (e.g. "Code") to
  18295. // unconditionally include in API requests. By default, fields with
  18296. // empty values are omitted from API requests. However, any non-pointer,
  18297. // non-interface field appearing in ForceSendFields will be sent to the
  18298. // server regardless of whether the field is empty or not. This may be
  18299. // used to include empty fields in Patch requests.
  18300. ForceSendFields []string `json:"-"`
  18301. // NullFields is a list of field names (e.g. "Code") to include in API
  18302. // requests with the JSON null value. By default, fields with empty
  18303. // values are omitted from API requests. However, any field with an
  18304. // empty value appearing in NullFields will be sent to the server as
  18305. // null. It is an error if a field in this list has a non-empty value.
  18306. // This may be used to include null fields in Patch requests.
  18307. NullFields []string `json:"-"`
  18308. }
  18309. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  18310. type NoMethod NodeTypesScopedListWarning
  18311. raw := NoMethod(*s)
  18312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18313. }
  18314. type NodeTypesScopedListWarningData struct {
  18315. // Key: [Output Only] A key that provides more detail on the warning
  18316. // being returned. For example, for warnings where there are no results
  18317. // in a list request for a particular zone, this key might be scope and
  18318. // the key value might be the zone name. Other examples might be a key
  18319. // indicating a deprecated resource and a suggested replacement, or a
  18320. // warning about invalid network settings (for example, if an instance
  18321. // attempts to perform IP forwarding but is not enabled for IP
  18322. // forwarding).
  18323. Key string `json:"key,omitempty"`
  18324. // Value: [Output Only] A warning data value corresponding to the key.
  18325. Value string `json:"value,omitempty"`
  18326. // ForceSendFields is a list of field names (e.g. "Key") to
  18327. // unconditionally include in API requests. By default, fields with
  18328. // empty values are omitted from API requests. However, any non-pointer,
  18329. // non-interface field appearing in ForceSendFields will be sent to the
  18330. // server regardless of whether the field is empty or not. This may be
  18331. // used to include empty fields in Patch requests.
  18332. ForceSendFields []string `json:"-"`
  18333. // NullFields is a list of field names (e.g. "Key") to include in API
  18334. // requests with the JSON null value. By default, fields with empty
  18335. // values are omitted from API requests. However, any field with an
  18336. // empty value appearing in NullFields will be sent to the server as
  18337. // null. It is an error if a field in this list has a non-empty value.
  18338. // This may be used to include null fields in Patch requests.
  18339. NullFields []string `json:"-"`
  18340. }
  18341. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  18342. type NoMethod NodeTypesScopedListWarningData
  18343. raw := NoMethod(*s)
  18344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18345. }
  18346. // Operation: An Operation resource, used to manage asynchronous API
  18347. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  18348. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  18349. // (== resource_for beta.regionOperations ==) (== resource_for
  18350. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  18351. type Operation struct {
  18352. // ClientOperationId: [Output Only] The value of `requestId` if you
  18353. // provided it in the request. Not present otherwise.
  18354. ClientOperationId string `json:"clientOperationId,omitempty"`
  18355. // CreationTimestamp: [Deprecated] This field is deprecated.
  18356. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18357. // Description: [Output Only] A textual description of the operation,
  18358. // which is set when the operation is created.
  18359. Description string `json:"description,omitempty"`
  18360. // EndTime: [Output Only] The time that this operation was completed.
  18361. // This value is in RFC3339 text format.
  18362. EndTime string `json:"endTime,omitempty"`
  18363. // Error: [Output Only] If errors are generated during processing of the
  18364. // operation, this field will be populated.
  18365. Error *OperationError `json:"error,omitempty"`
  18366. // HttpErrorMessage: [Output Only] If the operation fails, this field
  18367. // contains the HTTP error message that was returned, such as NOT FOUND.
  18368. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  18369. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  18370. // contains the HTTP error status code that was returned. For example, a
  18371. // 404 means the resource was not found.
  18372. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  18373. // Id: [Output Only] The unique identifier for the resource. This
  18374. // identifier is defined by the server.
  18375. Id uint64 `json:"id,omitempty,string"`
  18376. // InsertTime: [Output Only] The time that this operation was requested.
  18377. // This value is in RFC3339 text format.
  18378. InsertTime string `json:"insertTime,omitempty"`
  18379. // Kind: [Output Only] Type of the resource. Always compute#operation
  18380. // for Operation resources.
  18381. Kind string `json:"kind,omitempty"`
  18382. // Name: [Output Only] Name of the resource.
  18383. Name string `json:"name,omitempty"`
  18384. // OperationType: [Output Only] The type of operation, such as insert,
  18385. // update, or delete, and so on.
  18386. OperationType string `json:"operationType,omitempty"`
  18387. // Progress: [Output Only] An optional progress indicator that ranges
  18388. // from 0 to 100. There is no requirement that this be linear or support
  18389. // any granularity of operations. This should not be used to guess when
  18390. // the operation will be complete. This number should monotonically
  18391. // increase as the operation progresses.
  18392. Progress int64 `json:"progress,omitempty"`
  18393. // Region: [Output Only] The URL of the region where the operation
  18394. // resides. Only available when performing regional operations. You must
  18395. // specify this field as part of the HTTP request URL. It is not
  18396. // settable as a field in the request body.
  18397. Region string `json:"region,omitempty"`
  18398. // SelfLink: [Output Only] Server-defined URL for the resource.
  18399. SelfLink string `json:"selfLink,omitempty"`
  18400. // StartTime: [Output Only] The time that this operation was started by
  18401. // the server. This value is in RFC3339 text format.
  18402. StartTime string `json:"startTime,omitempty"`
  18403. // Status: [Output Only] The status of the operation, which can be one
  18404. // of the following: PENDING, RUNNING, or DONE.
  18405. //
  18406. // Possible values:
  18407. // "DONE"
  18408. // "PENDING"
  18409. // "RUNNING"
  18410. Status string `json:"status,omitempty"`
  18411. // StatusMessage: [Output Only] An optional textual description of the
  18412. // current status of the operation.
  18413. StatusMessage string `json:"statusMessage,omitempty"`
  18414. // TargetId: [Output Only] The unique target ID, which identifies a
  18415. // specific incarnation of the target resource.
  18416. TargetId uint64 `json:"targetId,omitempty,string"`
  18417. // TargetLink: [Output Only] The URL of the resource that the operation
  18418. // modifies. For operations related to creating a snapshot, this points
  18419. // to the persistent disk that the snapshot was created from.
  18420. TargetLink string `json:"targetLink,omitempty"`
  18421. // User: [Output Only] User who requested the operation, for example:
  18422. // user@example.com.
  18423. User string `json:"user,omitempty"`
  18424. // Warnings: [Output Only] If warning messages are generated during
  18425. // processing of the operation, this field will be populated.
  18426. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  18427. // Zone: [Output Only] The URL of the zone where the operation resides.
  18428. // Only available when performing per-zone operations. You must specify
  18429. // this field as part of the HTTP request URL. It is not settable as a
  18430. // field in the request body.
  18431. Zone string `json:"zone,omitempty"`
  18432. // ServerResponse contains the HTTP response code and headers from the
  18433. // server.
  18434. googleapi.ServerResponse `json:"-"`
  18435. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  18436. // to unconditionally include in API requests. By default, fields with
  18437. // empty values are omitted from API requests. However, any non-pointer,
  18438. // non-interface field appearing in ForceSendFields will be sent to the
  18439. // server regardless of whether the field is empty or not. This may be
  18440. // used to include empty fields in Patch requests.
  18441. ForceSendFields []string `json:"-"`
  18442. // NullFields is a list of field names (e.g. "ClientOperationId") to
  18443. // include in API requests with the JSON null value. By default, fields
  18444. // with empty values are omitted from API requests. However, any field
  18445. // with an empty value appearing in NullFields will be sent to the
  18446. // server as null. It is an error if a field in this list has a
  18447. // non-empty value. This may be used to include null fields in Patch
  18448. // requests.
  18449. NullFields []string `json:"-"`
  18450. }
  18451. func (s *Operation) MarshalJSON() ([]byte, error) {
  18452. type NoMethod Operation
  18453. raw := NoMethod(*s)
  18454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18455. }
  18456. // OperationError: [Output Only] If errors are generated during
  18457. // processing of the operation, this field will be populated.
  18458. type OperationError struct {
  18459. // Errors: [Output Only] The array of errors encountered while
  18460. // processing this operation.
  18461. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  18462. // ForceSendFields is a list of field names (e.g. "Errors") to
  18463. // unconditionally include in API requests. By default, fields with
  18464. // empty values are omitted from API requests. However, any non-pointer,
  18465. // non-interface field appearing in ForceSendFields will be sent to the
  18466. // server regardless of whether the field is empty or not. This may be
  18467. // used to include empty fields in Patch requests.
  18468. ForceSendFields []string `json:"-"`
  18469. // NullFields is a list of field names (e.g. "Errors") to include in API
  18470. // requests with the JSON null value. By default, fields with empty
  18471. // values are omitted from API requests. However, any field with an
  18472. // empty value appearing in NullFields will be sent to the server as
  18473. // null. It is an error if a field in this list has a non-empty value.
  18474. // This may be used to include null fields in Patch requests.
  18475. NullFields []string `json:"-"`
  18476. }
  18477. func (s *OperationError) MarshalJSON() ([]byte, error) {
  18478. type NoMethod OperationError
  18479. raw := NoMethod(*s)
  18480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18481. }
  18482. type OperationErrorErrors struct {
  18483. // Code: [Output Only] The error type identifier for this error.
  18484. Code string `json:"code,omitempty"`
  18485. // Location: [Output Only] Indicates the field in the request that
  18486. // caused the error. This property is optional.
  18487. Location string `json:"location,omitempty"`
  18488. // Message: [Output Only] An optional, human-readable error message.
  18489. Message string `json:"message,omitempty"`
  18490. // ForceSendFields is a list of field names (e.g. "Code") to
  18491. // unconditionally include in API requests. By default, fields with
  18492. // empty values are omitted from API requests. However, any non-pointer,
  18493. // non-interface field appearing in ForceSendFields will be sent to the
  18494. // server regardless of whether the field is empty or not. This may be
  18495. // used to include empty fields in Patch requests.
  18496. ForceSendFields []string `json:"-"`
  18497. // NullFields is a list of field names (e.g. "Code") to include in API
  18498. // requests with the JSON null value. By default, fields with empty
  18499. // values are omitted from API requests. However, any field with an
  18500. // empty value appearing in NullFields will be sent to the server as
  18501. // null. It is an error if a field in this list has a non-empty value.
  18502. // This may be used to include null fields in Patch requests.
  18503. NullFields []string `json:"-"`
  18504. }
  18505. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  18506. type NoMethod OperationErrorErrors
  18507. raw := NoMethod(*s)
  18508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18509. }
  18510. type OperationWarnings struct {
  18511. // Code: [Output Only] A warning code, if applicable. For example,
  18512. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18513. // the response.
  18514. //
  18515. // Possible values:
  18516. // "CLEANUP_FAILED"
  18517. // "DEPRECATED_RESOURCE_USED"
  18518. // "DEPRECATED_TYPE_USED"
  18519. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18520. // "EXPERIMENTAL_TYPE_USED"
  18521. // "EXTERNAL_API_WARNING"
  18522. // "FIELD_VALUE_OVERRIDEN"
  18523. // "INJECTED_KERNELS_DEPRECATED"
  18524. // "MISSING_TYPE_DEPENDENCY"
  18525. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18526. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18527. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18528. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18529. // "NEXT_HOP_NOT_RUNNING"
  18530. // "NOT_CRITICAL_ERROR"
  18531. // "NO_RESULTS_ON_PAGE"
  18532. // "REQUIRED_TOS_AGREEMENT"
  18533. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18534. // "RESOURCE_NOT_DELETED"
  18535. // "SCHEMA_VALIDATION_IGNORED"
  18536. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18537. // "UNDECLARED_PROPERTIES"
  18538. // "UNREACHABLE"
  18539. Code string `json:"code,omitempty"`
  18540. // Data: [Output Only] Metadata about this warning in key: value format.
  18541. // For example:
  18542. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18543. Data []*OperationWarningsData `json:"data,omitempty"`
  18544. // Message: [Output Only] A human-readable description of the warning
  18545. // code.
  18546. Message string `json:"message,omitempty"`
  18547. // ForceSendFields is a list of field names (e.g. "Code") to
  18548. // unconditionally include in API requests. By default, fields with
  18549. // empty values are omitted from API requests. However, any non-pointer,
  18550. // non-interface field appearing in ForceSendFields will be sent to the
  18551. // server regardless of whether the field is empty or not. This may be
  18552. // used to include empty fields in Patch requests.
  18553. ForceSendFields []string `json:"-"`
  18554. // NullFields is a list of field names (e.g. "Code") to include in API
  18555. // requests with the JSON null value. By default, fields with empty
  18556. // values are omitted from API requests. However, any field with an
  18557. // empty value appearing in NullFields will be sent to the server as
  18558. // null. It is an error if a field in this list has a non-empty value.
  18559. // This may be used to include null fields in Patch requests.
  18560. NullFields []string `json:"-"`
  18561. }
  18562. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  18563. type NoMethod OperationWarnings
  18564. raw := NoMethod(*s)
  18565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18566. }
  18567. type OperationWarningsData struct {
  18568. // Key: [Output Only] A key that provides more detail on the warning
  18569. // being returned. For example, for warnings where there are no results
  18570. // in a list request for a particular zone, this key might be scope and
  18571. // the key value might be the zone name. Other examples might be a key
  18572. // indicating a deprecated resource and a suggested replacement, or a
  18573. // warning about invalid network settings (for example, if an instance
  18574. // attempts to perform IP forwarding but is not enabled for IP
  18575. // forwarding).
  18576. Key string `json:"key,omitempty"`
  18577. // Value: [Output Only] A warning data value corresponding to the key.
  18578. Value string `json:"value,omitempty"`
  18579. // ForceSendFields is a list of field names (e.g. "Key") to
  18580. // unconditionally include in API requests. By default, fields with
  18581. // empty values are omitted from API requests. However, any non-pointer,
  18582. // non-interface field appearing in ForceSendFields will be sent to the
  18583. // server regardless of whether the field is empty or not. This may be
  18584. // used to include empty fields in Patch requests.
  18585. ForceSendFields []string `json:"-"`
  18586. // NullFields is a list of field names (e.g. "Key") to include in API
  18587. // requests with the JSON null value. By default, fields with empty
  18588. // values are omitted from API requests. However, any field with an
  18589. // empty value appearing in NullFields will be sent to the server as
  18590. // null. It is an error if a field in this list has a non-empty value.
  18591. // This may be used to include null fields in Patch requests.
  18592. NullFields []string `json:"-"`
  18593. }
  18594. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  18595. type NoMethod OperationWarningsData
  18596. raw := NoMethod(*s)
  18597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18598. }
  18599. type OperationAggregatedList struct {
  18600. // Id: [Output Only] The unique identifier for the resource. This
  18601. // identifier is defined by the server.
  18602. Id string `json:"id,omitempty"`
  18603. // Items: [Output Only] A map of scoped operation lists.
  18604. Items map[string]OperationsScopedList `json:"items,omitempty"`
  18605. // Kind: [Output Only] Type of resource. Always
  18606. // compute#operationAggregatedList for aggregated lists of operations.
  18607. Kind string `json:"kind,omitempty"`
  18608. // NextPageToken: [Output Only] This token allows you to get the next
  18609. // page of results for list requests. If the number of results is larger
  18610. // than maxResults, use the nextPageToken as a value for the query
  18611. // parameter pageToken in the next list request. Subsequent list
  18612. // requests will have their own nextPageToken to continue paging through
  18613. // the results.
  18614. NextPageToken string `json:"nextPageToken,omitempty"`
  18615. // SelfLink: [Output Only] Server-defined URL for this resource.
  18616. SelfLink string `json:"selfLink,omitempty"`
  18617. // Warning: [Output Only] Informational warning message.
  18618. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  18619. // ServerResponse contains the HTTP response code and headers from the
  18620. // server.
  18621. googleapi.ServerResponse `json:"-"`
  18622. // ForceSendFields is a list of field names (e.g. "Id") to
  18623. // unconditionally include in API requests. By default, fields with
  18624. // empty values are omitted from API requests. However, any non-pointer,
  18625. // non-interface field appearing in ForceSendFields will be sent to the
  18626. // server regardless of whether the field is empty or not. This may be
  18627. // used to include empty fields in Patch requests.
  18628. ForceSendFields []string `json:"-"`
  18629. // NullFields is a list of field names (e.g. "Id") to include in API
  18630. // requests with the JSON null value. By default, fields with empty
  18631. // values are omitted from API requests. However, any field with an
  18632. // empty value appearing in NullFields will be sent to the server as
  18633. // null. It is an error if a field in this list has a non-empty value.
  18634. // This may be used to include null fields in Patch requests.
  18635. NullFields []string `json:"-"`
  18636. }
  18637. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  18638. type NoMethod OperationAggregatedList
  18639. raw := NoMethod(*s)
  18640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18641. }
  18642. // OperationAggregatedListWarning: [Output Only] Informational warning
  18643. // message.
  18644. type OperationAggregatedListWarning struct {
  18645. // Code: [Output Only] A warning code, if applicable. For example,
  18646. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18647. // the response.
  18648. //
  18649. // Possible values:
  18650. // "CLEANUP_FAILED"
  18651. // "DEPRECATED_RESOURCE_USED"
  18652. // "DEPRECATED_TYPE_USED"
  18653. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18654. // "EXPERIMENTAL_TYPE_USED"
  18655. // "EXTERNAL_API_WARNING"
  18656. // "FIELD_VALUE_OVERRIDEN"
  18657. // "INJECTED_KERNELS_DEPRECATED"
  18658. // "MISSING_TYPE_DEPENDENCY"
  18659. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18660. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18661. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18662. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18663. // "NEXT_HOP_NOT_RUNNING"
  18664. // "NOT_CRITICAL_ERROR"
  18665. // "NO_RESULTS_ON_PAGE"
  18666. // "REQUIRED_TOS_AGREEMENT"
  18667. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18668. // "RESOURCE_NOT_DELETED"
  18669. // "SCHEMA_VALIDATION_IGNORED"
  18670. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18671. // "UNDECLARED_PROPERTIES"
  18672. // "UNREACHABLE"
  18673. Code string `json:"code,omitempty"`
  18674. // Data: [Output Only] Metadata about this warning in key: value format.
  18675. // For example:
  18676. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18677. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  18678. // Message: [Output Only] A human-readable description of the warning
  18679. // code.
  18680. Message string `json:"message,omitempty"`
  18681. // ForceSendFields is a list of field names (e.g. "Code") to
  18682. // unconditionally include in API requests. By default, fields with
  18683. // empty values are omitted from API requests. However, any non-pointer,
  18684. // non-interface field appearing in ForceSendFields will be sent to the
  18685. // server regardless of whether the field is empty or not. This may be
  18686. // used to include empty fields in Patch requests.
  18687. ForceSendFields []string `json:"-"`
  18688. // NullFields is a list of field names (e.g. "Code") to include in API
  18689. // requests with the JSON null value. By default, fields with empty
  18690. // values are omitted from API requests. However, any field with an
  18691. // empty value appearing in NullFields will be sent to the server as
  18692. // null. It is an error if a field in this list has a non-empty value.
  18693. // This may be used to include null fields in Patch requests.
  18694. NullFields []string `json:"-"`
  18695. }
  18696. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18697. type NoMethod OperationAggregatedListWarning
  18698. raw := NoMethod(*s)
  18699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18700. }
  18701. type OperationAggregatedListWarningData struct {
  18702. // Key: [Output Only] A key that provides more detail on the warning
  18703. // being returned. For example, for warnings where there are no results
  18704. // in a list request for a particular zone, this key might be scope and
  18705. // the key value might be the zone name. Other examples might be a key
  18706. // indicating a deprecated resource and a suggested replacement, or a
  18707. // warning about invalid network settings (for example, if an instance
  18708. // attempts to perform IP forwarding but is not enabled for IP
  18709. // forwarding).
  18710. Key string `json:"key,omitempty"`
  18711. // Value: [Output Only] A warning data value corresponding to the key.
  18712. Value string `json:"value,omitempty"`
  18713. // ForceSendFields is a list of field names (e.g. "Key") to
  18714. // unconditionally include in API requests. By default, fields with
  18715. // empty values are omitted from API requests. However, any non-pointer,
  18716. // non-interface field appearing in ForceSendFields will be sent to the
  18717. // server regardless of whether the field is empty or not. This may be
  18718. // used to include empty fields in Patch requests.
  18719. ForceSendFields []string `json:"-"`
  18720. // NullFields is a list of field names (e.g. "Key") to include in API
  18721. // requests with the JSON null value. By default, fields with empty
  18722. // values are omitted from API requests. However, any field with an
  18723. // empty value appearing in NullFields will be sent to the server as
  18724. // null. It is an error if a field in this list has a non-empty value.
  18725. // This may be used to include null fields in Patch requests.
  18726. NullFields []string `json:"-"`
  18727. }
  18728. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18729. type NoMethod OperationAggregatedListWarningData
  18730. raw := NoMethod(*s)
  18731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18732. }
  18733. // OperationList: Contains a list of Operation resources.
  18734. type OperationList struct {
  18735. // Id: [Output Only] The unique identifier for the resource. This
  18736. // identifier is defined by the server.
  18737. Id string `json:"id,omitempty"`
  18738. // Items: [Output Only] A list of Operation resources.
  18739. Items []*Operation `json:"items,omitempty"`
  18740. // Kind: [Output Only] Type of resource. Always compute#operations for
  18741. // Operations resource.
  18742. Kind string `json:"kind,omitempty"`
  18743. // NextPageToken: [Output Only] This token allows you to get the next
  18744. // page of results for list requests. If the number of results is larger
  18745. // than maxResults, use the nextPageToken as a value for the query
  18746. // parameter pageToken in the next list request. Subsequent list
  18747. // requests will have their own nextPageToken to continue paging through
  18748. // the results.
  18749. NextPageToken string `json:"nextPageToken,omitempty"`
  18750. // SelfLink: [Output Only] Server-defined URL for this resource.
  18751. SelfLink string `json:"selfLink,omitempty"`
  18752. // Warning: [Output Only] Informational warning message.
  18753. Warning *OperationListWarning `json:"warning,omitempty"`
  18754. // ServerResponse contains the HTTP response code and headers from the
  18755. // server.
  18756. googleapi.ServerResponse `json:"-"`
  18757. // ForceSendFields is a list of field names (e.g. "Id") to
  18758. // unconditionally include in API requests. By default, fields with
  18759. // empty values are omitted from API requests. However, any non-pointer,
  18760. // non-interface field appearing in ForceSendFields will be sent to the
  18761. // server regardless of whether the field is empty or not. This may be
  18762. // used to include empty fields in Patch requests.
  18763. ForceSendFields []string `json:"-"`
  18764. // NullFields is a list of field names (e.g. "Id") to include in API
  18765. // requests with the JSON null value. By default, fields with empty
  18766. // values are omitted from API requests. However, any field with an
  18767. // empty value appearing in NullFields will be sent to the server as
  18768. // null. It is an error if a field in this list has a non-empty value.
  18769. // This may be used to include null fields in Patch requests.
  18770. NullFields []string `json:"-"`
  18771. }
  18772. func (s *OperationList) MarshalJSON() ([]byte, error) {
  18773. type NoMethod OperationList
  18774. raw := NoMethod(*s)
  18775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18776. }
  18777. // OperationListWarning: [Output Only] Informational warning message.
  18778. type OperationListWarning struct {
  18779. // Code: [Output Only] A warning code, if applicable. For example,
  18780. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18781. // the response.
  18782. //
  18783. // Possible values:
  18784. // "CLEANUP_FAILED"
  18785. // "DEPRECATED_RESOURCE_USED"
  18786. // "DEPRECATED_TYPE_USED"
  18787. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18788. // "EXPERIMENTAL_TYPE_USED"
  18789. // "EXTERNAL_API_WARNING"
  18790. // "FIELD_VALUE_OVERRIDEN"
  18791. // "INJECTED_KERNELS_DEPRECATED"
  18792. // "MISSING_TYPE_DEPENDENCY"
  18793. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18794. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18795. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18796. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18797. // "NEXT_HOP_NOT_RUNNING"
  18798. // "NOT_CRITICAL_ERROR"
  18799. // "NO_RESULTS_ON_PAGE"
  18800. // "REQUIRED_TOS_AGREEMENT"
  18801. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18802. // "RESOURCE_NOT_DELETED"
  18803. // "SCHEMA_VALIDATION_IGNORED"
  18804. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18805. // "UNDECLARED_PROPERTIES"
  18806. // "UNREACHABLE"
  18807. Code string `json:"code,omitempty"`
  18808. // Data: [Output Only] Metadata about this warning in key: value format.
  18809. // For example:
  18810. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18811. Data []*OperationListWarningData `json:"data,omitempty"`
  18812. // Message: [Output Only] A human-readable description of the warning
  18813. // code.
  18814. Message string `json:"message,omitempty"`
  18815. // ForceSendFields is a list of field names (e.g. "Code") to
  18816. // unconditionally include in API requests. By default, fields with
  18817. // empty values are omitted from API requests. However, any non-pointer,
  18818. // non-interface field appearing in ForceSendFields will be sent to the
  18819. // server regardless of whether the field is empty or not. This may be
  18820. // used to include empty fields in Patch requests.
  18821. ForceSendFields []string `json:"-"`
  18822. // NullFields is a list of field names (e.g. "Code") to include in API
  18823. // requests with the JSON null value. By default, fields with empty
  18824. // values are omitted from API requests. However, any field with an
  18825. // empty value appearing in NullFields will be sent to the server as
  18826. // null. It is an error if a field in this list has a non-empty value.
  18827. // This may be used to include null fields in Patch requests.
  18828. NullFields []string `json:"-"`
  18829. }
  18830. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  18831. type NoMethod OperationListWarning
  18832. raw := NoMethod(*s)
  18833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18834. }
  18835. type OperationListWarningData struct {
  18836. // Key: [Output Only] A key that provides more detail on the warning
  18837. // being returned. For example, for warnings where there are no results
  18838. // in a list request for a particular zone, this key might be scope and
  18839. // the key value might be the zone name. Other examples might be a key
  18840. // indicating a deprecated resource and a suggested replacement, or a
  18841. // warning about invalid network settings (for example, if an instance
  18842. // attempts to perform IP forwarding but is not enabled for IP
  18843. // forwarding).
  18844. Key string `json:"key,omitempty"`
  18845. // Value: [Output Only] A warning data value corresponding to the key.
  18846. Value string `json:"value,omitempty"`
  18847. // ForceSendFields is a list of field names (e.g. "Key") to
  18848. // unconditionally include in API requests. By default, fields with
  18849. // empty values are omitted from API requests. However, any non-pointer,
  18850. // non-interface field appearing in ForceSendFields will be sent to the
  18851. // server regardless of whether the field is empty or not. This may be
  18852. // used to include empty fields in Patch requests.
  18853. ForceSendFields []string `json:"-"`
  18854. // NullFields is a list of field names (e.g. "Key") to include in API
  18855. // requests with the JSON null value. By default, fields with empty
  18856. // values are omitted from API requests. However, any field with an
  18857. // empty value appearing in NullFields will be sent to the server as
  18858. // null. It is an error if a field in this list has a non-empty value.
  18859. // This may be used to include null fields in Patch requests.
  18860. NullFields []string `json:"-"`
  18861. }
  18862. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  18863. type NoMethod OperationListWarningData
  18864. raw := NoMethod(*s)
  18865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18866. }
  18867. type OperationsScopedList struct {
  18868. // Operations: [Output Only] A list of operations contained in this
  18869. // scope.
  18870. Operations []*Operation `json:"operations,omitempty"`
  18871. // Warning: [Output Only] Informational warning which replaces the list
  18872. // of operations when the list is empty.
  18873. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  18874. // ForceSendFields is a list of field names (e.g. "Operations") to
  18875. // unconditionally include in API requests. By default, fields with
  18876. // empty values are omitted from API requests. However, any non-pointer,
  18877. // non-interface field appearing in ForceSendFields will be sent to the
  18878. // server regardless of whether the field is empty or not. This may be
  18879. // used to include empty fields in Patch requests.
  18880. ForceSendFields []string `json:"-"`
  18881. // NullFields is a list of field names (e.g. "Operations") to include in
  18882. // API requests with the JSON null value. By default, fields with empty
  18883. // values are omitted from API requests. However, any field with an
  18884. // empty value appearing in NullFields will be sent to the server as
  18885. // null. It is an error if a field in this list has a non-empty value.
  18886. // This may be used to include null fields in Patch requests.
  18887. NullFields []string `json:"-"`
  18888. }
  18889. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  18890. type NoMethod OperationsScopedList
  18891. raw := NoMethod(*s)
  18892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18893. }
  18894. // OperationsScopedListWarning: [Output Only] Informational warning
  18895. // which replaces the list of operations when the list is empty.
  18896. type OperationsScopedListWarning struct {
  18897. // Code: [Output Only] A warning code, if applicable. For example,
  18898. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18899. // the response.
  18900. //
  18901. // Possible values:
  18902. // "CLEANUP_FAILED"
  18903. // "DEPRECATED_RESOURCE_USED"
  18904. // "DEPRECATED_TYPE_USED"
  18905. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18906. // "EXPERIMENTAL_TYPE_USED"
  18907. // "EXTERNAL_API_WARNING"
  18908. // "FIELD_VALUE_OVERRIDEN"
  18909. // "INJECTED_KERNELS_DEPRECATED"
  18910. // "MISSING_TYPE_DEPENDENCY"
  18911. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18912. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18913. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18914. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18915. // "NEXT_HOP_NOT_RUNNING"
  18916. // "NOT_CRITICAL_ERROR"
  18917. // "NO_RESULTS_ON_PAGE"
  18918. // "REQUIRED_TOS_AGREEMENT"
  18919. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18920. // "RESOURCE_NOT_DELETED"
  18921. // "SCHEMA_VALIDATION_IGNORED"
  18922. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18923. // "UNDECLARED_PROPERTIES"
  18924. // "UNREACHABLE"
  18925. Code string `json:"code,omitempty"`
  18926. // Data: [Output Only] Metadata about this warning in key: value format.
  18927. // For example:
  18928. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18929. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  18930. // Message: [Output Only] A human-readable description of the warning
  18931. // code.
  18932. Message string `json:"message,omitempty"`
  18933. // ForceSendFields is a list of field names (e.g. "Code") to
  18934. // unconditionally include in API requests. By default, fields with
  18935. // empty values are omitted from API requests. However, any non-pointer,
  18936. // non-interface field appearing in ForceSendFields will be sent to the
  18937. // server regardless of whether the field is empty or not. This may be
  18938. // used to include empty fields in Patch requests.
  18939. ForceSendFields []string `json:"-"`
  18940. // NullFields is a list of field names (e.g. "Code") to include in API
  18941. // requests with the JSON null value. By default, fields with empty
  18942. // values are omitted from API requests. However, any field with an
  18943. // empty value appearing in NullFields will be sent to the server as
  18944. // null. It is an error if a field in this list has a non-empty value.
  18945. // This may be used to include null fields in Patch requests.
  18946. NullFields []string `json:"-"`
  18947. }
  18948. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  18949. type NoMethod OperationsScopedListWarning
  18950. raw := NoMethod(*s)
  18951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18952. }
  18953. type OperationsScopedListWarningData struct {
  18954. // Key: [Output Only] A key that provides more detail on the warning
  18955. // being returned. For example, for warnings where there are no results
  18956. // in a list request for a particular zone, this key might be scope and
  18957. // the key value might be the zone name. Other examples might be a key
  18958. // indicating a deprecated resource and a suggested replacement, or a
  18959. // warning about invalid network settings (for example, if an instance
  18960. // attempts to perform IP forwarding but is not enabled for IP
  18961. // forwarding).
  18962. Key string `json:"key,omitempty"`
  18963. // Value: [Output Only] A warning data value corresponding to the key.
  18964. Value string `json:"value,omitempty"`
  18965. // ForceSendFields is a list of field names (e.g. "Key") to
  18966. // unconditionally include in API requests. By default, fields with
  18967. // empty values are omitted from API requests. However, any non-pointer,
  18968. // non-interface field appearing in ForceSendFields will be sent to the
  18969. // server regardless of whether the field is empty or not. This may be
  18970. // used to include empty fields in Patch requests.
  18971. ForceSendFields []string `json:"-"`
  18972. // NullFields is a list of field names (e.g. "Key") to include in API
  18973. // requests with the JSON null value. By default, fields with empty
  18974. // values are omitted from API requests. However, any field with an
  18975. // empty value appearing in NullFields will be sent to the server as
  18976. // null. It is an error if a field in this list has a non-empty value.
  18977. // This may be used to include null fields in Patch requests.
  18978. NullFields []string `json:"-"`
  18979. }
  18980. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  18981. type NoMethod OperationsScopedListWarningData
  18982. raw := NoMethod(*s)
  18983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18984. }
  18985. // PathMatcher: A matcher for the path portion of the URL. The
  18986. // BackendService from the longest-matched rule will serve the URL. If
  18987. // no rule was matched, the default service will be used.
  18988. type PathMatcher struct {
  18989. // DefaultService: The full or partial URL to the BackendService
  18990. // resource. This will be used if none of the pathRules or routeRules
  18991. // defined by this PathMatcher are matched. For example, the following
  18992. // are all valid URLs to a BackendService resource:
  18993. // -
  18994. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  18995. // - compute/v1/projects/project/global/backendServices/backendService
  18996. //
  18997. // - global/backendServices/backendService If defaultRouteAction is
  18998. // additionally specified, advanced routing actions like URL Rewrites,
  18999. // etc. take effect prior to sending the request to the backend.
  19000. // However, if defaultService is specified, defaultRouteAction cannot
  19001. // contain any weightedBackendServices. Conversely, if
  19002. // defaultRouteAction specifies any weightedBackendServices,
  19003. // defaultService must not be specified.
  19004. // Only one of defaultService, defaultUrlRedirect or
  19005. // defaultRouteAction.weightedBackendService must be set.
  19006. // Authorization requires one or more of the following Google IAM
  19007. // permissions on the specified resource default_service:
  19008. // - compute.backendBuckets.use
  19009. // - compute.backendServices.use
  19010. DefaultService string `json:"defaultService,omitempty"`
  19011. // Description: An optional description of this resource. Provide this
  19012. // property when you create the resource.
  19013. Description string `json:"description,omitempty"`
  19014. // Name: The name to which this PathMatcher is referred by the HostRule.
  19015. Name string `json:"name,omitempty"`
  19016. // PathRules: The list of path rules. Use this list instead of
  19017. // routeRules when routing based on simple path matching is all that's
  19018. // required. The order by which path rules are specified does not
  19019. // matter. Matches are always done on the longest-path-first basis.
  19020. // For example: a pathRule with a path /a/b/c/* will match before /a/b/*
  19021. // irrespective of the order in which those paths appear in this
  19022. // list.
  19023. // Only one of pathRules or routeRules must be set.
  19024. PathRules []*PathRule `json:"pathRules,omitempty"`
  19025. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  19026. // unconditionally include in API requests. By default, fields with
  19027. // empty values are omitted from API requests. However, any non-pointer,
  19028. // non-interface field appearing in ForceSendFields will be sent to the
  19029. // server regardless of whether the field is empty or not. This may be
  19030. // used to include empty fields in Patch requests.
  19031. ForceSendFields []string `json:"-"`
  19032. // NullFields is a list of field names (e.g. "DefaultService") to
  19033. // include in API requests with the JSON null value. By default, fields
  19034. // with empty values are omitted from API requests. However, any field
  19035. // with an empty value appearing in NullFields will be sent to the
  19036. // server as null. It is an error if a field in this list has a
  19037. // non-empty value. This may be used to include null fields in Patch
  19038. // requests.
  19039. NullFields []string `json:"-"`
  19040. }
  19041. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  19042. type NoMethod PathMatcher
  19043. raw := NoMethod(*s)
  19044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19045. }
  19046. // PathRule: A path-matching rule for a URL. If matched, will use the
  19047. // specified BackendService to handle the traffic arriving at this URL.
  19048. type PathRule struct {
  19049. // Paths: The list of path patterns to match. Each must start with / and
  19050. // the only place a * is allowed is at the end following a /. The string
  19051. // fed to the path matcher does not include any text after the first ?
  19052. // or #, and those chars are not allowed here.
  19053. Paths []string `json:"paths,omitempty"`
  19054. // Service: The full or partial URL of the backend service resource to
  19055. // which traffic is directed if this rule is matched. If routeAction is
  19056. // additionally specified, advanced routing actions like URL Rewrites,
  19057. // etc. take effect prior to sending the request to the backend.
  19058. // However, if service is specified, routeAction cannot contain any
  19059. // weightedBackendService s. Conversely, if routeAction specifies any
  19060. // weightedBackendServices, service must not be specified.
  19061. // Only one of urlRedirect, service or
  19062. // routeAction.weightedBackendService must be set.
  19063. Service string `json:"service,omitempty"`
  19064. // ForceSendFields is a list of field names (e.g. "Paths") to
  19065. // unconditionally include in API requests. By default, fields with
  19066. // empty values are omitted from API requests. However, any non-pointer,
  19067. // non-interface field appearing in ForceSendFields will be sent to the
  19068. // server regardless of whether the field is empty or not. This may be
  19069. // used to include empty fields in Patch requests.
  19070. ForceSendFields []string `json:"-"`
  19071. // NullFields is a list of field names (e.g. "Paths") to include in API
  19072. // requests with the JSON null value. By default, fields with empty
  19073. // values are omitted from API requests. However, any field with an
  19074. // empty value appearing in NullFields will be sent to the server as
  19075. // null. It is an error if a field in this list has a non-empty value.
  19076. // This may be used to include null fields in Patch requests.
  19077. NullFields []string `json:"-"`
  19078. }
  19079. func (s *PathRule) MarshalJSON() ([]byte, error) {
  19080. type NoMethod PathRule
  19081. raw := NoMethod(*s)
  19082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19083. }
  19084. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  19085. // used to specify access control policies for Cloud Platform
  19086. // resources.
  19087. //
  19088. //
  19089. //
  19090. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  19091. // of `members` to a `role`, where the members can be user accounts,
  19092. // Google groups, Google domains, and service accounts. A `role` is a
  19093. // named list of permissions defined by IAM.
  19094. //
  19095. // **JSON Example**
  19096. //
  19097. // { "bindings": [ { "role": "roles/owner", "members": [
  19098. // "user:mike@example.com", "group:admins@example.com",
  19099. // "domain:google.com",
  19100. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  19101. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  19102. // }
  19103. //
  19104. // **YAML Example**
  19105. //
  19106. // bindings: - members: - user:mike@example.com -
  19107. // group:admins@example.com - domain:google.com -
  19108. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  19109. // roles/owner - members: - user:sean@example.com role:
  19110. // roles/viewer
  19111. //
  19112. //
  19113. //
  19114. // For a description of IAM and its features, see the [IAM developer's
  19115. // guide](https://cloud.google.com/iam/docs).
  19116. type Policy struct {
  19117. // AuditConfigs: Specifies cloud audit logging configuration for this
  19118. // policy.
  19119. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  19120. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  19121. // no members will result in an error.
  19122. Bindings []*Binding `json:"bindings,omitempty"`
  19123. // Etag: `etag` is used for optimistic concurrency control as a way to
  19124. // help prevent simultaneous updates of a policy from overwriting each
  19125. // other. It is strongly suggested that systems make use of the `etag`
  19126. // in the read-modify-write cycle to perform policy updates in order to
  19127. // avoid race conditions: An `etag` is returned in the response to
  19128. // `getIamPolicy`, and systems are expected to put that etag in the
  19129. // request to `setIamPolicy` to ensure that their change will be applied
  19130. // to the same version of the policy.
  19131. //
  19132. // If no `etag` is provided in the call to `setIamPolicy`, then the
  19133. // existing policy is overwritten blindly.
  19134. Etag string `json:"etag,omitempty"`
  19135. IamOwned bool `json:"iamOwned,omitempty"`
  19136. // Rules: If more than one rule is specified, the rules are applied in
  19137. // the following manner: - All matching LOG rules are always applied. -
  19138. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  19139. // will be applied if one or more matching rule requires logging. -
  19140. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  19141. // granted. Logging will be applied if one or more matching rule
  19142. // requires logging. - Otherwise, if no rule applies, permission is
  19143. // denied.
  19144. Rules []*Rule `json:"rules,omitempty"`
  19145. // Version: Deprecated.
  19146. Version int64 `json:"version,omitempty"`
  19147. // ServerResponse contains the HTTP response code and headers from the
  19148. // server.
  19149. googleapi.ServerResponse `json:"-"`
  19150. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  19151. // unconditionally include in API requests. By default, fields with
  19152. // empty values are omitted from API requests. However, any non-pointer,
  19153. // non-interface field appearing in ForceSendFields will be sent to the
  19154. // server regardless of whether the field is empty or not. This may be
  19155. // used to include empty fields in Patch requests.
  19156. ForceSendFields []string `json:"-"`
  19157. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  19158. // in API requests with the JSON null value. By default, fields with
  19159. // empty values are omitted from API requests. However, any field with
  19160. // an empty value appearing in NullFields will be sent to the server as
  19161. // null. It is an error if a field in this list has a non-empty value.
  19162. // This may be used to include null fields in Patch requests.
  19163. NullFields []string `json:"-"`
  19164. }
  19165. func (s *Policy) MarshalJSON() ([]byte, error) {
  19166. type NoMethod Policy
  19167. raw := NoMethod(*s)
  19168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19169. }
  19170. type PreconfiguredWafSet struct {
  19171. // ExpressionSets: List of entities that are currently supported for WAF
  19172. // rules.
  19173. ExpressionSets []*WafExpressionSet `json:"expressionSets,omitempty"`
  19174. // ForceSendFields is a list of field names (e.g. "ExpressionSets") to
  19175. // unconditionally include in API requests. By default, fields with
  19176. // empty values are omitted from API requests. However, any non-pointer,
  19177. // non-interface field appearing in ForceSendFields will be sent to the
  19178. // server regardless of whether the field is empty or not. This may be
  19179. // used to include empty fields in Patch requests.
  19180. ForceSendFields []string `json:"-"`
  19181. // NullFields is a list of field names (e.g. "ExpressionSets") to
  19182. // include in API requests with the JSON null value. By default, fields
  19183. // with empty values are omitted from API requests. However, any field
  19184. // with an empty value appearing in NullFields will be sent to the
  19185. // server as null. It is an error if a field in this list has a
  19186. // non-empty value. This may be used to include null fields in Patch
  19187. // requests.
  19188. NullFields []string `json:"-"`
  19189. }
  19190. func (s *PreconfiguredWafSet) MarshalJSON() ([]byte, error) {
  19191. type NoMethod PreconfiguredWafSet
  19192. raw := NoMethod(*s)
  19193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19194. }
  19195. // Project: A Project resource. For an overview of projects, see Cloud
  19196. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  19197. // resource_for beta.projects ==)
  19198. type Project struct {
  19199. // CommonInstanceMetadata: Metadata key/value pairs available to all
  19200. // instances contained in this project. See Custom metadata for more
  19201. // information.
  19202. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  19203. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19204. // format.
  19205. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19206. // DefaultNetworkTier: This signifies the default network tier used for
  19207. // configuring resources of the project and can only take the following
  19208. // values: PREMIUM, STANDARD. Initially the default network tier is
  19209. // PREMIUM.
  19210. //
  19211. // Possible values:
  19212. // "PREMIUM"
  19213. // "STANDARD"
  19214. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  19215. // DefaultServiceAccount: [Output Only] Default service account used by
  19216. // VMs running in this project.
  19217. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  19218. // Description: An optional textual description of the resource.
  19219. Description string `json:"description,omitempty"`
  19220. // EnabledFeatures: Restricted features enabled for use on this project.
  19221. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  19222. // Id: [Output Only] The unique identifier for the resource. This
  19223. // identifier is defined by the server. This is not the project ID, and
  19224. // is just a unique ID used by Compute Engine to identify resources.
  19225. Id uint64 `json:"id,omitempty,string"`
  19226. // Kind: [Output Only] Type of the resource. Always compute#project for
  19227. // projects.
  19228. Kind string `json:"kind,omitempty"`
  19229. // Name: The project ID. For example: my-example-project. Use the
  19230. // project ID to make requests to Compute Engine.
  19231. Name string `json:"name,omitempty"`
  19232. // Quotas: [Output Only] Quotas assigned to this project.
  19233. Quotas []*Quota `json:"quotas,omitempty"`
  19234. // SelfLink: [Output Only] Server-defined URL for the resource.
  19235. SelfLink string `json:"selfLink,omitempty"`
  19236. // UsageExportLocation: The naming prefix for daily usage reports and
  19237. // the Google Cloud Storage bucket where they are stored.
  19238. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  19239. // XpnProjectStatus: [Output Only] The role this project has in a shared
  19240. // VPC configuration. Currently only HOST projects are differentiated.
  19241. //
  19242. // Possible values:
  19243. // "HOST"
  19244. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  19245. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  19246. // ServerResponse contains the HTTP response code and headers from the
  19247. // server.
  19248. googleapi.ServerResponse `json:"-"`
  19249. // ForceSendFields is a list of field names (e.g.
  19250. // "CommonInstanceMetadata") to unconditionally include in API requests.
  19251. // By default, fields with empty values are omitted from API requests.
  19252. // However, any non-pointer, non-interface field appearing in
  19253. // ForceSendFields will be sent to the server regardless of whether the
  19254. // field is empty or not. This may be used to include empty fields in
  19255. // Patch requests.
  19256. ForceSendFields []string `json:"-"`
  19257. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  19258. // to include in API requests with the JSON null value. By default,
  19259. // fields with empty values are omitted from API requests. However, any
  19260. // field with an empty value appearing in NullFields will be sent to the
  19261. // server as null. It is an error if a field in this list has a
  19262. // non-empty value. This may be used to include null fields in Patch
  19263. // requests.
  19264. NullFields []string `json:"-"`
  19265. }
  19266. func (s *Project) MarshalJSON() ([]byte, error) {
  19267. type NoMethod Project
  19268. raw := NoMethod(*s)
  19269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19270. }
  19271. type ProjectsDisableXpnResourceRequest struct {
  19272. // XpnResource: Service resource (a.k.a service project) ID.
  19273. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  19274. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  19275. // unconditionally include in API requests. By default, fields with
  19276. // empty values are omitted from API requests. However, any non-pointer,
  19277. // non-interface field appearing in ForceSendFields will be sent to the
  19278. // server regardless of whether the field is empty or not. This may be
  19279. // used to include empty fields in Patch requests.
  19280. ForceSendFields []string `json:"-"`
  19281. // NullFields is a list of field names (e.g. "XpnResource") to include
  19282. // in API requests with the JSON null value. By default, fields with
  19283. // empty values are omitted from API requests. However, any field with
  19284. // an empty value appearing in NullFields will be sent to the server as
  19285. // null. It is an error if a field in this list has a non-empty value.
  19286. // This may be used to include null fields in Patch requests.
  19287. NullFields []string `json:"-"`
  19288. }
  19289. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  19290. type NoMethod ProjectsDisableXpnResourceRequest
  19291. raw := NoMethod(*s)
  19292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19293. }
  19294. type ProjectsEnableXpnResourceRequest struct {
  19295. // XpnResource: Service resource (a.k.a service project) ID.
  19296. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  19297. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  19298. // unconditionally include in API requests. By default, fields with
  19299. // empty values are omitted from API requests. However, any non-pointer,
  19300. // non-interface field appearing in ForceSendFields will be sent to the
  19301. // server regardless of whether the field is empty or not. This may be
  19302. // used to include empty fields in Patch requests.
  19303. ForceSendFields []string `json:"-"`
  19304. // NullFields is a list of field names (e.g. "XpnResource") to include
  19305. // in API requests with the JSON null value. By default, fields with
  19306. // empty values are omitted from API requests. However, any field with
  19307. // an empty value appearing in NullFields will be sent to the server as
  19308. // null. It is an error if a field in this list has a non-empty value.
  19309. // This may be used to include null fields in Patch requests.
  19310. NullFields []string `json:"-"`
  19311. }
  19312. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  19313. type NoMethod ProjectsEnableXpnResourceRequest
  19314. raw := NoMethod(*s)
  19315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19316. }
  19317. type ProjectsGetXpnResources struct {
  19318. // Kind: [Output Only] Type of resource. Always
  19319. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  19320. // service projects)
  19321. Kind string `json:"kind,omitempty"`
  19322. // NextPageToken: [Output Only] This token allows you to get the next
  19323. // page of results for list requests. If the number of results is larger
  19324. // than maxResults, use the nextPageToken as a value for the query
  19325. // parameter pageToken in the next list request. Subsequent list
  19326. // requests will have their own nextPageToken to continue paging through
  19327. // the results.
  19328. NextPageToken string `json:"nextPageToken,omitempty"`
  19329. // Resources: Service resources (a.k.a service projects) attached to
  19330. // this project as their shared VPC host.
  19331. Resources []*XpnResourceId `json:"resources,omitempty"`
  19332. // ServerResponse contains the HTTP response code and headers from the
  19333. // server.
  19334. googleapi.ServerResponse `json:"-"`
  19335. // ForceSendFields is a list of field names (e.g. "Kind") to
  19336. // unconditionally include in API requests. By default, fields with
  19337. // empty values are omitted from API requests. However, any non-pointer,
  19338. // non-interface field appearing in ForceSendFields will be sent to the
  19339. // server regardless of whether the field is empty or not. This may be
  19340. // used to include empty fields in Patch requests.
  19341. ForceSendFields []string `json:"-"`
  19342. // NullFields is a list of field names (e.g. "Kind") to include in API
  19343. // requests with the JSON null value. By default, fields with empty
  19344. // values are omitted from API requests. However, any field with an
  19345. // empty value appearing in NullFields will be sent to the server as
  19346. // null. It is an error if a field in this list has a non-empty value.
  19347. // This may be used to include null fields in Patch requests.
  19348. NullFields []string `json:"-"`
  19349. }
  19350. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  19351. type NoMethod ProjectsGetXpnResources
  19352. raw := NoMethod(*s)
  19353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19354. }
  19355. type ProjectsListXpnHostsRequest struct {
  19356. // Organization: Optional organization ID managed by Cloud Resource
  19357. // Manager, for which to list shared VPC host projects. If not
  19358. // specified, the organization will be inferred from the project.
  19359. Organization string `json:"organization,omitempty"`
  19360. // ForceSendFields is a list of field names (e.g. "Organization") to
  19361. // unconditionally include in API requests. By default, fields with
  19362. // empty values are omitted from API requests. However, any non-pointer,
  19363. // non-interface field appearing in ForceSendFields will be sent to the
  19364. // server regardless of whether the field is empty or not. This may be
  19365. // used to include empty fields in Patch requests.
  19366. ForceSendFields []string `json:"-"`
  19367. // NullFields is a list of field names (e.g. "Organization") to include
  19368. // in API requests with the JSON null value. By default, fields with
  19369. // empty values are omitted from API requests. However, any field with
  19370. // an empty value appearing in NullFields will be sent to the server as
  19371. // null. It is an error if a field in this list has a non-empty value.
  19372. // This may be used to include null fields in Patch requests.
  19373. NullFields []string `json:"-"`
  19374. }
  19375. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  19376. type NoMethod ProjectsListXpnHostsRequest
  19377. raw := NoMethod(*s)
  19378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19379. }
  19380. type ProjectsSetDefaultNetworkTierRequest struct {
  19381. // NetworkTier: Default network tier to be set.
  19382. //
  19383. // Possible values:
  19384. // "PREMIUM"
  19385. // "STANDARD"
  19386. NetworkTier string `json:"networkTier,omitempty"`
  19387. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  19388. // unconditionally include in API requests. By default, fields with
  19389. // empty values are omitted from API requests. However, any non-pointer,
  19390. // non-interface field appearing in ForceSendFields will be sent to the
  19391. // server regardless of whether the field is empty or not. This may be
  19392. // used to include empty fields in Patch requests.
  19393. ForceSendFields []string `json:"-"`
  19394. // NullFields is a list of field names (e.g. "NetworkTier") to include
  19395. // in API requests with the JSON null value. By default, fields with
  19396. // empty values are omitted from API requests. However, any field with
  19397. // an empty value appearing in NullFields will be sent to the server as
  19398. // null. It is an error if a field in this list has a non-empty value.
  19399. // This may be used to include null fields in Patch requests.
  19400. NullFields []string `json:"-"`
  19401. }
  19402. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  19403. type NoMethod ProjectsSetDefaultNetworkTierRequest
  19404. raw := NoMethod(*s)
  19405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19406. }
  19407. // Quota: A quotas entry.
  19408. type Quota struct {
  19409. // Limit: [Output Only] Quota limit for this metric.
  19410. Limit float64 `json:"limit,omitempty"`
  19411. // Metric: [Output Only] Name of the quota metric.
  19412. //
  19413. // Possible values:
  19414. // "AUTOSCALERS"
  19415. // "BACKEND_BUCKETS"
  19416. // "BACKEND_SERVICES"
  19417. // "COMMITMENTS"
  19418. // "CPUS"
  19419. // "CPUS_ALL_REGIONS"
  19420. // "DISKS_TOTAL_GB"
  19421. // "FIREWALLS"
  19422. // "FORWARDING_RULES"
  19423. // "GLOBAL_INTERNAL_ADDRESSES"
  19424. // "GPUS_ALL_REGIONS"
  19425. // "HEALTH_CHECKS"
  19426. // "IMAGES"
  19427. // "INSTANCES"
  19428. // "INSTANCE_GROUPS"
  19429. // "INSTANCE_GROUP_MANAGERS"
  19430. // "INSTANCE_TEMPLATES"
  19431. // "INTERCONNECTS"
  19432. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  19433. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  19434. // "INTERNAL_ADDRESSES"
  19435. // "IN_USE_ADDRESSES"
  19436. // "IN_USE_BACKUP_SCHEDULES"
  19437. // "IN_USE_SNAPSHOT_SCHEDULES"
  19438. // "LOCAL_SSD_TOTAL_GB"
  19439. // "NETWORKS"
  19440. // "NETWORK_ENDPOINT_GROUPS"
  19441. // "NVIDIA_K80_GPUS"
  19442. // "NVIDIA_P100_GPUS"
  19443. // "NVIDIA_P100_VWS_GPUS"
  19444. // "NVIDIA_P4_GPUS"
  19445. // "NVIDIA_P4_VWS_GPUS"
  19446. // "NVIDIA_T4_GPUS"
  19447. // "NVIDIA_T4_VWS_GPUS"
  19448. // "NVIDIA_V100_GPUS"
  19449. // "PREEMPTIBLE_CPUS"
  19450. // "PREEMPTIBLE_LOCAL_SSD_GB"
  19451. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  19452. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  19453. // "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS"
  19454. // "PREEMPTIBLE_NVIDIA_P4_GPUS"
  19455. // "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS"
  19456. // "PREEMPTIBLE_NVIDIA_T4_GPUS"
  19457. // "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS"
  19458. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  19459. // "REGIONAL_AUTOSCALERS"
  19460. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  19461. // "RESOURCE_POLICIES"
  19462. // "ROUTERS"
  19463. // "ROUTES"
  19464. // "SECURITY_POLICIES"
  19465. // "SECURITY_POLICY_RULES"
  19466. // "SNAPSHOTS"
  19467. // "SSD_TOTAL_GB"
  19468. // "SSL_CERTIFICATES"
  19469. // "STATIC_ADDRESSES"
  19470. // "SUBNETWORKS"
  19471. // "TARGET_HTTPS_PROXIES"
  19472. // "TARGET_HTTP_PROXIES"
  19473. // "TARGET_INSTANCES"
  19474. // "TARGET_POOLS"
  19475. // "TARGET_SSL_PROXIES"
  19476. // "TARGET_TCP_PROXIES"
  19477. // "TARGET_VPN_GATEWAYS"
  19478. // "URL_MAPS"
  19479. // "VPN_GATEWAYS"
  19480. // "VPN_TUNNELS"
  19481. Metric string `json:"metric,omitempty"`
  19482. // Owner: [Output Only] Owning resource. This is the resource on which
  19483. // this quota is applied.
  19484. Owner string `json:"owner,omitempty"`
  19485. // Usage: [Output Only] Current usage of this metric.
  19486. Usage float64 `json:"usage,omitempty"`
  19487. // ForceSendFields is a list of field names (e.g. "Limit") to
  19488. // unconditionally include in API requests. By default, fields with
  19489. // empty values are omitted from API requests. However, any non-pointer,
  19490. // non-interface field appearing in ForceSendFields will be sent to the
  19491. // server regardless of whether the field is empty or not. This may be
  19492. // used to include empty fields in Patch requests.
  19493. ForceSendFields []string `json:"-"`
  19494. // NullFields is a list of field names (e.g. "Limit") to include in API
  19495. // requests with the JSON null value. By default, fields with empty
  19496. // values are omitted from API requests. However, any field with an
  19497. // empty value appearing in NullFields will be sent to the server as
  19498. // null. It is an error if a field in this list has a non-empty value.
  19499. // This may be used to include null fields in Patch requests.
  19500. NullFields []string `json:"-"`
  19501. }
  19502. func (s *Quota) MarshalJSON() ([]byte, error) {
  19503. type NoMethod Quota
  19504. raw := NoMethod(*s)
  19505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19506. }
  19507. func (s *Quota) UnmarshalJSON(data []byte) error {
  19508. type NoMethod Quota
  19509. var s1 struct {
  19510. Limit gensupport.JSONFloat64 `json:"limit"`
  19511. Usage gensupport.JSONFloat64 `json:"usage"`
  19512. *NoMethod
  19513. }
  19514. s1.NoMethod = (*NoMethod)(s)
  19515. if err := json.Unmarshal(data, &s1); err != nil {
  19516. return err
  19517. }
  19518. s.Limit = float64(s1.Limit)
  19519. s.Usage = float64(s1.Usage)
  19520. return nil
  19521. }
  19522. // Reference: Represents a reference to a resource.
  19523. type Reference struct {
  19524. // Kind: [Output Only] Type of the resource. Always compute#reference
  19525. // for references.
  19526. Kind string `json:"kind,omitempty"`
  19527. // ReferenceType: A description of the reference type with no implied
  19528. // semantics. Possible values include:
  19529. // - MEMBER_OF
  19530. ReferenceType string `json:"referenceType,omitempty"`
  19531. // Referrer: URL of the resource which refers to the target.
  19532. Referrer string `json:"referrer,omitempty"`
  19533. // Target: URL of the resource to which this reference points.
  19534. Target string `json:"target,omitempty"`
  19535. // ForceSendFields is a list of field names (e.g. "Kind") to
  19536. // unconditionally include in API requests. By default, fields with
  19537. // empty values are omitted from API requests. However, any non-pointer,
  19538. // non-interface field appearing in ForceSendFields will be sent to the
  19539. // server regardless of whether the field is empty or not. This may be
  19540. // used to include empty fields in Patch requests.
  19541. ForceSendFields []string `json:"-"`
  19542. // NullFields is a list of field names (e.g. "Kind") to include in API
  19543. // requests with the JSON null value. By default, fields with empty
  19544. // values are omitted from API requests. However, any field with an
  19545. // empty value appearing in NullFields will be sent to the server as
  19546. // null. It is an error if a field in this list has a non-empty value.
  19547. // This may be used to include null fields in Patch requests.
  19548. NullFields []string `json:"-"`
  19549. }
  19550. func (s *Reference) MarshalJSON() ([]byte, error) {
  19551. type NoMethod Reference
  19552. raw := NoMethod(*s)
  19553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19554. }
  19555. // Region: Region resource. (== resource_for beta.regions ==) (==
  19556. // resource_for v1.regions ==)
  19557. type Region struct {
  19558. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19559. // format.
  19560. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19561. // Deprecated: [Output Only] The deprecation status associated with this
  19562. // region.
  19563. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  19564. // Description: [Output Only] Textual description of the resource.
  19565. Description string `json:"description,omitempty"`
  19566. // Id: [Output Only] The unique identifier for the resource. This
  19567. // identifier is defined by the server.
  19568. Id uint64 `json:"id,omitempty,string"`
  19569. // Kind: [Output Only] Type of the resource. Always compute#region for
  19570. // regions.
  19571. Kind string `json:"kind,omitempty"`
  19572. // Name: [Output Only] Name of the resource.
  19573. Name string `json:"name,omitempty"`
  19574. // Quotas: [Output Only] Quotas assigned to this region.
  19575. Quotas []*Quota `json:"quotas,omitempty"`
  19576. // SelfLink: [Output Only] Server-defined URL for the resource.
  19577. SelfLink string `json:"selfLink,omitempty"`
  19578. // Status: [Output Only] Status of the region, either UP or DOWN.
  19579. //
  19580. // Possible values:
  19581. // "DOWN"
  19582. // "UP"
  19583. Status string `json:"status,omitempty"`
  19584. // Zones: [Output Only] A list of zones available in this region, in the
  19585. // form of resource URLs.
  19586. Zones []string `json:"zones,omitempty"`
  19587. // ServerResponse contains the HTTP response code and headers from the
  19588. // server.
  19589. googleapi.ServerResponse `json:"-"`
  19590. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  19591. // to unconditionally include in API requests. By default, fields with
  19592. // empty values are omitted from API requests. However, any non-pointer,
  19593. // non-interface field appearing in ForceSendFields will be sent to the
  19594. // server regardless of whether the field is empty or not. This may be
  19595. // used to include empty fields in Patch requests.
  19596. ForceSendFields []string `json:"-"`
  19597. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  19598. // include in API requests with the JSON null value. By default, fields
  19599. // with empty values are omitted from API requests. However, any field
  19600. // with an empty value appearing in NullFields will be sent to the
  19601. // server as null. It is an error if a field in this list has a
  19602. // non-empty value. This may be used to include null fields in Patch
  19603. // requests.
  19604. NullFields []string `json:"-"`
  19605. }
  19606. func (s *Region) MarshalJSON() ([]byte, error) {
  19607. type NoMethod Region
  19608. raw := NoMethod(*s)
  19609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19610. }
  19611. // RegionAutoscalerList: Contains a list of autoscalers.
  19612. type RegionAutoscalerList struct {
  19613. // Id: [Output Only] Unique identifier for the resource; defined by the
  19614. // server.
  19615. Id string `json:"id,omitempty"`
  19616. // Items: A list of Autoscaler resources.
  19617. Items []*Autoscaler `json:"items,omitempty"`
  19618. // Kind: Type of resource.
  19619. Kind string `json:"kind,omitempty"`
  19620. // NextPageToken: [Output Only] This token allows you to get the next
  19621. // page of results for list requests. If the number of results is larger
  19622. // than maxResults, use the nextPageToken as a value for the query
  19623. // parameter pageToken in the next list request. Subsequent list
  19624. // requests will have their own nextPageToken to continue paging through
  19625. // the results.
  19626. NextPageToken string `json:"nextPageToken,omitempty"`
  19627. // SelfLink: [Output Only] Server-defined URL for this resource.
  19628. SelfLink string `json:"selfLink,omitempty"`
  19629. // Warning: [Output Only] Informational warning message.
  19630. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  19631. // ServerResponse contains the HTTP response code and headers from the
  19632. // server.
  19633. googleapi.ServerResponse `json:"-"`
  19634. // ForceSendFields is a list of field names (e.g. "Id") to
  19635. // unconditionally include in API requests. By default, fields with
  19636. // empty values are omitted from API requests. However, any non-pointer,
  19637. // non-interface field appearing in ForceSendFields will be sent to the
  19638. // server regardless of whether the field is empty or not. This may be
  19639. // used to include empty fields in Patch requests.
  19640. ForceSendFields []string `json:"-"`
  19641. // NullFields is a list of field names (e.g. "Id") to include in API
  19642. // requests with the JSON null value. By default, fields with empty
  19643. // values are omitted from API requests. However, any field with an
  19644. // empty value appearing in NullFields will be sent to the server as
  19645. // null. It is an error if a field in this list has a non-empty value.
  19646. // This may be used to include null fields in Patch requests.
  19647. NullFields []string `json:"-"`
  19648. }
  19649. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  19650. type NoMethod RegionAutoscalerList
  19651. raw := NoMethod(*s)
  19652. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19653. }
  19654. // RegionAutoscalerListWarning: [Output Only] Informational warning
  19655. // message.
  19656. type RegionAutoscalerListWarning struct {
  19657. // Code: [Output Only] A warning code, if applicable. For example,
  19658. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19659. // the response.
  19660. //
  19661. // Possible values:
  19662. // "CLEANUP_FAILED"
  19663. // "DEPRECATED_RESOURCE_USED"
  19664. // "DEPRECATED_TYPE_USED"
  19665. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19666. // "EXPERIMENTAL_TYPE_USED"
  19667. // "EXTERNAL_API_WARNING"
  19668. // "FIELD_VALUE_OVERRIDEN"
  19669. // "INJECTED_KERNELS_DEPRECATED"
  19670. // "MISSING_TYPE_DEPENDENCY"
  19671. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19672. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19673. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19674. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19675. // "NEXT_HOP_NOT_RUNNING"
  19676. // "NOT_CRITICAL_ERROR"
  19677. // "NO_RESULTS_ON_PAGE"
  19678. // "REQUIRED_TOS_AGREEMENT"
  19679. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19680. // "RESOURCE_NOT_DELETED"
  19681. // "SCHEMA_VALIDATION_IGNORED"
  19682. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19683. // "UNDECLARED_PROPERTIES"
  19684. // "UNREACHABLE"
  19685. Code string `json:"code,omitempty"`
  19686. // Data: [Output Only] Metadata about this warning in key: value format.
  19687. // For example:
  19688. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19689. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  19690. // Message: [Output Only] A human-readable description of the warning
  19691. // code.
  19692. Message string `json:"message,omitempty"`
  19693. // ForceSendFields is a list of field names (e.g. "Code") to
  19694. // unconditionally include in API requests. By default, fields with
  19695. // empty values are omitted from API requests. However, any non-pointer,
  19696. // non-interface field appearing in ForceSendFields will be sent to the
  19697. // server regardless of whether the field is empty or not. This may be
  19698. // used to include empty fields in Patch requests.
  19699. ForceSendFields []string `json:"-"`
  19700. // NullFields is a list of field names (e.g. "Code") to include in API
  19701. // requests with the JSON null value. By default, fields with empty
  19702. // values are omitted from API requests. However, any field with an
  19703. // empty value appearing in NullFields will be sent to the server as
  19704. // null. It is an error if a field in this list has a non-empty value.
  19705. // This may be used to include null fields in Patch requests.
  19706. NullFields []string `json:"-"`
  19707. }
  19708. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  19709. type NoMethod RegionAutoscalerListWarning
  19710. raw := NoMethod(*s)
  19711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19712. }
  19713. type RegionAutoscalerListWarningData struct {
  19714. // Key: [Output Only] A key that provides more detail on the warning
  19715. // being returned. For example, for warnings where there are no results
  19716. // in a list request for a particular zone, this key might be scope and
  19717. // the key value might be the zone name. Other examples might be a key
  19718. // indicating a deprecated resource and a suggested replacement, or a
  19719. // warning about invalid network settings (for example, if an instance
  19720. // attempts to perform IP forwarding but is not enabled for IP
  19721. // forwarding).
  19722. Key string `json:"key,omitempty"`
  19723. // Value: [Output Only] A warning data value corresponding to the key.
  19724. Value string `json:"value,omitempty"`
  19725. // ForceSendFields is a list of field names (e.g. "Key") to
  19726. // unconditionally include in API requests. By default, fields with
  19727. // empty values are omitted from API requests. However, any non-pointer,
  19728. // non-interface field appearing in ForceSendFields will be sent to the
  19729. // server regardless of whether the field is empty or not. This may be
  19730. // used to include empty fields in Patch requests.
  19731. ForceSendFields []string `json:"-"`
  19732. // NullFields is a list of field names (e.g. "Key") to include in API
  19733. // requests with the JSON null value. By default, fields with empty
  19734. // values are omitted from API requests. However, any field with an
  19735. // empty value appearing in NullFields will be sent to the server as
  19736. // null. It is an error if a field in this list has a non-empty value.
  19737. // This may be used to include null fields in Patch requests.
  19738. NullFields []string `json:"-"`
  19739. }
  19740. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  19741. type NoMethod RegionAutoscalerListWarningData
  19742. raw := NoMethod(*s)
  19743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19744. }
  19745. type RegionCommitmentsUpdateAllocationsRequest struct {
  19746. // Allocations: List of allocations for the capacity move of VMs with
  19747. // accelerators and local ssds.
  19748. Allocations []*Allocation `json:"allocations,omitempty"`
  19749. // ForceSendFields is a list of field names (e.g. "Allocations") to
  19750. // unconditionally include in API requests. By default, fields with
  19751. // empty values are omitted from API requests. However, any non-pointer,
  19752. // non-interface field appearing in ForceSendFields will be sent to the
  19753. // server regardless of whether the field is empty or not. This may be
  19754. // used to include empty fields in Patch requests.
  19755. ForceSendFields []string `json:"-"`
  19756. // NullFields is a list of field names (e.g. "Allocations") to include
  19757. // in API requests with the JSON null value. By default, fields with
  19758. // empty values are omitted from API requests. However, any field with
  19759. // an empty value appearing in NullFields will be sent to the server as
  19760. // null. It is an error if a field in this list has a non-empty value.
  19761. // This may be used to include null fields in Patch requests.
  19762. NullFields []string `json:"-"`
  19763. }
  19764. func (s *RegionCommitmentsUpdateAllocationsRequest) MarshalJSON() ([]byte, error) {
  19765. type NoMethod RegionCommitmentsUpdateAllocationsRequest
  19766. raw := NoMethod(*s)
  19767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19768. }
  19769. type RegionDiskTypeList struct {
  19770. // Id: [Output Only] Unique identifier for the resource; defined by the
  19771. // server.
  19772. Id string `json:"id,omitempty"`
  19773. // Items: A list of DiskType resources.
  19774. Items []*DiskType `json:"items,omitempty"`
  19775. // Kind: [Output Only] Type of resource. Always
  19776. // compute#regionDiskTypeList for region disk types.
  19777. Kind string `json:"kind,omitempty"`
  19778. // NextPageToken: [Output Only] This token allows you to get the next
  19779. // page of results for list requests. If the number of results is larger
  19780. // than maxResults, use the nextPageToken as a value for the query
  19781. // parameter pageToken in the next list request. Subsequent list
  19782. // requests will have their own nextPageToken to continue paging through
  19783. // the results.
  19784. NextPageToken string `json:"nextPageToken,omitempty"`
  19785. // SelfLink: [Output Only] Server-defined URL for this resource.
  19786. SelfLink string `json:"selfLink,omitempty"`
  19787. // Warning: [Output Only] Informational warning message.
  19788. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  19789. // ServerResponse contains the HTTP response code and headers from the
  19790. // server.
  19791. googleapi.ServerResponse `json:"-"`
  19792. // ForceSendFields is a list of field names (e.g. "Id") to
  19793. // unconditionally include in API requests. By default, fields with
  19794. // empty values are omitted from API requests. However, any non-pointer,
  19795. // non-interface field appearing in ForceSendFields will be sent to the
  19796. // server regardless of whether the field is empty or not. This may be
  19797. // used to include empty fields in Patch requests.
  19798. ForceSendFields []string `json:"-"`
  19799. // NullFields is a list of field names (e.g. "Id") to include in API
  19800. // requests with the JSON null value. By default, fields with empty
  19801. // values are omitted from API requests. However, any field with an
  19802. // empty value appearing in NullFields will be sent to the server as
  19803. // null. It is an error if a field in this list has a non-empty value.
  19804. // This may be used to include null fields in Patch requests.
  19805. NullFields []string `json:"-"`
  19806. }
  19807. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  19808. type NoMethod RegionDiskTypeList
  19809. raw := NoMethod(*s)
  19810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19811. }
  19812. // RegionDiskTypeListWarning: [Output Only] Informational warning
  19813. // message.
  19814. type RegionDiskTypeListWarning struct {
  19815. // Code: [Output Only] A warning code, if applicable. For example,
  19816. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19817. // the response.
  19818. //
  19819. // Possible values:
  19820. // "CLEANUP_FAILED"
  19821. // "DEPRECATED_RESOURCE_USED"
  19822. // "DEPRECATED_TYPE_USED"
  19823. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19824. // "EXPERIMENTAL_TYPE_USED"
  19825. // "EXTERNAL_API_WARNING"
  19826. // "FIELD_VALUE_OVERRIDEN"
  19827. // "INJECTED_KERNELS_DEPRECATED"
  19828. // "MISSING_TYPE_DEPENDENCY"
  19829. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19830. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19831. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19832. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19833. // "NEXT_HOP_NOT_RUNNING"
  19834. // "NOT_CRITICAL_ERROR"
  19835. // "NO_RESULTS_ON_PAGE"
  19836. // "REQUIRED_TOS_AGREEMENT"
  19837. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19838. // "RESOURCE_NOT_DELETED"
  19839. // "SCHEMA_VALIDATION_IGNORED"
  19840. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19841. // "UNDECLARED_PROPERTIES"
  19842. // "UNREACHABLE"
  19843. Code string `json:"code,omitempty"`
  19844. // Data: [Output Only] Metadata about this warning in key: value format.
  19845. // For example:
  19846. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19847. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  19848. // Message: [Output Only] A human-readable description of the warning
  19849. // code.
  19850. Message string `json:"message,omitempty"`
  19851. // ForceSendFields is a list of field names (e.g. "Code") to
  19852. // unconditionally include in API requests. By default, fields with
  19853. // empty values are omitted from API requests. However, any non-pointer,
  19854. // non-interface field appearing in ForceSendFields will be sent to the
  19855. // server regardless of whether the field is empty or not. This may be
  19856. // used to include empty fields in Patch requests.
  19857. ForceSendFields []string `json:"-"`
  19858. // NullFields is a list of field names (e.g. "Code") to include in API
  19859. // requests with the JSON null value. By default, fields with empty
  19860. // values are omitted from API requests. However, any field with an
  19861. // empty value appearing in NullFields will be sent to the server as
  19862. // null. It is an error if a field in this list has a non-empty value.
  19863. // This may be used to include null fields in Patch requests.
  19864. NullFields []string `json:"-"`
  19865. }
  19866. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  19867. type NoMethod RegionDiskTypeListWarning
  19868. raw := NoMethod(*s)
  19869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19870. }
  19871. type RegionDiskTypeListWarningData struct {
  19872. // Key: [Output Only] A key that provides more detail on the warning
  19873. // being returned. For example, for warnings where there are no results
  19874. // in a list request for a particular zone, this key might be scope and
  19875. // the key value might be the zone name. Other examples might be a key
  19876. // indicating a deprecated resource and a suggested replacement, or a
  19877. // warning about invalid network settings (for example, if an instance
  19878. // attempts to perform IP forwarding but is not enabled for IP
  19879. // forwarding).
  19880. Key string `json:"key,omitempty"`
  19881. // Value: [Output Only] A warning data value corresponding to the key.
  19882. Value string `json:"value,omitempty"`
  19883. // ForceSendFields is a list of field names (e.g. "Key") to
  19884. // unconditionally include in API requests. By default, fields with
  19885. // empty values are omitted from API requests. However, any non-pointer,
  19886. // non-interface field appearing in ForceSendFields will be sent to the
  19887. // server regardless of whether the field is empty or not. This may be
  19888. // used to include empty fields in Patch requests.
  19889. ForceSendFields []string `json:"-"`
  19890. // NullFields is a list of field names (e.g. "Key") to include in API
  19891. // requests with the JSON null value. By default, fields with empty
  19892. // values are omitted from API requests. However, any field with an
  19893. // empty value appearing in NullFields will be sent to the server as
  19894. // null. It is an error if a field in this list has a non-empty value.
  19895. // This may be used to include null fields in Patch requests.
  19896. NullFields []string `json:"-"`
  19897. }
  19898. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  19899. type NoMethod RegionDiskTypeListWarningData
  19900. raw := NoMethod(*s)
  19901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19902. }
  19903. type RegionDisksAddResourcePoliciesRequest struct {
  19904. // ResourcePolicies: Resource policies to be added to this disk.
  19905. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  19906. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  19907. // unconditionally include in API requests. By default, fields with
  19908. // empty values are omitted from API requests. However, any non-pointer,
  19909. // non-interface field appearing in ForceSendFields will be sent to the
  19910. // server regardless of whether the field is empty or not. This may be
  19911. // used to include empty fields in Patch requests.
  19912. ForceSendFields []string `json:"-"`
  19913. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  19914. // include in API requests with the JSON null value. By default, fields
  19915. // with empty values are omitted from API requests. However, any field
  19916. // with an empty value appearing in NullFields will be sent to the
  19917. // server as null. It is an error if a field in this list has a
  19918. // non-empty value. This may be used to include null fields in Patch
  19919. // requests.
  19920. NullFields []string `json:"-"`
  19921. }
  19922. func (s *RegionDisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  19923. type NoMethod RegionDisksAddResourcePoliciesRequest
  19924. raw := NoMethod(*s)
  19925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19926. }
  19927. type RegionDisksRemoveResourcePoliciesRequest struct {
  19928. // ResourcePolicies: Resource policies to be removed from this disk.
  19929. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  19930. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  19931. // unconditionally include in API requests. By default, fields with
  19932. // empty values are omitted from API requests. However, any non-pointer,
  19933. // non-interface field appearing in ForceSendFields will be sent to the
  19934. // server regardless of whether the field is empty or not. This may be
  19935. // used to include empty fields in Patch requests.
  19936. ForceSendFields []string `json:"-"`
  19937. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  19938. // include in API requests with the JSON null value. By default, fields
  19939. // with empty values are omitted from API requests. However, any field
  19940. // with an empty value appearing in NullFields will be sent to the
  19941. // server as null. It is an error if a field in this list has a
  19942. // non-empty value. This may be used to include null fields in Patch
  19943. // requests.
  19944. NullFields []string `json:"-"`
  19945. }
  19946. func (s *RegionDisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  19947. type NoMethod RegionDisksRemoveResourcePoliciesRequest
  19948. raw := NoMethod(*s)
  19949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19950. }
  19951. type RegionDisksResizeRequest struct {
  19952. // SizeGb: The new size of the regional persistent disk, which is
  19953. // specified in GB.
  19954. SizeGb int64 `json:"sizeGb,omitempty,string"`
  19955. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  19956. // unconditionally include in API requests. By default, fields with
  19957. // empty values are omitted from API requests. However, any non-pointer,
  19958. // non-interface field appearing in ForceSendFields will be sent to the
  19959. // server regardless of whether the field is empty or not. This may be
  19960. // used to include empty fields in Patch requests.
  19961. ForceSendFields []string `json:"-"`
  19962. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  19963. // requests with the JSON null value. By default, fields with empty
  19964. // values are omitted from API requests. However, any field with an
  19965. // empty value appearing in NullFields will be sent to the server as
  19966. // null. It is an error if a field in this list has a non-empty value.
  19967. // This may be used to include null fields in Patch requests.
  19968. NullFields []string `json:"-"`
  19969. }
  19970. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  19971. type NoMethod RegionDisksResizeRequest
  19972. raw := NoMethod(*s)
  19973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19974. }
  19975. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  19976. type RegionInstanceGroupList struct {
  19977. // Id: [Output Only] Unique identifier for the resource; defined by the
  19978. // server.
  19979. Id string `json:"id,omitempty"`
  19980. // Items: A list of InstanceGroup resources.
  19981. Items []*InstanceGroup `json:"items,omitempty"`
  19982. // Kind: The resource type.
  19983. Kind string `json:"kind,omitempty"`
  19984. // NextPageToken: [Output Only] This token allows you to get the next
  19985. // page of results for list requests. If the number of results is larger
  19986. // than maxResults, use the nextPageToken as a value for the query
  19987. // parameter pageToken in the next list request. Subsequent list
  19988. // requests will have their own nextPageToken to continue paging through
  19989. // the results.
  19990. NextPageToken string `json:"nextPageToken,omitempty"`
  19991. // SelfLink: [Output Only] Server-defined URL for this resource.
  19992. SelfLink string `json:"selfLink,omitempty"`
  19993. // Warning: [Output Only] Informational warning message.
  19994. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  19995. // ServerResponse contains the HTTP response code and headers from the
  19996. // server.
  19997. googleapi.ServerResponse `json:"-"`
  19998. // ForceSendFields is a list of field names (e.g. "Id") to
  19999. // unconditionally include in API requests. By default, fields with
  20000. // empty values are omitted from API requests. However, any non-pointer,
  20001. // non-interface field appearing in ForceSendFields will be sent to the
  20002. // server regardless of whether the field is empty or not. This may be
  20003. // used to include empty fields in Patch requests.
  20004. ForceSendFields []string `json:"-"`
  20005. // NullFields is a list of field names (e.g. "Id") to include in API
  20006. // requests with the JSON null value. By default, fields with empty
  20007. // values are omitted from API requests. However, any field with an
  20008. // empty value appearing in NullFields will be sent to the server as
  20009. // null. It is an error if a field in this list has a non-empty value.
  20010. // This may be used to include null fields in Patch requests.
  20011. NullFields []string `json:"-"`
  20012. }
  20013. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  20014. type NoMethod RegionInstanceGroupList
  20015. raw := NoMethod(*s)
  20016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20017. }
  20018. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  20019. // message.
  20020. type RegionInstanceGroupListWarning struct {
  20021. // Code: [Output Only] A warning code, if applicable. For example,
  20022. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20023. // the response.
  20024. //
  20025. // Possible values:
  20026. // "CLEANUP_FAILED"
  20027. // "DEPRECATED_RESOURCE_USED"
  20028. // "DEPRECATED_TYPE_USED"
  20029. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20030. // "EXPERIMENTAL_TYPE_USED"
  20031. // "EXTERNAL_API_WARNING"
  20032. // "FIELD_VALUE_OVERRIDEN"
  20033. // "INJECTED_KERNELS_DEPRECATED"
  20034. // "MISSING_TYPE_DEPENDENCY"
  20035. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20036. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20037. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20038. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20039. // "NEXT_HOP_NOT_RUNNING"
  20040. // "NOT_CRITICAL_ERROR"
  20041. // "NO_RESULTS_ON_PAGE"
  20042. // "REQUIRED_TOS_AGREEMENT"
  20043. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20044. // "RESOURCE_NOT_DELETED"
  20045. // "SCHEMA_VALIDATION_IGNORED"
  20046. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20047. // "UNDECLARED_PROPERTIES"
  20048. // "UNREACHABLE"
  20049. Code string `json:"code,omitempty"`
  20050. // Data: [Output Only] Metadata about this warning in key: value format.
  20051. // For example:
  20052. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20053. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  20054. // Message: [Output Only] A human-readable description of the warning
  20055. // code.
  20056. Message string `json:"message,omitempty"`
  20057. // ForceSendFields is a list of field names (e.g. "Code") to
  20058. // unconditionally include in API requests. By default, fields with
  20059. // empty values are omitted from API requests. However, any non-pointer,
  20060. // non-interface field appearing in ForceSendFields will be sent to the
  20061. // server regardless of whether the field is empty or not. This may be
  20062. // used to include empty fields in Patch requests.
  20063. ForceSendFields []string `json:"-"`
  20064. // NullFields is a list of field names (e.g. "Code") to include in API
  20065. // requests with the JSON null value. By default, fields with empty
  20066. // values are omitted from API requests. However, any field with an
  20067. // empty value appearing in NullFields will be sent to the server as
  20068. // null. It is an error if a field in this list has a non-empty value.
  20069. // This may be used to include null fields in Patch requests.
  20070. NullFields []string `json:"-"`
  20071. }
  20072. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  20073. type NoMethod RegionInstanceGroupListWarning
  20074. raw := NoMethod(*s)
  20075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20076. }
  20077. type RegionInstanceGroupListWarningData struct {
  20078. // Key: [Output Only] A key that provides more detail on the warning
  20079. // being returned. For example, for warnings where there are no results
  20080. // in a list request for a particular zone, this key might be scope and
  20081. // the key value might be the zone name. Other examples might be a key
  20082. // indicating a deprecated resource and a suggested replacement, or a
  20083. // warning about invalid network settings (for example, if an instance
  20084. // attempts to perform IP forwarding but is not enabled for IP
  20085. // forwarding).
  20086. Key string `json:"key,omitempty"`
  20087. // Value: [Output Only] A warning data value corresponding to the key.
  20088. Value string `json:"value,omitempty"`
  20089. // ForceSendFields is a list of field names (e.g. "Key") to
  20090. // unconditionally include in API requests. By default, fields with
  20091. // empty values are omitted from API requests. However, any non-pointer,
  20092. // non-interface field appearing in ForceSendFields will be sent to the
  20093. // server regardless of whether the field is empty or not. This may be
  20094. // used to include empty fields in Patch requests.
  20095. ForceSendFields []string `json:"-"`
  20096. // NullFields is a list of field names (e.g. "Key") to include in API
  20097. // requests with the JSON null value. By default, fields with empty
  20098. // values are omitted from API requests. However, any field with an
  20099. // empty value appearing in NullFields will be sent to the server as
  20100. // null. It is an error if a field in this list has a non-empty value.
  20101. // This may be used to include null fields in Patch requests.
  20102. NullFields []string `json:"-"`
  20103. }
  20104. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  20105. type NoMethod RegionInstanceGroupListWarningData
  20106. raw := NoMethod(*s)
  20107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20108. }
  20109. // RegionInstanceGroupManagerList: Contains a list of managed instance
  20110. // groups.
  20111. type RegionInstanceGroupManagerList struct {
  20112. // Id: [Output Only] Unique identifier for the resource; defined by the
  20113. // server.
  20114. Id string `json:"id,omitempty"`
  20115. // Items: A list of InstanceGroupManager resources.
  20116. Items []*InstanceGroupManager `json:"items,omitempty"`
  20117. // Kind: [Output Only] The resource type, which is always
  20118. // compute#instanceGroupManagerList for a list of managed instance
  20119. // groups that exist in th regional scope.
  20120. Kind string `json:"kind,omitempty"`
  20121. // NextPageToken: [Output Only] This token allows you to get the next
  20122. // page of results for list requests. If the number of results is larger
  20123. // than maxResults, use the nextPageToken as a value for the query
  20124. // parameter pageToken in the next list request. Subsequent list
  20125. // requests will have their own nextPageToken to continue paging through
  20126. // the results.
  20127. NextPageToken string `json:"nextPageToken,omitempty"`
  20128. // SelfLink: [Output Only] Server-defined URL for this resource.
  20129. SelfLink string `json:"selfLink,omitempty"`
  20130. // Warning: [Output Only] Informational warning message.
  20131. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  20132. // ServerResponse contains the HTTP response code and headers from the
  20133. // server.
  20134. googleapi.ServerResponse `json:"-"`
  20135. // ForceSendFields is a list of field names (e.g. "Id") to
  20136. // unconditionally include in API requests. By default, fields with
  20137. // empty values are omitted from API requests. However, any non-pointer,
  20138. // non-interface field appearing in ForceSendFields will be sent to the
  20139. // server regardless of whether the field is empty or not. This may be
  20140. // used to include empty fields in Patch requests.
  20141. ForceSendFields []string `json:"-"`
  20142. // NullFields is a list of field names (e.g. "Id") to include in API
  20143. // requests with the JSON null value. By default, fields with empty
  20144. // values are omitted from API requests. However, any field with an
  20145. // empty value appearing in NullFields will be sent to the server as
  20146. // null. It is an error if a field in this list has a non-empty value.
  20147. // This may be used to include null fields in Patch requests.
  20148. NullFields []string `json:"-"`
  20149. }
  20150. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  20151. type NoMethod RegionInstanceGroupManagerList
  20152. raw := NoMethod(*s)
  20153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20154. }
  20155. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  20156. // warning message.
  20157. type RegionInstanceGroupManagerListWarning struct {
  20158. // Code: [Output Only] A warning code, if applicable. For example,
  20159. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20160. // the response.
  20161. //
  20162. // Possible values:
  20163. // "CLEANUP_FAILED"
  20164. // "DEPRECATED_RESOURCE_USED"
  20165. // "DEPRECATED_TYPE_USED"
  20166. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20167. // "EXPERIMENTAL_TYPE_USED"
  20168. // "EXTERNAL_API_WARNING"
  20169. // "FIELD_VALUE_OVERRIDEN"
  20170. // "INJECTED_KERNELS_DEPRECATED"
  20171. // "MISSING_TYPE_DEPENDENCY"
  20172. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20173. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20174. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20175. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20176. // "NEXT_HOP_NOT_RUNNING"
  20177. // "NOT_CRITICAL_ERROR"
  20178. // "NO_RESULTS_ON_PAGE"
  20179. // "REQUIRED_TOS_AGREEMENT"
  20180. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20181. // "RESOURCE_NOT_DELETED"
  20182. // "SCHEMA_VALIDATION_IGNORED"
  20183. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20184. // "UNDECLARED_PROPERTIES"
  20185. // "UNREACHABLE"
  20186. Code string `json:"code,omitempty"`
  20187. // Data: [Output Only] Metadata about this warning in key: value format.
  20188. // For example:
  20189. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20190. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  20191. // Message: [Output Only] A human-readable description of the warning
  20192. // code.
  20193. Message string `json:"message,omitempty"`
  20194. // ForceSendFields is a list of field names (e.g. "Code") to
  20195. // unconditionally include in API requests. By default, fields with
  20196. // empty values are omitted from API requests. However, any non-pointer,
  20197. // non-interface field appearing in ForceSendFields will be sent to the
  20198. // server regardless of whether the field is empty or not. This may be
  20199. // used to include empty fields in Patch requests.
  20200. ForceSendFields []string `json:"-"`
  20201. // NullFields is a list of field names (e.g. "Code") to include in API
  20202. // requests with the JSON null value. By default, fields with empty
  20203. // values are omitted from API requests. However, any field with an
  20204. // empty value appearing in NullFields will be sent to the server as
  20205. // null. It is an error if a field in this list has a non-empty value.
  20206. // This may be used to include null fields in Patch requests.
  20207. NullFields []string `json:"-"`
  20208. }
  20209. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  20210. type NoMethod RegionInstanceGroupManagerListWarning
  20211. raw := NoMethod(*s)
  20212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20213. }
  20214. type RegionInstanceGroupManagerListWarningData struct {
  20215. // Key: [Output Only] A key that provides more detail on the warning
  20216. // being returned. For example, for warnings where there are no results
  20217. // in a list request for a particular zone, this key might be scope and
  20218. // the key value might be the zone name. Other examples might be a key
  20219. // indicating a deprecated resource and a suggested replacement, or a
  20220. // warning about invalid network settings (for example, if an instance
  20221. // attempts to perform IP forwarding but is not enabled for IP
  20222. // forwarding).
  20223. Key string `json:"key,omitempty"`
  20224. // Value: [Output Only] A warning data value corresponding to the key.
  20225. Value string `json:"value,omitempty"`
  20226. // ForceSendFields is a list of field names (e.g. "Key") to
  20227. // unconditionally include in API requests. By default, fields with
  20228. // empty values are omitted from API requests. However, any non-pointer,
  20229. // non-interface field appearing in ForceSendFields will be sent to the
  20230. // server regardless of whether the field is empty or not. This may be
  20231. // used to include empty fields in Patch requests.
  20232. ForceSendFields []string `json:"-"`
  20233. // NullFields is a list of field names (e.g. "Key") to include in API
  20234. // requests with the JSON null value. By default, fields with empty
  20235. // values are omitted from API requests. However, any field with an
  20236. // empty value appearing in NullFields will be sent to the server as
  20237. // null. It is an error if a field in this list has a non-empty value.
  20238. // This may be used to include null fields in Patch requests.
  20239. NullFields []string `json:"-"`
  20240. }
  20241. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  20242. type NoMethod RegionInstanceGroupManagerListWarningData
  20243. raw := NoMethod(*s)
  20244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20245. }
  20246. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  20247. // Instances: The URLs of one or more instances to abandon. This can be
  20248. // a full URL or a partial URL, such as
  20249. // zones/[ZONE]/instances/[INSTANCE_NAME].
  20250. Instances []string `json:"instances,omitempty"`
  20251. // ForceSendFields is a list of field names (e.g. "Instances") to
  20252. // unconditionally include in API requests. By default, fields with
  20253. // empty values are omitted from API requests. However, any non-pointer,
  20254. // non-interface field appearing in ForceSendFields will be sent to the
  20255. // server regardless of whether the field is empty or not. This may be
  20256. // used to include empty fields in Patch requests.
  20257. ForceSendFields []string `json:"-"`
  20258. // NullFields is a list of field names (e.g. "Instances") to include in
  20259. // API requests with the JSON null value. By default, fields with empty
  20260. // values are omitted from API requests. However, any field with an
  20261. // empty value appearing in NullFields will be sent to the server as
  20262. // null. It is an error if a field in this list has a non-empty value.
  20263. // This may be used to include null fields in Patch requests.
  20264. NullFields []string `json:"-"`
  20265. }
  20266. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  20267. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  20268. raw := NoMethod(*s)
  20269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20270. }
  20271. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  20272. // Instances: The URLs of one or more instances to delete. This can be a
  20273. // full URL or a partial URL, such as
  20274. // zones/[ZONE]/instances/[INSTANCE_NAME].
  20275. Instances []string `json:"instances,omitempty"`
  20276. // ForceSendFields is a list of field names (e.g. "Instances") to
  20277. // unconditionally include in API requests. By default, fields with
  20278. // empty values are omitted from API requests. However, any non-pointer,
  20279. // non-interface field appearing in ForceSendFields will be sent to the
  20280. // server regardless of whether the field is empty or not. This may be
  20281. // used to include empty fields in Patch requests.
  20282. ForceSendFields []string `json:"-"`
  20283. // NullFields is a list of field names (e.g. "Instances") to include in
  20284. // API requests with the JSON null value. By default, fields with empty
  20285. // values are omitted from API requests. However, any field with an
  20286. // empty value appearing in NullFields will be sent to the server as
  20287. // null. It is an error if a field in this list has a non-empty value.
  20288. // This may be used to include null fields in Patch requests.
  20289. NullFields []string `json:"-"`
  20290. }
  20291. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  20292. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  20293. raw := NoMethod(*s)
  20294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20295. }
  20296. type RegionInstanceGroupManagersListInstancesResponse struct {
  20297. // ManagedInstances: A list of managed instances.
  20298. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  20299. // NextPageToken: [Output Only] This token allows you to get the next
  20300. // page of results for list requests. If the number of results is larger
  20301. // than maxResults, use the nextPageToken as a value for the query
  20302. // parameter pageToken in the next list request. Subsequent list
  20303. // requests will have their own nextPageToken to continue paging through
  20304. // the results.
  20305. NextPageToken string `json:"nextPageToken,omitempty"`
  20306. // ServerResponse contains the HTTP response code and headers from the
  20307. // server.
  20308. googleapi.ServerResponse `json:"-"`
  20309. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  20310. // unconditionally include in API requests. By default, fields with
  20311. // empty values are omitted from API requests. However, any non-pointer,
  20312. // non-interface field appearing in ForceSendFields will be sent to the
  20313. // server regardless of whether the field is empty or not. This may be
  20314. // used to include empty fields in Patch requests.
  20315. ForceSendFields []string `json:"-"`
  20316. // NullFields is a list of field names (e.g. "ManagedInstances") to
  20317. // include in API requests with the JSON null value. By default, fields
  20318. // with empty values are omitted from API requests. However, any field
  20319. // with an empty value appearing in NullFields will be sent to the
  20320. // server as null. It is an error if a field in this list has a
  20321. // non-empty value. This may be used to include null fields in Patch
  20322. // requests.
  20323. NullFields []string `json:"-"`
  20324. }
  20325. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  20326. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  20327. raw := NoMethod(*s)
  20328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20329. }
  20330. type RegionInstanceGroupManagersRecreateRequest struct {
  20331. // Instances: The URLs of one or more instances to recreate. This can be
  20332. // a full URL or a partial URL, such as
  20333. // zones/[ZONE]/instances/[INSTANCE_NAME].
  20334. Instances []string `json:"instances,omitempty"`
  20335. // ForceSendFields is a list of field names (e.g. "Instances") to
  20336. // unconditionally include in API requests. By default, fields with
  20337. // empty values are omitted from API requests. However, any non-pointer,
  20338. // non-interface field appearing in ForceSendFields will be sent to the
  20339. // server regardless of whether the field is empty or not. This may be
  20340. // used to include empty fields in Patch requests.
  20341. ForceSendFields []string `json:"-"`
  20342. // NullFields is a list of field names (e.g. "Instances") to include in
  20343. // API requests with the JSON null value. By default, fields with empty
  20344. // values are omitted from API requests. However, any field with an
  20345. // empty value appearing in NullFields will be sent to the server as
  20346. // null. It is an error if a field in this list has a non-empty value.
  20347. // This may be used to include null fields in Patch requests.
  20348. NullFields []string `json:"-"`
  20349. }
  20350. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  20351. type NoMethod RegionInstanceGroupManagersRecreateRequest
  20352. raw := NoMethod(*s)
  20353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20354. }
  20355. type RegionInstanceGroupManagersSetAutoHealingRequest struct {
  20356. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  20357. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  20358. // to unconditionally include in API requests. By default, fields with
  20359. // empty values are omitted from API requests. However, any non-pointer,
  20360. // non-interface field appearing in ForceSendFields will be sent to the
  20361. // server regardless of whether the field is empty or not. This may be
  20362. // used to include empty fields in Patch requests.
  20363. ForceSendFields []string `json:"-"`
  20364. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  20365. // include in API requests with the JSON null value. By default, fields
  20366. // with empty values are omitted from API requests. However, any field
  20367. // with an empty value appearing in NullFields will be sent to the
  20368. // server as null. It is an error if a field in this list has a
  20369. // non-empty value. This may be used to include null fields in Patch
  20370. // requests.
  20371. NullFields []string `json:"-"`
  20372. }
  20373. func (s *RegionInstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  20374. type NoMethod RegionInstanceGroupManagersSetAutoHealingRequest
  20375. raw := NoMethod(*s)
  20376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20377. }
  20378. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  20379. // Fingerprint: Fingerprint of the target pools information, which is a
  20380. // hash of the contents. This field is used for optimistic locking when
  20381. // you update the target pool entries. This field is optional.
  20382. Fingerprint string `json:"fingerprint,omitempty"`
  20383. // TargetPools: The URL of all TargetPool resources to which instances
  20384. // in the instanceGroup field are added. The target pools automatically
  20385. // apply to all of the instances in the managed instance group.
  20386. TargetPools []string `json:"targetPools,omitempty"`
  20387. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  20388. // unconditionally include in API requests. By default, fields with
  20389. // empty values are omitted from API requests. However, any non-pointer,
  20390. // non-interface field appearing in ForceSendFields will be sent to the
  20391. // server regardless of whether the field is empty or not. This may be
  20392. // used to include empty fields in Patch requests.
  20393. ForceSendFields []string `json:"-"`
  20394. // NullFields is a list of field names (e.g. "Fingerprint") to include
  20395. // in API requests with the JSON null value. By default, fields with
  20396. // empty values are omitted from API requests. However, any field with
  20397. // an empty value appearing in NullFields will be sent to the server as
  20398. // null. It is an error if a field in this list has a non-empty value.
  20399. // This may be used to include null fields in Patch requests.
  20400. NullFields []string `json:"-"`
  20401. }
  20402. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  20403. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  20404. raw := NoMethod(*s)
  20405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20406. }
  20407. type RegionInstanceGroupManagersSetTemplateRequest struct {
  20408. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  20409. // new instances will be created.
  20410. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  20411. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  20412. // unconditionally include in API requests. By default, fields with
  20413. // empty values are omitted from API requests. However, any non-pointer,
  20414. // non-interface field appearing in ForceSendFields will be sent to the
  20415. // server regardless of whether the field is empty or not. This may be
  20416. // used to include empty fields in Patch requests.
  20417. ForceSendFields []string `json:"-"`
  20418. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  20419. // include in API requests with the JSON null value. By default, fields
  20420. // with empty values are omitted from API requests. However, any field
  20421. // with an empty value appearing in NullFields will be sent to the
  20422. // server as null. It is an error if a field in this list has a
  20423. // non-empty value. This may be used to include null fields in Patch
  20424. // requests.
  20425. NullFields []string `json:"-"`
  20426. }
  20427. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  20428. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  20429. raw := NoMethod(*s)
  20430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20431. }
  20432. type RegionInstanceGroupsListInstances struct {
  20433. // Id: [Output Only] Unique identifier for the resource; defined by the
  20434. // server.
  20435. Id string `json:"id,omitempty"`
  20436. // Items: A list of InstanceWithNamedPorts resources.
  20437. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  20438. // Kind: The resource type.
  20439. Kind string `json:"kind,omitempty"`
  20440. // NextPageToken: [Output Only] This token allows you to get the next
  20441. // page of results for list requests. If the number of results is larger
  20442. // than maxResults, use the nextPageToken as a value for the query
  20443. // parameter pageToken in the next list request. Subsequent list
  20444. // requests will have their own nextPageToken to continue paging through
  20445. // the results.
  20446. NextPageToken string `json:"nextPageToken,omitempty"`
  20447. // SelfLink: [Output Only] Server-defined URL for this resource.
  20448. SelfLink string `json:"selfLink,omitempty"`
  20449. // Warning: [Output Only] Informational warning message.
  20450. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  20451. // ServerResponse contains the HTTP response code and headers from the
  20452. // server.
  20453. googleapi.ServerResponse `json:"-"`
  20454. // ForceSendFields is a list of field names (e.g. "Id") to
  20455. // unconditionally include in API requests. By default, fields with
  20456. // empty values are omitted from API requests. However, any non-pointer,
  20457. // non-interface field appearing in ForceSendFields will be sent to the
  20458. // server regardless of whether the field is empty or not. This may be
  20459. // used to include empty fields in Patch requests.
  20460. ForceSendFields []string `json:"-"`
  20461. // NullFields is a list of field names (e.g. "Id") to include in API
  20462. // requests with the JSON null value. By default, fields with empty
  20463. // values are omitted from API requests. However, any field with an
  20464. // empty value appearing in NullFields will be sent to the server as
  20465. // null. It is an error if a field in this list has a non-empty value.
  20466. // This may be used to include null fields in Patch requests.
  20467. NullFields []string `json:"-"`
  20468. }
  20469. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  20470. type NoMethod RegionInstanceGroupsListInstances
  20471. raw := NoMethod(*s)
  20472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20473. }
  20474. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  20475. // warning message.
  20476. type RegionInstanceGroupsListInstancesWarning struct {
  20477. // Code: [Output Only] A warning code, if applicable. For example,
  20478. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20479. // the response.
  20480. //
  20481. // Possible values:
  20482. // "CLEANUP_FAILED"
  20483. // "DEPRECATED_RESOURCE_USED"
  20484. // "DEPRECATED_TYPE_USED"
  20485. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20486. // "EXPERIMENTAL_TYPE_USED"
  20487. // "EXTERNAL_API_WARNING"
  20488. // "FIELD_VALUE_OVERRIDEN"
  20489. // "INJECTED_KERNELS_DEPRECATED"
  20490. // "MISSING_TYPE_DEPENDENCY"
  20491. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20492. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20493. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20494. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20495. // "NEXT_HOP_NOT_RUNNING"
  20496. // "NOT_CRITICAL_ERROR"
  20497. // "NO_RESULTS_ON_PAGE"
  20498. // "REQUIRED_TOS_AGREEMENT"
  20499. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20500. // "RESOURCE_NOT_DELETED"
  20501. // "SCHEMA_VALIDATION_IGNORED"
  20502. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20503. // "UNDECLARED_PROPERTIES"
  20504. // "UNREACHABLE"
  20505. Code string `json:"code,omitempty"`
  20506. // Data: [Output Only] Metadata about this warning in key: value format.
  20507. // For example:
  20508. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20509. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  20510. // Message: [Output Only] A human-readable description of the warning
  20511. // code.
  20512. Message string `json:"message,omitempty"`
  20513. // ForceSendFields is a list of field names (e.g. "Code") to
  20514. // unconditionally include in API requests. By default, fields with
  20515. // empty values are omitted from API requests. However, any non-pointer,
  20516. // non-interface field appearing in ForceSendFields will be sent to the
  20517. // server regardless of whether the field is empty or not. This may be
  20518. // used to include empty fields in Patch requests.
  20519. ForceSendFields []string `json:"-"`
  20520. // NullFields is a list of field names (e.g. "Code") to include in API
  20521. // requests with the JSON null value. By default, fields with empty
  20522. // values are omitted from API requests. However, any field with an
  20523. // empty value appearing in NullFields will be sent to the server as
  20524. // null. It is an error if a field in this list has a non-empty value.
  20525. // This may be used to include null fields in Patch requests.
  20526. NullFields []string `json:"-"`
  20527. }
  20528. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  20529. type NoMethod RegionInstanceGroupsListInstancesWarning
  20530. raw := NoMethod(*s)
  20531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20532. }
  20533. type RegionInstanceGroupsListInstancesWarningData struct {
  20534. // Key: [Output Only] A key that provides more detail on the warning
  20535. // being returned. For example, for warnings where there are no results
  20536. // in a list request for a particular zone, this key might be scope and
  20537. // the key value might be the zone name. Other examples might be a key
  20538. // indicating a deprecated resource and a suggested replacement, or a
  20539. // warning about invalid network settings (for example, if an instance
  20540. // attempts to perform IP forwarding but is not enabled for IP
  20541. // forwarding).
  20542. Key string `json:"key,omitempty"`
  20543. // Value: [Output Only] A warning data value corresponding to the key.
  20544. Value string `json:"value,omitempty"`
  20545. // ForceSendFields is a list of field names (e.g. "Key") to
  20546. // unconditionally include in API requests. By default, fields with
  20547. // empty values are omitted from API requests. However, any non-pointer,
  20548. // non-interface field appearing in ForceSendFields will be sent to the
  20549. // server regardless of whether the field is empty or not. This may be
  20550. // used to include empty fields in Patch requests.
  20551. ForceSendFields []string `json:"-"`
  20552. // NullFields is a list of field names (e.g. "Key") to include in API
  20553. // requests with the JSON null value. By default, fields with empty
  20554. // values are omitted from API requests. However, any field with an
  20555. // empty value appearing in NullFields will be sent to the server as
  20556. // null. It is an error if a field in this list has a non-empty value.
  20557. // This may be used to include null fields in Patch requests.
  20558. NullFields []string `json:"-"`
  20559. }
  20560. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  20561. type NoMethod RegionInstanceGroupsListInstancesWarningData
  20562. raw := NoMethod(*s)
  20563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20564. }
  20565. type RegionInstanceGroupsListInstancesRequest struct {
  20566. // InstanceState: Instances in which state should be returned. Valid
  20567. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  20568. //
  20569. // Possible values:
  20570. // "ALL"
  20571. // "RUNNING"
  20572. InstanceState string `json:"instanceState,omitempty"`
  20573. // PortName: Name of port user is interested in. It is optional. If it
  20574. // is set, only information about this ports will be returned. If it is
  20575. // not set, all the named ports will be returned. Always lists all
  20576. // instances.
  20577. PortName string `json:"portName,omitempty"`
  20578. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  20579. // unconditionally include in API requests. By default, fields with
  20580. // empty values are omitted from API requests. However, any non-pointer,
  20581. // non-interface field appearing in ForceSendFields will be sent to the
  20582. // server regardless of whether the field is empty or not. This may be
  20583. // used to include empty fields in Patch requests.
  20584. ForceSendFields []string `json:"-"`
  20585. // NullFields is a list of field names (e.g. "InstanceState") to include
  20586. // in API requests with the JSON null value. By default, fields with
  20587. // empty values are omitted from API requests. However, any field with
  20588. // an empty value appearing in NullFields will be sent to the server as
  20589. // null. It is an error if a field in this list has a non-empty value.
  20590. // This may be used to include null fields in Patch requests.
  20591. NullFields []string `json:"-"`
  20592. }
  20593. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  20594. type NoMethod RegionInstanceGroupsListInstancesRequest
  20595. raw := NoMethod(*s)
  20596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20597. }
  20598. type RegionInstanceGroupsSetNamedPortsRequest struct {
  20599. // Fingerprint: The fingerprint of the named ports information for this
  20600. // instance group. Use this optional property to prevent conflicts when
  20601. // multiple users change the named ports settings concurrently. Obtain
  20602. // the fingerprint with the instanceGroups.get method. Then, include the
  20603. // fingerprint in your request to ensure that you do not overwrite
  20604. // changes that were applied from another concurrent request.
  20605. Fingerprint string `json:"fingerprint,omitempty"`
  20606. // NamedPorts: The list of named ports to set for this instance group.
  20607. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  20608. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  20609. // unconditionally include in API requests. By default, fields with
  20610. // empty values are omitted from API requests. However, any non-pointer,
  20611. // non-interface field appearing in ForceSendFields will be sent to the
  20612. // server regardless of whether the field is empty or not. This may be
  20613. // used to include empty fields in Patch requests.
  20614. ForceSendFields []string `json:"-"`
  20615. // NullFields is a list of field names (e.g. "Fingerprint") to include
  20616. // in API requests with the JSON null value. By default, fields with
  20617. // empty values are omitted from API requests. However, any field with
  20618. // an empty value appearing in NullFields will be sent to the server as
  20619. // null. It is an error if a field in this list has a non-empty value.
  20620. // This may be used to include null fields in Patch requests.
  20621. NullFields []string `json:"-"`
  20622. }
  20623. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  20624. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  20625. raw := NoMethod(*s)
  20626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20627. }
  20628. // RegionList: Contains a list of region resources.
  20629. type RegionList struct {
  20630. // Id: [Output Only] Unique identifier for the resource; defined by the
  20631. // server.
  20632. Id string `json:"id,omitempty"`
  20633. // Items: A list of Region resources.
  20634. Items []*Region `json:"items,omitempty"`
  20635. // Kind: [Output Only] Type of resource. Always compute#regionList for
  20636. // lists of regions.
  20637. Kind string `json:"kind,omitempty"`
  20638. // NextPageToken: [Output Only] This token allows you to get the next
  20639. // page of results for list requests. If the number of results is larger
  20640. // than maxResults, use the nextPageToken as a value for the query
  20641. // parameter pageToken in the next list request. Subsequent list
  20642. // requests will have their own nextPageToken to continue paging through
  20643. // the results.
  20644. NextPageToken string `json:"nextPageToken,omitempty"`
  20645. // SelfLink: [Output Only] Server-defined URL for this resource.
  20646. SelfLink string `json:"selfLink,omitempty"`
  20647. // Warning: [Output Only] Informational warning message.
  20648. Warning *RegionListWarning `json:"warning,omitempty"`
  20649. // ServerResponse contains the HTTP response code and headers from the
  20650. // server.
  20651. googleapi.ServerResponse `json:"-"`
  20652. // ForceSendFields is a list of field names (e.g. "Id") to
  20653. // unconditionally include in API requests. By default, fields with
  20654. // empty values are omitted from API requests. However, any non-pointer,
  20655. // non-interface field appearing in ForceSendFields will be sent to the
  20656. // server regardless of whether the field is empty or not. This may be
  20657. // used to include empty fields in Patch requests.
  20658. ForceSendFields []string `json:"-"`
  20659. // NullFields is a list of field names (e.g. "Id") to include in API
  20660. // requests with the JSON null value. By default, fields with empty
  20661. // values are omitted from API requests. However, any field with an
  20662. // empty value appearing in NullFields will be sent to the server as
  20663. // null. It is an error if a field in this list has a non-empty value.
  20664. // This may be used to include null fields in Patch requests.
  20665. NullFields []string `json:"-"`
  20666. }
  20667. func (s *RegionList) MarshalJSON() ([]byte, error) {
  20668. type NoMethod RegionList
  20669. raw := NoMethod(*s)
  20670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20671. }
  20672. // RegionListWarning: [Output Only] Informational warning message.
  20673. type RegionListWarning struct {
  20674. // Code: [Output Only] A warning code, if applicable. For example,
  20675. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20676. // the response.
  20677. //
  20678. // Possible values:
  20679. // "CLEANUP_FAILED"
  20680. // "DEPRECATED_RESOURCE_USED"
  20681. // "DEPRECATED_TYPE_USED"
  20682. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20683. // "EXPERIMENTAL_TYPE_USED"
  20684. // "EXTERNAL_API_WARNING"
  20685. // "FIELD_VALUE_OVERRIDEN"
  20686. // "INJECTED_KERNELS_DEPRECATED"
  20687. // "MISSING_TYPE_DEPENDENCY"
  20688. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20689. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20690. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20691. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20692. // "NEXT_HOP_NOT_RUNNING"
  20693. // "NOT_CRITICAL_ERROR"
  20694. // "NO_RESULTS_ON_PAGE"
  20695. // "REQUIRED_TOS_AGREEMENT"
  20696. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20697. // "RESOURCE_NOT_DELETED"
  20698. // "SCHEMA_VALIDATION_IGNORED"
  20699. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20700. // "UNDECLARED_PROPERTIES"
  20701. // "UNREACHABLE"
  20702. Code string `json:"code,omitempty"`
  20703. // Data: [Output Only] Metadata about this warning in key: value format.
  20704. // For example:
  20705. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20706. Data []*RegionListWarningData `json:"data,omitempty"`
  20707. // Message: [Output Only] A human-readable description of the warning
  20708. // code.
  20709. Message string `json:"message,omitempty"`
  20710. // ForceSendFields is a list of field names (e.g. "Code") to
  20711. // unconditionally include in API requests. By default, fields with
  20712. // empty values are omitted from API requests. However, any non-pointer,
  20713. // non-interface field appearing in ForceSendFields will be sent to the
  20714. // server regardless of whether the field is empty or not. This may be
  20715. // used to include empty fields in Patch requests.
  20716. ForceSendFields []string `json:"-"`
  20717. // NullFields is a list of field names (e.g. "Code") to include in API
  20718. // requests with the JSON null value. By default, fields with empty
  20719. // values are omitted from API requests. However, any field with an
  20720. // empty value appearing in NullFields will be sent to the server as
  20721. // null. It is an error if a field in this list has a non-empty value.
  20722. // This may be used to include null fields in Patch requests.
  20723. NullFields []string `json:"-"`
  20724. }
  20725. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  20726. type NoMethod RegionListWarning
  20727. raw := NoMethod(*s)
  20728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20729. }
  20730. type RegionListWarningData struct {
  20731. // Key: [Output Only] A key that provides more detail on the warning
  20732. // being returned. For example, for warnings where there are no results
  20733. // in a list request for a particular zone, this key might be scope and
  20734. // the key value might be the zone name. Other examples might be a key
  20735. // indicating a deprecated resource and a suggested replacement, or a
  20736. // warning about invalid network settings (for example, if an instance
  20737. // attempts to perform IP forwarding but is not enabled for IP
  20738. // forwarding).
  20739. Key string `json:"key,omitempty"`
  20740. // Value: [Output Only] A warning data value corresponding to the key.
  20741. Value string `json:"value,omitempty"`
  20742. // ForceSendFields is a list of field names (e.g. "Key") to
  20743. // unconditionally include in API requests. By default, fields with
  20744. // empty values are omitted from API requests. However, any non-pointer,
  20745. // non-interface field appearing in ForceSendFields will be sent to the
  20746. // server regardless of whether the field is empty or not. This may be
  20747. // used to include empty fields in Patch requests.
  20748. ForceSendFields []string `json:"-"`
  20749. // NullFields is a list of field names (e.g. "Key") to include in API
  20750. // requests with the JSON null value. By default, fields with empty
  20751. // values are omitted from API requests. However, any field with an
  20752. // empty value appearing in NullFields will be sent to the server as
  20753. // null. It is an error if a field in this list has a non-empty value.
  20754. // This may be used to include null fields in Patch requests.
  20755. NullFields []string `json:"-"`
  20756. }
  20757. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  20758. type NoMethod RegionListWarningData
  20759. raw := NoMethod(*s)
  20760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20761. }
  20762. type RegionSetLabelsRequest struct {
  20763. // LabelFingerprint: The fingerprint of the previous set of labels for
  20764. // this resource, used to detect conflicts. The fingerprint is initially
  20765. // generated by Compute Engine and changes after every request to modify
  20766. // or update labels. You must always provide an up-to-date fingerprint
  20767. // hash in order to update or change labels. Make a get() request to the
  20768. // resource to get the latest fingerprint.
  20769. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  20770. // Labels: The labels to set for this resource.
  20771. Labels map[string]string `json:"labels,omitempty"`
  20772. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  20773. // unconditionally include in API requests. By default, fields with
  20774. // empty values are omitted from API requests. However, any non-pointer,
  20775. // non-interface field appearing in ForceSendFields will be sent to the
  20776. // server regardless of whether the field is empty or not. This may be
  20777. // used to include empty fields in Patch requests.
  20778. ForceSendFields []string `json:"-"`
  20779. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  20780. // include in API requests with the JSON null value. By default, fields
  20781. // with empty values are omitted from API requests. However, any field
  20782. // with an empty value appearing in NullFields will be sent to the
  20783. // server as null. It is an error if a field in this list has a
  20784. // non-empty value. This may be used to include null fields in Patch
  20785. // requests.
  20786. NullFields []string `json:"-"`
  20787. }
  20788. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  20789. type NoMethod RegionSetLabelsRequest
  20790. raw := NoMethod(*s)
  20791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20792. }
  20793. type RegionSetPolicyRequest struct {
  20794. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  20795. // Deprecated. Use 'policy' to specify bindings.
  20796. Bindings []*Binding `json:"bindings,omitempty"`
  20797. // Etag: Flatten Policy to create a backward compatible wire-format.
  20798. // Deprecated. Use 'policy' to specify the etag.
  20799. Etag string `json:"etag,omitempty"`
  20800. // Policy: REQUIRED: The complete policy to be applied to the
  20801. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  20802. // empty policy is in general a valid policy but certain services (like
  20803. // Projects) might reject them.
  20804. Policy *Policy `json:"policy,omitempty"`
  20805. // ForceSendFields is a list of field names (e.g. "Bindings") to
  20806. // unconditionally include in API requests. By default, fields with
  20807. // empty values are omitted from API requests. However, any non-pointer,
  20808. // non-interface field appearing in ForceSendFields will be sent to the
  20809. // server regardless of whether the field is empty or not. This may be
  20810. // used to include empty fields in Patch requests.
  20811. ForceSendFields []string `json:"-"`
  20812. // NullFields is a list of field names (e.g. "Bindings") to include in
  20813. // API requests with the JSON null value. By default, fields with empty
  20814. // values are omitted from API requests. However, any field with an
  20815. // empty value appearing in NullFields will be sent to the server as
  20816. // null. It is an error if a field in this list has a non-empty value.
  20817. // This may be used to include null fields in Patch requests.
  20818. NullFields []string `json:"-"`
  20819. }
  20820. func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  20821. type NoMethod RegionSetPolicyRequest
  20822. raw := NoMethod(*s)
  20823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20824. }
  20825. // ResourceCommitment: Commitment for a particular resource (a
  20826. // Commitment is composed of one or more of these).
  20827. type ResourceCommitment struct {
  20828. // AcceleratorType: Name of the accelerator type resource. Applicable
  20829. // only when the type is ACCELERATOR.
  20830. AcceleratorType string `json:"acceleratorType,omitempty"`
  20831. // Amount: The amount of the resource purchased (in a type-dependent
  20832. // unit, such as bytes). For vCPUs, this can just be an integer. For
  20833. // memory, this must be provided in MB. Memory must be a multiple of 256
  20834. // MB, with up to 6.5GB of memory per every vCPU.
  20835. Amount int64 `json:"amount,omitempty,string"`
  20836. // Type: Type of resource for which this commitment applies. Possible
  20837. // values are VCPU and MEMORY
  20838. //
  20839. // Possible values:
  20840. // "ACCELERATOR"
  20841. // "LOCAL_SSD"
  20842. // "MEMORY"
  20843. // "UNSPECIFIED"
  20844. // "VCPU"
  20845. Type string `json:"type,omitempty"`
  20846. // ForceSendFields is a list of field names (e.g. "AcceleratorType") to
  20847. // unconditionally include in API requests. By default, fields with
  20848. // empty values are omitted from API requests. However, any non-pointer,
  20849. // non-interface field appearing in ForceSendFields will be sent to the
  20850. // server regardless of whether the field is empty or not. This may be
  20851. // used to include empty fields in Patch requests.
  20852. ForceSendFields []string `json:"-"`
  20853. // NullFields is a list of field names (e.g. "AcceleratorType") to
  20854. // include in API requests with the JSON null value. By default, fields
  20855. // with empty values are omitted from API requests. However, any field
  20856. // with an empty value appearing in NullFields will be sent to the
  20857. // server as null. It is an error if a field in this list has a
  20858. // non-empty value. This may be used to include null fields in Patch
  20859. // requests.
  20860. NullFields []string `json:"-"`
  20861. }
  20862. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  20863. type NoMethod ResourceCommitment
  20864. raw := NoMethod(*s)
  20865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20866. }
  20867. type ResourceGroupReference struct {
  20868. // Group: A URI referencing one of the instance groups or network
  20869. // endpoint groups listed in the backend service.
  20870. Group string `json:"group,omitempty"`
  20871. // ForceSendFields is a list of field names (e.g. "Group") to
  20872. // unconditionally include in API requests. By default, fields with
  20873. // empty values are omitted from API requests. However, any non-pointer,
  20874. // non-interface field appearing in ForceSendFields will be sent to the
  20875. // server regardless of whether the field is empty or not. This may be
  20876. // used to include empty fields in Patch requests.
  20877. ForceSendFields []string `json:"-"`
  20878. // NullFields is a list of field names (e.g. "Group") to include in API
  20879. // requests with the JSON null value. By default, fields with empty
  20880. // values are omitted from API requests. However, any field with an
  20881. // empty value appearing in NullFields will be sent to the server as
  20882. // null. It is an error if a field in this list has a non-empty value.
  20883. // This may be used to include null fields in Patch requests.
  20884. NullFields []string `json:"-"`
  20885. }
  20886. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  20887. type NoMethod ResourceGroupReference
  20888. raw := NoMethod(*s)
  20889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20890. }
  20891. type ResourcePoliciesScopedList struct {
  20892. // ResourcePolicies: A list of resourcePolicies contained in this scope.
  20893. ResourcePolicies []*ResourcePolicy `json:"resourcePolicies,omitempty"`
  20894. // Warning: Informational warning which replaces the list of
  20895. // resourcePolicies when the list is empty.
  20896. Warning *ResourcePoliciesScopedListWarning `json:"warning,omitempty"`
  20897. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  20898. // unconditionally include in API requests. By default, fields with
  20899. // empty values are omitted from API requests. However, any non-pointer,
  20900. // non-interface field appearing in ForceSendFields will be sent to the
  20901. // server regardless of whether the field is empty or not. This may be
  20902. // used to include empty fields in Patch requests.
  20903. ForceSendFields []string `json:"-"`
  20904. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  20905. // include in API requests with the JSON null value. By default, fields
  20906. // with empty values are omitted from API requests. However, any field
  20907. // with an empty value appearing in NullFields will be sent to the
  20908. // server as null. It is an error if a field in this list has a
  20909. // non-empty value. This may be used to include null fields in Patch
  20910. // requests.
  20911. NullFields []string `json:"-"`
  20912. }
  20913. func (s *ResourcePoliciesScopedList) MarshalJSON() ([]byte, error) {
  20914. type NoMethod ResourcePoliciesScopedList
  20915. raw := NoMethod(*s)
  20916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20917. }
  20918. // ResourcePoliciesScopedListWarning: Informational warning which
  20919. // replaces the list of resourcePolicies when the list is empty.
  20920. type ResourcePoliciesScopedListWarning struct {
  20921. // Code: [Output Only] A warning code, if applicable. For example,
  20922. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20923. // the response.
  20924. //
  20925. // Possible values:
  20926. // "CLEANUP_FAILED"
  20927. // "DEPRECATED_RESOURCE_USED"
  20928. // "DEPRECATED_TYPE_USED"
  20929. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20930. // "EXPERIMENTAL_TYPE_USED"
  20931. // "EXTERNAL_API_WARNING"
  20932. // "FIELD_VALUE_OVERRIDEN"
  20933. // "INJECTED_KERNELS_DEPRECATED"
  20934. // "MISSING_TYPE_DEPENDENCY"
  20935. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20936. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20937. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20938. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20939. // "NEXT_HOP_NOT_RUNNING"
  20940. // "NOT_CRITICAL_ERROR"
  20941. // "NO_RESULTS_ON_PAGE"
  20942. // "REQUIRED_TOS_AGREEMENT"
  20943. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20944. // "RESOURCE_NOT_DELETED"
  20945. // "SCHEMA_VALIDATION_IGNORED"
  20946. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20947. // "UNDECLARED_PROPERTIES"
  20948. // "UNREACHABLE"
  20949. Code string `json:"code,omitempty"`
  20950. // Data: [Output Only] Metadata about this warning in key: value format.
  20951. // For example:
  20952. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20953. Data []*ResourcePoliciesScopedListWarningData `json:"data,omitempty"`
  20954. // Message: [Output Only] A human-readable description of the warning
  20955. // code.
  20956. Message string `json:"message,omitempty"`
  20957. // ForceSendFields is a list of field names (e.g. "Code") to
  20958. // unconditionally include in API requests. By default, fields with
  20959. // empty values are omitted from API requests. However, any non-pointer,
  20960. // non-interface field appearing in ForceSendFields will be sent to the
  20961. // server regardless of whether the field is empty or not. This may be
  20962. // used to include empty fields in Patch requests.
  20963. ForceSendFields []string `json:"-"`
  20964. // NullFields is a list of field names (e.g. "Code") to include in API
  20965. // requests with the JSON null value. By default, fields with empty
  20966. // values are omitted from API requests. However, any field with an
  20967. // empty value appearing in NullFields will be sent to the server as
  20968. // null. It is an error if a field in this list has a non-empty value.
  20969. // This may be used to include null fields in Patch requests.
  20970. NullFields []string `json:"-"`
  20971. }
  20972. func (s *ResourcePoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
  20973. type NoMethod ResourcePoliciesScopedListWarning
  20974. raw := NoMethod(*s)
  20975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20976. }
  20977. type ResourcePoliciesScopedListWarningData struct {
  20978. // Key: [Output Only] A key that provides more detail on the warning
  20979. // being returned. For example, for warnings where there are no results
  20980. // in a list request for a particular zone, this key might be scope and
  20981. // the key value might be the zone name. Other examples might be a key
  20982. // indicating a deprecated resource and a suggested replacement, or a
  20983. // warning about invalid network settings (for example, if an instance
  20984. // attempts to perform IP forwarding but is not enabled for IP
  20985. // forwarding).
  20986. Key string `json:"key,omitempty"`
  20987. // Value: [Output Only] A warning data value corresponding to the key.
  20988. Value string `json:"value,omitempty"`
  20989. // ForceSendFields is a list of field names (e.g. "Key") to
  20990. // unconditionally include in API requests. By default, fields with
  20991. // empty values are omitted from API requests. However, any non-pointer,
  20992. // non-interface field appearing in ForceSendFields will be sent to the
  20993. // server regardless of whether the field is empty or not. This may be
  20994. // used to include empty fields in Patch requests.
  20995. ForceSendFields []string `json:"-"`
  20996. // NullFields is a list of field names (e.g. "Key") to include in API
  20997. // requests with the JSON null value. By default, fields with empty
  20998. // values are omitted from API requests. However, any field with an
  20999. // empty value appearing in NullFields will be sent to the server as
  21000. // null. It is an error if a field in this list has a non-empty value.
  21001. // This may be used to include null fields in Patch requests.
  21002. NullFields []string `json:"-"`
  21003. }
  21004. func (s *ResourcePoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
  21005. type NoMethod ResourcePoliciesScopedListWarningData
  21006. raw := NoMethod(*s)
  21007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21008. }
  21009. type ResourcePolicy struct {
  21010. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21011. // format.
  21012. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21013. Description string `json:"description,omitempty"`
  21014. // Id: [Output Only] The unique identifier for the resource. This
  21015. // identifier is defined by the server.
  21016. Id uint64 `json:"id,omitempty,string"`
  21017. // Kind: [Output Only] Type of the resource. Always
  21018. // compute#resource_policies for resource policies.
  21019. Kind string `json:"kind,omitempty"`
  21020. // Name: The name of the resource, provided by the client when initially
  21021. // creating the resource. The resource name must be 1-63 characters
  21022. // long, and comply with RFC1035. Specifically, the name must be 1-63
  21023. // characters long and match the regular expression
  21024. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  21025. // a lowercase letter, and all following characters must be a dash,
  21026. // lowercase letter, or digit, except the last character, which cannot
  21027. // be a dash.
  21028. Name string `json:"name,omitempty"`
  21029. Region string `json:"region,omitempty"`
  21030. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  21031. // resource.
  21032. SelfLink string `json:"selfLink,omitempty"`
  21033. // SnapshotSchedulePolicy: Resource policy for persistent disks for
  21034. // creating snapshots.
  21035. SnapshotSchedulePolicy *ResourcePolicySnapshotSchedulePolicy `json:"snapshotSchedulePolicy,omitempty"`
  21036. // ServerResponse contains the HTTP response code and headers from the
  21037. // server.
  21038. googleapi.ServerResponse `json:"-"`
  21039. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21040. // to unconditionally include in API requests. By default, fields with
  21041. // empty values are omitted from API requests. However, any non-pointer,
  21042. // non-interface field appearing in ForceSendFields will be sent to the
  21043. // server regardless of whether the field is empty or not. This may be
  21044. // used to include empty fields in Patch requests.
  21045. ForceSendFields []string `json:"-"`
  21046. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21047. // include in API requests with the JSON null value. By default, fields
  21048. // with empty values are omitted from API requests. However, any field
  21049. // with an empty value appearing in NullFields will be sent to the
  21050. // server as null. It is an error if a field in this list has a
  21051. // non-empty value. This may be used to include null fields in Patch
  21052. // requests.
  21053. NullFields []string `json:"-"`
  21054. }
  21055. func (s *ResourcePolicy) MarshalJSON() ([]byte, error) {
  21056. type NoMethod ResourcePolicy
  21057. raw := NoMethod(*s)
  21058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21059. }
  21060. // ResourcePolicyAggregatedList: Contains a list of resourcePolicies.
  21061. type ResourcePolicyAggregatedList struct {
  21062. Etag string `json:"etag,omitempty"`
  21063. // Id: [Output Only] Unique identifier for the resource; defined by the
  21064. // server.
  21065. Id string `json:"id,omitempty"`
  21066. // Items: A list of ResourcePolicy resources.
  21067. Items map[string]ResourcePoliciesScopedList `json:"items,omitempty"`
  21068. // Kind: Type of resource.
  21069. Kind string `json:"kind,omitempty"`
  21070. // NextPageToken: [Output Only] This token allows you to get the next
  21071. // page of results for list requests. If the number of results is larger
  21072. // than maxResults, use the nextPageToken as a value for the query
  21073. // parameter pageToken in the next list request. Subsequent list
  21074. // requests will have their own nextPageToken to continue paging through
  21075. // the results.
  21076. NextPageToken string `json:"nextPageToken,omitempty"`
  21077. // SelfLink: [Output Only] Server-defined URL for this resource.
  21078. SelfLink string `json:"selfLink,omitempty"`
  21079. // Warning: [Output Only] Informational warning message.
  21080. Warning *ResourcePolicyAggregatedListWarning `json:"warning,omitempty"`
  21081. // ServerResponse contains the HTTP response code and headers from the
  21082. // server.
  21083. googleapi.ServerResponse `json:"-"`
  21084. // ForceSendFields is a list of field names (e.g. "Etag") to
  21085. // unconditionally include in API requests. By default, fields with
  21086. // empty values are omitted from API requests. However, any non-pointer,
  21087. // non-interface field appearing in ForceSendFields will be sent to the
  21088. // server regardless of whether the field is empty or not. This may be
  21089. // used to include empty fields in Patch requests.
  21090. ForceSendFields []string `json:"-"`
  21091. // NullFields is a list of field names (e.g. "Etag") to include in API
  21092. // requests with the JSON null value. By default, fields with empty
  21093. // values are omitted from API requests. However, any field with an
  21094. // empty value appearing in NullFields will be sent to the server as
  21095. // null. It is an error if a field in this list has a non-empty value.
  21096. // This may be used to include null fields in Patch requests.
  21097. NullFields []string `json:"-"`
  21098. }
  21099. func (s *ResourcePolicyAggregatedList) MarshalJSON() ([]byte, error) {
  21100. type NoMethod ResourcePolicyAggregatedList
  21101. raw := NoMethod(*s)
  21102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21103. }
  21104. // ResourcePolicyAggregatedListWarning: [Output Only] Informational
  21105. // warning message.
  21106. type ResourcePolicyAggregatedListWarning struct {
  21107. // Code: [Output Only] A warning code, if applicable. For example,
  21108. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21109. // the response.
  21110. //
  21111. // Possible values:
  21112. // "CLEANUP_FAILED"
  21113. // "DEPRECATED_RESOURCE_USED"
  21114. // "DEPRECATED_TYPE_USED"
  21115. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21116. // "EXPERIMENTAL_TYPE_USED"
  21117. // "EXTERNAL_API_WARNING"
  21118. // "FIELD_VALUE_OVERRIDEN"
  21119. // "INJECTED_KERNELS_DEPRECATED"
  21120. // "MISSING_TYPE_DEPENDENCY"
  21121. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21122. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21123. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21124. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21125. // "NEXT_HOP_NOT_RUNNING"
  21126. // "NOT_CRITICAL_ERROR"
  21127. // "NO_RESULTS_ON_PAGE"
  21128. // "REQUIRED_TOS_AGREEMENT"
  21129. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21130. // "RESOURCE_NOT_DELETED"
  21131. // "SCHEMA_VALIDATION_IGNORED"
  21132. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21133. // "UNDECLARED_PROPERTIES"
  21134. // "UNREACHABLE"
  21135. Code string `json:"code,omitempty"`
  21136. // Data: [Output Only] Metadata about this warning in key: value format.
  21137. // For example:
  21138. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21139. Data []*ResourcePolicyAggregatedListWarningData `json:"data,omitempty"`
  21140. // Message: [Output Only] A human-readable description of the warning
  21141. // code.
  21142. Message string `json:"message,omitempty"`
  21143. // ForceSendFields is a list of field names (e.g. "Code") to
  21144. // unconditionally include in API requests. By default, fields with
  21145. // empty values are omitted from API requests. However, any non-pointer,
  21146. // non-interface field appearing in ForceSendFields will be sent to the
  21147. // server regardless of whether the field is empty or not. This may be
  21148. // used to include empty fields in Patch requests.
  21149. ForceSendFields []string `json:"-"`
  21150. // NullFields is a list of field names (e.g. "Code") to include in API
  21151. // requests with the JSON null value. By default, fields with empty
  21152. // values are omitted from API requests. However, any field with an
  21153. // empty value appearing in NullFields will be sent to the server as
  21154. // null. It is an error if a field in this list has a non-empty value.
  21155. // This may be used to include null fields in Patch requests.
  21156. NullFields []string `json:"-"`
  21157. }
  21158. func (s *ResourcePolicyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21159. type NoMethod ResourcePolicyAggregatedListWarning
  21160. raw := NoMethod(*s)
  21161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21162. }
  21163. type ResourcePolicyAggregatedListWarningData struct {
  21164. // Key: [Output Only] A key that provides more detail on the warning
  21165. // being returned. For example, for warnings where there are no results
  21166. // in a list request for a particular zone, this key might be scope and
  21167. // the key value might be the zone name. Other examples might be a key
  21168. // indicating a deprecated resource and a suggested replacement, or a
  21169. // warning about invalid network settings (for example, if an instance
  21170. // attempts to perform IP forwarding but is not enabled for IP
  21171. // forwarding).
  21172. Key string `json:"key,omitempty"`
  21173. // Value: [Output Only] A warning data value corresponding to the key.
  21174. Value string `json:"value,omitempty"`
  21175. // ForceSendFields is a list of field names (e.g. "Key") to
  21176. // unconditionally include in API requests. By default, fields with
  21177. // empty values are omitted from API requests. However, any non-pointer,
  21178. // non-interface field appearing in ForceSendFields will be sent to the
  21179. // server regardless of whether the field is empty or not. This may be
  21180. // used to include empty fields in Patch requests.
  21181. ForceSendFields []string `json:"-"`
  21182. // NullFields is a list of field names (e.g. "Key") to include in API
  21183. // requests with the JSON null value. By default, fields with empty
  21184. // values are omitted from API requests. However, any field with an
  21185. // empty value appearing in NullFields will be sent to the server as
  21186. // null. It is an error if a field in this list has a non-empty value.
  21187. // This may be used to include null fields in Patch requests.
  21188. NullFields []string `json:"-"`
  21189. }
  21190. func (s *ResourcePolicyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21191. type NoMethod ResourcePolicyAggregatedListWarningData
  21192. raw := NoMethod(*s)
  21193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21194. }
  21195. // ResourcePolicyDailyCycle: Time window specified for daily operations.
  21196. type ResourcePolicyDailyCycle struct {
  21197. // DaysInCycle: Allows to define schedule that runs every nth day of the
  21198. // month.
  21199. DaysInCycle int64 `json:"daysInCycle,omitempty"`
  21200. // Duration: [Output only] Duration of the time window, automatically
  21201. // chosen to be smallest possible in the given scenario.
  21202. Duration string `json:"duration,omitempty"`
  21203. // StartTime: Time within the window to start the operations. It must be
  21204. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  21205. StartTime string `json:"startTime,omitempty"`
  21206. // ForceSendFields is a list of field names (e.g. "DaysInCycle") to
  21207. // unconditionally include in API requests. By default, fields with
  21208. // empty values are omitted from API requests. However, any non-pointer,
  21209. // non-interface field appearing in ForceSendFields will be sent to the
  21210. // server regardless of whether the field is empty or not. This may be
  21211. // used to include empty fields in Patch requests.
  21212. ForceSendFields []string `json:"-"`
  21213. // NullFields is a list of field names (e.g. "DaysInCycle") to include
  21214. // in API requests with the JSON null value. By default, fields with
  21215. // empty values are omitted from API requests. However, any field with
  21216. // an empty value appearing in NullFields will be sent to the server as
  21217. // null. It is an error if a field in this list has a non-empty value.
  21218. // This may be used to include null fields in Patch requests.
  21219. NullFields []string `json:"-"`
  21220. }
  21221. func (s *ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) {
  21222. type NoMethod ResourcePolicyDailyCycle
  21223. raw := NoMethod(*s)
  21224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21225. }
  21226. // ResourcePolicyHourlyCycle: Time window specified for hourly
  21227. // operations.
  21228. type ResourcePolicyHourlyCycle struct {
  21229. // Duration: [Output only] Duration of the time window, automatically
  21230. // chosen to be smallest possible in the given scenario.
  21231. Duration string `json:"duration,omitempty"`
  21232. // HoursInCycle: Allows to define schedule that runs every nth hour.
  21233. HoursInCycle int64 `json:"hoursInCycle,omitempty"`
  21234. // StartTime: Time within the window to start the operations. It must be
  21235. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  21236. StartTime string `json:"startTime,omitempty"`
  21237. // ForceSendFields is a list of field names (e.g. "Duration") to
  21238. // unconditionally include in API requests. By default, fields with
  21239. // empty values are omitted from API requests. However, any non-pointer,
  21240. // non-interface field appearing in ForceSendFields will be sent to the
  21241. // server regardless of whether the field is empty or not. This may be
  21242. // used to include empty fields in Patch requests.
  21243. ForceSendFields []string `json:"-"`
  21244. // NullFields is a list of field names (e.g. "Duration") to include in
  21245. // API requests with the JSON null value. By default, fields with empty
  21246. // values are omitted from API requests. However, any field with an
  21247. // empty value appearing in NullFields will be sent to the server as
  21248. // null. It is an error if a field in this list has a non-empty value.
  21249. // This may be used to include null fields in Patch requests.
  21250. NullFields []string `json:"-"`
  21251. }
  21252. func (s *ResourcePolicyHourlyCycle) MarshalJSON() ([]byte, error) {
  21253. type NoMethod ResourcePolicyHourlyCycle
  21254. raw := NoMethod(*s)
  21255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21256. }
  21257. type ResourcePolicyList struct {
  21258. Etag string `json:"etag,omitempty"`
  21259. // Id: [Output Only] The unique identifier for the resource. This
  21260. // identifier is defined by the server.
  21261. Id string `json:"id,omitempty"`
  21262. // Items: [Output Only] A list of ResourcePolicy resources.
  21263. Items []*ResourcePolicy `json:"items,omitempty"`
  21264. // Kind: [Output Only] Type of resource.Always
  21265. // compute#resourcePoliciesList for listsof resourcePolicies
  21266. Kind string `json:"kind,omitempty"`
  21267. // NextPageToken: [Output Only] This token allows you to get the next
  21268. // page of results for list requests. If the number of results is larger
  21269. // than maxResults, use the nextPageToken as a value for the query
  21270. // parameter pageToken in the next list request. Subsequent list
  21271. // requests will have their own nextPageToken to continue paging through
  21272. // the results.
  21273. NextPageToken string `json:"nextPageToken,omitempty"`
  21274. // SelfLink: [Output Only] Server-defined URL for this resource.
  21275. SelfLink string `json:"selfLink,omitempty"`
  21276. // Warning: [Output Only] Informational warning message.
  21277. Warning *ResourcePolicyListWarning `json:"warning,omitempty"`
  21278. // ServerResponse contains the HTTP response code and headers from the
  21279. // server.
  21280. googleapi.ServerResponse `json:"-"`
  21281. // ForceSendFields is a list of field names (e.g. "Etag") to
  21282. // unconditionally include in API requests. By default, fields with
  21283. // empty values are omitted from API requests. However, any non-pointer,
  21284. // non-interface field appearing in ForceSendFields will be sent to the
  21285. // server regardless of whether the field is empty or not. This may be
  21286. // used to include empty fields in Patch requests.
  21287. ForceSendFields []string `json:"-"`
  21288. // NullFields is a list of field names (e.g. "Etag") to include in API
  21289. // requests with the JSON null value. By default, fields with empty
  21290. // values are omitted from API requests. However, any field with an
  21291. // empty value appearing in NullFields will be sent to the server as
  21292. // null. It is an error if a field in this list has a non-empty value.
  21293. // This may be used to include null fields in Patch requests.
  21294. NullFields []string `json:"-"`
  21295. }
  21296. func (s *ResourcePolicyList) MarshalJSON() ([]byte, error) {
  21297. type NoMethod ResourcePolicyList
  21298. raw := NoMethod(*s)
  21299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21300. }
  21301. // ResourcePolicyListWarning: [Output Only] Informational warning
  21302. // message.
  21303. type ResourcePolicyListWarning struct {
  21304. // Code: [Output Only] A warning code, if applicable. For example,
  21305. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21306. // the response.
  21307. //
  21308. // Possible values:
  21309. // "CLEANUP_FAILED"
  21310. // "DEPRECATED_RESOURCE_USED"
  21311. // "DEPRECATED_TYPE_USED"
  21312. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21313. // "EXPERIMENTAL_TYPE_USED"
  21314. // "EXTERNAL_API_WARNING"
  21315. // "FIELD_VALUE_OVERRIDEN"
  21316. // "INJECTED_KERNELS_DEPRECATED"
  21317. // "MISSING_TYPE_DEPENDENCY"
  21318. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21319. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21320. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21321. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21322. // "NEXT_HOP_NOT_RUNNING"
  21323. // "NOT_CRITICAL_ERROR"
  21324. // "NO_RESULTS_ON_PAGE"
  21325. // "REQUIRED_TOS_AGREEMENT"
  21326. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21327. // "RESOURCE_NOT_DELETED"
  21328. // "SCHEMA_VALIDATION_IGNORED"
  21329. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21330. // "UNDECLARED_PROPERTIES"
  21331. // "UNREACHABLE"
  21332. Code string `json:"code,omitempty"`
  21333. // Data: [Output Only] Metadata about this warning in key: value format.
  21334. // For example:
  21335. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21336. Data []*ResourcePolicyListWarningData `json:"data,omitempty"`
  21337. // Message: [Output Only] A human-readable description of the warning
  21338. // code.
  21339. Message string `json:"message,omitempty"`
  21340. // ForceSendFields is a list of field names (e.g. "Code") to
  21341. // unconditionally include in API requests. By default, fields with
  21342. // empty values are omitted from API requests. However, any non-pointer,
  21343. // non-interface field appearing in ForceSendFields will be sent to the
  21344. // server regardless of whether the field is empty or not. This may be
  21345. // used to include empty fields in Patch requests.
  21346. ForceSendFields []string `json:"-"`
  21347. // NullFields is a list of field names (e.g. "Code") to include in API
  21348. // requests with the JSON null value. By default, fields with empty
  21349. // values are omitted from API requests. However, any field with an
  21350. // empty value appearing in NullFields will be sent to the server as
  21351. // null. It is an error if a field in this list has a non-empty value.
  21352. // This may be used to include null fields in Patch requests.
  21353. NullFields []string `json:"-"`
  21354. }
  21355. func (s *ResourcePolicyListWarning) MarshalJSON() ([]byte, error) {
  21356. type NoMethod ResourcePolicyListWarning
  21357. raw := NoMethod(*s)
  21358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21359. }
  21360. type ResourcePolicyListWarningData struct {
  21361. // Key: [Output Only] A key that provides more detail on the warning
  21362. // being returned. For example, for warnings where there are no results
  21363. // in a list request for a particular zone, this key might be scope and
  21364. // the key value might be the zone name. Other examples might be a key
  21365. // indicating a deprecated resource and a suggested replacement, or a
  21366. // warning about invalid network settings (for example, if an instance
  21367. // attempts to perform IP forwarding but is not enabled for IP
  21368. // forwarding).
  21369. Key string `json:"key,omitempty"`
  21370. // Value: [Output Only] A warning data value corresponding to the key.
  21371. Value string `json:"value,omitempty"`
  21372. // ForceSendFields is a list of field names (e.g. "Key") to
  21373. // unconditionally include in API requests. By default, fields with
  21374. // empty values are omitted from API requests. However, any non-pointer,
  21375. // non-interface field appearing in ForceSendFields will be sent to the
  21376. // server regardless of whether the field is empty or not. This may be
  21377. // used to include empty fields in Patch requests.
  21378. ForceSendFields []string `json:"-"`
  21379. // NullFields is a list of field names (e.g. "Key") to include in API
  21380. // requests with the JSON null value. By default, fields with empty
  21381. // values are omitted from API requests. However, any field with an
  21382. // empty value appearing in NullFields will be sent to the server as
  21383. // null. It is an error if a field in this list has a non-empty value.
  21384. // This may be used to include null fields in Patch requests.
  21385. NullFields []string `json:"-"`
  21386. }
  21387. func (s *ResourcePolicyListWarningData) MarshalJSON() ([]byte, error) {
  21388. type NoMethod ResourcePolicyListWarningData
  21389. raw := NoMethod(*s)
  21390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21391. }
  21392. // ResourcePolicySnapshotSchedulePolicy: A snapshot schedule policy
  21393. // specifies when and how frequently snapshots are to be created for the
  21394. // target disk. Also specifies how many and how long these scheduled
  21395. // snapshots should be retained.
  21396. type ResourcePolicySnapshotSchedulePolicy struct {
  21397. // RetentionPolicy: Retention policy applied to snapshots created by
  21398. // this resource policy.
  21399. RetentionPolicy *ResourcePolicySnapshotSchedulePolicyRetentionPolicy `json:"retentionPolicy,omitempty"`
  21400. // Schedule: A Vm Maintenance Policy specifies what kind of
  21401. // infrastructure maintenance we are allowed to perform on this VM and
  21402. // when. Schedule that is applied to disks covered by this policy.
  21403. Schedule *ResourcePolicySnapshotSchedulePolicySchedule `json:"schedule,omitempty"`
  21404. // SnapshotProperties: Properties with which snapshots are created such
  21405. // as labels, encryption keys.
  21406. SnapshotProperties *ResourcePolicySnapshotSchedulePolicySnapshotProperties `json:"snapshotProperties,omitempty"`
  21407. // ForceSendFields is a list of field names (e.g. "RetentionPolicy") to
  21408. // unconditionally include in API requests. By default, fields with
  21409. // empty values are omitted from API requests. However, any non-pointer,
  21410. // non-interface field appearing in ForceSendFields will be sent to the
  21411. // server regardless of whether the field is empty or not. This may be
  21412. // used to include empty fields in Patch requests.
  21413. ForceSendFields []string `json:"-"`
  21414. // NullFields is a list of field names (e.g. "RetentionPolicy") to
  21415. // include in API requests with the JSON null value. By default, fields
  21416. // with empty values are omitted from API requests. However, any field
  21417. // with an empty value appearing in NullFields will be sent to the
  21418. // server as null. It is an error if a field in this list has a
  21419. // non-empty value. This may be used to include null fields in Patch
  21420. // requests.
  21421. NullFields []string `json:"-"`
  21422. }
  21423. func (s *ResourcePolicySnapshotSchedulePolicy) MarshalJSON() ([]byte, error) {
  21424. type NoMethod ResourcePolicySnapshotSchedulePolicy
  21425. raw := NoMethod(*s)
  21426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21427. }
  21428. // ResourcePolicySnapshotSchedulePolicyRetentionPolicy: Policy for
  21429. // retention of scheduled snapshots.
  21430. type ResourcePolicySnapshotSchedulePolicyRetentionPolicy struct {
  21431. // MaxRetentionDays: Maximum age of the snapshot that is allowed to be
  21432. // kept.
  21433. MaxRetentionDays int64 `json:"maxRetentionDays,omitempty"`
  21434. // OnSourceDiskDelete: Specifies the behavior to apply to scheduled
  21435. // snapshots when the source disk is deleted.
  21436. //
  21437. // Possible values:
  21438. // "APPLY_RETENTION_POLICY"
  21439. // "KEEP_AUTO_SNAPSHOTS"
  21440. // "UNSPECIFIED_ON_SOURCE_DISK_DELETE"
  21441. OnSourceDiskDelete string `json:"onSourceDiskDelete,omitempty"`
  21442. // ForceSendFields is a list of field names (e.g. "MaxRetentionDays") to
  21443. // unconditionally include in API requests. By default, fields with
  21444. // empty values are omitted from API requests. However, any non-pointer,
  21445. // non-interface field appearing in ForceSendFields will be sent to the
  21446. // server regardless of whether the field is empty or not. This may be
  21447. // used to include empty fields in Patch requests.
  21448. ForceSendFields []string `json:"-"`
  21449. // NullFields is a list of field names (e.g. "MaxRetentionDays") to
  21450. // include in API requests with the JSON null value. By default, fields
  21451. // with empty values are omitted from API requests. However, any field
  21452. // with an empty value appearing in NullFields will be sent to the
  21453. // server as null. It is an error if a field in this list has a
  21454. // non-empty value. This may be used to include null fields in Patch
  21455. // requests.
  21456. NullFields []string `json:"-"`
  21457. }
  21458. func (s *ResourcePolicySnapshotSchedulePolicyRetentionPolicy) MarshalJSON() ([]byte, error) {
  21459. type NoMethod ResourcePolicySnapshotSchedulePolicyRetentionPolicy
  21460. raw := NoMethod(*s)
  21461. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21462. }
  21463. // ResourcePolicySnapshotSchedulePolicySchedule: A schedule for disks
  21464. // where the schedueled operations are performed.
  21465. type ResourcePolicySnapshotSchedulePolicySchedule struct {
  21466. DailySchedule *ResourcePolicyDailyCycle `json:"dailySchedule,omitempty"`
  21467. HourlySchedule *ResourcePolicyHourlyCycle `json:"hourlySchedule,omitempty"`
  21468. WeeklySchedule *ResourcePolicyWeeklyCycle `json:"weeklySchedule,omitempty"`
  21469. // ForceSendFields is a list of field names (e.g. "DailySchedule") to
  21470. // unconditionally include in API requests. By default, fields with
  21471. // empty values are omitted from API requests. However, any non-pointer,
  21472. // non-interface field appearing in ForceSendFields will be sent to the
  21473. // server regardless of whether the field is empty or not. This may be
  21474. // used to include empty fields in Patch requests.
  21475. ForceSendFields []string `json:"-"`
  21476. // NullFields is a list of field names (e.g. "DailySchedule") to include
  21477. // in API requests with the JSON null value. By default, fields with
  21478. // empty values are omitted from API requests. However, any field with
  21479. // an empty value appearing in NullFields will be sent to the server as
  21480. // null. It is an error if a field in this list has a non-empty value.
  21481. // This may be used to include null fields in Patch requests.
  21482. NullFields []string `json:"-"`
  21483. }
  21484. func (s *ResourcePolicySnapshotSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
  21485. type NoMethod ResourcePolicySnapshotSchedulePolicySchedule
  21486. raw := NoMethod(*s)
  21487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21488. }
  21489. // ResourcePolicySnapshotSchedulePolicySnapshotProperties: Specified
  21490. // snapshot properties for scheduled snapshots created by this policy.
  21491. type ResourcePolicySnapshotSchedulePolicySnapshotProperties struct {
  21492. // GuestFlush: Indication to perform a ?guest aware? snapshot.
  21493. GuestFlush bool `json:"guestFlush,omitempty"`
  21494. // Labels: Labels to apply to scheduled snapshots. These can be later
  21495. // modified by the setLabels method. Label values may be empty.
  21496. Labels map[string]string `json:"labels,omitempty"`
  21497. // StorageLocations: GCS bucket storage location of the auto snapshot
  21498. // (regional or multi-regional).
  21499. StorageLocations []string `json:"storageLocations,omitempty"`
  21500. // ForceSendFields is a list of field names (e.g. "GuestFlush") to
  21501. // unconditionally include in API requests. By default, fields with
  21502. // empty values are omitted from API requests. However, any non-pointer,
  21503. // non-interface field appearing in ForceSendFields will be sent to the
  21504. // server regardless of whether the field is empty or not. This may be
  21505. // used to include empty fields in Patch requests.
  21506. ForceSendFields []string `json:"-"`
  21507. // NullFields is a list of field names (e.g. "GuestFlush") to include in
  21508. // API requests with the JSON null value. By default, fields with empty
  21509. // values are omitted from API requests. However, any field with an
  21510. // empty value appearing in NullFields will be sent to the server as
  21511. // null. It is an error if a field in this list has a non-empty value.
  21512. // This may be used to include null fields in Patch requests.
  21513. NullFields []string `json:"-"`
  21514. }
  21515. func (s *ResourcePolicySnapshotSchedulePolicySnapshotProperties) MarshalJSON() ([]byte, error) {
  21516. type NoMethod ResourcePolicySnapshotSchedulePolicySnapshotProperties
  21517. raw := NoMethod(*s)
  21518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21519. }
  21520. // ResourcePolicyWeeklyCycle: Time window specified for weekly
  21521. // operations.
  21522. type ResourcePolicyWeeklyCycle struct {
  21523. // DayOfWeeks: Up to 7 intervals/windows, one for each day of the week.
  21524. DayOfWeeks []*ResourcePolicyWeeklyCycleDayOfWeek `json:"dayOfWeeks,omitempty"`
  21525. // ForceSendFields is a list of field names (e.g. "DayOfWeeks") to
  21526. // unconditionally include in API requests. By default, fields with
  21527. // empty values are omitted from API requests. However, any non-pointer,
  21528. // non-interface field appearing in ForceSendFields will be sent to the
  21529. // server regardless of whether the field is empty or not. This may be
  21530. // used to include empty fields in Patch requests.
  21531. ForceSendFields []string `json:"-"`
  21532. // NullFields is a list of field names (e.g. "DayOfWeeks") to include in
  21533. // API requests with the JSON null value. By default, fields with empty
  21534. // values are omitted from API requests. However, any field with an
  21535. // empty value appearing in NullFields will be sent to the server as
  21536. // null. It is an error if a field in this list has a non-empty value.
  21537. // This may be used to include null fields in Patch requests.
  21538. NullFields []string `json:"-"`
  21539. }
  21540. func (s *ResourcePolicyWeeklyCycle) MarshalJSON() ([]byte, error) {
  21541. type NoMethod ResourcePolicyWeeklyCycle
  21542. raw := NoMethod(*s)
  21543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21544. }
  21545. type ResourcePolicyWeeklyCycleDayOfWeek struct {
  21546. // Day: Allows to define schedule that runs specified day of the week.
  21547. //
  21548. // Possible values:
  21549. // "FRIDAY"
  21550. // "INVALID"
  21551. // "MONDAY"
  21552. // "SATURDAY"
  21553. // "SUNDAY"
  21554. // "THURSDAY"
  21555. // "TUESDAY"
  21556. // "WEDNESDAY"
  21557. Day string `json:"day,omitempty"`
  21558. // Duration: [Output only] Duration of the time window, automatically
  21559. // chosen to be smallest possible in the given scenario.
  21560. Duration string `json:"duration,omitempty"`
  21561. // StartTime: Time within the window to start the operations. It must be
  21562. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  21563. StartTime string `json:"startTime,omitempty"`
  21564. // ForceSendFields is a list of field names (e.g. "Day") to
  21565. // unconditionally include in API requests. By default, fields with
  21566. // empty values are omitted from API requests. However, any non-pointer,
  21567. // non-interface field appearing in ForceSendFields will be sent to the
  21568. // server regardless of whether the field is empty or not. This may be
  21569. // used to include empty fields in Patch requests.
  21570. ForceSendFields []string `json:"-"`
  21571. // NullFields is a list of field names (e.g. "Day") to include in API
  21572. // requests with the JSON null value. By default, fields with empty
  21573. // values are omitted from API requests. However, any field with an
  21574. // empty value appearing in NullFields will be sent to the server as
  21575. // null. It is an error if a field in this list has a non-empty value.
  21576. // This may be used to include null fields in Patch requests.
  21577. NullFields []string `json:"-"`
  21578. }
  21579. func (s *ResourcePolicyWeeklyCycleDayOfWeek) MarshalJSON() ([]byte, error) {
  21580. type NoMethod ResourcePolicyWeeklyCycleDayOfWeek
  21581. raw := NoMethod(*s)
  21582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21583. }
  21584. // Route: Represents a Route resource. A route specifies how certain
  21585. // packets should be handled by the network. Routes are associated with
  21586. // instances by tags and the set of routes for a particular instance is
  21587. // called its routing table.
  21588. //
  21589. // For each packet leaving an instance, the system searches that
  21590. // instance's routing table for a single best matching route. Routes
  21591. // match packets by destination IP address, preferring smaller or more
  21592. // specific ranges over larger ones. If there is a tie, the system
  21593. // selects the route with the smallest priority value. If there is still
  21594. // a tie, it uses the layer three and four packet headers to select just
  21595. // one of the remaining matching routes. The packet is then forwarded as
  21596. // specified by the nextHop field of the winning route - either to
  21597. // another instance destination, an instance gateway, or a Google
  21598. // Compute Engine-operated gateway.
  21599. //
  21600. // Packets that do not match any route in the sending instance's routing
  21601. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  21602. // v1.routes ==)
  21603. type Route struct {
  21604. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21605. // format.
  21606. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21607. // Description: An optional description of this resource. Provide this
  21608. // property when you create the resource.
  21609. Description string `json:"description,omitempty"`
  21610. // DestRange: The destination range of outgoing packets that this route
  21611. // applies to. Only IPv4 is supported.
  21612. DestRange string `json:"destRange,omitempty"`
  21613. // Id: [Output Only] The unique identifier for the resource. This
  21614. // identifier is defined by the server.
  21615. Id uint64 `json:"id,omitempty,string"`
  21616. // Kind: [Output Only] Type of this resource. Always compute#routes for
  21617. // Route resources.
  21618. Kind string `json:"kind,omitempty"`
  21619. // Name: Name of the resource. Provided by the client when the resource
  21620. // is created. The name must be 1-63 characters long, and comply with
  21621. // RFC1035. Specifically, the name must be 1-63 characters long and
  21622. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21623. // the first character must be a lowercase letter, and all following
  21624. // characters must be a dash, lowercase letter, or digit, except the
  21625. // last character, which cannot be a dash.
  21626. Name string `json:"name,omitempty"`
  21627. // Network: Fully-qualified URL of the network that this route applies
  21628. // to.
  21629. Network string `json:"network,omitempty"`
  21630. // NextHopGateway: The URL to a gateway that should handle matching
  21631. // packets. You can only specify the internet gateway using a full or
  21632. // partial valid URL:
  21633. // projects/<project-id>/global/gateways/default-internet-gateway
  21634. NextHopGateway string `json:"nextHopGateway,omitempty"`
  21635. // NextHopIlb: The URL to a forwarding rule of type
  21636. // loadBalancingScheme=INTERNAL that should handle matching packets. You
  21637. // can only specify the forwarding rule as a partial or full URL. For
  21638. // example, the following are all valid URLs:
  21639. // -
  21640. // https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule
  21641. // - regions/region/forwardingRules/forwardingRule Note that this can
  21642. // only be used when the destination_range is a public (non-RFC 1918) IP
  21643. // CIDR range.
  21644. NextHopIlb string `json:"nextHopIlb,omitempty"`
  21645. // NextHopInstance: The URL to an instance that should handle matching
  21646. // packets. You can specify this as a full or partial URL. For
  21647. // example:
  21648. // https://www.googleapis.com/compute/v1/projects/project/zones/
  21649. // zone/instances/
  21650. NextHopInstance string `json:"nextHopInstance,omitempty"`
  21651. // NextHopIp: The network IP address of an instance that should handle
  21652. // matching packets. Only IPv4 is supported.
  21653. NextHopIp string `json:"nextHopIp,omitempty"`
  21654. // NextHopNetwork: The URL of the local network if it should handle
  21655. // matching packets.
  21656. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  21657. // NextHopPeering: [Output Only] The network peering name that should
  21658. // handle matching packets, which should conform to RFC1035.
  21659. NextHopPeering string `json:"nextHopPeering,omitempty"`
  21660. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  21661. // packets.
  21662. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  21663. // Priority: The priority of this route. Priority is used to break ties
  21664. // in cases where there is more than one matching route of equal prefix
  21665. // length. In the case of two routes with equal prefix length, the one
  21666. // with the lowest-numbered priority value wins. Default value is 1000.
  21667. // Valid range is 0 through 65535.
  21668. Priority int64 `json:"priority,omitempty"`
  21669. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  21670. // resource.
  21671. SelfLink string `json:"selfLink,omitempty"`
  21672. // Tags: A list of instance tags to which this route applies.
  21673. Tags []string `json:"tags,omitempty"`
  21674. // Warnings: [Output Only] If potential misconfigurations are detected
  21675. // for this route, this field will be populated with warning messages.
  21676. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  21677. // ServerResponse contains the HTTP response code and headers from the
  21678. // server.
  21679. googleapi.ServerResponse `json:"-"`
  21680. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21681. // to unconditionally include in API requests. By default, fields with
  21682. // empty values are omitted from API requests. However, any non-pointer,
  21683. // non-interface field appearing in ForceSendFields will be sent to the
  21684. // server regardless of whether the field is empty or not. This may be
  21685. // used to include empty fields in Patch requests.
  21686. ForceSendFields []string `json:"-"`
  21687. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21688. // include in API requests with the JSON null value. By default, fields
  21689. // with empty values are omitted from API requests. However, any field
  21690. // with an empty value appearing in NullFields will be sent to the
  21691. // server as null. It is an error if a field in this list has a
  21692. // non-empty value. This may be used to include null fields in Patch
  21693. // requests.
  21694. NullFields []string `json:"-"`
  21695. }
  21696. func (s *Route) MarshalJSON() ([]byte, error) {
  21697. type NoMethod Route
  21698. raw := NoMethod(*s)
  21699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21700. }
  21701. type RouteWarnings struct {
  21702. // Code: [Output Only] A warning code, if applicable. For example,
  21703. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21704. // the response.
  21705. //
  21706. // Possible values:
  21707. // "CLEANUP_FAILED"
  21708. // "DEPRECATED_RESOURCE_USED"
  21709. // "DEPRECATED_TYPE_USED"
  21710. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21711. // "EXPERIMENTAL_TYPE_USED"
  21712. // "EXTERNAL_API_WARNING"
  21713. // "FIELD_VALUE_OVERRIDEN"
  21714. // "INJECTED_KERNELS_DEPRECATED"
  21715. // "MISSING_TYPE_DEPENDENCY"
  21716. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21717. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21718. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21719. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21720. // "NEXT_HOP_NOT_RUNNING"
  21721. // "NOT_CRITICAL_ERROR"
  21722. // "NO_RESULTS_ON_PAGE"
  21723. // "REQUIRED_TOS_AGREEMENT"
  21724. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21725. // "RESOURCE_NOT_DELETED"
  21726. // "SCHEMA_VALIDATION_IGNORED"
  21727. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21728. // "UNDECLARED_PROPERTIES"
  21729. // "UNREACHABLE"
  21730. Code string `json:"code,omitempty"`
  21731. // Data: [Output Only] Metadata about this warning in key: value format.
  21732. // For example:
  21733. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21734. Data []*RouteWarningsData `json:"data,omitempty"`
  21735. // Message: [Output Only] A human-readable description of the warning
  21736. // code.
  21737. Message string `json:"message,omitempty"`
  21738. // ForceSendFields is a list of field names (e.g. "Code") to
  21739. // unconditionally include in API requests. By default, fields with
  21740. // empty values are omitted from API requests. However, any non-pointer,
  21741. // non-interface field appearing in ForceSendFields will be sent to the
  21742. // server regardless of whether the field is empty or not. This may be
  21743. // used to include empty fields in Patch requests.
  21744. ForceSendFields []string `json:"-"`
  21745. // NullFields is a list of field names (e.g. "Code") to include in API
  21746. // requests with the JSON null value. By default, fields with empty
  21747. // values are omitted from API requests. However, any field with an
  21748. // empty value appearing in NullFields will be sent to the server as
  21749. // null. It is an error if a field in this list has a non-empty value.
  21750. // This may be used to include null fields in Patch requests.
  21751. NullFields []string `json:"-"`
  21752. }
  21753. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  21754. type NoMethod RouteWarnings
  21755. raw := NoMethod(*s)
  21756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21757. }
  21758. type RouteWarningsData struct {
  21759. // Key: [Output Only] A key that provides more detail on the warning
  21760. // being returned. For example, for warnings where there are no results
  21761. // in a list request for a particular zone, this key might be scope and
  21762. // the key value might be the zone name. Other examples might be a key
  21763. // indicating a deprecated resource and a suggested replacement, or a
  21764. // warning about invalid network settings (for example, if an instance
  21765. // attempts to perform IP forwarding but is not enabled for IP
  21766. // forwarding).
  21767. Key string `json:"key,omitempty"`
  21768. // Value: [Output Only] A warning data value corresponding to the key.
  21769. Value string `json:"value,omitempty"`
  21770. // ForceSendFields is a list of field names (e.g. "Key") to
  21771. // unconditionally include in API requests. By default, fields with
  21772. // empty values are omitted from API requests. However, any non-pointer,
  21773. // non-interface field appearing in ForceSendFields will be sent to the
  21774. // server regardless of whether the field is empty or not. This may be
  21775. // used to include empty fields in Patch requests.
  21776. ForceSendFields []string `json:"-"`
  21777. // NullFields is a list of field names (e.g. "Key") to include in API
  21778. // requests with the JSON null value. By default, fields with empty
  21779. // values are omitted from API requests. However, any field with an
  21780. // empty value appearing in NullFields will be sent to the server as
  21781. // null. It is an error if a field in this list has a non-empty value.
  21782. // This may be used to include null fields in Patch requests.
  21783. NullFields []string `json:"-"`
  21784. }
  21785. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  21786. type NoMethod RouteWarningsData
  21787. raw := NoMethod(*s)
  21788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21789. }
  21790. // RouteList: Contains a list of Route resources.
  21791. type RouteList struct {
  21792. // Id: [Output Only] Unique identifier for the resource; defined by the
  21793. // server.
  21794. Id string `json:"id,omitempty"`
  21795. // Items: A list of Route resources.
  21796. Items []*Route `json:"items,omitempty"`
  21797. // Kind: Type of resource.
  21798. Kind string `json:"kind,omitempty"`
  21799. // NextPageToken: [Output Only] This token allows you to get the next
  21800. // page of results for list requests. If the number of results is larger
  21801. // than maxResults, use the nextPageToken as a value for the query
  21802. // parameter pageToken in the next list request. Subsequent list
  21803. // requests will have their own nextPageToken to continue paging through
  21804. // the results.
  21805. NextPageToken string `json:"nextPageToken,omitempty"`
  21806. // SelfLink: [Output Only] Server-defined URL for this resource.
  21807. SelfLink string `json:"selfLink,omitempty"`
  21808. // Warning: [Output Only] Informational warning message.
  21809. Warning *RouteListWarning `json:"warning,omitempty"`
  21810. // ServerResponse contains the HTTP response code and headers from the
  21811. // server.
  21812. googleapi.ServerResponse `json:"-"`
  21813. // ForceSendFields is a list of field names (e.g. "Id") to
  21814. // unconditionally include in API requests. By default, fields with
  21815. // empty values are omitted from API requests. However, any non-pointer,
  21816. // non-interface field appearing in ForceSendFields will be sent to the
  21817. // server regardless of whether the field is empty or not. This may be
  21818. // used to include empty fields in Patch requests.
  21819. ForceSendFields []string `json:"-"`
  21820. // NullFields is a list of field names (e.g. "Id") to include in API
  21821. // requests with the JSON null value. By default, fields with empty
  21822. // values are omitted from API requests. However, any field with an
  21823. // empty value appearing in NullFields will be sent to the server as
  21824. // null. It is an error if a field in this list has a non-empty value.
  21825. // This may be used to include null fields in Patch requests.
  21826. NullFields []string `json:"-"`
  21827. }
  21828. func (s *RouteList) MarshalJSON() ([]byte, error) {
  21829. type NoMethod RouteList
  21830. raw := NoMethod(*s)
  21831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21832. }
  21833. // RouteListWarning: [Output Only] Informational warning message.
  21834. type RouteListWarning struct {
  21835. // Code: [Output Only] A warning code, if applicable. For example,
  21836. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21837. // the response.
  21838. //
  21839. // Possible values:
  21840. // "CLEANUP_FAILED"
  21841. // "DEPRECATED_RESOURCE_USED"
  21842. // "DEPRECATED_TYPE_USED"
  21843. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21844. // "EXPERIMENTAL_TYPE_USED"
  21845. // "EXTERNAL_API_WARNING"
  21846. // "FIELD_VALUE_OVERRIDEN"
  21847. // "INJECTED_KERNELS_DEPRECATED"
  21848. // "MISSING_TYPE_DEPENDENCY"
  21849. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21850. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21851. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21852. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21853. // "NEXT_HOP_NOT_RUNNING"
  21854. // "NOT_CRITICAL_ERROR"
  21855. // "NO_RESULTS_ON_PAGE"
  21856. // "REQUIRED_TOS_AGREEMENT"
  21857. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21858. // "RESOURCE_NOT_DELETED"
  21859. // "SCHEMA_VALIDATION_IGNORED"
  21860. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21861. // "UNDECLARED_PROPERTIES"
  21862. // "UNREACHABLE"
  21863. Code string `json:"code,omitempty"`
  21864. // Data: [Output Only] Metadata about this warning in key: value format.
  21865. // For example:
  21866. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21867. Data []*RouteListWarningData `json:"data,omitempty"`
  21868. // Message: [Output Only] A human-readable description of the warning
  21869. // code.
  21870. Message string `json:"message,omitempty"`
  21871. // ForceSendFields is a list of field names (e.g. "Code") to
  21872. // unconditionally include in API requests. By default, fields with
  21873. // empty values are omitted from API requests. However, any non-pointer,
  21874. // non-interface field appearing in ForceSendFields will be sent to the
  21875. // server regardless of whether the field is empty or not. This may be
  21876. // used to include empty fields in Patch requests.
  21877. ForceSendFields []string `json:"-"`
  21878. // NullFields is a list of field names (e.g. "Code") to include in API
  21879. // requests with the JSON null value. By default, fields with empty
  21880. // values are omitted from API requests. However, any field with an
  21881. // empty value appearing in NullFields will be sent to the server as
  21882. // null. It is an error if a field in this list has a non-empty value.
  21883. // This may be used to include null fields in Patch requests.
  21884. NullFields []string `json:"-"`
  21885. }
  21886. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  21887. type NoMethod RouteListWarning
  21888. raw := NoMethod(*s)
  21889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21890. }
  21891. type RouteListWarningData struct {
  21892. // Key: [Output Only] A key that provides more detail on the warning
  21893. // being returned. For example, for warnings where there are no results
  21894. // in a list request for a particular zone, this key might be scope and
  21895. // the key value might be the zone name. Other examples might be a key
  21896. // indicating a deprecated resource and a suggested replacement, or a
  21897. // warning about invalid network settings (for example, if an instance
  21898. // attempts to perform IP forwarding but is not enabled for IP
  21899. // forwarding).
  21900. Key string `json:"key,omitempty"`
  21901. // Value: [Output Only] A warning data value corresponding to the key.
  21902. Value string `json:"value,omitempty"`
  21903. // ForceSendFields is a list of field names (e.g. "Key") to
  21904. // unconditionally include in API requests. By default, fields with
  21905. // empty values are omitted from API requests. However, any non-pointer,
  21906. // non-interface field appearing in ForceSendFields will be sent to the
  21907. // server regardless of whether the field is empty or not. This may be
  21908. // used to include empty fields in Patch requests.
  21909. ForceSendFields []string `json:"-"`
  21910. // NullFields is a list of field names (e.g. "Key") to include in API
  21911. // requests with the JSON null value. By default, fields with empty
  21912. // values are omitted from API requests. However, any field with an
  21913. // empty value appearing in NullFields will be sent to the server as
  21914. // null. It is an error if a field in this list has a non-empty value.
  21915. // This may be used to include null fields in Patch requests.
  21916. NullFields []string `json:"-"`
  21917. }
  21918. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  21919. type NoMethod RouteListWarningData
  21920. raw := NoMethod(*s)
  21921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21922. }
  21923. // Router: Router resource.
  21924. type Router struct {
  21925. // Bgp: BGP information specific to this router.
  21926. Bgp *RouterBgp `json:"bgp,omitempty"`
  21927. // BgpPeers: BGP information that needs to be configured into the
  21928. // routing stack to establish the BGP peering. It must specify peer ASN
  21929. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  21930. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  21931. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21932. // format.
  21933. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21934. // Description: An optional description of this resource. Provide this
  21935. // property when you create the resource.
  21936. Description string `json:"description,omitempty"`
  21937. // Id: [Output Only] The unique identifier for the resource. This
  21938. // identifier is defined by the server.
  21939. Id uint64 `json:"id,omitempty,string"`
  21940. // Interfaces: Router interfaces. Each interface requires either one
  21941. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  21942. // range (e.g. ipRange), or both.
  21943. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  21944. // Kind: [Output Only] Type of resource. Always compute#router for
  21945. // routers.
  21946. Kind string `json:"kind,omitempty"`
  21947. // Name: Name of the resource. Provided by the client when the resource
  21948. // is created. The name must be 1-63 characters long, and comply with
  21949. // RFC1035. Specifically, the name must be 1-63 characters long and
  21950. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21951. // the first character must be a lowercase letter, and all following
  21952. // characters must be a dash, lowercase letter, or digit, except the
  21953. // last character, which cannot be a dash.
  21954. Name string `json:"name,omitempty"`
  21955. // Nats: A list of Nat services created in this router.
  21956. Nats []*RouterNat `json:"nats,omitempty"`
  21957. // Network: URI of the network to which this router belongs.
  21958. Network string `json:"network,omitempty"`
  21959. // Region: [Output Only] URI of the region where the router resides. You
  21960. // must specify this field as part of the HTTP request URL. It is not
  21961. // settable as a field in the request body.
  21962. Region string `json:"region,omitempty"`
  21963. // SelfLink: [Output Only] Server-defined URL for the resource.
  21964. SelfLink string `json:"selfLink,omitempty"`
  21965. // ServerResponse contains the HTTP response code and headers from the
  21966. // server.
  21967. googleapi.ServerResponse `json:"-"`
  21968. // ForceSendFields is a list of field names (e.g. "Bgp") to
  21969. // unconditionally include in API requests. By default, fields with
  21970. // empty values are omitted from API requests. However, any non-pointer,
  21971. // non-interface field appearing in ForceSendFields will be sent to the
  21972. // server regardless of whether the field is empty or not. This may be
  21973. // used to include empty fields in Patch requests.
  21974. ForceSendFields []string `json:"-"`
  21975. // NullFields is a list of field names (e.g. "Bgp") to include in API
  21976. // requests with the JSON null value. By default, fields with empty
  21977. // values are omitted from API requests. However, any field with an
  21978. // empty value appearing in NullFields will be sent to the server as
  21979. // null. It is an error if a field in this list has a non-empty value.
  21980. // This may be used to include null fields in Patch requests.
  21981. NullFields []string `json:"-"`
  21982. }
  21983. func (s *Router) MarshalJSON() ([]byte, error) {
  21984. type NoMethod Router
  21985. raw := NoMethod(*s)
  21986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21987. }
  21988. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  21989. // to advertise.
  21990. type RouterAdvertisedIpRange struct {
  21991. // Description: User-specified description for the IP range.
  21992. Description string `json:"description,omitempty"`
  21993. // Range: The IP range to advertise. The value must be a CIDR-formatted
  21994. // string.
  21995. Range string `json:"range,omitempty"`
  21996. // ForceSendFields is a list of field names (e.g. "Description") to
  21997. // unconditionally include in API requests. By default, fields with
  21998. // empty values are omitted from API requests. However, any non-pointer,
  21999. // non-interface field appearing in ForceSendFields will be sent to the
  22000. // server regardless of whether the field is empty or not. This may be
  22001. // used to include empty fields in Patch requests.
  22002. ForceSendFields []string `json:"-"`
  22003. // NullFields is a list of field names (e.g. "Description") to include
  22004. // in API requests with the JSON null value. By default, fields with
  22005. // empty values are omitted from API requests. However, any field with
  22006. // an empty value appearing in NullFields will be sent to the server as
  22007. // null. It is an error if a field in this list has a non-empty value.
  22008. // This may be used to include null fields in Patch requests.
  22009. NullFields []string `json:"-"`
  22010. }
  22011. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  22012. type NoMethod RouterAdvertisedIpRange
  22013. raw := NoMethod(*s)
  22014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22015. }
  22016. // RouterAggregatedList: Contains a list of routers.
  22017. type RouterAggregatedList struct {
  22018. // Id: [Output Only] Unique identifier for the resource; defined by the
  22019. // server.
  22020. Id string `json:"id,omitempty"`
  22021. // Items: A list of Router resources.
  22022. Items map[string]RoutersScopedList `json:"items,omitempty"`
  22023. // Kind: Type of resource.
  22024. Kind string `json:"kind,omitempty"`
  22025. // NextPageToken: [Output Only] This token allows you to get the next
  22026. // page of results for list requests. If the number of results is larger
  22027. // than maxResults, use the nextPageToken as a value for the query
  22028. // parameter pageToken in the next list request. Subsequent list
  22029. // requests will have their own nextPageToken to continue paging through
  22030. // the results.
  22031. NextPageToken string `json:"nextPageToken,omitempty"`
  22032. // SelfLink: [Output Only] Server-defined URL for this resource.
  22033. SelfLink string `json:"selfLink,omitempty"`
  22034. // Warning: [Output Only] Informational warning message.
  22035. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  22036. // ServerResponse contains the HTTP response code and headers from the
  22037. // server.
  22038. googleapi.ServerResponse `json:"-"`
  22039. // ForceSendFields is a list of field names (e.g. "Id") to
  22040. // unconditionally include in API requests. By default, fields with
  22041. // empty values are omitted from API requests. However, any non-pointer,
  22042. // non-interface field appearing in ForceSendFields will be sent to the
  22043. // server regardless of whether the field is empty or not. This may be
  22044. // used to include empty fields in Patch requests.
  22045. ForceSendFields []string `json:"-"`
  22046. // NullFields is a list of field names (e.g. "Id") to include in API
  22047. // requests with the JSON null value. By default, fields with empty
  22048. // values are omitted from API requests. However, any field with an
  22049. // empty value appearing in NullFields will be sent to the server as
  22050. // null. It is an error if a field in this list has a non-empty value.
  22051. // This may be used to include null fields in Patch requests.
  22052. NullFields []string `json:"-"`
  22053. }
  22054. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  22055. type NoMethod RouterAggregatedList
  22056. raw := NoMethod(*s)
  22057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22058. }
  22059. // RouterAggregatedListWarning: [Output Only] Informational warning
  22060. // message.
  22061. type RouterAggregatedListWarning struct {
  22062. // Code: [Output Only] A warning code, if applicable. For example,
  22063. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22064. // the response.
  22065. //
  22066. // Possible values:
  22067. // "CLEANUP_FAILED"
  22068. // "DEPRECATED_RESOURCE_USED"
  22069. // "DEPRECATED_TYPE_USED"
  22070. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22071. // "EXPERIMENTAL_TYPE_USED"
  22072. // "EXTERNAL_API_WARNING"
  22073. // "FIELD_VALUE_OVERRIDEN"
  22074. // "INJECTED_KERNELS_DEPRECATED"
  22075. // "MISSING_TYPE_DEPENDENCY"
  22076. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22077. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22078. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22079. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22080. // "NEXT_HOP_NOT_RUNNING"
  22081. // "NOT_CRITICAL_ERROR"
  22082. // "NO_RESULTS_ON_PAGE"
  22083. // "REQUIRED_TOS_AGREEMENT"
  22084. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22085. // "RESOURCE_NOT_DELETED"
  22086. // "SCHEMA_VALIDATION_IGNORED"
  22087. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22088. // "UNDECLARED_PROPERTIES"
  22089. // "UNREACHABLE"
  22090. Code string `json:"code,omitempty"`
  22091. // Data: [Output Only] Metadata about this warning in key: value format.
  22092. // For example:
  22093. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22094. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  22095. // Message: [Output Only] A human-readable description of the warning
  22096. // code.
  22097. Message string `json:"message,omitempty"`
  22098. // ForceSendFields is a list of field names (e.g. "Code") to
  22099. // unconditionally include in API requests. By default, fields with
  22100. // empty values are omitted from API requests. However, any non-pointer,
  22101. // non-interface field appearing in ForceSendFields will be sent to the
  22102. // server regardless of whether the field is empty or not. This may be
  22103. // used to include empty fields in Patch requests.
  22104. ForceSendFields []string `json:"-"`
  22105. // NullFields is a list of field names (e.g. "Code") to include in API
  22106. // requests with the JSON null value. By default, fields with empty
  22107. // values are omitted from API requests. However, any field with an
  22108. // empty value appearing in NullFields will be sent to the server as
  22109. // null. It is an error if a field in this list has a non-empty value.
  22110. // This may be used to include null fields in Patch requests.
  22111. NullFields []string `json:"-"`
  22112. }
  22113. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22114. type NoMethod RouterAggregatedListWarning
  22115. raw := NoMethod(*s)
  22116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22117. }
  22118. type RouterAggregatedListWarningData struct {
  22119. // Key: [Output Only] A key that provides more detail on the warning
  22120. // being returned. For example, for warnings where there are no results
  22121. // in a list request for a particular zone, this key might be scope and
  22122. // the key value might be the zone name. Other examples might be a key
  22123. // indicating a deprecated resource and a suggested replacement, or a
  22124. // warning about invalid network settings (for example, if an instance
  22125. // attempts to perform IP forwarding but is not enabled for IP
  22126. // forwarding).
  22127. Key string `json:"key,omitempty"`
  22128. // Value: [Output Only] A warning data value corresponding to the key.
  22129. Value string `json:"value,omitempty"`
  22130. // ForceSendFields is a list of field names (e.g. "Key") to
  22131. // unconditionally include in API requests. By default, fields with
  22132. // empty values are omitted from API requests. However, any non-pointer,
  22133. // non-interface field appearing in ForceSendFields will be sent to the
  22134. // server regardless of whether the field is empty or not. This may be
  22135. // used to include empty fields in Patch requests.
  22136. ForceSendFields []string `json:"-"`
  22137. // NullFields is a list of field names (e.g. "Key") to include in API
  22138. // requests with the JSON null value. By default, fields with empty
  22139. // values are omitted from API requests. However, any field with an
  22140. // empty value appearing in NullFields will be sent to the server as
  22141. // null. It is an error if a field in this list has a non-empty value.
  22142. // This may be used to include null fields in Patch requests.
  22143. NullFields []string `json:"-"`
  22144. }
  22145. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22146. type NoMethod RouterAggregatedListWarningData
  22147. raw := NoMethod(*s)
  22148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22149. }
  22150. type RouterBgp struct {
  22151. // AdvertiseMode: User-specified flag to indicate which mode to use for
  22152. // advertisement.
  22153. //
  22154. // Possible values:
  22155. // "CUSTOM"
  22156. // "DEFAULT"
  22157. AdvertiseMode string `json:"advertiseMode,omitempty"`
  22158. // AdvertisedGroups: User-specified list of prefix groups to advertise
  22159. // in custom mode. This field can only be populated if advertise_mode is
  22160. // CUSTOM and is advertised to all peers of the router. These groups
  22161. // will be advertised in addition to any specified prefixes. Leave this
  22162. // field blank to advertise no custom groups.
  22163. //
  22164. // Possible values:
  22165. // "ALL_SUBNETS"
  22166. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  22167. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  22168. // advertise in custom mode. This field can only be populated if
  22169. // advertise_mode is CUSTOM and is advertised to all peers of the
  22170. // router. These IP ranges will be advertised in addition to any
  22171. // specified groups. Leave this field blank to advertise no custom IP
  22172. // ranges.
  22173. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  22174. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  22175. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  22176. // this router resource. All VPN tunnels that link to this router will
  22177. // have the same local ASN.
  22178. Asn int64 `json:"asn,omitempty"`
  22179. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  22180. // unconditionally include in API requests. By default, fields with
  22181. // empty values are omitted from API requests. However, any non-pointer,
  22182. // non-interface field appearing in ForceSendFields will be sent to the
  22183. // server regardless of whether the field is empty or not. This may be
  22184. // used to include empty fields in Patch requests.
  22185. ForceSendFields []string `json:"-"`
  22186. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  22187. // in API requests with the JSON null value. By default, fields with
  22188. // empty values are omitted from API requests. However, any field with
  22189. // an empty value appearing in NullFields will be sent to the server as
  22190. // null. It is an error if a field in this list has a non-empty value.
  22191. // This may be used to include null fields in Patch requests.
  22192. NullFields []string `json:"-"`
  22193. }
  22194. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  22195. type NoMethod RouterBgp
  22196. raw := NoMethod(*s)
  22197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22198. }
  22199. type RouterBgpPeer struct {
  22200. // AdvertiseMode: User-specified flag to indicate which mode to use for
  22201. // advertisement.
  22202. //
  22203. // Possible values:
  22204. // "CUSTOM"
  22205. // "DEFAULT"
  22206. AdvertiseMode string `json:"advertiseMode,omitempty"`
  22207. // AdvertisedGroups: User-specified list of prefix groups to advertise
  22208. // in custom mode. This field can only be populated if advertise_mode is
  22209. // CUSTOM and overrides the list defined for the router (in Bgp
  22210. // message). These groups will be advertised in addition to any
  22211. // specified prefixes. Leave this field blank to advertise no custom
  22212. // groups.
  22213. //
  22214. // Possible values:
  22215. // "ALL_SUBNETS"
  22216. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  22217. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  22218. // advertise in custom mode. This field can only be populated if
  22219. // advertise_mode is CUSTOM and overrides the list defined for the
  22220. // router (in Bgp message). These IP ranges will be advertised in
  22221. // addition to any specified groups. Leave this field blank to advertise
  22222. // no custom IP ranges.
  22223. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  22224. // AdvertisedRoutePriority: The priority of routes advertised to this
  22225. // BGP peer. In the case where there is more than one matching route of
  22226. // maximum length, the routes with lowest priority value win.
  22227. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  22228. // InterfaceName: Name of the interface the BGP peer is associated with.
  22229. InterfaceName string `json:"interfaceName,omitempty"`
  22230. // IpAddress: IP address of the interface inside Google Cloud Platform.
  22231. // Only IPv4 is supported.
  22232. IpAddress string `json:"ipAddress,omitempty"`
  22233. // ManagementType: [Output Only] The resource that configures and
  22234. // manages this BGP peer. MANAGED_BY_USER is the default value and can
  22235. // be managed by you or other users; MANAGED_BY_ATTACHMENT is a BGP peer
  22236. // that is configured and managed by Cloud Interconnect, specifically by
  22237. // an InterconnectAttachment of type PARTNER. Google will automatically
  22238. // create, update, and delete this type of BGP peer when the PARTNER
  22239. // InterconnectAttachment is created, updated, or deleted.
  22240. //
  22241. // Possible values:
  22242. // "MANAGED_BY_ATTACHMENT"
  22243. // "MANAGED_BY_USER"
  22244. ManagementType string `json:"managementType,omitempty"`
  22245. // Name: Name of this BGP peer. The name must be 1-63 characters long
  22246. // and comply with RFC1035.
  22247. Name string `json:"name,omitempty"`
  22248. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  22249. // this value can be different for every tunnel.
  22250. PeerAsn int64 `json:"peerAsn,omitempty"`
  22251. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  22252. // Only IPv4 is supported.
  22253. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  22254. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  22255. // unconditionally include in API requests. By default, fields with
  22256. // empty values are omitted from API requests. However, any non-pointer,
  22257. // non-interface field appearing in ForceSendFields will be sent to the
  22258. // server regardless of whether the field is empty or not. This may be
  22259. // used to include empty fields in Patch requests.
  22260. ForceSendFields []string `json:"-"`
  22261. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  22262. // in API requests with the JSON null value. By default, fields with
  22263. // empty values are omitted from API requests. However, any field with
  22264. // an empty value appearing in NullFields will be sent to the server as
  22265. // null. It is an error if a field in this list has a non-empty value.
  22266. // This may be used to include null fields in Patch requests.
  22267. NullFields []string `json:"-"`
  22268. }
  22269. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  22270. type NoMethod RouterBgpPeer
  22271. raw := NoMethod(*s)
  22272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22273. }
  22274. type RouterInterface struct {
  22275. // IpRange: IP address and range of the interface. The IP range must be
  22276. // in the RFC3927 link-local IP space. The value must be a
  22277. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  22278. // truncate the address as it represents the IP address of the
  22279. // interface.
  22280. IpRange string `json:"ipRange,omitempty"`
  22281. // LinkedInterconnectAttachment: URI of the linked interconnect
  22282. // attachment. It must be in the same region as the router. Each
  22283. // interface can have at most one linked resource and it could either be
  22284. // a VPN Tunnel or an interconnect attachment.
  22285. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  22286. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  22287. // region as the router. Each interface can have at most one linked
  22288. // resource and it could either be a VPN Tunnel or an interconnect
  22289. // attachment.
  22290. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  22291. // ManagementType: [Output Only] The resource that configures and
  22292. // manages this interface. MANAGED_BY_USER is the default value and can
  22293. // be managed by you or other users; MANAGED_BY_ATTACHMENT is an
  22294. // interface that is configured and managed by Cloud Interconnect,
  22295. // specifically by an InterconnectAttachment of type PARTNER. Google
  22296. // will automatically create, update, and delete this type of interface
  22297. // when the PARTNER InterconnectAttachment is created, updated, or
  22298. // deleted.
  22299. //
  22300. // Possible values:
  22301. // "MANAGED_BY_ATTACHMENT"
  22302. // "MANAGED_BY_USER"
  22303. ManagementType string `json:"managementType,omitempty"`
  22304. // Name: Name of this interface entry. The name must be 1-63 characters
  22305. // long and comply with RFC1035.
  22306. Name string `json:"name,omitempty"`
  22307. // ForceSendFields is a list of field names (e.g. "IpRange") to
  22308. // unconditionally include in API requests. By default, fields with
  22309. // empty values are omitted from API requests. However, any non-pointer,
  22310. // non-interface field appearing in ForceSendFields will be sent to the
  22311. // server regardless of whether the field is empty or not. This may be
  22312. // used to include empty fields in Patch requests.
  22313. ForceSendFields []string `json:"-"`
  22314. // NullFields is a list of field names (e.g. "IpRange") to include in
  22315. // API requests with the JSON null value. By default, fields with empty
  22316. // values are omitted from API requests. However, any field with an
  22317. // empty value appearing in NullFields will be sent to the server as
  22318. // null. It is an error if a field in this list has a non-empty value.
  22319. // This may be used to include null fields in Patch requests.
  22320. NullFields []string `json:"-"`
  22321. }
  22322. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  22323. type NoMethod RouterInterface
  22324. raw := NoMethod(*s)
  22325. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22326. }
  22327. // RouterList: Contains a list of Router resources.
  22328. type RouterList struct {
  22329. // Id: [Output Only] Unique identifier for the resource; defined by the
  22330. // server.
  22331. Id string `json:"id,omitempty"`
  22332. // Items: A list of Router resources.
  22333. Items []*Router `json:"items,omitempty"`
  22334. // Kind: [Output Only] Type of resource. Always compute#router for
  22335. // routers.
  22336. Kind string `json:"kind,omitempty"`
  22337. // NextPageToken: [Output Only] This token allows you to get the next
  22338. // page of results for list requests. If the number of results is larger
  22339. // than maxResults, use the nextPageToken as a value for the query
  22340. // parameter pageToken in the next list request. Subsequent list
  22341. // requests will have their own nextPageToken to continue paging through
  22342. // the results.
  22343. NextPageToken string `json:"nextPageToken,omitempty"`
  22344. // SelfLink: [Output Only] Server-defined URL for this resource.
  22345. SelfLink string `json:"selfLink,omitempty"`
  22346. // Warning: [Output Only] Informational warning message.
  22347. Warning *RouterListWarning `json:"warning,omitempty"`
  22348. // ServerResponse contains the HTTP response code and headers from the
  22349. // server.
  22350. googleapi.ServerResponse `json:"-"`
  22351. // ForceSendFields is a list of field names (e.g. "Id") to
  22352. // unconditionally include in API requests. By default, fields with
  22353. // empty values are omitted from API requests. However, any non-pointer,
  22354. // non-interface field appearing in ForceSendFields will be sent to the
  22355. // server regardless of whether the field is empty or not. This may be
  22356. // used to include empty fields in Patch requests.
  22357. ForceSendFields []string `json:"-"`
  22358. // NullFields is a list of field names (e.g. "Id") to include in API
  22359. // requests with the JSON null value. By default, fields with empty
  22360. // values are omitted from API requests. However, any field with an
  22361. // empty value appearing in NullFields will be sent to the server as
  22362. // null. It is an error if a field in this list has a non-empty value.
  22363. // This may be used to include null fields in Patch requests.
  22364. NullFields []string `json:"-"`
  22365. }
  22366. func (s *RouterList) MarshalJSON() ([]byte, error) {
  22367. type NoMethod RouterList
  22368. raw := NoMethod(*s)
  22369. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22370. }
  22371. // RouterListWarning: [Output Only] Informational warning message.
  22372. type RouterListWarning struct {
  22373. // Code: [Output Only] A warning code, if applicable. For example,
  22374. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22375. // the response.
  22376. //
  22377. // Possible values:
  22378. // "CLEANUP_FAILED"
  22379. // "DEPRECATED_RESOURCE_USED"
  22380. // "DEPRECATED_TYPE_USED"
  22381. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22382. // "EXPERIMENTAL_TYPE_USED"
  22383. // "EXTERNAL_API_WARNING"
  22384. // "FIELD_VALUE_OVERRIDEN"
  22385. // "INJECTED_KERNELS_DEPRECATED"
  22386. // "MISSING_TYPE_DEPENDENCY"
  22387. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22388. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22389. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22390. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22391. // "NEXT_HOP_NOT_RUNNING"
  22392. // "NOT_CRITICAL_ERROR"
  22393. // "NO_RESULTS_ON_PAGE"
  22394. // "REQUIRED_TOS_AGREEMENT"
  22395. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22396. // "RESOURCE_NOT_DELETED"
  22397. // "SCHEMA_VALIDATION_IGNORED"
  22398. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22399. // "UNDECLARED_PROPERTIES"
  22400. // "UNREACHABLE"
  22401. Code string `json:"code,omitempty"`
  22402. // Data: [Output Only] Metadata about this warning in key: value format.
  22403. // For example:
  22404. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22405. Data []*RouterListWarningData `json:"data,omitempty"`
  22406. // Message: [Output Only] A human-readable description of the warning
  22407. // code.
  22408. Message string `json:"message,omitempty"`
  22409. // ForceSendFields is a list of field names (e.g. "Code") to
  22410. // unconditionally include in API requests. By default, fields with
  22411. // empty values are omitted from API requests. However, any non-pointer,
  22412. // non-interface field appearing in ForceSendFields will be sent to the
  22413. // server regardless of whether the field is empty or not. This may be
  22414. // used to include empty fields in Patch requests.
  22415. ForceSendFields []string `json:"-"`
  22416. // NullFields is a list of field names (e.g. "Code") to include in API
  22417. // requests with the JSON null value. By default, fields with empty
  22418. // values are omitted from API requests. However, any field with an
  22419. // empty value appearing in NullFields will be sent to the server as
  22420. // null. It is an error if a field in this list has a non-empty value.
  22421. // This may be used to include null fields in Patch requests.
  22422. NullFields []string `json:"-"`
  22423. }
  22424. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  22425. type NoMethod RouterListWarning
  22426. raw := NoMethod(*s)
  22427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22428. }
  22429. type RouterListWarningData struct {
  22430. // Key: [Output Only] A key that provides more detail on the warning
  22431. // being returned. For example, for warnings where there are no results
  22432. // in a list request for a particular zone, this key might be scope and
  22433. // the key value might be the zone name. Other examples might be a key
  22434. // indicating a deprecated resource and a suggested replacement, or a
  22435. // warning about invalid network settings (for example, if an instance
  22436. // attempts to perform IP forwarding but is not enabled for IP
  22437. // forwarding).
  22438. Key string `json:"key,omitempty"`
  22439. // Value: [Output Only] A warning data value corresponding to the key.
  22440. Value string `json:"value,omitempty"`
  22441. // ForceSendFields is a list of field names (e.g. "Key") to
  22442. // unconditionally include in API requests. By default, fields with
  22443. // empty values are omitted from API requests. However, any non-pointer,
  22444. // non-interface field appearing in ForceSendFields will be sent to the
  22445. // server regardless of whether the field is empty or not. This may be
  22446. // used to include empty fields in Patch requests.
  22447. ForceSendFields []string `json:"-"`
  22448. // NullFields is a list of field names (e.g. "Key") to include in API
  22449. // requests with the JSON null value. By default, fields with empty
  22450. // values are omitted from API requests. However, any field with an
  22451. // empty value appearing in NullFields will be sent to the server as
  22452. // null. It is an error if a field in this list has a non-empty value.
  22453. // This may be used to include null fields in Patch requests.
  22454. NullFields []string `json:"-"`
  22455. }
  22456. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  22457. type NoMethod RouterListWarningData
  22458. raw := NoMethod(*s)
  22459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22460. }
  22461. // RouterNat: Represents a Nat resource. It enables the VMs within the
  22462. // specified subnetworks to access Internet without external IP
  22463. // addresses. It specifies a list of subnetworks (and the ranges within)
  22464. // that want to use NAT. Customers can also provide the external IPs
  22465. // that would be used for NAT. GCP would auto-allocate ephemeral IPs if
  22466. // no external IPs are provided.
  22467. type RouterNat struct {
  22468. // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
  22469. // Defaults to 30s if not set.
  22470. IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
  22471. // LogConfig: Configure logging on this NAT.
  22472. LogConfig *RouterNatLogConfig `json:"logConfig,omitempty"`
  22473. // MinPortsPerVm: Minimum number of ports allocated to a VM from this
  22474. // NAT config. If not set, a default number of ports is allocated to a
  22475. // VM. This gets rounded up to the nearest power of 2. Eg. if the value
  22476. // of this field is 50, at least 64 ports will be allocated to a VM.
  22477. MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
  22478. // Name: Unique name of this Nat service. The name must be 1-63
  22479. // characters long and comply with RFC1035.
  22480. Name string `json:"name,omitempty"`
  22481. // NatIpAllocateOption: Specify the NatIpAllocateOption. If it is
  22482. // AUTO_ONLY, then nat_ip should be empty.
  22483. //
  22484. // Possible values:
  22485. // "AUTO_ONLY"
  22486. // "MANUAL_ONLY"
  22487. NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
  22488. // NatIps: A list of URLs of the IP resources used for this Nat service.
  22489. // These IPs must be valid static external IP addresses assigned to the
  22490. // project. max_length is subject to change post alpha.
  22491. NatIps []string `json:"natIps,omitempty"`
  22492. // SourceSubnetworkIpRangesToNat: Specify the Nat option. If this field
  22493. // contains ALL_SUBNETWORKS_ALL_IP_RANGES or
  22494. // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any
  22495. // other Router.Nat section in any Router for this network in this
  22496. // region.
  22497. //
  22498. // Possible values:
  22499. // "ALL_SUBNETWORKS_ALL_IP_RANGES"
  22500. // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"
  22501. // "LIST_OF_SUBNETWORKS"
  22502. SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
  22503. // Subnetworks: A list of Subnetwork resources whose traffic should be
  22504. // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
  22505. // is selected for the SubnetworkIpRangeToNatOption above.
  22506. Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
  22507. // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
  22508. // established connections. Defaults to 1200s if not set.
  22509. TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
  22510. // TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
  22511. // connections. Defaults to 30s if not set.
  22512. TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
  22513. // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
  22514. // to 30s if not set.
  22515. UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
  22516. // ForceSendFields is a list of field names (e.g. "IcmpIdleTimeoutSec")
  22517. // to unconditionally include in API requests. By default, fields with
  22518. // empty values are omitted from API requests. However, any non-pointer,
  22519. // non-interface field appearing in ForceSendFields will be sent to the
  22520. // server regardless of whether the field is empty or not. This may be
  22521. // used to include empty fields in Patch requests.
  22522. ForceSendFields []string `json:"-"`
  22523. // NullFields is a list of field names (e.g. "IcmpIdleTimeoutSec") to
  22524. // include in API requests with the JSON null value. By default, fields
  22525. // with empty values are omitted from API requests. However, any field
  22526. // with an empty value appearing in NullFields will be sent to the
  22527. // server as null. It is an error if a field in this list has a
  22528. // non-empty value. This may be used to include null fields in Patch
  22529. // requests.
  22530. NullFields []string `json:"-"`
  22531. }
  22532. func (s *RouterNat) MarshalJSON() ([]byte, error) {
  22533. type NoMethod RouterNat
  22534. raw := NoMethod(*s)
  22535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22536. }
  22537. // RouterNatLogConfig: Configuration of logging on a NAT.
  22538. type RouterNatLogConfig struct {
  22539. // Enable: Indicates whether or not to export logs. This is false by
  22540. // default.
  22541. Enable bool `json:"enable,omitempty"`
  22542. // Filter: Specifies the desired filtering of logs on this NAT. If
  22543. // unspecified, logs are exported for all connections handled by this
  22544. // NAT.
  22545. //
  22546. // Possible values:
  22547. // "ALL"
  22548. // "ERRORS_ONLY"
  22549. // "TRANSLATIONS_ONLY"
  22550. Filter string `json:"filter,omitempty"`
  22551. // ForceSendFields is a list of field names (e.g. "Enable") to
  22552. // unconditionally include in API requests. By default, fields with
  22553. // empty values are omitted from API requests. However, any non-pointer,
  22554. // non-interface field appearing in ForceSendFields will be sent to the
  22555. // server regardless of whether the field is empty or not. This may be
  22556. // used to include empty fields in Patch requests.
  22557. ForceSendFields []string `json:"-"`
  22558. // NullFields is a list of field names (e.g. "Enable") to include in API
  22559. // requests with the JSON null value. By default, fields with empty
  22560. // values are omitted from API requests. However, any field with an
  22561. // empty value appearing in NullFields will be sent to the server as
  22562. // null. It is an error if a field in this list has a non-empty value.
  22563. // This may be used to include null fields in Patch requests.
  22564. NullFields []string `json:"-"`
  22565. }
  22566. func (s *RouterNatLogConfig) MarshalJSON() ([]byte, error) {
  22567. type NoMethod RouterNatLogConfig
  22568. raw := NoMethod(*s)
  22569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22570. }
  22571. // RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
  22572. // for a subnetwork.
  22573. type RouterNatSubnetworkToNat struct {
  22574. // Name: URL for the subnetwork resource to use NAT.
  22575. Name string `json:"name,omitempty"`
  22576. // SecondaryIpRangeNames: A list of the secondary ranges of the
  22577. // Subnetwork that are allowed to use NAT. This can be populated only if
  22578. // "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
  22579. // source_ip_ranges_to_nat.
  22580. SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
  22581. // SourceIpRangesToNat: Specify the options for NAT ranges in the
  22582. // Subnetwork. All usages of single value are valid except
  22583. // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
  22584. // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
  22585. // Default: [ALL_IP_RANGES]
  22586. //
  22587. // Possible values:
  22588. // "ALL_IP_RANGES"
  22589. // "LIST_OF_SECONDARY_IP_RANGES"
  22590. // "PRIMARY_IP_RANGE"
  22591. SourceIpRangesToNat []string `json:"sourceIpRangesToNat,omitempty"`
  22592. // ForceSendFields is a list of field names (e.g. "Name") to
  22593. // unconditionally include in API requests. By default, fields with
  22594. // empty values are omitted from API requests. However, any non-pointer,
  22595. // non-interface field appearing in ForceSendFields will be sent to the
  22596. // server regardless of whether the field is empty or not. This may be
  22597. // used to include empty fields in Patch requests.
  22598. ForceSendFields []string `json:"-"`
  22599. // NullFields is a list of field names (e.g. "Name") to include in API
  22600. // requests with the JSON null value. By default, fields with empty
  22601. // values are omitted from API requests. However, any field with an
  22602. // empty value appearing in NullFields will be sent to the server as
  22603. // null. It is an error if a field in this list has a non-empty value.
  22604. // This may be used to include null fields in Patch requests.
  22605. NullFields []string `json:"-"`
  22606. }
  22607. func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
  22608. type NoMethod RouterNatSubnetworkToNat
  22609. raw := NoMethod(*s)
  22610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22611. }
  22612. type RouterStatus struct {
  22613. // BestRoutes: Best routes for this router's network.
  22614. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  22615. // BestRoutesForRouter: Best routes learned by this router.
  22616. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  22617. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  22618. NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
  22619. // Network: URI of the network to which this router belongs.
  22620. Network string `json:"network,omitempty"`
  22621. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  22622. // unconditionally include in API requests. By default, fields with
  22623. // empty values are omitted from API requests. However, any non-pointer,
  22624. // non-interface field appearing in ForceSendFields will be sent to the
  22625. // server regardless of whether the field is empty or not. This may be
  22626. // used to include empty fields in Patch requests.
  22627. ForceSendFields []string `json:"-"`
  22628. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  22629. // API requests with the JSON null value. By default, fields with empty
  22630. // values are omitted from API requests. However, any field with an
  22631. // empty value appearing in NullFields will be sent to the server as
  22632. // null. It is an error if a field in this list has a non-empty value.
  22633. // This may be used to include null fields in Patch requests.
  22634. NullFields []string `json:"-"`
  22635. }
  22636. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  22637. type NoMethod RouterStatus
  22638. raw := NoMethod(*s)
  22639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22640. }
  22641. type RouterStatusBgpPeerStatus struct {
  22642. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  22643. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  22644. // IpAddress: IP address of the local BGP interface.
  22645. IpAddress string `json:"ipAddress,omitempty"`
  22646. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  22647. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  22648. // Name: Name of this BGP peer. Unique within the Routers resource.
  22649. Name string `json:"name,omitempty"`
  22650. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  22651. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  22652. // PeerIpAddress: IP address of the remote BGP interface.
  22653. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  22654. // State: BGP state as specified in RFC1771.
  22655. State string `json:"state,omitempty"`
  22656. // Status: Status of the BGP peer: {UP, DOWN}
  22657. //
  22658. // Possible values:
  22659. // "DOWN"
  22660. // "UNKNOWN"
  22661. // "UP"
  22662. Status string `json:"status,omitempty"`
  22663. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  22664. // days, 23 hours, 59 minutes, 59 seconds
  22665. Uptime string `json:"uptime,omitempty"`
  22666. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  22667. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  22668. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  22669. // unconditionally include in API requests. By default, fields with
  22670. // empty values are omitted from API requests. However, any non-pointer,
  22671. // non-interface field appearing in ForceSendFields will be sent to the
  22672. // server regardless of whether the field is empty or not. This may be
  22673. // used to include empty fields in Patch requests.
  22674. ForceSendFields []string `json:"-"`
  22675. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  22676. // include in API requests with the JSON null value. By default, fields
  22677. // with empty values are omitted from API requests. However, any field
  22678. // with an empty value appearing in NullFields will be sent to the
  22679. // server as null. It is an error if a field in this list has a
  22680. // non-empty value. This may be used to include null fields in Patch
  22681. // requests.
  22682. NullFields []string `json:"-"`
  22683. }
  22684. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  22685. type NoMethod RouterStatusBgpPeerStatus
  22686. raw := NoMethod(*s)
  22687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22688. }
  22689. // RouterStatusNatStatus: Status of a NAT contained in this router. Next
  22690. // tag: 9
  22691. type RouterStatusNatStatus struct {
  22692. // AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
  22693. // ["1.1.1.1", "129.2.16.89"]
  22694. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  22695. // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
  22696. // be greater than 0 only if user-specified IPs are NOT enough to allow
  22697. // all configured VMs to use NAT. This value is meaningful only when
  22698. // auto-allocation of NAT IPs is *not* used.
  22699. MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
  22700. // Name: Unique name of this NAT.
  22701. Name string `json:"name,omitempty"`
  22702. // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
  22703. // that can use NAT.
  22704. NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
  22705. // UserAllocatedNatIpResources: A list of fully qualified URLs of
  22706. // reserved IP address resources.
  22707. UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
  22708. // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
  22709. // be raw IP strings like "179.12.26.133".
  22710. UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
  22711. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  22712. // to unconditionally include in API requests. By default, fields with
  22713. // empty values are omitted from API requests. However, any non-pointer,
  22714. // non-interface field appearing in ForceSendFields will be sent to the
  22715. // server regardless of whether the field is empty or not. This may be
  22716. // used to include empty fields in Patch requests.
  22717. ForceSendFields []string `json:"-"`
  22718. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  22719. // include in API requests with the JSON null value. By default, fields
  22720. // with empty values are omitted from API requests. However, any field
  22721. // with an empty value appearing in NullFields will be sent to the
  22722. // server as null. It is an error if a field in this list has a
  22723. // non-empty value. This may be used to include null fields in Patch
  22724. // requests.
  22725. NullFields []string `json:"-"`
  22726. }
  22727. func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
  22728. type NoMethod RouterStatusNatStatus
  22729. raw := NoMethod(*s)
  22730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22731. }
  22732. type RouterStatusResponse struct {
  22733. // Kind: Type of resource.
  22734. Kind string `json:"kind,omitempty"`
  22735. Result *RouterStatus `json:"result,omitempty"`
  22736. // ServerResponse contains the HTTP response code and headers from the
  22737. // server.
  22738. googleapi.ServerResponse `json:"-"`
  22739. // ForceSendFields is a list of field names (e.g. "Kind") to
  22740. // unconditionally include in API requests. By default, fields with
  22741. // empty values are omitted from API requests. However, any non-pointer,
  22742. // non-interface field appearing in ForceSendFields will be sent to the
  22743. // server regardless of whether the field is empty or not. This may be
  22744. // used to include empty fields in Patch requests.
  22745. ForceSendFields []string `json:"-"`
  22746. // NullFields is a list of field names (e.g. "Kind") to include in API
  22747. // requests with the JSON null value. By default, fields with empty
  22748. // values are omitted from API requests. However, any field with an
  22749. // empty value appearing in NullFields will be sent to the server as
  22750. // null. It is an error if a field in this list has a non-empty value.
  22751. // This may be used to include null fields in Patch requests.
  22752. NullFields []string `json:"-"`
  22753. }
  22754. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  22755. type NoMethod RouterStatusResponse
  22756. raw := NoMethod(*s)
  22757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22758. }
  22759. type RoutersPreviewResponse struct {
  22760. // Resource: Preview of given router.
  22761. Resource *Router `json:"resource,omitempty"`
  22762. // ServerResponse contains the HTTP response code and headers from the
  22763. // server.
  22764. googleapi.ServerResponse `json:"-"`
  22765. // ForceSendFields is a list of field names (e.g. "Resource") to
  22766. // unconditionally include in API requests. By default, fields with
  22767. // empty values are omitted from API requests. However, any non-pointer,
  22768. // non-interface field appearing in ForceSendFields will be sent to the
  22769. // server regardless of whether the field is empty or not. This may be
  22770. // used to include empty fields in Patch requests.
  22771. ForceSendFields []string `json:"-"`
  22772. // NullFields is a list of field names (e.g. "Resource") to include in
  22773. // API requests with the JSON null value. By default, fields with empty
  22774. // values are omitted from API requests. However, any field with an
  22775. // empty value appearing in NullFields will be sent to the server as
  22776. // null. It is an error if a field in this list has a non-empty value.
  22777. // This may be used to include null fields in Patch requests.
  22778. NullFields []string `json:"-"`
  22779. }
  22780. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  22781. type NoMethod RoutersPreviewResponse
  22782. raw := NoMethod(*s)
  22783. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22784. }
  22785. type RoutersScopedList struct {
  22786. // Routers: A list of routers contained in this scope.
  22787. Routers []*Router `json:"routers,omitempty"`
  22788. // Warning: Informational warning which replaces the list of routers
  22789. // when the list is empty.
  22790. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  22791. // ForceSendFields is a list of field names (e.g. "Routers") to
  22792. // unconditionally include in API requests. By default, fields with
  22793. // empty values are omitted from API requests. However, any non-pointer,
  22794. // non-interface field appearing in ForceSendFields will be sent to the
  22795. // server regardless of whether the field is empty or not. This may be
  22796. // used to include empty fields in Patch requests.
  22797. ForceSendFields []string `json:"-"`
  22798. // NullFields is a list of field names (e.g. "Routers") to include in
  22799. // API requests with the JSON null value. By default, fields with empty
  22800. // values are omitted from API requests. However, any field with an
  22801. // empty value appearing in NullFields will be sent to the server as
  22802. // null. It is an error if a field in this list has a non-empty value.
  22803. // This may be used to include null fields in Patch requests.
  22804. NullFields []string `json:"-"`
  22805. }
  22806. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  22807. type NoMethod RoutersScopedList
  22808. raw := NoMethod(*s)
  22809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22810. }
  22811. // RoutersScopedListWarning: Informational warning which replaces the
  22812. // list of routers when the list is empty.
  22813. type RoutersScopedListWarning struct {
  22814. // Code: [Output Only] A warning code, if applicable. For example,
  22815. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22816. // the response.
  22817. //
  22818. // Possible values:
  22819. // "CLEANUP_FAILED"
  22820. // "DEPRECATED_RESOURCE_USED"
  22821. // "DEPRECATED_TYPE_USED"
  22822. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22823. // "EXPERIMENTAL_TYPE_USED"
  22824. // "EXTERNAL_API_WARNING"
  22825. // "FIELD_VALUE_OVERRIDEN"
  22826. // "INJECTED_KERNELS_DEPRECATED"
  22827. // "MISSING_TYPE_DEPENDENCY"
  22828. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22829. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22830. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22831. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22832. // "NEXT_HOP_NOT_RUNNING"
  22833. // "NOT_CRITICAL_ERROR"
  22834. // "NO_RESULTS_ON_PAGE"
  22835. // "REQUIRED_TOS_AGREEMENT"
  22836. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22837. // "RESOURCE_NOT_DELETED"
  22838. // "SCHEMA_VALIDATION_IGNORED"
  22839. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22840. // "UNDECLARED_PROPERTIES"
  22841. // "UNREACHABLE"
  22842. Code string `json:"code,omitempty"`
  22843. // Data: [Output Only] Metadata about this warning in key: value format.
  22844. // For example:
  22845. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22846. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  22847. // Message: [Output Only] A human-readable description of the warning
  22848. // code.
  22849. Message string `json:"message,omitempty"`
  22850. // ForceSendFields is a list of field names (e.g. "Code") to
  22851. // unconditionally include in API requests. By default, fields with
  22852. // empty values are omitted from API requests. However, any non-pointer,
  22853. // non-interface field appearing in ForceSendFields will be sent to the
  22854. // server regardless of whether the field is empty or not. This may be
  22855. // used to include empty fields in Patch requests.
  22856. ForceSendFields []string `json:"-"`
  22857. // NullFields is a list of field names (e.g. "Code") to include in API
  22858. // requests with the JSON null value. By default, fields with empty
  22859. // values are omitted from API requests. However, any field with an
  22860. // empty value appearing in NullFields will be sent to the server as
  22861. // null. It is an error if a field in this list has a non-empty value.
  22862. // This may be used to include null fields in Patch requests.
  22863. NullFields []string `json:"-"`
  22864. }
  22865. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  22866. type NoMethod RoutersScopedListWarning
  22867. raw := NoMethod(*s)
  22868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22869. }
  22870. type RoutersScopedListWarningData struct {
  22871. // Key: [Output Only] A key that provides more detail on the warning
  22872. // being returned. For example, for warnings where there are no results
  22873. // in a list request for a particular zone, this key might be scope and
  22874. // the key value might be the zone name. Other examples might be a key
  22875. // indicating a deprecated resource and a suggested replacement, or a
  22876. // warning about invalid network settings (for example, if an instance
  22877. // attempts to perform IP forwarding but is not enabled for IP
  22878. // forwarding).
  22879. Key string `json:"key,omitempty"`
  22880. // Value: [Output Only] A warning data value corresponding to the key.
  22881. Value string `json:"value,omitempty"`
  22882. // ForceSendFields is a list of field names (e.g. "Key") to
  22883. // unconditionally include in API requests. By default, fields with
  22884. // empty values are omitted from API requests. However, any non-pointer,
  22885. // non-interface field appearing in ForceSendFields will be sent to the
  22886. // server regardless of whether the field is empty or not. This may be
  22887. // used to include empty fields in Patch requests.
  22888. ForceSendFields []string `json:"-"`
  22889. // NullFields is a list of field names (e.g. "Key") to include in API
  22890. // requests with the JSON null value. By default, fields with empty
  22891. // values are omitted from API requests. However, any field with an
  22892. // empty value appearing in NullFields will be sent to the server as
  22893. // null. It is an error if a field in this list has a non-empty value.
  22894. // This may be used to include null fields in Patch requests.
  22895. NullFields []string `json:"-"`
  22896. }
  22897. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  22898. type NoMethod RoutersScopedListWarningData
  22899. raw := NoMethod(*s)
  22900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22901. }
  22902. // Rule: A rule to be applied in a Policy.
  22903. type Rule struct {
  22904. // Action: Required
  22905. //
  22906. // Possible values:
  22907. // "ALLOW"
  22908. // "ALLOW_WITH_LOG"
  22909. // "DENY"
  22910. // "DENY_WITH_LOG"
  22911. // "LOG"
  22912. // "NO_ACTION"
  22913. Action string `json:"action,omitempty"`
  22914. // Conditions: Additional restrictions that must be met. All conditions
  22915. // must pass for the rule to match.
  22916. Conditions []*Condition `json:"conditions,omitempty"`
  22917. // Description: Human-readable description of the rule.
  22918. Description string `json:"description,omitempty"`
  22919. // Ins: If one or more 'in' clauses are specified, the rule matches if
  22920. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  22921. Ins []string `json:"ins,omitempty"`
  22922. // LogConfigs: The config returned to callers of
  22923. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  22924. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  22925. // NotIns: If one or more 'not_in' clauses are specified, the rule
  22926. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  22927. // entries.
  22928. NotIns []string `json:"notIns,omitempty"`
  22929. // Permissions: A permission is a string of form '..' (e.g.,
  22930. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  22931. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  22932. Permissions []string `json:"permissions,omitempty"`
  22933. // ForceSendFields is a list of field names (e.g. "Action") to
  22934. // unconditionally include in API requests. By default, fields with
  22935. // empty values are omitted from API requests. However, any non-pointer,
  22936. // non-interface field appearing in ForceSendFields will be sent to the
  22937. // server regardless of whether the field is empty or not. This may be
  22938. // used to include empty fields in Patch requests.
  22939. ForceSendFields []string `json:"-"`
  22940. // NullFields is a list of field names (e.g. "Action") to include in API
  22941. // requests with the JSON null value. By default, fields with empty
  22942. // values are omitted from API requests. However, any field with an
  22943. // empty value appearing in NullFields will be sent to the server as
  22944. // null. It is an error if a field in this list has a non-empty value.
  22945. // This may be used to include null fields in Patch requests.
  22946. NullFields []string `json:"-"`
  22947. }
  22948. func (s *Rule) MarshalJSON() ([]byte, error) {
  22949. type NoMethod Rule
  22950. raw := NoMethod(*s)
  22951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22952. }
  22953. type SSLHealthCheck struct {
  22954. // Port: The TCP port number for the health check request. The default
  22955. // value is 443. Valid values are 1 through 65535.
  22956. Port int64 `json:"port,omitempty"`
  22957. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  22958. // both port and port_name are defined, port takes precedence.
  22959. PortName string `json:"portName,omitempty"`
  22960. // PortSpecification: Specifies how port is selected for health
  22961. // checking, can be one of following values:
  22962. // USE_FIXED_PORT: The port number in
  22963. // port
  22964. // is used for health checking.
  22965. // USE_NAMED_PORT: The
  22966. // portName
  22967. // is used for health checking.
  22968. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  22969. // each network endpoint is used for health checking. For other
  22970. // backends, the port or named port specified in the Backend Service is
  22971. // used for health checking.
  22972. //
  22973. //
  22974. // If not specified, SSL health check follows behavior specified
  22975. // in
  22976. // port
  22977. // and
  22978. // portName
  22979. // fields.
  22980. //
  22981. // Possible values:
  22982. // "USE_FIXED_PORT"
  22983. // "USE_NAMED_PORT"
  22984. // "USE_SERVING_PORT"
  22985. PortSpecification string `json:"portSpecification,omitempty"`
  22986. // ProxyHeader: Specifies the type of proxy header to append before
  22987. // sending data to the backend, either NONE or PROXY_V1. The default is
  22988. // NONE.
  22989. //
  22990. // Possible values:
  22991. // "NONE"
  22992. // "PROXY_V1"
  22993. ProxyHeader string `json:"proxyHeader,omitempty"`
  22994. // Request: The application data to send once the SSL connection has
  22995. // been established (default value is empty). If both request and
  22996. // response are empty, the connection establishment alone will indicate
  22997. // health. The request data can only be ASCII.
  22998. Request string `json:"request,omitempty"`
  22999. // Response: The bytes to match against the beginning of the response
  23000. // data. If left empty (the default value), any response will indicate
  23001. // health. The response data can only be ASCII.
  23002. Response string `json:"response,omitempty"`
  23003. // ForceSendFields is a list of field names (e.g. "Port") to
  23004. // unconditionally include in API requests. By default, fields with
  23005. // empty values are omitted from API requests. However, any non-pointer,
  23006. // non-interface field appearing in ForceSendFields will be sent to the
  23007. // server regardless of whether the field is empty or not. This may be
  23008. // used to include empty fields in Patch requests.
  23009. ForceSendFields []string `json:"-"`
  23010. // NullFields is a list of field names (e.g. "Port") to include in API
  23011. // requests with the JSON null value. By default, fields with empty
  23012. // values are omitted from API requests. However, any field with an
  23013. // empty value appearing in NullFields will be sent to the server as
  23014. // null. It is an error if a field in this list has a non-empty value.
  23015. // This may be used to include null fields in Patch requests.
  23016. NullFields []string `json:"-"`
  23017. }
  23018. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  23019. type NoMethod SSLHealthCheck
  23020. raw := NoMethod(*s)
  23021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23022. }
  23023. // Scheduling: Sets the scheduling options for an Instance.
  23024. type Scheduling struct {
  23025. // AutomaticRestart: Specifies whether the instance should be
  23026. // automatically restarted if it is terminated by Compute Engine (not
  23027. // terminated by a user). You can only set the automatic restart option
  23028. // for standard instances. Preemptible instances cannot be automatically
  23029. // restarted.
  23030. //
  23031. // By default, this is set to true so an instance is automatically
  23032. // restarted if it is terminated by Compute Engine.
  23033. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  23034. // NodeAffinities: A set of node affinity and anti-affinity.
  23035. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  23036. // OnHostMaintenance: Defines the maintenance behavior for this
  23037. // instance. For standard instances, the default behavior is MIGRATE.
  23038. // For preemptible instances, the default and only possible behavior is
  23039. // TERMINATE. For more information, see Setting Instance Scheduling
  23040. // Options.
  23041. //
  23042. // Possible values:
  23043. // "MIGRATE"
  23044. // "TERMINATE"
  23045. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  23046. // Preemptible: Defines whether the instance is preemptible. This can
  23047. // only be set during instance creation, it cannot be set or changed
  23048. // after the instance has been created.
  23049. Preemptible bool `json:"preemptible,omitempty"`
  23050. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  23051. // unconditionally include in API requests. By default, fields with
  23052. // empty values are omitted from API requests. However, any non-pointer,
  23053. // non-interface field appearing in ForceSendFields will be sent to the
  23054. // server regardless of whether the field is empty or not. This may be
  23055. // used to include empty fields in Patch requests.
  23056. ForceSendFields []string `json:"-"`
  23057. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  23058. // include in API requests with the JSON null value. By default, fields
  23059. // with empty values are omitted from API requests. However, any field
  23060. // with an empty value appearing in NullFields will be sent to the
  23061. // server as null. It is an error if a field in this list has a
  23062. // non-empty value. This may be used to include null fields in Patch
  23063. // requests.
  23064. NullFields []string `json:"-"`
  23065. }
  23066. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  23067. type NoMethod Scheduling
  23068. raw := NoMethod(*s)
  23069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23070. }
  23071. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  23072. // nodes onto which this Instance could be scheduled.
  23073. type SchedulingNodeAffinity struct {
  23074. // Key: Corresponds to the label key of Node resource.
  23075. Key string `json:"key,omitempty"`
  23076. // Operator: Defines the operation of node selection.
  23077. //
  23078. // Possible values:
  23079. // "IN"
  23080. // "NOT_IN"
  23081. // "OPERATOR_UNSPECIFIED"
  23082. Operator string `json:"operator,omitempty"`
  23083. // Values: Corresponds to the label values of Node resource.
  23084. Values []string `json:"values,omitempty"`
  23085. // ForceSendFields is a list of field names (e.g. "Key") to
  23086. // unconditionally include in API requests. By default, fields with
  23087. // empty values are omitted from API requests. However, any non-pointer,
  23088. // non-interface field appearing in ForceSendFields will be sent to the
  23089. // server regardless of whether the field is empty or not. This may be
  23090. // used to include empty fields in Patch requests.
  23091. ForceSendFields []string `json:"-"`
  23092. // NullFields is a list of field names (e.g. "Key") to include in API
  23093. // requests with the JSON null value. By default, fields with empty
  23094. // values are omitted from API requests. However, any field with an
  23095. // empty value appearing in NullFields will be sent to the server as
  23096. // null. It is an error if a field in this list has a non-empty value.
  23097. // This may be used to include null fields in Patch requests.
  23098. NullFields []string `json:"-"`
  23099. }
  23100. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  23101. type NoMethod SchedulingNodeAffinity
  23102. raw := NoMethod(*s)
  23103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23104. }
  23105. type SecurityPoliciesListPreconfiguredExpressionSetsResponse struct {
  23106. PreconfiguredExpressionSets *SecurityPoliciesWafConfig `json:"preconfiguredExpressionSets,omitempty"`
  23107. // ServerResponse contains the HTTP response code and headers from the
  23108. // server.
  23109. googleapi.ServerResponse `json:"-"`
  23110. // ForceSendFields is a list of field names (e.g.
  23111. // "PreconfiguredExpressionSets") to unconditionally include in API
  23112. // requests. By default, fields with empty values are omitted from API
  23113. // requests. However, any non-pointer, non-interface field appearing in
  23114. // ForceSendFields will be sent to the server regardless of whether the
  23115. // field is empty or not. This may be used to include empty fields in
  23116. // Patch requests.
  23117. ForceSendFields []string `json:"-"`
  23118. // NullFields is a list of field names (e.g.
  23119. // "PreconfiguredExpressionSets") to include in API requests with the
  23120. // JSON null value. By default, fields with empty values are omitted
  23121. // from API requests. However, any field with an empty value appearing
  23122. // in NullFields will be sent to the server as null. It is an error if a
  23123. // field in this list has a non-empty value. This may be used to include
  23124. // null fields in Patch requests.
  23125. NullFields []string `json:"-"`
  23126. }
  23127. func (s *SecurityPoliciesListPreconfiguredExpressionSetsResponse) MarshalJSON() ([]byte, error) {
  23128. type NoMethod SecurityPoliciesListPreconfiguredExpressionSetsResponse
  23129. raw := NoMethod(*s)
  23130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23131. }
  23132. type SecurityPoliciesWafConfig struct {
  23133. WafRules *PreconfiguredWafSet `json:"wafRules,omitempty"`
  23134. // ForceSendFields is a list of field names (e.g. "WafRules") to
  23135. // unconditionally include in API requests. By default, fields with
  23136. // empty values are omitted from API requests. However, any non-pointer,
  23137. // non-interface field appearing in ForceSendFields will be sent to the
  23138. // server regardless of whether the field is empty or not. This may be
  23139. // used to include empty fields in Patch requests.
  23140. ForceSendFields []string `json:"-"`
  23141. // NullFields is a list of field names (e.g. "WafRules") to include in
  23142. // API requests with the JSON null value. By default, fields with empty
  23143. // values are omitted from API requests. However, any field with an
  23144. // empty value appearing in NullFields will be sent to the server as
  23145. // null. It is an error if a field in this list has a non-empty value.
  23146. // This may be used to include null fields in Patch requests.
  23147. NullFields []string `json:"-"`
  23148. }
  23149. func (s *SecurityPoliciesWafConfig) MarshalJSON() ([]byte, error) {
  23150. type NoMethod SecurityPoliciesWafConfig
  23151. raw := NoMethod(*s)
  23152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23153. }
  23154. // SecurityPolicy: A security policy is comprised of one or more rules.
  23155. // It can also be associated with one or more 'targets'. (==
  23156. // resource_for v1.securityPolicies ==) (== resource_for
  23157. // beta.securityPolicies ==)
  23158. type SecurityPolicy struct {
  23159. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23160. // format.
  23161. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23162. // Description: An optional description of this resource. Provide this
  23163. // property when you create the resource.
  23164. Description string `json:"description,omitempty"`
  23165. // Fingerprint: Specifies a fingerprint for this resource, which is
  23166. // essentially a hash of the metadata's contents and used for optimistic
  23167. // locking. The fingerprint is initially generated by Compute Engine and
  23168. // changes after every request to modify or update metadata. You must
  23169. // always provide an up-to-date fingerprint hash in order to update or
  23170. // change metadata, otherwise the request will fail with error 412
  23171. // conditionNotMet.
  23172. //
  23173. // To see the latest fingerprint, make get() request to the security
  23174. // policy.
  23175. Fingerprint string `json:"fingerprint,omitempty"`
  23176. // Id: [Output Only] The unique identifier for the resource. This
  23177. // identifier is defined by the server.
  23178. Id uint64 `json:"id,omitempty,string"`
  23179. // Kind: [Output only] Type of the resource. Always
  23180. // compute#securityPolicyfor security policies
  23181. Kind string `json:"kind,omitempty"`
  23182. // LabelFingerprint: A fingerprint for the labels being applied to this
  23183. // security policy, which is essentially a hash of the labels set used
  23184. // for optimistic locking. The fingerprint is initially generated by
  23185. // Compute Engine and changes after every request to modify or update
  23186. // labels. You must always provide an up-to-date fingerprint hash in
  23187. // order to update or change labels.
  23188. //
  23189. // To see the latest fingerprint, make get() request to the security
  23190. // policy.
  23191. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  23192. // Labels: Labels to apply to this security policy resource. These can
  23193. // be later modified by the setLabels method. Each label key/value must
  23194. // comply with RFC1035. Label values may be empty.
  23195. Labels map[string]string `json:"labels,omitempty"`
  23196. // Name: Name of the resource. Provided by the client when the resource
  23197. // is created. The name must be 1-63 characters long, and comply with
  23198. // RFC1035. Specifically, the name must be 1-63 characters long and
  23199. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23200. // the first character must be a lowercase letter, and all following
  23201. // characters must be a dash, lowercase letter, or digit, except the
  23202. // last character, which cannot be a dash.
  23203. Name string `json:"name,omitempty"`
  23204. // Rules: A list of rules that belong to this policy. There must always
  23205. // be a default rule (rule with priority 2147483647 and match "*"). If
  23206. // no rules are provided when creating a security policy, a default rule
  23207. // with action "allow" will be added.
  23208. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  23209. // SelfLink: [Output Only] Server-defined URL for the resource.
  23210. SelfLink string `json:"selfLink,omitempty"`
  23211. // ServerResponse contains the HTTP response code and headers from the
  23212. // server.
  23213. googleapi.ServerResponse `json:"-"`
  23214. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23215. // to unconditionally include in API requests. By default, fields with
  23216. // empty values are omitted from API requests. However, any non-pointer,
  23217. // non-interface field appearing in ForceSendFields will be sent to the
  23218. // server regardless of whether the field is empty or not. This may be
  23219. // used to include empty fields in Patch requests.
  23220. ForceSendFields []string `json:"-"`
  23221. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23222. // include in API requests with the JSON null value. By default, fields
  23223. // with empty values are omitted from API requests. However, any field
  23224. // with an empty value appearing in NullFields will be sent to the
  23225. // server as null. It is an error if a field in this list has a
  23226. // non-empty value. This may be used to include null fields in Patch
  23227. // requests.
  23228. NullFields []string `json:"-"`
  23229. }
  23230. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  23231. type NoMethod SecurityPolicy
  23232. raw := NoMethod(*s)
  23233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23234. }
  23235. type SecurityPolicyList struct {
  23236. // Id: [Output Only] Unique identifier for the resource; defined by the
  23237. // server.
  23238. Id string `json:"id,omitempty"`
  23239. // Items: A list of SecurityPolicy resources.
  23240. Items []*SecurityPolicy `json:"items,omitempty"`
  23241. // Kind: [Output Only] Type of resource. Always
  23242. // compute#securityPolicyList for listsof securityPolicies
  23243. Kind string `json:"kind,omitempty"`
  23244. // NextPageToken: [Output Only] This token allows you to get the next
  23245. // page of results for list requests. If the number of results is larger
  23246. // than maxResults, use the nextPageToken as a value for the query
  23247. // parameter pageToken in the next list request. Subsequent list
  23248. // requests will have their own nextPageToken to continue paging through
  23249. // the results.
  23250. NextPageToken string `json:"nextPageToken,omitempty"`
  23251. // Warning: [Output Only] Informational warning message.
  23252. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  23253. // ServerResponse contains the HTTP response code and headers from the
  23254. // server.
  23255. googleapi.ServerResponse `json:"-"`
  23256. // ForceSendFields is a list of field names (e.g. "Id") to
  23257. // unconditionally include in API requests. By default, fields with
  23258. // empty values are omitted from API requests. However, any non-pointer,
  23259. // non-interface field appearing in ForceSendFields will be sent to the
  23260. // server regardless of whether the field is empty or not. This may be
  23261. // used to include empty fields in Patch requests.
  23262. ForceSendFields []string `json:"-"`
  23263. // NullFields is a list of field names (e.g. "Id") to include in API
  23264. // requests with the JSON null value. By default, fields with empty
  23265. // values are omitted from API requests. However, any field with an
  23266. // empty value appearing in NullFields will be sent to the server as
  23267. // null. It is an error if a field in this list has a non-empty value.
  23268. // This may be used to include null fields in Patch requests.
  23269. NullFields []string `json:"-"`
  23270. }
  23271. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  23272. type NoMethod SecurityPolicyList
  23273. raw := NoMethod(*s)
  23274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23275. }
  23276. // SecurityPolicyListWarning: [Output Only] Informational warning
  23277. // message.
  23278. type SecurityPolicyListWarning struct {
  23279. // Code: [Output Only] A warning code, if applicable. For example,
  23280. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23281. // the response.
  23282. //
  23283. // Possible values:
  23284. // "CLEANUP_FAILED"
  23285. // "DEPRECATED_RESOURCE_USED"
  23286. // "DEPRECATED_TYPE_USED"
  23287. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23288. // "EXPERIMENTAL_TYPE_USED"
  23289. // "EXTERNAL_API_WARNING"
  23290. // "FIELD_VALUE_OVERRIDEN"
  23291. // "INJECTED_KERNELS_DEPRECATED"
  23292. // "MISSING_TYPE_DEPENDENCY"
  23293. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23294. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23295. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23296. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23297. // "NEXT_HOP_NOT_RUNNING"
  23298. // "NOT_CRITICAL_ERROR"
  23299. // "NO_RESULTS_ON_PAGE"
  23300. // "REQUIRED_TOS_AGREEMENT"
  23301. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23302. // "RESOURCE_NOT_DELETED"
  23303. // "SCHEMA_VALIDATION_IGNORED"
  23304. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23305. // "UNDECLARED_PROPERTIES"
  23306. // "UNREACHABLE"
  23307. Code string `json:"code,omitempty"`
  23308. // Data: [Output Only] Metadata about this warning in key: value format.
  23309. // For example:
  23310. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23311. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  23312. // Message: [Output Only] A human-readable description of the warning
  23313. // code.
  23314. Message string `json:"message,omitempty"`
  23315. // ForceSendFields is a list of field names (e.g. "Code") to
  23316. // unconditionally include in API requests. By default, fields with
  23317. // empty values are omitted from API requests. However, any non-pointer,
  23318. // non-interface field appearing in ForceSendFields will be sent to the
  23319. // server regardless of whether the field is empty or not. This may be
  23320. // used to include empty fields in Patch requests.
  23321. ForceSendFields []string `json:"-"`
  23322. // NullFields is a list of field names (e.g. "Code") to include in API
  23323. // requests with the JSON null value. By default, fields with empty
  23324. // values are omitted from API requests. However, any field with an
  23325. // empty value appearing in NullFields will be sent to the server as
  23326. // null. It is an error if a field in this list has a non-empty value.
  23327. // This may be used to include null fields in Patch requests.
  23328. NullFields []string `json:"-"`
  23329. }
  23330. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  23331. type NoMethod SecurityPolicyListWarning
  23332. raw := NoMethod(*s)
  23333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23334. }
  23335. type SecurityPolicyListWarningData struct {
  23336. // Key: [Output Only] A key that provides more detail on the warning
  23337. // being returned. For example, for warnings where there are no results
  23338. // in a list request for a particular zone, this key might be scope and
  23339. // the key value might be the zone name. Other examples might be a key
  23340. // indicating a deprecated resource and a suggested replacement, or a
  23341. // warning about invalid network settings (for example, if an instance
  23342. // attempts to perform IP forwarding but is not enabled for IP
  23343. // forwarding).
  23344. Key string `json:"key,omitempty"`
  23345. // Value: [Output Only] A warning data value corresponding to the key.
  23346. Value string `json:"value,omitempty"`
  23347. // ForceSendFields is a list of field names (e.g. "Key") to
  23348. // unconditionally include in API requests. By default, fields with
  23349. // empty values are omitted from API requests. However, any non-pointer,
  23350. // non-interface field appearing in ForceSendFields will be sent to the
  23351. // server regardless of whether the field is empty or not. This may be
  23352. // used to include empty fields in Patch requests.
  23353. ForceSendFields []string `json:"-"`
  23354. // NullFields is a list of field names (e.g. "Key") to include in API
  23355. // requests with the JSON null value. By default, fields with empty
  23356. // values are omitted from API requests. However, any field with an
  23357. // empty value appearing in NullFields will be sent to the server as
  23358. // null. It is an error if a field in this list has a non-empty value.
  23359. // This may be used to include null fields in Patch requests.
  23360. NullFields []string `json:"-"`
  23361. }
  23362. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  23363. type NoMethod SecurityPolicyListWarningData
  23364. raw := NoMethod(*s)
  23365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23366. }
  23367. type SecurityPolicyReference struct {
  23368. SecurityPolicy string `json:"securityPolicy,omitempty"`
  23369. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  23370. // unconditionally include in API requests. By default, fields with
  23371. // empty values are omitted from API requests. However, any non-pointer,
  23372. // non-interface field appearing in ForceSendFields will be sent to the
  23373. // server regardless of whether the field is empty or not. This may be
  23374. // used to include empty fields in Patch requests.
  23375. ForceSendFields []string `json:"-"`
  23376. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  23377. // include in API requests with the JSON null value. By default, fields
  23378. // with empty values are omitted from API requests. However, any field
  23379. // with an empty value appearing in NullFields will be sent to the
  23380. // server as null. It is an error if a field in this list has a
  23381. // non-empty value. This may be used to include null fields in Patch
  23382. // requests.
  23383. NullFields []string `json:"-"`
  23384. }
  23385. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  23386. type NoMethod SecurityPolicyReference
  23387. raw := NoMethod(*s)
  23388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23389. }
  23390. // SecurityPolicyRule: Represents a rule that describes one or more
  23391. // match conditions along with the action to be taken when traffic
  23392. // matches this condition (allow or deny).
  23393. type SecurityPolicyRule struct {
  23394. // Action: The Action to preform when the client connection triggers the
  23395. // rule. Can currently be either "allow" or "deny()" where valid values
  23396. // for status are 403, 404, and 502.
  23397. Action string `json:"action,omitempty"`
  23398. // Description: An optional description of this resource. Provide this
  23399. // property when you create the resource.
  23400. Description string `json:"description,omitempty"`
  23401. // Kind: [Output only] Type of the resource. Always
  23402. // compute#securityPolicyRule for security policy rules
  23403. Kind string `json:"kind,omitempty"`
  23404. // Match: A match condition that incoming traffic is evaluated against.
  23405. // If it evaluates to true, the corresponding ?action? is enforced.
  23406. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  23407. // Preview: If set to true, the specified action is not enforced.
  23408. Preview bool `json:"preview,omitempty"`
  23409. // Priority: An integer indicating the priority of a rule in the list.
  23410. // The priority must be a positive value between 0 and 2147483647. Rules
  23411. // are evaluated from highest to lowest priority where 0 is the highest
  23412. // priority and 2147483647 is the lowest prority.
  23413. Priority int64 `json:"priority,omitempty"`
  23414. // ServerResponse contains the HTTP response code and headers from the
  23415. // server.
  23416. googleapi.ServerResponse `json:"-"`
  23417. // ForceSendFields is a list of field names (e.g. "Action") to
  23418. // unconditionally include in API requests. By default, fields with
  23419. // empty values are omitted from API requests. However, any non-pointer,
  23420. // non-interface field appearing in ForceSendFields will be sent to the
  23421. // server regardless of whether the field is empty or not. This may be
  23422. // used to include empty fields in Patch requests.
  23423. ForceSendFields []string `json:"-"`
  23424. // NullFields is a list of field names (e.g. "Action") to include in API
  23425. // requests with the JSON null value. By default, fields with empty
  23426. // values are omitted from API requests. However, any field with an
  23427. // empty value appearing in NullFields will be sent to the server as
  23428. // null. It is an error if a field in this list has a non-empty value.
  23429. // This may be used to include null fields in Patch requests.
  23430. NullFields []string `json:"-"`
  23431. }
  23432. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  23433. type NoMethod SecurityPolicyRule
  23434. raw := NoMethod(*s)
  23435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23436. }
  23437. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  23438. // traffic is evaluated against. Exactly one field must be specified.
  23439. type SecurityPolicyRuleMatcher struct {
  23440. // Config: The configuration options available when specifying
  23441. // versioned_expr. This field must be specified if versioned_expr is
  23442. // specified and cannot be specified if versioned_expr is not specified.
  23443. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  23444. // Expr: User defined CEVAL expression. A CEVAL expression is used to
  23445. // specify match criteria such as origin.ip, source.region_code and
  23446. // contents in the request header.
  23447. Expr *Expr `json:"expr,omitempty"`
  23448. // VersionedExpr: Preconfigured versioned expression. If this field is
  23449. // specified, config must also be specified. Available preconfigured
  23450. // expressions along with their requirements are: SRC_IPS_V1 - must
  23451. // specify the corresponding src_ip_range field in config.
  23452. //
  23453. // Possible values:
  23454. // "SRC_IPS_V1"
  23455. VersionedExpr string `json:"versionedExpr,omitempty"`
  23456. // ForceSendFields is a list of field names (e.g. "Config") to
  23457. // unconditionally include in API requests. By default, fields with
  23458. // empty values are omitted from API requests. However, any non-pointer,
  23459. // non-interface field appearing in ForceSendFields will be sent to the
  23460. // server regardless of whether the field is empty or not. This may be
  23461. // used to include empty fields in Patch requests.
  23462. ForceSendFields []string `json:"-"`
  23463. // NullFields is a list of field names (e.g. "Config") to include in API
  23464. // requests with the JSON null value. By default, fields with empty
  23465. // values are omitted from API requests. However, any field with an
  23466. // empty value appearing in NullFields will be sent to the server as
  23467. // null. It is an error if a field in this list has a non-empty value.
  23468. // This may be used to include null fields in Patch requests.
  23469. NullFields []string `json:"-"`
  23470. }
  23471. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  23472. type NoMethod SecurityPolicyRuleMatcher
  23473. raw := NoMethod(*s)
  23474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23475. }
  23476. type SecurityPolicyRuleMatcherConfig struct {
  23477. // SrcIpRanges: CIDR IP address range.
  23478. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  23479. // ForceSendFields is a list of field names (e.g. "SrcIpRanges") to
  23480. // unconditionally include in API requests. By default, fields with
  23481. // empty values are omitted from API requests. However, any non-pointer,
  23482. // non-interface field appearing in ForceSendFields will be sent to the
  23483. // server regardless of whether the field is empty or not. This may be
  23484. // used to include empty fields in Patch requests.
  23485. ForceSendFields []string `json:"-"`
  23486. // NullFields is a list of field names (e.g. "SrcIpRanges") to include
  23487. // in API requests with the JSON null value. By default, fields with
  23488. // empty values are omitted from API requests. However, any field with
  23489. // an empty value appearing in NullFields will be sent to the server as
  23490. // null. It is an error if a field in this list has a non-empty value.
  23491. // This may be used to include null fields in Patch requests.
  23492. NullFields []string `json:"-"`
  23493. }
  23494. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  23495. type NoMethod SecurityPolicyRuleMatcherConfig
  23496. raw := NoMethod(*s)
  23497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23498. }
  23499. // SerialPortOutput: An instance's serial console output.
  23500. type SerialPortOutput struct {
  23501. // Contents: [Output Only] The contents of the console output.
  23502. Contents string `json:"contents,omitempty"`
  23503. // Kind: [Output Only] Type of the resource. Always
  23504. // compute#serialPortOutput for serial port output.
  23505. Kind string `json:"kind,omitempty"`
  23506. // Next: [Output Only] The position of the next byte of content from the
  23507. // serial console output. Use this value in the next request as the
  23508. // start parameter.
  23509. Next int64 `json:"next,omitempty,string"`
  23510. // SelfLink: [Output Only] Server-defined URL for this resource.
  23511. SelfLink string `json:"selfLink,omitempty"`
  23512. // Start: The starting byte position of the output that was returned.
  23513. // This should match the start parameter sent with the request. If the
  23514. // serial console output exceeds the size of the buffer, older output
  23515. // will be overwritten by newer content and the start values will be
  23516. // mismatched.
  23517. Start int64 `json:"start,omitempty,string"`
  23518. // ServerResponse contains the HTTP response code and headers from the
  23519. // server.
  23520. googleapi.ServerResponse `json:"-"`
  23521. // ForceSendFields is a list of field names (e.g. "Contents") to
  23522. // unconditionally include in API requests. By default, fields with
  23523. // empty values are omitted from API requests. However, any non-pointer,
  23524. // non-interface field appearing in ForceSendFields will be sent to the
  23525. // server regardless of whether the field is empty or not. This may be
  23526. // used to include empty fields in Patch requests.
  23527. ForceSendFields []string `json:"-"`
  23528. // NullFields is a list of field names (e.g. "Contents") to include in
  23529. // API requests with the JSON null value. By default, fields with empty
  23530. // values are omitted from API requests. However, any field with an
  23531. // empty value appearing in NullFields will be sent to the server as
  23532. // null. It is an error if a field in this list has a non-empty value.
  23533. // This may be used to include null fields in Patch requests.
  23534. NullFields []string `json:"-"`
  23535. }
  23536. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  23537. type NoMethod SerialPortOutput
  23538. raw := NoMethod(*s)
  23539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23540. }
  23541. type ServerBinding struct {
  23542. // Possible values:
  23543. // "RESTART_NODE_ON_ANY_SERVER"
  23544. // "RESTART_NODE_ON_MINIMAL_SERVERS"
  23545. // "SERVER_BINDING_TYPE_UNSPECIFIED"
  23546. Type string `json:"type,omitempty"`
  23547. // ForceSendFields is a list of field names (e.g. "Type") to
  23548. // unconditionally include in API requests. By default, fields with
  23549. // empty values are omitted from API requests. However, any non-pointer,
  23550. // non-interface field appearing in ForceSendFields will be sent to the
  23551. // server regardless of whether the field is empty or not. This may be
  23552. // used to include empty fields in Patch requests.
  23553. ForceSendFields []string `json:"-"`
  23554. // NullFields is a list of field names (e.g. "Type") to include in API
  23555. // requests with the JSON null value. By default, fields with empty
  23556. // values are omitted from API requests. However, any field with an
  23557. // empty value appearing in NullFields will be sent to the server as
  23558. // null. It is an error if a field in this list has a non-empty value.
  23559. // This may be used to include null fields in Patch requests.
  23560. NullFields []string `json:"-"`
  23561. }
  23562. func (s *ServerBinding) MarshalJSON() ([]byte, error) {
  23563. type NoMethod ServerBinding
  23564. raw := NoMethod(*s)
  23565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23566. }
  23567. // ServiceAccount: A service account.
  23568. type ServiceAccount struct {
  23569. // Email: Email address of the service account.
  23570. Email string `json:"email,omitempty"`
  23571. // Scopes: The list of scopes to be made available for this service
  23572. // account.
  23573. Scopes []string `json:"scopes,omitempty"`
  23574. // ForceSendFields is a list of field names (e.g. "Email") to
  23575. // unconditionally include in API requests. By default, fields with
  23576. // empty values are omitted from API requests. However, any non-pointer,
  23577. // non-interface field appearing in ForceSendFields will be sent to the
  23578. // server regardless of whether the field is empty or not. This may be
  23579. // used to include empty fields in Patch requests.
  23580. ForceSendFields []string `json:"-"`
  23581. // NullFields is a list of field names (e.g. "Email") to include in API
  23582. // requests with the JSON null value. By default, fields with empty
  23583. // values are omitted from API requests. However, any field with an
  23584. // empty value appearing in NullFields will be sent to the server as
  23585. // null. It is an error if a field in this list has a non-empty value.
  23586. // This may be used to include null fields in Patch requests.
  23587. NullFields []string `json:"-"`
  23588. }
  23589. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  23590. type NoMethod ServiceAccount
  23591. raw := NoMethod(*s)
  23592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23593. }
  23594. // ShieldedInstanceConfig: A set of Shielded Instance options.
  23595. type ShieldedInstanceConfig struct {
  23596. // EnableIntegrityMonitoring: Defines whether the instance has integrity
  23597. // monitoring enabled.
  23598. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  23599. // EnableSecureBoot: Defines whether the instance has Secure Boot
  23600. // enabled.
  23601. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  23602. // EnableVtpm: Defines whether the instance has the vTPM enabled.
  23603. EnableVtpm bool `json:"enableVtpm,omitempty"`
  23604. // ForceSendFields is a list of field names (e.g.
  23605. // "EnableIntegrityMonitoring") to unconditionally include in API
  23606. // requests. By default, fields with empty values are omitted from API
  23607. // requests. However, any non-pointer, non-interface field appearing in
  23608. // ForceSendFields will be sent to the server regardless of whether the
  23609. // field is empty or not. This may be used to include empty fields in
  23610. // Patch requests.
  23611. ForceSendFields []string `json:"-"`
  23612. // NullFields is a list of field names (e.g.
  23613. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  23614. // null value. By default, fields with empty values are omitted from API
  23615. // requests. However, any field with an empty value appearing in
  23616. // NullFields will be sent to the server as null. It is an error if a
  23617. // field in this list has a non-empty value. This may be used to include
  23618. // null fields in Patch requests.
  23619. NullFields []string `json:"-"`
  23620. }
  23621. func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) {
  23622. type NoMethod ShieldedInstanceConfig
  23623. raw := NoMethod(*s)
  23624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23625. }
  23626. // ShieldedInstanceIdentity: A shielded Instance identity entry.
  23627. type ShieldedInstanceIdentity struct {
  23628. // EncryptionKey: An Endorsement Key (EK) issued to the Shielded
  23629. // Instance's vTPM.
  23630. EncryptionKey *ShieldedInstanceIdentityEntry `json:"encryptionKey,omitempty"`
  23631. // Kind: [Output Only] Type of the resource. Always
  23632. // compute#shieldedInstanceIdentity for shielded Instance identity
  23633. // entry.
  23634. Kind string `json:"kind,omitempty"`
  23635. // SigningKey: An Attestation Key (AK) issued to the Shielded Instance's
  23636. // vTPM.
  23637. SigningKey *ShieldedInstanceIdentityEntry `json:"signingKey,omitempty"`
  23638. // ServerResponse contains the HTTP response code and headers from the
  23639. // server.
  23640. googleapi.ServerResponse `json:"-"`
  23641. // ForceSendFields is a list of field names (e.g. "EncryptionKey") to
  23642. // unconditionally include in API requests. By default, fields with
  23643. // empty values are omitted from API requests. However, any non-pointer,
  23644. // non-interface field appearing in ForceSendFields will be sent to the
  23645. // server regardless of whether the field is empty or not. This may be
  23646. // used to include empty fields in Patch requests.
  23647. ForceSendFields []string `json:"-"`
  23648. // NullFields is a list of field names (e.g. "EncryptionKey") to include
  23649. // in API requests with the JSON null value. By default, fields with
  23650. // empty values are omitted from API requests. However, any field with
  23651. // an empty value appearing in NullFields will be sent to the server as
  23652. // null. It is an error if a field in this list has a non-empty value.
  23653. // This may be used to include null fields in Patch requests.
  23654. NullFields []string `json:"-"`
  23655. }
  23656. func (s *ShieldedInstanceIdentity) MarshalJSON() ([]byte, error) {
  23657. type NoMethod ShieldedInstanceIdentity
  23658. raw := NoMethod(*s)
  23659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23660. }
  23661. // ShieldedInstanceIdentityEntry: A Shielded Instance Identity Entry.
  23662. type ShieldedInstanceIdentityEntry struct {
  23663. // EkCert: A PEM-encoded X.509 certificate. This field can be empty.
  23664. EkCert string `json:"ekCert,omitempty"`
  23665. // EkPub: A PEM-encoded public key.
  23666. EkPub string `json:"ekPub,omitempty"`
  23667. // ForceSendFields is a list of field names (e.g. "EkCert") to
  23668. // unconditionally include in API requests. By default, fields with
  23669. // empty values are omitted from API requests. However, any non-pointer,
  23670. // non-interface field appearing in ForceSendFields will be sent to the
  23671. // server regardless of whether the field is empty or not. This may be
  23672. // used to include empty fields in Patch requests.
  23673. ForceSendFields []string `json:"-"`
  23674. // NullFields is a list of field names (e.g. "EkCert") to include in API
  23675. // requests with the JSON null value. By default, fields with empty
  23676. // values are omitted from API requests. However, any field with an
  23677. // empty value appearing in NullFields will be sent to the server as
  23678. // null. It is an error if a field in this list has a non-empty value.
  23679. // This may be used to include null fields in Patch requests.
  23680. NullFields []string `json:"-"`
  23681. }
  23682. func (s *ShieldedInstanceIdentityEntry) MarshalJSON() ([]byte, error) {
  23683. type NoMethod ShieldedInstanceIdentityEntry
  23684. raw := NoMethod(*s)
  23685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23686. }
  23687. // ShieldedInstanceIntegrityPolicy: The policy describes the baseline
  23688. // against which Instance boot integrity is measured.
  23689. type ShieldedInstanceIntegrityPolicy struct {
  23690. // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
  23691. // the measurements from the VM instance's most recent boot.
  23692. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  23693. // ForceSendFields is a list of field names (e.g.
  23694. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  23695. // By default, fields with empty values are omitted from API requests.
  23696. // However, any non-pointer, non-interface field appearing in
  23697. // ForceSendFields will be sent to the server regardless of whether the
  23698. // field is empty or not. This may be used to include empty fields in
  23699. // Patch requests.
  23700. ForceSendFields []string `json:"-"`
  23701. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  23702. // include in API requests with the JSON null value. By default, fields
  23703. // with empty values are omitted from API requests. However, any field
  23704. // with an empty value appearing in NullFields will be sent to the
  23705. // server as null. It is an error if a field in this list has a
  23706. // non-empty value. This may be used to include null fields in Patch
  23707. // requests.
  23708. NullFields []string `json:"-"`
  23709. }
  23710. func (s *ShieldedInstanceIntegrityPolicy) MarshalJSON() ([]byte, error) {
  23711. type NoMethod ShieldedInstanceIntegrityPolicy
  23712. raw := NoMethod(*s)
  23713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23714. }
  23715. // ShieldedVmConfig: A set of Shielded VM options.
  23716. type ShieldedVmConfig struct {
  23717. // EnableIntegrityMonitoring: Defines whether the instance has integrity
  23718. // monitoring enabled.
  23719. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  23720. // EnableSecureBoot: Defines whether the instance has Secure Boot
  23721. // enabled.
  23722. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  23723. // EnableVtpm: Defines whether the instance has the vTPM enabled.
  23724. EnableVtpm bool `json:"enableVtpm,omitempty"`
  23725. // ForceSendFields is a list of field names (e.g.
  23726. // "EnableIntegrityMonitoring") to unconditionally include in API
  23727. // requests. By default, fields with empty values are omitted from API
  23728. // requests. However, any non-pointer, non-interface field appearing in
  23729. // ForceSendFields will be sent to the server regardless of whether the
  23730. // field is empty or not. This may be used to include empty fields in
  23731. // Patch requests.
  23732. ForceSendFields []string `json:"-"`
  23733. // NullFields is a list of field names (e.g.
  23734. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  23735. // null value. By default, fields with empty values are omitted from API
  23736. // requests. However, any field with an empty value appearing in
  23737. // NullFields will be sent to the server as null. It is an error if a
  23738. // field in this list has a non-empty value. This may be used to include
  23739. // null fields in Patch requests.
  23740. NullFields []string `json:"-"`
  23741. }
  23742. func (s *ShieldedVmConfig) MarshalJSON() ([]byte, error) {
  23743. type NoMethod ShieldedVmConfig
  23744. raw := NoMethod(*s)
  23745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23746. }
  23747. // ShieldedVmIdentity: A shielded VM identity entry.
  23748. type ShieldedVmIdentity struct {
  23749. // EncryptionKey: An Endorsement Key (EK) issued to the Shielded VM's
  23750. // vTPM.
  23751. EncryptionKey *ShieldedVmIdentityEntry `json:"encryptionKey,omitempty"`
  23752. // Kind: [Output Only] Type of the resource. Always
  23753. // compute#shieldedVmIdentity for shielded VM identity entry.
  23754. Kind string `json:"kind,omitempty"`
  23755. // SigningKey: An Attestation Key (AK) issued to the Shielded VM's vTPM.
  23756. SigningKey *ShieldedVmIdentityEntry `json:"signingKey,omitempty"`
  23757. // ServerResponse contains the HTTP response code and headers from the
  23758. // server.
  23759. googleapi.ServerResponse `json:"-"`
  23760. // ForceSendFields is a list of field names (e.g. "EncryptionKey") to
  23761. // unconditionally include in API requests. By default, fields with
  23762. // empty values are omitted from API requests. However, any non-pointer,
  23763. // non-interface field appearing in ForceSendFields will be sent to the
  23764. // server regardless of whether the field is empty or not. This may be
  23765. // used to include empty fields in Patch requests.
  23766. ForceSendFields []string `json:"-"`
  23767. // NullFields is a list of field names (e.g. "EncryptionKey") to include
  23768. // in API requests with the JSON null value. By default, fields with
  23769. // empty values are omitted from API requests. However, any field with
  23770. // an empty value appearing in NullFields will be sent to the server as
  23771. // null. It is an error if a field in this list has a non-empty value.
  23772. // This may be used to include null fields in Patch requests.
  23773. NullFields []string `json:"-"`
  23774. }
  23775. func (s *ShieldedVmIdentity) MarshalJSON() ([]byte, error) {
  23776. type NoMethod ShieldedVmIdentity
  23777. raw := NoMethod(*s)
  23778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23779. }
  23780. // ShieldedVmIdentityEntry: A Shielded Instance Identity Entry.
  23781. type ShieldedVmIdentityEntry struct {
  23782. // EkCert: A PEM-encoded X.509 certificate. This field can be empty.
  23783. EkCert string `json:"ekCert,omitempty"`
  23784. // EkPub: A PEM-encoded public key.
  23785. EkPub string `json:"ekPub,omitempty"`
  23786. // ForceSendFields is a list of field names (e.g. "EkCert") to
  23787. // unconditionally include in API requests. By default, fields with
  23788. // empty values are omitted from API requests. However, any non-pointer,
  23789. // non-interface field appearing in ForceSendFields will be sent to the
  23790. // server regardless of whether the field is empty or not. This may be
  23791. // used to include empty fields in Patch requests.
  23792. ForceSendFields []string `json:"-"`
  23793. // NullFields is a list of field names (e.g. "EkCert") to include in API
  23794. // requests with the JSON null value. By default, fields with empty
  23795. // values are omitted from API requests. However, any field with an
  23796. // empty value appearing in NullFields will be sent to the server as
  23797. // null. It is an error if a field in this list has a non-empty value.
  23798. // This may be used to include null fields in Patch requests.
  23799. NullFields []string `json:"-"`
  23800. }
  23801. func (s *ShieldedVmIdentityEntry) MarshalJSON() ([]byte, error) {
  23802. type NoMethod ShieldedVmIdentityEntry
  23803. raw := NoMethod(*s)
  23804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23805. }
  23806. // ShieldedVmIntegrityPolicy: The policy describes the baseline against
  23807. // which VM instance boot integrity is measured.
  23808. type ShieldedVmIntegrityPolicy struct {
  23809. // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
  23810. // the measurements from the VM instance's most recent boot.
  23811. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  23812. // ForceSendFields is a list of field names (e.g.
  23813. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  23814. // By default, fields with empty values are omitted from API requests.
  23815. // However, any non-pointer, non-interface field appearing in
  23816. // ForceSendFields will be sent to the server regardless of whether the
  23817. // field is empty or not. This may be used to include empty fields in
  23818. // Patch requests.
  23819. ForceSendFields []string `json:"-"`
  23820. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  23821. // include in API requests with the JSON null value. By default, fields
  23822. // with empty values are omitted from API requests. However, any field
  23823. // with an empty value appearing in NullFields will be sent to the
  23824. // server as null. It is an error if a field in this list has a
  23825. // non-empty value. This may be used to include null fields in Patch
  23826. // requests.
  23827. NullFields []string `json:"-"`
  23828. }
  23829. func (s *ShieldedVmIntegrityPolicy) MarshalJSON() ([]byte, error) {
  23830. type NoMethod ShieldedVmIntegrityPolicy
  23831. raw := NoMethod(*s)
  23832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23833. }
  23834. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  23835. // Cloud CDN Signed URLs
  23836. type SignedUrlKey struct {
  23837. // KeyName: Name of the key. The name must be 1-63 characters long, and
  23838. // comply with RFC1035. Specifically, the name must be 1-63 characters
  23839. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  23840. // which means the first character must be a lowercase letter, and all
  23841. // following characters must be a dash, lowercase letter, or digit,
  23842. // except the last character, which cannot be a dash.
  23843. KeyName string `json:"keyName,omitempty"`
  23844. // KeyValue: 128-bit key value used for signing the URL. The key value
  23845. // must be a valid RFC 4648 Section 5 base64url encoded string.
  23846. KeyValue string `json:"keyValue,omitempty"`
  23847. // ForceSendFields is a list of field names (e.g. "KeyName") to
  23848. // unconditionally include in API requests. By default, fields with
  23849. // empty values are omitted from API requests. However, any non-pointer,
  23850. // non-interface field appearing in ForceSendFields will be sent to the
  23851. // server regardless of whether the field is empty or not. This may be
  23852. // used to include empty fields in Patch requests.
  23853. ForceSendFields []string `json:"-"`
  23854. // NullFields is a list of field names (e.g. "KeyName") to include in
  23855. // API requests with the JSON null value. By default, fields with empty
  23856. // values are omitted from API requests. However, any field with an
  23857. // empty value appearing in NullFields will be sent to the server as
  23858. // null. It is an error if a field in this list has a non-empty value.
  23859. // This may be used to include null fields in Patch requests.
  23860. NullFields []string `json:"-"`
  23861. }
  23862. func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
  23863. type NoMethod SignedUrlKey
  23864. raw := NoMethod(*s)
  23865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23866. }
  23867. // Snapshot: A persistent disk snapshot resource. (== resource_for
  23868. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  23869. type Snapshot struct {
  23870. // AutoCreated: [Output Only] Set to true if snapshots are automatically
  23871. // by applying resource policy on the target disk.
  23872. AutoCreated bool `json:"autoCreated,omitempty"`
  23873. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23874. // format.
  23875. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23876. // Description: An optional description of this resource. Provide this
  23877. // property when you create the resource.
  23878. Description string `json:"description,omitempty"`
  23879. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  23880. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  23881. // Id: [Output Only] The unique identifier for the resource. This
  23882. // identifier is defined by the server.
  23883. Id uint64 `json:"id,omitempty,string"`
  23884. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  23885. // Snapshot resources.
  23886. Kind string `json:"kind,omitempty"`
  23887. // LabelFingerprint: A fingerprint for the labels being applied to this
  23888. // snapshot, which is essentially a hash of the labels set used for
  23889. // optimistic locking. The fingerprint is initially generated by Compute
  23890. // Engine and changes after every request to modify or update labels.
  23891. // You must always provide an up-to-date fingerprint hash in order to
  23892. // update or change labels, otherwise the request will fail with error
  23893. // 412 conditionNotMet.
  23894. //
  23895. // To see the latest fingerprint, make a get() request to retrieve a
  23896. // snapshot.
  23897. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  23898. // Labels: Labels to apply to this snapshot. These can be later modified
  23899. // by the setLabels method. Label values may be empty.
  23900. Labels map[string]string `json:"labels,omitempty"`
  23901. // LicenseCodes: [Output Only] Integer license codes indicating which
  23902. // licenses are attached to this snapshot.
  23903. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  23904. // Licenses: [Output Only] A list of public visible licenses that apply
  23905. // to this snapshot. This can be because the original image had licenses
  23906. // attached (such as a Windows image).
  23907. Licenses []string `json:"licenses,omitempty"`
  23908. // Name: Name of the resource; provided by the client when the resource
  23909. // is created. The name must be 1-63 characters long, and comply with
  23910. // RFC1035. Specifically, the name must be 1-63 characters long and
  23911. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23912. // the first character must be a lowercase letter, and all following
  23913. // characters must be a dash, lowercase letter, or digit, except the
  23914. // last character, which cannot be a dash.
  23915. Name string `json:"name,omitempty"`
  23916. // SelfLink: [Output Only] Server-defined URL for the resource.
  23917. SelfLink string `json:"selfLink,omitempty"`
  23918. // SnapshotEncryptionKey: Encrypts the snapshot using a
  23919. // customer-supplied encryption key.
  23920. //
  23921. // After you encrypt a snapshot using a customer-supplied key, you must
  23922. // provide the same key if you use the image later For example, you must
  23923. // provide the encryption key when you create a disk from the encrypted
  23924. // snapshot in a future request.
  23925. //
  23926. // Customer-supplied encryption keys do not protect access to metadata
  23927. // of the disk.
  23928. //
  23929. // If you do not provide an encryption key when creating the snapshot,
  23930. // then the snapshot will be encrypted using an automatically generated
  23931. // key and you do not need to provide a key to use the snapshot later.
  23932. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  23933. // SourceDisk: [Output Only] The source disk used to create this
  23934. // snapshot.
  23935. SourceDisk string `json:"sourceDisk,omitempty"`
  23936. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  23937. // source disk. Required if the source disk is protected by a
  23938. // customer-supplied encryption key.
  23939. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  23940. // SourceDiskId: [Output Only] The ID value of the disk used to create
  23941. // this snapshot. This value may be used to determine whether the
  23942. // snapshot was taken from the current or a previous instance of a given
  23943. // disk name.
  23944. SourceDiskId string `json:"sourceDiskId,omitempty"`
  23945. // Status: [Output Only] The status of the snapshot. This can be
  23946. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  23947. //
  23948. // Possible values:
  23949. // "CREATING"
  23950. // "DELETING"
  23951. // "FAILED"
  23952. // "READY"
  23953. // "UPLOADING"
  23954. Status string `json:"status,omitempty"`
  23955. // StorageBytes: [Output Only] A size of the storage used by the
  23956. // snapshot. As snapshots share storage, this number is expected to
  23957. // change with snapshot creation/deletion.
  23958. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  23959. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  23960. // is in a stable state or it is being adjusted as a result of shared
  23961. // storage reallocation. This status can either be UPDATING, meaning the
  23962. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  23963. // size of the snapshot is up-to-date.
  23964. //
  23965. // Possible values:
  23966. // "UPDATING"
  23967. // "UP_TO_DATE"
  23968. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  23969. // StorageLocations: GCS bucket storage location of the snapshot
  23970. // (regional or multi-regional).
  23971. StorageLocations []string `json:"storageLocations,omitempty"`
  23972. // ServerResponse contains the HTTP response code and headers from the
  23973. // server.
  23974. googleapi.ServerResponse `json:"-"`
  23975. // ForceSendFields is a list of field names (e.g. "AutoCreated") to
  23976. // unconditionally include in API requests. By default, fields with
  23977. // empty values are omitted from API requests. However, any non-pointer,
  23978. // non-interface field appearing in ForceSendFields will be sent to the
  23979. // server regardless of whether the field is empty or not. This may be
  23980. // used to include empty fields in Patch requests.
  23981. ForceSendFields []string `json:"-"`
  23982. // NullFields is a list of field names (e.g. "AutoCreated") to include
  23983. // in API requests with the JSON null value. By default, fields with
  23984. // empty values are omitted from API requests. However, any field with
  23985. // an empty value appearing in NullFields will be sent to the server as
  23986. // null. It is an error if a field in this list has a non-empty value.
  23987. // This may be used to include null fields in Patch requests.
  23988. NullFields []string `json:"-"`
  23989. }
  23990. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  23991. type NoMethod Snapshot
  23992. raw := NoMethod(*s)
  23993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23994. }
  23995. // SnapshotList: Contains a list of Snapshot resources.
  23996. type SnapshotList struct {
  23997. // Id: [Output Only] Unique identifier for the resource; defined by the
  23998. // server.
  23999. Id string `json:"id,omitempty"`
  24000. // Items: A list of Snapshot resources.
  24001. Items []*Snapshot `json:"items,omitempty"`
  24002. // Kind: Type of resource.
  24003. Kind string `json:"kind,omitempty"`
  24004. // NextPageToken: [Output Only] This token allows you to get the next
  24005. // page of results for list requests. If the number of results is larger
  24006. // than maxResults, use the nextPageToken as a value for the query
  24007. // parameter pageToken in the next list request. Subsequent list
  24008. // requests will have their own nextPageToken to continue paging through
  24009. // the results.
  24010. NextPageToken string `json:"nextPageToken,omitempty"`
  24011. // SelfLink: [Output Only] Server-defined URL for this resource.
  24012. SelfLink string `json:"selfLink,omitempty"`
  24013. // Warning: [Output Only] Informational warning message.
  24014. Warning *SnapshotListWarning `json:"warning,omitempty"`
  24015. // ServerResponse contains the HTTP response code and headers from the
  24016. // server.
  24017. googleapi.ServerResponse `json:"-"`
  24018. // ForceSendFields is a list of field names (e.g. "Id") to
  24019. // unconditionally include in API requests. By default, fields with
  24020. // empty values are omitted from API requests. However, any non-pointer,
  24021. // non-interface field appearing in ForceSendFields will be sent to the
  24022. // server regardless of whether the field is empty or not. This may be
  24023. // used to include empty fields in Patch requests.
  24024. ForceSendFields []string `json:"-"`
  24025. // NullFields is a list of field names (e.g. "Id") to include in API
  24026. // requests with the JSON null value. By default, fields with empty
  24027. // values are omitted from API requests. However, any field with an
  24028. // empty value appearing in NullFields will be sent to the server as
  24029. // null. It is an error if a field in this list has a non-empty value.
  24030. // This may be used to include null fields in Patch requests.
  24031. NullFields []string `json:"-"`
  24032. }
  24033. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  24034. type NoMethod SnapshotList
  24035. raw := NoMethod(*s)
  24036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24037. }
  24038. // SnapshotListWarning: [Output Only] Informational warning message.
  24039. type SnapshotListWarning struct {
  24040. // Code: [Output Only] A warning code, if applicable. For example,
  24041. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24042. // the response.
  24043. //
  24044. // Possible values:
  24045. // "CLEANUP_FAILED"
  24046. // "DEPRECATED_RESOURCE_USED"
  24047. // "DEPRECATED_TYPE_USED"
  24048. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24049. // "EXPERIMENTAL_TYPE_USED"
  24050. // "EXTERNAL_API_WARNING"
  24051. // "FIELD_VALUE_OVERRIDEN"
  24052. // "INJECTED_KERNELS_DEPRECATED"
  24053. // "MISSING_TYPE_DEPENDENCY"
  24054. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24055. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24056. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24057. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24058. // "NEXT_HOP_NOT_RUNNING"
  24059. // "NOT_CRITICAL_ERROR"
  24060. // "NO_RESULTS_ON_PAGE"
  24061. // "REQUIRED_TOS_AGREEMENT"
  24062. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24063. // "RESOURCE_NOT_DELETED"
  24064. // "SCHEMA_VALIDATION_IGNORED"
  24065. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24066. // "UNDECLARED_PROPERTIES"
  24067. // "UNREACHABLE"
  24068. Code string `json:"code,omitempty"`
  24069. // Data: [Output Only] Metadata about this warning in key: value format.
  24070. // For example:
  24071. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24072. Data []*SnapshotListWarningData `json:"data,omitempty"`
  24073. // Message: [Output Only] A human-readable description of the warning
  24074. // code.
  24075. Message string `json:"message,omitempty"`
  24076. // ForceSendFields is a list of field names (e.g. "Code") to
  24077. // unconditionally include in API requests. By default, fields with
  24078. // empty values are omitted from API requests. However, any non-pointer,
  24079. // non-interface field appearing in ForceSendFields will be sent to the
  24080. // server regardless of whether the field is empty or not. This may be
  24081. // used to include empty fields in Patch requests.
  24082. ForceSendFields []string `json:"-"`
  24083. // NullFields is a list of field names (e.g. "Code") to include in API
  24084. // requests with the JSON null value. By default, fields with empty
  24085. // values are omitted from API requests. However, any field with an
  24086. // empty value appearing in NullFields will be sent to the server as
  24087. // null. It is an error if a field in this list has a non-empty value.
  24088. // This may be used to include null fields in Patch requests.
  24089. NullFields []string `json:"-"`
  24090. }
  24091. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  24092. type NoMethod SnapshotListWarning
  24093. raw := NoMethod(*s)
  24094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24095. }
  24096. type SnapshotListWarningData struct {
  24097. // Key: [Output Only] A key that provides more detail on the warning
  24098. // being returned. For example, for warnings where there are no results
  24099. // in a list request for a particular zone, this key might be scope and
  24100. // the key value might be the zone name. Other examples might be a key
  24101. // indicating a deprecated resource and a suggested replacement, or a
  24102. // warning about invalid network settings (for example, if an instance
  24103. // attempts to perform IP forwarding but is not enabled for IP
  24104. // forwarding).
  24105. Key string `json:"key,omitempty"`
  24106. // Value: [Output Only] A warning data value corresponding to the key.
  24107. Value string `json:"value,omitempty"`
  24108. // ForceSendFields is a list of field names (e.g. "Key") to
  24109. // unconditionally include in API requests. By default, fields with
  24110. // empty values are omitted from API requests. However, any non-pointer,
  24111. // non-interface field appearing in ForceSendFields will be sent to the
  24112. // server regardless of whether the field is empty or not. This may be
  24113. // used to include empty fields in Patch requests.
  24114. ForceSendFields []string `json:"-"`
  24115. // NullFields is a list of field names (e.g. "Key") to include in API
  24116. // requests with the JSON null value. By default, fields with empty
  24117. // values are omitted from API requests. However, any field with an
  24118. // empty value appearing in NullFields will be sent to the server as
  24119. // null. It is an error if a field in this list has a non-empty value.
  24120. // This may be used to include null fields in Patch requests.
  24121. NullFields []string `json:"-"`
  24122. }
  24123. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  24124. type NoMethod SnapshotListWarningData
  24125. raw := NoMethod(*s)
  24126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24127. }
  24128. // SourceInstanceParams: A specification of the parameters to use when
  24129. // creating the instance template from a source instance.
  24130. type SourceInstanceParams struct {
  24131. // DiskConfigs: Attached disks configuration. If not provided, defaults
  24132. // are applied: For boot disk and any other R/W disks, new custom images
  24133. // will be created from each disk. For read-only disks, they will be
  24134. // attached in read-only mode. Local SSD disks will be created as blank
  24135. // volumes.
  24136. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  24137. // ForceSendFields is a list of field names (e.g. "DiskConfigs") 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. "DiskConfigs") to include
  24145. // in API requests with the JSON null value. By default, fields with
  24146. // empty values are omitted from API requests. However, any field with
  24147. // an 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 *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  24153. type NoMethod SourceInstanceParams
  24154. raw := NoMethod(*s)
  24155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24156. }
  24157. // SslCertificate: An SslCertificate resource. This resource provides a
  24158. // mechanism to upload an SSL key and certificate to the load balancer
  24159. // to serve secure connections from the user. (== resource_for
  24160. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  24161. type SslCertificate struct {
  24162. // Certificate: A local certificate file. The certificate must be in PEM
  24163. // format. The certificate chain must be no greater than 5 certs long.
  24164. // The chain must include at least one intermediate cert.
  24165. Certificate string `json:"certificate,omitempty"`
  24166. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24167. // format.
  24168. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24169. // Description: An optional description of this resource. Provide this
  24170. // property when you create the resource.
  24171. Description string `json:"description,omitempty"`
  24172. // ExpireTime: [Output Only] Expire time of the certificate. RFC3339
  24173. ExpireTime string `json:"expireTime,omitempty"`
  24174. // Id: [Output Only] The unique identifier for the resource. This
  24175. // identifier is defined by the server.
  24176. Id uint64 `json:"id,omitempty,string"`
  24177. // Kind: [Output Only] Type of the resource. Always
  24178. // compute#sslCertificate for SSL certificates.
  24179. Kind string `json:"kind,omitempty"`
  24180. // Managed: Configuration and status of a managed SSL certificate.
  24181. Managed *SslCertificateManagedSslCertificate `json:"managed,omitempty"`
  24182. // Name: Name of the resource. Provided by the client when the resource
  24183. // is created. The name must be 1-63 characters long, and comply with
  24184. // RFC1035. Specifically, the name must be 1-63 characters long and
  24185. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24186. // the first character must be a lowercase letter, and all following
  24187. // characters must be a dash, lowercase letter, or digit, except the
  24188. // last character, which cannot be a dash.
  24189. Name string `json:"name,omitempty"`
  24190. // PrivateKey: A write-only private key in PEM format. Only insert
  24191. // requests will include this field.
  24192. PrivateKey string `json:"privateKey,omitempty"`
  24193. // SelfLink: [Output only] Server-defined URL for the resource.
  24194. SelfLink string `json:"selfLink,omitempty"`
  24195. // SelfManaged: Configuration and status of a self-managed SSL
  24196. // certificate.
  24197. SelfManaged *SslCertificateSelfManagedSslCertificate `json:"selfManaged,omitempty"`
  24198. // SubjectAlternativeNames: [Output Only] Domains associated with the
  24199. // certificate via Subject Alternative Name.
  24200. SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`
  24201. // Type: (Optional) Specifies the type of SSL certificate, either
  24202. // "SELF_MANAGED" or "MANAGED". If not specified, the certificate is
  24203. // self-managed and the fields certificate and private_key are used.
  24204. //
  24205. // Possible values:
  24206. // "MANAGED"
  24207. // "SELF_MANAGED"
  24208. // "TYPE_UNSPECIFIED"
  24209. Type string `json:"type,omitempty"`
  24210. // ServerResponse contains the HTTP response code and headers from the
  24211. // server.
  24212. googleapi.ServerResponse `json:"-"`
  24213. // ForceSendFields is a list of field names (e.g. "Certificate") to
  24214. // unconditionally include in API requests. By default, fields with
  24215. // empty values are omitted from API requests. However, any non-pointer,
  24216. // non-interface field appearing in ForceSendFields will be sent to the
  24217. // server regardless of whether the field is empty or not. This may be
  24218. // used to include empty fields in Patch requests.
  24219. ForceSendFields []string `json:"-"`
  24220. // NullFields is a list of field names (e.g. "Certificate") to include
  24221. // in API requests with the JSON null value. By default, fields with
  24222. // empty values are omitted from API requests. However, any field with
  24223. // an empty value appearing in NullFields will be sent to the server as
  24224. // null. It is an error if a field in this list has a non-empty value.
  24225. // This may be used to include null fields in Patch requests.
  24226. NullFields []string `json:"-"`
  24227. }
  24228. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  24229. type NoMethod SslCertificate
  24230. raw := NoMethod(*s)
  24231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24232. }
  24233. // SslCertificateList: Contains a list of SslCertificate resources.
  24234. type SslCertificateList struct {
  24235. // Id: [Output Only] Unique identifier for the resource; defined by the
  24236. // server.
  24237. Id string `json:"id,omitempty"`
  24238. // Items: A list of SslCertificate resources.
  24239. Items []*SslCertificate `json:"items,omitempty"`
  24240. // Kind: Type of resource.
  24241. Kind string `json:"kind,omitempty"`
  24242. // NextPageToken: [Output Only] This token allows you to get the next
  24243. // page of results for list requests. If the number of results is larger
  24244. // than maxResults, use the nextPageToken as a value for the query
  24245. // parameter pageToken in the next list request. Subsequent list
  24246. // requests will have their own nextPageToken to continue paging through
  24247. // the results.
  24248. NextPageToken string `json:"nextPageToken,omitempty"`
  24249. // SelfLink: [Output Only] Server-defined URL for this resource.
  24250. SelfLink string `json:"selfLink,omitempty"`
  24251. // Warning: [Output Only] Informational warning message.
  24252. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  24253. // ServerResponse contains the HTTP response code and headers from the
  24254. // server.
  24255. googleapi.ServerResponse `json:"-"`
  24256. // ForceSendFields is a list of field names (e.g. "Id") to
  24257. // unconditionally include in API requests. By default, fields with
  24258. // empty values are omitted from API requests. However, any non-pointer,
  24259. // non-interface field appearing in ForceSendFields will be sent to the
  24260. // server regardless of whether the field is empty or not. This may be
  24261. // used to include empty fields in Patch requests.
  24262. ForceSendFields []string `json:"-"`
  24263. // NullFields is a list of field names (e.g. "Id") to include in API
  24264. // requests with the JSON null value. By default, fields with empty
  24265. // values are omitted from API requests. However, any field with an
  24266. // empty value appearing in NullFields will be sent to the server as
  24267. // null. It is an error if a field in this list has a non-empty value.
  24268. // This may be used to include null fields in Patch requests.
  24269. NullFields []string `json:"-"`
  24270. }
  24271. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  24272. type NoMethod SslCertificateList
  24273. raw := NoMethod(*s)
  24274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24275. }
  24276. // SslCertificateListWarning: [Output Only] Informational warning
  24277. // message.
  24278. type SslCertificateListWarning struct {
  24279. // Code: [Output Only] A warning code, if applicable. For example,
  24280. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24281. // the response.
  24282. //
  24283. // Possible values:
  24284. // "CLEANUP_FAILED"
  24285. // "DEPRECATED_RESOURCE_USED"
  24286. // "DEPRECATED_TYPE_USED"
  24287. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24288. // "EXPERIMENTAL_TYPE_USED"
  24289. // "EXTERNAL_API_WARNING"
  24290. // "FIELD_VALUE_OVERRIDEN"
  24291. // "INJECTED_KERNELS_DEPRECATED"
  24292. // "MISSING_TYPE_DEPENDENCY"
  24293. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24294. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24295. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24296. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24297. // "NEXT_HOP_NOT_RUNNING"
  24298. // "NOT_CRITICAL_ERROR"
  24299. // "NO_RESULTS_ON_PAGE"
  24300. // "REQUIRED_TOS_AGREEMENT"
  24301. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24302. // "RESOURCE_NOT_DELETED"
  24303. // "SCHEMA_VALIDATION_IGNORED"
  24304. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24305. // "UNDECLARED_PROPERTIES"
  24306. // "UNREACHABLE"
  24307. Code string `json:"code,omitempty"`
  24308. // Data: [Output Only] Metadata about this warning in key: value format.
  24309. // For example:
  24310. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24311. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  24312. // Message: [Output Only] A human-readable description of the warning
  24313. // code.
  24314. Message string `json:"message,omitempty"`
  24315. // ForceSendFields is a list of field names (e.g. "Code") to
  24316. // unconditionally include in API requests. By default, fields with
  24317. // empty values are omitted from API requests. However, any non-pointer,
  24318. // non-interface field appearing in ForceSendFields will be sent to the
  24319. // server regardless of whether the field is empty or not. This may be
  24320. // used to include empty fields in Patch requests.
  24321. ForceSendFields []string `json:"-"`
  24322. // NullFields is a list of field names (e.g. "Code") to include in API
  24323. // requests with the JSON null value. By default, fields with empty
  24324. // values are omitted from API requests. However, any field with an
  24325. // empty value appearing in NullFields will be sent to the server as
  24326. // null. It is an error if a field in this list has a non-empty value.
  24327. // This may be used to include null fields in Patch requests.
  24328. NullFields []string `json:"-"`
  24329. }
  24330. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  24331. type NoMethod SslCertificateListWarning
  24332. raw := NoMethod(*s)
  24333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24334. }
  24335. type SslCertificateListWarningData struct {
  24336. // Key: [Output Only] A key that provides more detail on the warning
  24337. // being returned. For example, for warnings where there are no results
  24338. // in a list request for a particular zone, this key might be scope and
  24339. // the key value might be the zone name. Other examples might be a key
  24340. // indicating a deprecated resource and a suggested replacement, or a
  24341. // warning about invalid network settings (for example, if an instance
  24342. // attempts to perform IP forwarding but is not enabled for IP
  24343. // forwarding).
  24344. Key string `json:"key,omitempty"`
  24345. // Value: [Output Only] A warning data value corresponding to the key.
  24346. Value string `json:"value,omitempty"`
  24347. // ForceSendFields is a list of field names (e.g. "Key") to
  24348. // unconditionally include in API requests. By default, fields with
  24349. // empty values are omitted from API requests. However, any non-pointer,
  24350. // non-interface field appearing in ForceSendFields will be sent to the
  24351. // server regardless of whether the field is empty or not. This may be
  24352. // used to include empty fields in Patch requests.
  24353. ForceSendFields []string `json:"-"`
  24354. // NullFields is a list of field names (e.g. "Key") to include in API
  24355. // requests with the JSON null value. By default, fields with empty
  24356. // values are omitted from API requests. However, any field with an
  24357. // empty value appearing in NullFields will be sent to the server as
  24358. // null. It is an error if a field in this list has a non-empty value.
  24359. // This may be used to include null fields in Patch requests.
  24360. NullFields []string `json:"-"`
  24361. }
  24362. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  24363. type NoMethod SslCertificateListWarningData
  24364. raw := NoMethod(*s)
  24365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24366. }
  24367. // SslCertificateManagedSslCertificate: Configuration and status of a
  24368. // managed SSL certificate.
  24369. type SslCertificateManagedSslCertificate struct {
  24370. // DomainStatus: [Output only] Detailed statuses of the domains
  24371. // specified for managed certificate resource.
  24372. DomainStatus map[string]string `json:"domainStatus,omitempty"`
  24373. // Domains: The domains for which a managed SSL certificate will be
  24374. // generated. Currently only single-domain certs are supported.
  24375. Domains []string `json:"domains,omitempty"`
  24376. // Status: [Output only] Status of the managed certificate resource.
  24377. //
  24378. // Possible values:
  24379. // "ACTIVE"
  24380. // "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED"
  24381. // "PROVISIONING"
  24382. // "PROVISIONING_FAILED"
  24383. // "PROVISIONING_FAILED_PERMANENTLY"
  24384. // "RENEWAL_FAILED"
  24385. Status string `json:"status,omitempty"`
  24386. // ForceSendFields is a list of field names (e.g. "DomainStatus") to
  24387. // unconditionally include in API requests. By default, fields with
  24388. // empty values are omitted from API requests. However, any non-pointer,
  24389. // non-interface field appearing in ForceSendFields will be sent to the
  24390. // server regardless of whether the field is empty or not. This may be
  24391. // used to include empty fields in Patch requests.
  24392. ForceSendFields []string `json:"-"`
  24393. // NullFields is a list of field names (e.g. "DomainStatus") to include
  24394. // in API requests with the JSON null value. By default, fields with
  24395. // empty values are omitted from API requests. However, any field with
  24396. // an empty value appearing in NullFields will be sent to the server as
  24397. // null. It is an error if a field in this list has a non-empty value.
  24398. // This may be used to include null fields in Patch requests.
  24399. NullFields []string `json:"-"`
  24400. }
  24401. func (s *SslCertificateManagedSslCertificate) MarshalJSON() ([]byte, error) {
  24402. type NoMethod SslCertificateManagedSslCertificate
  24403. raw := NoMethod(*s)
  24404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24405. }
  24406. // SslCertificateSelfManagedSslCertificate: Configuration and status of
  24407. // a self-managed SSL certificate.
  24408. type SslCertificateSelfManagedSslCertificate struct {
  24409. // Certificate: A local certificate file. The certificate must be in PEM
  24410. // format. The certificate chain must be no greater than 5 certs long.
  24411. // The chain must include at least one intermediate cert.
  24412. Certificate string `json:"certificate,omitempty"`
  24413. // PrivateKey: A write-only private key in PEM format. Only insert
  24414. // requests will include this field.
  24415. PrivateKey string `json:"privateKey,omitempty"`
  24416. // ForceSendFields is a list of field names (e.g. "Certificate") to
  24417. // unconditionally include in API requests. By default, fields with
  24418. // empty values are omitted from API requests. However, any non-pointer,
  24419. // non-interface field appearing in ForceSendFields will be sent to the
  24420. // server regardless of whether the field is empty or not. This may be
  24421. // used to include empty fields in Patch requests.
  24422. ForceSendFields []string `json:"-"`
  24423. // NullFields is a list of field names (e.g. "Certificate") to include
  24424. // in API requests with the JSON null value. By default, fields with
  24425. // empty values are omitted from API requests. However, any field with
  24426. // an empty value appearing in NullFields will be sent to the server as
  24427. // null. It is an error if a field in this list has a non-empty value.
  24428. // This may be used to include null fields in Patch requests.
  24429. NullFields []string `json:"-"`
  24430. }
  24431. func (s *SslCertificateSelfManagedSslCertificate) MarshalJSON() ([]byte, error) {
  24432. type NoMethod SslCertificateSelfManagedSslCertificate
  24433. raw := NoMethod(*s)
  24434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24435. }
  24436. type SslPoliciesList struct {
  24437. // Id: [Output Only] Unique identifier for the resource; defined by the
  24438. // server.
  24439. Id string `json:"id,omitempty"`
  24440. // Items: A list of SslPolicy resources.
  24441. Items []*SslPolicy `json:"items,omitempty"`
  24442. // Kind: [Output Only] Type of the resource. Always
  24443. // compute#sslPoliciesList for lists of sslPolicies.
  24444. Kind string `json:"kind,omitempty"`
  24445. // NextPageToken: [Output Only] This token allows you to get the next
  24446. // page of results for list requests. If the number of results is larger
  24447. // than maxResults, use the nextPageToken as a value for the query
  24448. // parameter pageToken in the next list request. Subsequent list
  24449. // requests will have their own nextPageToken to continue paging through
  24450. // the results.
  24451. NextPageToken string `json:"nextPageToken,omitempty"`
  24452. // SelfLink: [Output Only] Server-defined URL for this resource.
  24453. SelfLink string `json:"selfLink,omitempty"`
  24454. // Warning: [Output Only] Informational warning message.
  24455. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  24456. // ServerResponse contains the HTTP response code and headers from the
  24457. // server.
  24458. googleapi.ServerResponse `json:"-"`
  24459. // ForceSendFields is a list of field names (e.g. "Id") to
  24460. // unconditionally include in API requests. By default, fields with
  24461. // empty values are omitted from API requests. However, any non-pointer,
  24462. // non-interface field appearing in ForceSendFields will be sent to the
  24463. // server regardless of whether the field is empty or not. This may be
  24464. // used to include empty fields in Patch requests.
  24465. ForceSendFields []string `json:"-"`
  24466. // NullFields is a list of field names (e.g. "Id") to include in API
  24467. // requests with the JSON null value. By default, fields with empty
  24468. // values are omitted from API requests. However, any field with an
  24469. // empty value appearing in NullFields will be sent to the server as
  24470. // null. It is an error if a field in this list has a non-empty value.
  24471. // This may be used to include null fields in Patch requests.
  24472. NullFields []string `json:"-"`
  24473. }
  24474. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  24475. type NoMethod SslPoliciesList
  24476. raw := NoMethod(*s)
  24477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24478. }
  24479. // SslPoliciesListWarning: [Output Only] Informational warning message.
  24480. type SslPoliciesListWarning struct {
  24481. // Code: [Output Only] A warning code, if applicable. For example,
  24482. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24483. // the response.
  24484. //
  24485. // Possible values:
  24486. // "CLEANUP_FAILED"
  24487. // "DEPRECATED_RESOURCE_USED"
  24488. // "DEPRECATED_TYPE_USED"
  24489. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24490. // "EXPERIMENTAL_TYPE_USED"
  24491. // "EXTERNAL_API_WARNING"
  24492. // "FIELD_VALUE_OVERRIDEN"
  24493. // "INJECTED_KERNELS_DEPRECATED"
  24494. // "MISSING_TYPE_DEPENDENCY"
  24495. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24496. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24497. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24498. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24499. // "NEXT_HOP_NOT_RUNNING"
  24500. // "NOT_CRITICAL_ERROR"
  24501. // "NO_RESULTS_ON_PAGE"
  24502. // "REQUIRED_TOS_AGREEMENT"
  24503. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24504. // "RESOURCE_NOT_DELETED"
  24505. // "SCHEMA_VALIDATION_IGNORED"
  24506. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24507. // "UNDECLARED_PROPERTIES"
  24508. // "UNREACHABLE"
  24509. Code string `json:"code,omitempty"`
  24510. // Data: [Output Only] Metadata about this warning in key: value format.
  24511. // For example:
  24512. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24513. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  24514. // Message: [Output Only] A human-readable description of the warning
  24515. // code.
  24516. Message string `json:"message,omitempty"`
  24517. // ForceSendFields is a list of field names (e.g. "Code") to
  24518. // unconditionally include in API requests. By default, fields with
  24519. // empty values are omitted from API requests. However, any non-pointer,
  24520. // non-interface field appearing in ForceSendFields will be sent to the
  24521. // server regardless of whether the field is empty or not. This may be
  24522. // used to include empty fields in Patch requests.
  24523. ForceSendFields []string `json:"-"`
  24524. // NullFields is a list of field names (e.g. "Code") to include in API
  24525. // requests with the JSON null value. By default, fields with empty
  24526. // values are omitted from API requests. However, any field with an
  24527. // empty value appearing in NullFields will be sent to the server as
  24528. // null. It is an error if a field in this list has a non-empty value.
  24529. // This may be used to include null fields in Patch requests.
  24530. NullFields []string `json:"-"`
  24531. }
  24532. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  24533. type NoMethod SslPoliciesListWarning
  24534. raw := NoMethod(*s)
  24535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24536. }
  24537. type SslPoliciesListWarningData struct {
  24538. // Key: [Output Only] A key that provides more detail on the warning
  24539. // being returned. For example, for warnings where there are no results
  24540. // in a list request for a particular zone, this key might be scope and
  24541. // the key value might be the zone name. Other examples might be a key
  24542. // indicating a deprecated resource and a suggested replacement, or a
  24543. // warning about invalid network settings (for example, if an instance
  24544. // attempts to perform IP forwarding but is not enabled for IP
  24545. // forwarding).
  24546. Key string `json:"key,omitempty"`
  24547. // Value: [Output Only] A warning data value corresponding to the key.
  24548. Value string `json:"value,omitempty"`
  24549. // ForceSendFields is a list of field names (e.g. "Key") to
  24550. // unconditionally include in API requests. By default, fields with
  24551. // empty values are omitted from API requests. However, any non-pointer,
  24552. // non-interface field appearing in ForceSendFields will be sent to the
  24553. // server regardless of whether the field is empty or not. This may be
  24554. // used to include empty fields in Patch requests.
  24555. ForceSendFields []string `json:"-"`
  24556. // NullFields is a list of field names (e.g. "Key") to include in API
  24557. // requests with the JSON null value. By default, fields with empty
  24558. // values are omitted from API requests. However, any field with an
  24559. // empty value appearing in NullFields will be sent to the server as
  24560. // null. It is an error if a field in this list has a non-empty value.
  24561. // This may be used to include null fields in Patch requests.
  24562. NullFields []string `json:"-"`
  24563. }
  24564. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  24565. type NoMethod SslPoliciesListWarningData
  24566. raw := NoMethod(*s)
  24567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24568. }
  24569. type SslPoliciesListAvailableFeaturesResponse struct {
  24570. Features []string `json:"features,omitempty"`
  24571. // ServerResponse contains the HTTP response code and headers from the
  24572. // server.
  24573. googleapi.ServerResponse `json:"-"`
  24574. // ForceSendFields is a list of field names (e.g. "Features") to
  24575. // unconditionally include in API requests. By default, fields with
  24576. // empty values are omitted from API requests. However, any non-pointer,
  24577. // non-interface field appearing in ForceSendFields will be sent to the
  24578. // server regardless of whether the field is empty or not. This may be
  24579. // used to include empty fields in Patch requests.
  24580. ForceSendFields []string `json:"-"`
  24581. // NullFields is a list of field names (e.g. "Features") to include in
  24582. // API requests with the JSON null value. By default, fields with empty
  24583. // values are omitted from API requests. However, any field with an
  24584. // empty value appearing in NullFields will be sent to the server as
  24585. // null. It is an error if a field in this list has a non-empty value.
  24586. // This may be used to include null fields in Patch requests.
  24587. NullFields []string `json:"-"`
  24588. }
  24589. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  24590. type NoMethod SslPoliciesListAvailableFeaturesResponse
  24591. raw := NoMethod(*s)
  24592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24593. }
  24594. // SslPolicy: A SSL policy specifies the server-side support for SSL
  24595. // features. This can be attached to a TargetHttpsProxy or a
  24596. // TargetSslProxy. This affects connections between clients and the
  24597. // HTTPS or SSL proxy load balancer. They do not affect the connection
  24598. // between the load balancers and the backends.
  24599. type SslPolicy struct {
  24600. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24601. // format.
  24602. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24603. // CustomFeatures: A list of features enabled when the selected profile
  24604. // is CUSTOM. The
  24605. // - method returns the set of features that can be specified in this
  24606. // list. This field must be empty if the profile is not CUSTOM.
  24607. CustomFeatures []string `json:"customFeatures,omitempty"`
  24608. // Description: An optional description of this resource. Provide this
  24609. // property when you create the resource.
  24610. Description string `json:"description,omitempty"`
  24611. // EnabledFeatures: [Output Only] The list of features enabled in the
  24612. // SSL policy.
  24613. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  24614. // Fingerprint: Fingerprint of this resource. A hash of the contents
  24615. // stored in this object. This field is used in optimistic locking. This
  24616. // field will be ignored when inserting a SslPolicy. An up-to-date
  24617. // fingerprint must be provided in order to update the SslPolicy,
  24618. // otherwise the request will fail with error 412 conditionNotMet.
  24619. //
  24620. // To see the latest fingerprint, make a get() request to retrieve an
  24621. // SslPolicy.
  24622. Fingerprint string `json:"fingerprint,omitempty"`
  24623. // Id: [Output Only] The unique identifier for the resource. This
  24624. // identifier is defined by the server.
  24625. Id uint64 `json:"id,omitempty,string"`
  24626. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  24627. // SSL policies.
  24628. Kind string `json:"kind,omitempty"`
  24629. // MinTlsVersion: The minimum version of SSL protocol that can be used
  24630. // by the clients to establish a connection with the load balancer. This
  24631. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  24632. //
  24633. // Possible values:
  24634. // "TLS_1_0"
  24635. // "TLS_1_1"
  24636. // "TLS_1_2"
  24637. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  24638. // Name: Name of the resource. The name must be 1-63 characters long,
  24639. // and comply with RFC1035. Specifically, the name must be 1-63
  24640. // characters long and match the regular expression
  24641. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  24642. // a lowercase letter, and all following characters must be a dash,
  24643. // lowercase letter, or digit, except the last character, which cannot
  24644. // be a dash.
  24645. Name string `json:"name,omitempty"`
  24646. // Profile: Profile specifies the set of SSL features that can be used
  24647. // by the load balancer when negotiating SSL with clients. This can be
  24648. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  24649. // the set of SSL features to enable must be specified in the
  24650. // customFeatures field.
  24651. //
  24652. // Possible values:
  24653. // "COMPATIBLE"
  24654. // "CUSTOM"
  24655. // "MODERN"
  24656. // "RESTRICTED"
  24657. Profile string `json:"profile,omitempty"`
  24658. // SelfLink: [Output Only] Server-defined URL for the resource.
  24659. SelfLink string `json:"selfLink,omitempty"`
  24660. // Warnings: [Output Only] If potential misconfigurations are detected
  24661. // for this SSL policy, this field will be populated with warning
  24662. // messages.
  24663. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  24664. // ServerResponse contains the HTTP response code and headers from the
  24665. // server.
  24666. googleapi.ServerResponse `json:"-"`
  24667. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24668. // to unconditionally include in API requests. By default, fields with
  24669. // empty values are omitted from API requests. However, any non-pointer,
  24670. // non-interface field appearing in ForceSendFields will be sent to the
  24671. // server regardless of whether the field is empty or not. This may be
  24672. // used to include empty fields in Patch requests.
  24673. ForceSendFields []string `json:"-"`
  24674. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24675. // include in API requests with the JSON null value. By default, fields
  24676. // with empty values are omitted from API requests. However, any field
  24677. // with an empty value appearing in NullFields will be sent to the
  24678. // server as null. It is an error if a field in this list has a
  24679. // non-empty value. This may be used to include null fields in Patch
  24680. // requests.
  24681. NullFields []string `json:"-"`
  24682. }
  24683. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  24684. type NoMethod SslPolicy
  24685. raw := NoMethod(*s)
  24686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24687. }
  24688. type SslPolicyWarnings struct {
  24689. // Code: [Output Only] A warning code, if applicable. For example,
  24690. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24691. // the response.
  24692. //
  24693. // Possible values:
  24694. // "CLEANUP_FAILED"
  24695. // "DEPRECATED_RESOURCE_USED"
  24696. // "DEPRECATED_TYPE_USED"
  24697. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24698. // "EXPERIMENTAL_TYPE_USED"
  24699. // "EXTERNAL_API_WARNING"
  24700. // "FIELD_VALUE_OVERRIDEN"
  24701. // "INJECTED_KERNELS_DEPRECATED"
  24702. // "MISSING_TYPE_DEPENDENCY"
  24703. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24704. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24705. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24706. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24707. // "NEXT_HOP_NOT_RUNNING"
  24708. // "NOT_CRITICAL_ERROR"
  24709. // "NO_RESULTS_ON_PAGE"
  24710. // "REQUIRED_TOS_AGREEMENT"
  24711. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24712. // "RESOURCE_NOT_DELETED"
  24713. // "SCHEMA_VALIDATION_IGNORED"
  24714. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24715. // "UNDECLARED_PROPERTIES"
  24716. // "UNREACHABLE"
  24717. Code string `json:"code,omitempty"`
  24718. // Data: [Output Only] Metadata about this warning in key: value format.
  24719. // For example:
  24720. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24721. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  24722. // Message: [Output Only] A human-readable description of the warning
  24723. // code.
  24724. Message string `json:"message,omitempty"`
  24725. // ForceSendFields is a list of field names (e.g. "Code") to
  24726. // unconditionally include in API requests. By default, fields with
  24727. // empty values are omitted from API requests. However, any non-pointer,
  24728. // non-interface field appearing in ForceSendFields will be sent to the
  24729. // server regardless of whether the field is empty or not. This may be
  24730. // used to include empty fields in Patch requests.
  24731. ForceSendFields []string `json:"-"`
  24732. // NullFields is a list of field names (e.g. "Code") to include in API
  24733. // requests with the JSON null value. By default, fields with empty
  24734. // values are omitted from API requests. However, any field with an
  24735. // empty value appearing in NullFields will be sent to the server as
  24736. // null. It is an error if a field in this list has a non-empty value.
  24737. // This may be used to include null fields in Patch requests.
  24738. NullFields []string `json:"-"`
  24739. }
  24740. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  24741. type NoMethod SslPolicyWarnings
  24742. raw := NoMethod(*s)
  24743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24744. }
  24745. type SslPolicyWarningsData struct {
  24746. // Key: [Output Only] A key that provides more detail on the warning
  24747. // being returned. For example, for warnings where there are no results
  24748. // in a list request for a particular zone, this key might be scope and
  24749. // the key value might be the zone name. Other examples might be a key
  24750. // indicating a deprecated resource and a suggested replacement, or a
  24751. // warning about invalid network settings (for example, if an instance
  24752. // attempts to perform IP forwarding but is not enabled for IP
  24753. // forwarding).
  24754. Key string `json:"key,omitempty"`
  24755. // Value: [Output Only] A warning data value corresponding to the key.
  24756. Value string `json:"value,omitempty"`
  24757. // ForceSendFields is a list of field names (e.g. "Key") to
  24758. // unconditionally include in API requests. By default, fields with
  24759. // empty values are omitted from API requests. However, any non-pointer,
  24760. // non-interface field appearing in ForceSendFields will be sent to the
  24761. // server regardless of whether the field is empty or not. This may be
  24762. // used to include empty fields in Patch requests.
  24763. ForceSendFields []string `json:"-"`
  24764. // NullFields is a list of field names (e.g. "Key") to include in API
  24765. // requests with the JSON null value. By default, fields with empty
  24766. // values are omitted from API requests. However, any field with an
  24767. // empty value appearing in NullFields will be sent to the server as
  24768. // null. It is an error if a field in this list has a non-empty value.
  24769. // This may be used to include null fields in Patch requests.
  24770. NullFields []string `json:"-"`
  24771. }
  24772. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  24773. type NoMethod SslPolicyWarningsData
  24774. raw := NoMethod(*s)
  24775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24776. }
  24777. type SslPolicyReference struct {
  24778. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  24779. // to clear any existing SSL policy associated with the target proxy
  24780. // resource.
  24781. SslPolicy string `json:"sslPolicy,omitempty"`
  24782. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  24783. // unconditionally include in API requests. By default, fields with
  24784. // empty values are omitted from API requests. However, any non-pointer,
  24785. // non-interface field appearing in ForceSendFields will be sent to the
  24786. // server regardless of whether the field is empty or not. This may be
  24787. // used to include empty fields in Patch requests.
  24788. ForceSendFields []string `json:"-"`
  24789. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  24790. // API requests with the JSON null value. By default, fields with empty
  24791. // values are omitted from API requests. However, any field with an
  24792. // empty value appearing in NullFields will be sent to the server as
  24793. // null. It is an error if a field in this list has a non-empty value.
  24794. // This may be used to include null fields in Patch requests.
  24795. NullFields []string `json:"-"`
  24796. }
  24797. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  24798. type NoMethod SslPolicyReference
  24799. raw := NoMethod(*s)
  24800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24801. }
  24802. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  24803. // ==) (== resource_for v1.subnetworks ==)
  24804. type Subnetwork struct {
  24805. // AllowSubnetCidrRoutesOverlap: Whether this subnetwork can conflict
  24806. // with static routes. Setting this to true allows this subnetwork's
  24807. // primary and secondary ranges to conflict with routes that have
  24808. // already been configured on the corresponding network. Static routes
  24809. // will take precedence over the subnetwork route if the route prefix
  24810. // length is at least as large as the subnetwork prefix length.
  24811. //
  24812. // Also, packets destined to IPs within subnetwork may contain
  24813. // private/sensitive data and are prevented from leaving the virtual
  24814. // network. Setting this field to true will disable this feature.
  24815. //
  24816. // The default value is false and applies to all existing subnetworks
  24817. // and automatically created subnetworks.
  24818. //
  24819. // This field cannot be set to true at resource creation time.
  24820. AllowSubnetCidrRoutesOverlap bool `json:"allowSubnetCidrRoutesOverlap,omitempty"`
  24821. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24822. // format.
  24823. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24824. // Description: An optional description of this resource. Provide this
  24825. // property when you create the resource. This field can be set only at
  24826. // resource creation time.
  24827. Description string `json:"description,omitempty"`
  24828. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  24829. // If this field is not explicitly set, it will not appear in get
  24830. // listings. If not set the default behavior is to disable flow logging.
  24831. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  24832. // Fingerprint: Fingerprint of this resource. A hash of the contents
  24833. // stored in this object. This field is used in optimistic locking. This
  24834. // field will be ignored when inserting a Subnetwork. An up-to-date
  24835. // fingerprint must be provided in order to update the Subnetwork,
  24836. // otherwise the request will fail with error 412 conditionNotMet.
  24837. //
  24838. // To see the latest fingerprint, make a get() request to retrieve a
  24839. // Subnetwork.
  24840. Fingerprint string `json:"fingerprint,omitempty"`
  24841. // GatewayAddress: [Output Only] The gateway address for default routes
  24842. // to reach destination addresses outside this subnetwork.
  24843. GatewayAddress string `json:"gatewayAddress,omitempty"`
  24844. // Id: [Output Only] The unique identifier for the resource. This
  24845. // identifier is defined by the server.
  24846. Id uint64 `json:"id,omitempty,string"`
  24847. // IpCidrRange: The range of internal addresses that are owned by this
  24848. // subnetwork. Provide this property when you create the subnetwork. For
  24849. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  24850. // non-overlapping within a network. Only IPv4 is supported. This field
  24851. // can be set only at resource creation time.
  24852. IpCidrRange string `json:"ipCidrRange,omitempty"`
  24853. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  24854. // for Subnetwork resources.
  24855. Kind string `json:"kind,omitempty"`
  24856. // LogConfig: This field denotes the logging options for the load
  24857. // balancer traffic served by this backend service. If logging is
  24858. // enabled, logs will be exported to Stackdriver.
  24859. LogConfig *SubnetworkLogConfig `json:"logConfig,omitempty"`
  24860. // Name: The name of the resource, provided by the client when initially
  24861. // creating the resource. The name must be 1-63 characters long, and
  24862. // comply with RFC1035. Specifically, the name must be 1-63 characters
  24863. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  24864. // which means the first character must be a lowercase letter, and all
  24865. // following characters must be a dash, lowercase letter, or digit,
  24866. // except the last character, which cannot be a dash.
  24867. Name string `json:"name,omitempty"`
  24868. // Network: The URL of the network to which this subnetwork belongs,
  24869. // provided by the client when initially creating the subnetwork. Only
  24870. // networks that are in the distributed mode can have subnetworks. This
  24871. // field can be set only at resource creation time.
  24872. Network string `json:"network,omitempty"`
  24873. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  24874. // Google services without assigned external IP addresses. This field
  24875. // can be both set at resource creation time and updated using
  24876. // setPrivateIpGoogleAccess.
  24877. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  24878. // Region: URL of the region where the Subnetwork resides. This field
  24879. // can be set only at resource creation time.
  24880. Region string `json:"region,omitempty"`
  24881. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  24882. // for VM instances contained in this subnetwork. The primary IP of such
  24883. // VM must belong to the primary ipCidrRange of the subnetwork. The
  24884. // alias IPs may belong to either primary or secondary ranges. This
  24885. // field can be updated with a patch request.
  24886. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  24887. // SelfLink: [Output Only] Server-defined URL for the resource.
  24888. SelfLink string `json:"selfLink,omitempty"`
  24889. // ServerResponse contains the HTTP response code and headers from the
  24890. // server.
  24891. googleapi.ServerResponse `json:"-"`
  24892. // ForceSendFields is a list of field names (e.g.
  24893. // "AllowSubnetCidrRoutesOverlap") to unconditionally include in API
  24894. // requests. By default, fields with empty values are omitted from API
  24895. // requests. However, any non-pointer, non-interface field appearing in
  24896. // ForceSendFields will be sent to the server regardless of whether the
  24897. // field is empty or not. This may be used to include empty fields in
  24898. // Patch requests.
  24899. ForceSendFields []string `json:"-"`
  24900. // NullFields is a list of field names (e.g.
  24901. // "AllowSubnetCidrRoutesOverlap") to include in API requests with the
  24902. // JSON null value. By default, fields with empty values are omitted
  24903. // from API requests. However, any field with an empty value appearing
  24904. // in NullFields will be sent to the server as null. It is an error if a
  24905. // field in this list has a non-empty value. This may be used to include
  24906. // null fields in Patch requests.
  24907. NullFields []string `json:"-"`
  24908. }
  24909. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  24910. type NoMethod Subnetwork
  24911. raw := NoMethod(*s)
  24912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24913. }
  24914. type SubnetworkAggregatedList struct {
  24915. // Id: [Output Only] Unique identifier for the resource; defined by the
  24916. // server.
  24917. Id string `json:"id,omitempty"`
  24918. // Items: A list of SubnetworksScopedList resources.
  24919. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  24920. // Kind: [Output Only] Type of resource. Always
  24921. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  24922. Kind string `json:"kind,omitempty"`
  24923. // NextPageToken: [Output Only] This token allows you to get the next
  24924. // page of results for list requests. If the number of results is larger
  24925. // than maxResults, use the nextPageToken as a value for the query
  24926. // parameter pageToken in the next list request. Subsequent list
  24927. // requests will have their own nextPageToken to continue paging through
  24928. // the results.
  24929. NextPageToken string `json:"nextPageToken,omitempty"`
  24930. // SelfLink: [Output Only] Server-defined URL for this resource.
  24931. SelfLink string `json:"selfLink,omitempty"`
  24932. // Warning: [Output Only] Informational warning message.
  24933. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  24934. // ServerResponse contains the HTTP response code and headers from the
  24935. // server.
  24936. googleapi.ServerResponse `json:"-"`
  24937. // ForceSendFields is a list of field names (e.g. "Id") to
  24938. // unconditionally include in API requests. By default, fields with
  24939. // empty values are omitted from API requests. However, any non-pointer,
  24940. // non-interface field appearing in ForceSendFields will be sent to the
  24941. // server regardless of whether the field is empty or not. This may be
  24942. // used to include empty fields in Patch requests.
  24943. ForceSendFields []string `json:"-"`
  24944. // NullFields is a list of field names (e.g. "Id") to include in API
  24945. // requests with the JSON null value. By default, fields with empty
  24946. // values are omitted from API requests. However, any field with an
  24947. // empty value appearing in NullFields will be sent to the server as
  24948. // null. It is an error if a field in this list has a non-empty value.
  24949. // This may be used to include null fields in Patch requests.
  24950. NullFields []string `json:"-"`
  24951. }
  24952. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  24953. type NoMethod SubnetworkAggregatedList
  24954. raw := NoMethod(*s)
  24955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24956. }
  24957. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  24958. // message.
  24959. type SubnetworkAggregatedListWarning struct {
  24960. // Code: [Output Only] A warning code, if applicable. For example,
  24961. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24962. // the response.
  24963. //
  24964. // Possible values:
  24965. // "CLEANUP_FAILED"
  24966. // "DEPRECATED_RESOURCE_USED"
  24967. // "DEPRECATED_TYPE_USED"
  24968. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24969. // "EXPERIMENTAL_TYPE_USED"
  24970. // "EXTERNAL_API_WARNING"
  24971. // "FIELD_VALUE_OVERRIDEN"
  24972. // "INJECTED_KERNELS_DEPRECATED"
  24973. // "MISSING_TYPE_DEPENDENCY"
  24974. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24975. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24976. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24977. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24978. // "NEXT_HOP_NOT_RUNNING"
  24979. // "NOT_CRITICAL_ERROR"
  24980. // "NO_RESULTS_ON_PAGE"
  24981. // "REQUIRED_TOS_AGREEMENT"
  24982. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24983. // "RESOURCE_NOT_DELETED"
  24984. // "SCHEMA_VALIDATION_IGNORED"
  24985. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24986. // "UNDECLARED_PROPERTIES"
  24987. // "UNREACHABLE"
  24988. Code string `json:"code,omitempty"`
  24989. // Data: [Output Only] Metadata about this warning in key: value format.
  24990. // For example:
  24991. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24992. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  24993. // Message: [Output Only] A human-readable description of the warning
  24994. // code.
  24995. Message string `json:"message,omitempty"`
  24996. // ForceSendFields is a list of field names (e.g. "Code") to
  24997. // unconditionally include in API requests. By default, fields with
  24998. // empty values are omitted from API requests. However, any non-pointer,
  24999. // non-interface field appearing in ForceSendFields will be sent to the
  25000. // server regardless of whether the field is empty or not. This may be
  25001. // used to include empty fields in Patch requests.
  25002. ForceSendFields []string `json:"-"`
  25003. // NullFields is a list of field names (e.g. "Code") to include in API
  25004. // requests with the JSON null value. By default, fields with empty
  25005. // values are omitted from API requests. However, any field with an
  25006. // empty value appearing in NullFields will be sent to the server as
  25007. // null. It is an error if a field in this list has a non-empty value.
  25008. // This may be used to include null fields in Patch requests.
  25009. NullFields []string `json:"-"`
  25010. }
  25011. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25012. type NoMethod SubnetworkAggregatedListWarning
  25013. raw := NoMethod(*s)
  25014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25015. }
  25016. type SubnetworkAggregatedListWarningData struct {
  25017. // Key: [Output Only] A key that provides more detail on the warning
  25018. // being returned. For example, for warnings where there are no results
  25019. // in a list request for a particular zone, this key might be scope and
  25020. // the key value might be the zone name. Other examples might be a key
  25021. // indicating a deprecated resource and a suggested replacement, or a
  25022. // warning about invalid network settings (for example, if an instance
  25023. // attempts to perform IP forwarding but is not enabled for IP
  25024. // forwarding).
  25025. Key string `json:"key,omitempty"`
  25026. // Value: [Output Only] A warning data value corresponding to the key.
  25027. Value string `json:"value,omitempty"`
  25028. // ForceSendFields is a list of field names (e.g. "Key") to
  25029. // unconditionally include in API requests. By default, fields with
  25030. // empty values are omitted from API requests. However, any non-pointer,
  25031. // non-interface field appearing in ForceSendFields will be sent to the
  25032. // server regardless of whether the field is empty or not. This may be
  25033. // used to include empty fields in Patch requests.
  25034. ForceSendFields []string `json:"-"`
  25035. // NullFields is a list of field names (e.g. "Key") to include in API
  25036. // requests with the JSON null value. By default, fields with empty
  25037. // values are omitted from API requests. However, any field with an
  25038. // empty value appearing in NullFields will be sent to the server as
  25039. // null. It is an error if a field in this list has a non-empty value.
  25040. // This may be used to include null fields in Patch requests.
  25041. NullFields []string `json:"-"`
  25042. }
  25043. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25044. type NoMethod SubnetworkAggregatedListWarningData
  25045. raw := NoMethod(*s)
  25046. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25047. }
  25048. // SubnetworkList: Contains a list of Subnetwork resources.
  25049. type SubnetworkList struct {
  25050. // Id: [Output Only] Unique identifier for the resource; defined by the
  25051. // server.
  25052. Id string `json:"id,omitempty"`
  25053. // Items: A list of Subnetwork resources.
  25054. Items []*Subnetwork `json:"items,omitempty"`
  25055. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  25056. // for lists of subnetworks.
  25057. Kind string `json:"kind,omitempty"`
  25058. // NextPageToken: [Output Only] This token allows you to get the next
  25059. // page of results for list requests. If the number of results is larger
  25060. // than maxResults, use the nextPageToken as a value for the query
  25061. // parameter pageToken in the next list request. Subsequent list
  25062. // requests will have their own nextPageToken to continue paging through
  25063. // the results.
  25064. NextPageToken string `json:"nextPageToken,omitempty"`
  25065. // SelfLink: [Output Only] Server-defined URL for this resource.
  25066. SelfLink string `json:"selfLink,omitempty"`
  25067. // Warning: [Output Only] Informational warning message.
  25068. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  25069. // ServerResponse contains the HTTP response code and headers from the
  25070. // server.
  25071. googleapi.ServerResponse `json:"-"`
  25072. // ForceSendFields is a list of field names (e.g. "Id") to
  25073. // unconditionally include in API requests. By default, fields with
  25074. // empty values are omitted from API requests. However, any non-pointer,
  25075. // non-interface field appearing in ForceSendFields will be sent to the
  25076. // server regardless of whether the field is empty or not. This may be
  25077. // used to include empty fields in Patch requests.
  25078. ForceSendFields []string `json:"-"`
  25079. // NullFields is a list of field names (e.g. "Id") to include in API
  25080. // requests with the JSON null value. By default, fields with empty
  25081. // values are omitted from API requests. However, any field with an
  25082. // empty value appearing in NullFields will be sent to the server as
  25083. // null. It is an error if a field in this list has a non-empty value.
  25084. // This may be used to include null fields in Patch requests.
  25085. NullFields []string `json:"-"`
  25086. }
  25087. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  25088. type NoMethod SubnetworkList
  25089. raw := NoMethod(*s)
  25090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25091. }
  25092. // SubnetworkListWarning: [Output Only] Informational warning message.
  25093. type SubnetworkListWarning struct {
  25094. // Code: [Output Only] A warning code, if applicable. For example,
  25095. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25096. // the response.
  25097. //
  25098. // Possible values:
  25099. // "CLEANUP_FAILED"
  25100. // "DEPRECATED_RESOURCE_USED"
  25101. // "DEPRECATED_TYPE_USED"
  25102. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25103. // "EXPERIMENTAL_TYPE_USED"
  25104. // "EXTERNAL_API_WARNING"
  25105. // "FIELD_VALUE_OVERRIDEN"
  25106. // "INJECTED_KERNELS_DEPRECATED"
  25107. // "MISSING_TYPE_DEPENDENCY"
  25108. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25109. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25110. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25111. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25112. // "NEXT_HOP_NOT_RUNNING"
  25113. // "NOT_CRITICAL_ERROR"
  25114. // "NO_RESULTS_ON_PAGE"
  25115. // "REQUIRED_TOS_AGREEMENT"
  25116. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25117. // "RESOURCE_NOT_DELETED"
  25118. // "SCHEMA_VALIDATION_IGNORED"
  25119. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25120. // "UNDECLARED_PROPERTIES"
  25121. // "UNREACHABLE"
  25122. Code string `json:"code,omitempty"`
  25123. // Data: [Output Only] Metadata about this warning in key: value format.
  25124. // For example:
  25125. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25126. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  25127. // Message: [Output Only] A human-readable description of the warning
  25128. // code.
  25129. Message string `json:"message,omitempty"`
  25130. // ForceSendFields is a list of field names (e.g. "Code") to
  25131. // unconditionally include in API requests. By default, fields with
  25132. // empty values are omitted from API requests. However, any non-pointer,
  25133. // non-interface field appearing in ForceSendFields will be sent to the
  25134. // server regardless of whether the field is empty or not. This may be
  25135. // used to include empty fields in Patch requests.
  25136. ForceSendFields []string `json:"-"`
  25137. // NullFields is a list of field names (e.g. "Code") to include in API
  25138. // requests with the JSON null value. By default, fields with empty
  25139. // values are omitted from API requests. However, any field with an
  25140. // empty value appearing in NullFields will be sent to the server as
  25141. // null. It is an error if a field in this list has a non-empty value.
  25142. // This may be used to include null fields in Patch requests.
  25143. NullFields []string `json:"-"`
  25144. }
  25145. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  25146. type NoMethod SubnetworkListWarning
  25147. raw := NoMethod(*s)
  25148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25149. }
  25150. type SubnetworkListWarningData struct {
  25151. // Key: [Output Only] A key that provides more detail on the warning
  25152. // being returned. For example, for warnings where there are no results
  25153. // in a list request for a particular zone, this key might be scope and
  25154. // the key value might be the zone name. Other examples might be a key
  25155. // indicating a deprecated resource and a suggested replacement, or a
  25156. // warning about invalid network settings (for example, if an instance
  25157. // attempts to perform IP forwarding but is not enabled for IP
  25158. // forwarding).
  25159. Key string `json:"key,omitempty"`
  25160. // Value: [Output Only] A warning data value corresponding to the key.
  25161. Value string `json:"value,omitempty"`
  25162. // ForceSendFields is a list of field names (e.g. "Key") to
  25163. // unconditionally include in API requests. By default, fields with
  25164. // empty values are omitted from API requests. However, any non-pointer,
  25165. // non-interface field appearing in ForceSendFields will be sent to the
  25166. // server regardless of whether the field is empty or not. This may be
  25167. // used to include empty fields in Patch requests.
  25168. ForceSendFields []string `json:"-"`
  25169. // NullFields is a list of field names (e.g. "Key") to include in API
  25170. // requests with the JSON null value. By default, fields with empty
  25171. // values are omitted from API requests. However, any field with an
  25172. // empty value appearing in NullFields will be sent to the server as
  25173. // null. It is an error if a field in this list has a non-empty value.
  25174. // This may be used to include null fields in Patch requests.
  25175. NullFields []string `json:"-"`
  25176. }
  25177. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  25178. type NoMethod SubnetworkListWarningData
  25179. raw := NoMethod(*s)
  25180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25181. }
  25182. // SubnetworkLogConfig: The available logging options for this
  25183. // subnetwork.
  25184. type SubnetworkLogConfig struct {
  25185. // AggregationInterval: Can only be specified if VPC flow logging for
  25186. // this subnetwork is enabled. Toggles the aggregation interval for
  25187. // collecting flow logs. Increasing the interval time will reduce the
  25188. // amount of generated flow logs for long lasting connections. Default
  25189. // is an interval of 5 seconds per connection.
  25190. //
  25191. // Possible values:
  25192. // "INTERVAL_10_MIN"
  25193. // "INTERVAL_15_MIN"
  25194. // "INTERVAL_1_MIN"
  25195. // "INTERVAL_30_SEC"
  25196. // "INTERVAL_5_MIN"
  25197. // "INTERVAL_5_SEC"
  25198. AggregationInterval string `json:"aggregationInterval,omitempty"`
  25199. // Enable: Whether to enable flow logging for this subnetwork. If this
  25200. // field is not explicitly set, it will not appear in get listings. If
  25201. // not set the default behavior is to disable flow logging.
  25202. Enable bool `json:"enable,omitempty"`
  25203. // FlowSampling: Can only be specified if VPC flow logging for this
  25204. // subnetwork is enabled. The value of the field must be in [0, 1]. Set
  25205. // the sampling rate of VPC flow logs within the subnetwork where 1.0
  25206. // means all collected logs are reported and 0.0 means no logs are
  25207. // reported. Default is 0.5 which means half of all collected logs are
  25208. // reported.
  25209. FlowSampling float64 `json:"flowSampling,omitempty"`
  25210. // Metadata: Can only be specified if VPC flow logging for this
  25211. // subnetwork is enabled. Configures whether metadata fields should be
  25212. // added to the reported VPC flow logs. Default is INCLUDE_ALL_METADATA.
  25213. //
  25214. // Possible values:
  25215. // "EXCLUDE_ALL_METADATA"
  25216. // "INCLUDE_ALL_METADATA"
  25217. Metadata string `json:"metadata,omitempty"`
  25218. // ForceSendFields is a list of field names (e.g. "AggregationInterval")
  25219. // to unconditionally include in API requests. By default, fields with
  25220. // empty values are omitted from API requests. However, any non-pointer,
  25221. // non-interface field appearing in ForceSendFields will be sent to the
  25222. // server regardless of whether the field is empty or not. This may be
  25223. // used to include empty fields in Patch requests.
  25224. ForceSendFields []string `json:"-"`
  25225. // NullFields is a list of field names (e.g. "AggregationInterval") to
  25226. // include in API requests with the JSON null value. By default, fields
  25227. // with empty values are omitted from API requests. However, any field
  25228. // with an empty value appearing in NullFields will be sent to the
  25229. // server as null. It is an error if a field in this list has a
  25230. // non-empty value. This may be used to include null fields in Patch
  25231. // requests.
  25232. NullFields []string `json:"-"`
  25233. }
  25234. func (s *SubnetworkLogConfig) MarshalJSON() ([]byte, error) {
  25235. type NoMethod SubnetworkLogConfig
  25236. raw := NoMethod(*s)
  25237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25238. }
  25239. func (s *SubnetworkLogConfig) UnmarshalJSON(data []byte) error {
  25240. type NoMethod SubnetworkLogConfig
  25241. var s1 struct {
  25242. FlowSampling gensupport.JSONFloat64 `json:"flowSampling"`
  25243. *NoMethod
  25244. }
  25245. s1.NoMethod = (*NoMethod)(s)
  25246. if err := json.Unmarshal(data, &s1); err != nil {
  25247. return err
  25248. }
  25249. s.FlowSampling = float64(s1.FlowSampling)
  25250. return nil
  25251. }
  25252. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  25253. // subnetwork.
  25254. type SubnetworkSecondaryRange struct {
  25255. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  25256. // secondary range. Provide this property when you create the
  25257. // subnetwork. Ranges must be unique and non-overlapping with all
  25258. // primary and secondary IP ranges within a network. Only IPv4 is
  25259. // supported.
  25260. IpCidrRange string `json:"ipCidrRange,omitempty"`
  25261. // RangeName: The name associated with this subnetwork secondary range,
  25262. // used when adding an alias IP range to a VM instance. The name must be
  25263. // 1-63 characters long, and comply with RFC1035. The name must be
  25264. // unique within the subnetwork.
  25265. RangeName string `json:"rangeName,omitempty"`
  25266. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  25267. // unconditionally include in API requests. By default, fields with
  25268. // empty values are omitted from API requests. However, any non-pointer,
  25269. // non-interface field appearing in ForceSendFields will be sent to the
  25270. // server regardless of whether the field is empty or not. This may be
  25271. // used to include empty fields in Patch requests.
  25272. ForceSendFields []string `json:"-"`
  25273. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  25274. // in API requests with the JSON null value. By default, fields with
  25275. // empty values are omitted from API requests. However, any field with
  25276. // an empty value appearing in NullFields will be sent to the server as
  25277. // null. It is an error if a field in this list has a non-empty value.
  25278. // This may be used to include null fields in Patch requests.
  25279. NullFields []string `json:"-"`
  25280. }
  25281. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  25282. type NoMethod SubnetworkSecondaryRange
  25283. raw := NoMethod(*s)
  25284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25285. }
  25286. type SubnetworksExpandIpCidrRangeRequest struct {
  25287. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  25288. // that are legal on this Subnetwork. This range should be disjoint from
  25289. // other subnetworks within this network. This range can only be larger
  25290. // than (i.e. a superset of) the range previously defined before the
  25291. // update.
  25292. IpCidrRange string `json:"ipCidrRange,omitempty"`
  25293. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  25294. // unconditionally include in API requests. By default, fields with
  25295. // empty values are omitted from API requests. However, any non-pointer,
  25296. // non-interface field appearing in ForceSendFields will be sent to the
  25297. // server regardless of whether the field is empty or not. This may be
  25298. // used to include empty fields in Patch requests.
  25299. ForceSendFields []string `json:"-"`
  25300. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  25301. // in API requests with the JSON null value. By default, fields with
  25302. // empty values are omitted from API requests. However, any field with
  25303. // an empty value appearing in NullFields will be sent to the server as
  25304. // null. It is an error if a field in this list has a non-empty value.
  25305. // This may be used to include null fields in Patch requests.
  25306. NullFields []string `json:"-"`
  25307. }
  25308. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  25309. type NoMethod SubnetworksExpandIpCidrRangeRequest
  25310. raw := NoMethod(*s)
  25311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25312. }
  25313. type SubnetworksScopedList struct {
  25314. // Subnetworks: A list of subnetworks contained in this scope.
  25315. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  25316. // Warning: An informational warning that appears when the list of
  25317. // addresses is empty.
  25318. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  25319. // ForceSendFields is a list of field names (e.g. "Subnetworks") 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. "Subnetworks") to include
  25327. // in API requests with the JSON null value. By default, fields with
  25328. // empty values are omitted from API requests. However, any field with
  25329. // an empty value appearing in NullFields will be sent to the server as
  25330. // null. It is an error if a field in this list has a non-empty value.
  25331. // This may be used to include null fields in Patch requests.
  25332. NullFields []string `json:"-"`
  25333. }
  25334. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  25335. type NoMethod SubnetworksScopedList
  25336. raw := NoMethod(*s)
  25337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25338. }
  25339. // SubnetworksScopedListWarning: An informational warning that appears
  25340. // when the list of addresses is empty.
  25341. type SubnetworksScopedListWarning struct {
  25342. // Code: [Output Only] A warning code, if applicable. For example,
  25343. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25344. // the response.
  25345. //
  25346. // Possible values:
  25347. // "CLEANUP_FAILED"
  25348. // "DEPRECATED_RESOURCE_USED"
  25349. // "DEPRECATED_TYPE_USED"
  25350. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25351. // "EXPERIMENTAL_TYPE_USED"
  25352. // "EXTERNAL_API_WARNING"
  25353. // "FIELD_VALUE_OVERRIDEN"
  25354. // "INJECTED_KERNELS_DEPRECATED"
  25355. // "MISSING_TYPE_DEPENDENCY"
  25356. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25357. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25358. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25359. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25360. // "NEXT_HOP_NOT_RUNNING"
  25361. // "NOT_CRITICAL_ERROR"
  25362. // "NO_RESULTS_ON_PAGE"
  25363. // "REQUIRED_TOS_AGREEMENT"
  25364. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25365. // "RESOURCE_NOT_DELETED"
  25366. // "SCHEMA_VALIDATION_IGNORED"
  25367. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25368. // "UNDECLARED_PROPERTIES"
  25369. // "UNREACHABLE"
  25370. Code string `json:"code,omitempty"`
  25371. // Data: [Output Only] Metadata about this warning in key: value format.
  25372. // For example:
  25373. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25374. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  25375. // Message: [Output Only] A human-readable description of the warning
  25376. // code.
  25377. Message string `json:"message,omitempty"`
  25378. // ForceSendFields is a list of field names (e.g. "Code") to
  25379. // unconditionally include in API requests. By default, fields with
  25380. // empty values are omitted from API requests. However, any non-pointer,
  25381. // non-interface field appearing in ForceSendFields will be sent to the
  25382. // server regardless of whether the field is empty or not. This may be
  25383. // used to include empty fields in Patch requests.
  25384. ForceSendFields []string `json:"-"`
  25385. // NullFields is a list of field names (e.g. "Code") to include in API
  25386. // requests with the JSON null value. By default, fields with empty
  25387. // values are omitted from API requests. However, any field with an
  25388. // empty value appearing in NullFields will be sent to the server as
  25389. // null. It is an error if a field in this list has a non-empty value.
  25390. // This may be used to include null fields in Patch requests.
  25391. NullFields []string `json:"-"`
  25392. }
  25393. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  25394. type NoMethod SubnetworksScopedListWarning
  25395. raw := NoMethod(*s)
  25396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25397. }
  25398. type SubnetworksScopedListWarningData struct {
  25399. // Key: [Output Only] A key that provides more detail on the warning
  25400. // being returned. For example, for warnings where there are no results
  25401. // in a list request for a particular zone, this key might be scope and
  25402. // the key value might be the zone name. Other examples might be a key
  25403. // indicating a deprecated resource and a suggested replacement, or a
  25404. // warning about invalid network settings (for example, if an instance
  25405. // attempts to perform IP forwarding but is not enabled for IP
  25406. // forwarding).
  25407. Key string `json:"key,omitempty"`
  25408. // Value: [Output Only] A warning data value corresponding to the key.
  25409. Value string `json:"value,omitempty"`
  25410. // ForceSendFields is a list of field names (e.g. "Key") to
  25411. // unconditionally include in API requests. By default, fields with
  25412. // empty values are omitted from API requests. However, any non-pointer,
  25413. // non-interface field appearing in ForceSendFields will be sent to the
  25414. // server regardless of whether the field is empty or not. This may be
  25415. // used to include empty fields in Patch requests.
  25416. ForceSendFields []string `json:"-"`
  25417. // NullFields is a list of field names (e.g. "Key") to include in API
  25418. // requests with the JSON null value. By default, fields with empty
  25419. // values are omitted from API requests. However, any field with an
  25420. // empty value appearing in NullFields will be sent to the server as
  25421. // null. It is an error if a field in this list has a non-empty value.
  25422. // This may be used to include null fields in Patch requests.
  25423. NullFields []string `json:"-"`
  25424. }
  25425. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  25426. type NoMethod SubnetworksScopedListWarningData
  25427. raw := NoMethod(*s)
  25428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25429. }
  25430. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  25431. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  25432. // ForceSendFields is a list of field names (e.g.
  25433. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  25434. // By default, fields with empty values are omitted from API requests.
  25435. // However, any non-pointer, non-interface field appearing in
  25436. // ForceSendFields will be sent to the server regardless of whether the
  25437. // field is empty or not. This may be used to include empty fields in
  25438. // Patch requests.
  25439. ForceSendFields []string `json:"-"`
  25440. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  25441. // include in API requests with the JSON null value. By default, fields
  25442. // with empty values are omitted from API requests. However, any field
  25443. // with an empty value appearing in NullFields will be sent to the
  25444. // server as null. It is an error if a field in this list has a
  25445. // non-empty value. This may be used to include null fields in Patch
  25446. // requests.
  25447. NullFields []string `json:"-"`
  25448. }
  25449. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  25450. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  25451. raw := NoMethod(*s)
  25452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25453. }
  25454. type TCPHealthCheck struct {
  25455. // Port: The TCP port number for the health check request. The default
  25456. // value is 80. Valid values are 1 through 65535.
  25457. Port int64 `json:"port,omitempty"`
  25458. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  25459. // both port and port_name are defined, port takes precedence.
  25460. PortName string `json:"portName,omitempty"`
  25461. // PortSpecification: Specifies how port is selected for health
  25462. // checking, can be one of following values:
  25463. // USE_FIXED_PORT: The port number in
  25464. // port
  25465. // is used for health checking.
  25466. // USE_NAMED_PORT: The
  25467. // portName
  25468. // is used for health checking.
  25469. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  25470. // each network endpoint is used for health checking. For other
  25471. // backends, the port or named port specified in the Backend Service is
  25472. // used for health checking.
  25473. //
  25474. //
  25475. // If not specified, TCP health check follows behavior specified
  25476. // in
  25477. // port
  25478. // and
  25479. // portName
  25480. // fields.
  25481. //
  25482. // Possible values:
  25483. // "USE_FIXED_PORT"
  25484. // "USE_NAMED_PORT"
  25485. // "USE_SERVING_PORT"
  25486. PortSpecification string `json:"portSpecification,omitempty"`
  25487. // ProxyHeader: Specifies the type of proxy header to append before
  25488. // sending data to the backend, either NONE or PROXY_V1. The default is
  25489. // NONE.
  25490. //
  25491. // Possible values:
  25492. // "NONE"
  25493. // "PROXY_V1"
  25494. ProxyHeader string `json:"proxyHeader,omitempty"`
  25495. // Request: The application data to send once the TCP connection has
  25496. // been established (default value is empty). If both request and
  25497. // response are empty, the connection establishment alone will indicate
  25498. // health. The request data can only be ASCII.
  25499. Request string `json:"request,omitempty"`
  25500. // Response: The bytes to match against the beginning of the response
  25501. // data. If left empty (the default value), any response will indicate
  25502. // health. The response data can only be ASCII.
  25503. Response string `json:"response,omitempty"`
  25504. // ForceSendFields is a list of field names (e.g. "Port") to
  25505. // unconditionally include in API requests. By default, fields with
  25506. // empty values are omitted from API requests. However, any non-pointer,
  25507. // non-interface field appearing in ForceSendFields will be sent to the
  25508. // server regardless of whether the field is empty or not. This may be
  25509. // used to include empty fields in Patch requests.
  25510. ForceSendFields []string `json:"-"`
  25511. // NullFields is a list of field names (e.g. "Port") to include in API
  25512. // requests with the JSON null value. By default, fields with empty
  25513. // values are omitted from API requests. However, any field with an
  25514. // empty value appearing in NullFields will be sent to the server as
  25515. // null. It is an error if a field in this list has a non-empty value.
  25516. // This may be used to include null fields in Patch requests.
  25517. NullFields []string `json:"-"`
  25518. }
  25519. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  25520. type NoMethod TCPHealthCheck
  25521. raw := NoMethod(*s)
  25522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25523. }
  25524. // Tags: A set of instance tags.
  25525. type Tags struct {
  25526. // Fingerprint: Specifies a fingerprint for this request, which is
  25527. // essentially a hash of the tags' contents and used for optimistic
  25528. // locking. The fingerprint is initially generated by Compute Engine and
  25529. // changes after every request to modify or update tags. You must always
  25530. // provide an up-to-date fingerprint hash in order to update or change
  25531. // tags.
  25532. //
  25533. // To see the latest fingerprint, make get() request to the instance.
  25534. Fingerprint string `json:"fingerprint,omitempty"`
  25535. // Items: An array of tags. Each tag must be 1-63 characters long, and
  25536. // comply with RFC1035.
  25537. Items []string `json:"items,omitempty"`
  25538. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  25539. // unconditionally include in API requests. By default, fields with
  25540. // empty values are omitted from API requests. However, any non-pointer,
  25541. // non-interface field appearing in ForceSendFields will be sent to the
  25542. // server regardless of whether the field is empty or not. This may be
  25543. // used to include empty fields in Patch requests.
  25544. ForceSendFields []string `json:"-"`
  25545. // NullFields is a list of field names (e.g. "Fingerprint") to include
  25546. // in API requests with the JSON null value. By default, fields with
  25547. // empty values are omitted from API requests. However, any field with
  25548. // an empty value appearing in NullFields will be sent to the server as
  25549. // null. It is an error if a field in this list has a non-empty value.
  25550. // This may be used to include null fields in Patch requests.
  25551. NullFields []string `json:"-"`
  25552. }
  25553. func (s *Tags) MarshalJSON() ([]byte, error) {
  25554. type NoMethod Tags
  25555. raw := NoMethod(*s)
  25556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25557. }
  25558. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  25559. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  25560. // resource_for v1.targetHttpProxies ==)
  25561. type TargetHttpProxy struct {
  25562. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25563. // format.
  25564. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25565. // Description: An optional description of this resource. Provide this
  25566. // property when you create the resource.
  25567. Description string `json:"description,omitempty"`
  25568. // Id: [Output Only] The unique identifier for the resource. This
  25569. // identifier is defined by the server.
  25570. Id uint64 `json:"id,omitempty,string"`
  25571. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  25572. // for target HTTP proxies.
  25573. Kind string `json:"kind,omitempty"`
  25574. // Name: Name of the resource. Provided by the client when the resource
  25575. // is created. The name must be 1-63 characters long, and comply with
  25576. // RFC1035. Specifically, the name must be 1-63 characters long and
  25577. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  25578. // the first character must be a lowercase letter, and all following
  25579. // characters must be a dash, lowercase letter, or digit, except the
  25580. // last character, which cannot be a dash.
  25581. Name string `json:"name,omitempty"`
  25582. // SelfLink: [Output Only] Server-defined URL for the resource.
  25583. SelfLink string `json:"selfLink,omitempty"`
  25584. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  25585. // to the BackendService.
  25586. UrlMap string `json:"urlMap,omitempty"`
  25587. // ServerResponse contains the HTTP response code and headers from the
  25588. // server.
  25589. googleapi.ServerResponse `json:"-"`
  25590. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  25591. // to unconditionally include in API requests. By default, fields with
  25592. // empty values are omitted from API requests. However, any non-pointer,
  25593. // non-interface field appearing in ForceSendFields will be sent to the
  25594. // server regardless of whether the field is empty or not. This may be
  25595. // used to include empty fields in Patch requests.
  25596. ForceSendFields []string `json:"-"`
  25597. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  25598. // include in API requests with the JSON null value. By default, fields
  25599. // with empty values are omitted from API requests. However, any field
  25600. // with an empty value appearing in NullFields will be sent to the
  25601. // server as null. It is an error if a field in this list has a
  25602. // non-empty value. This may be used to include null fields in Patch
  25603. // requests.
  25604. NullFields []string `json:"-"`
  25605. }
  25606. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  25607. type NoMethod TargetHttpProxy
  25608. raw := NoMethod(*s)
  25609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25610. }
  25611. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  25612. type TargetHttpProxyList struct {
  25613. // Id: [Output Only] Unique identifier for the resource; defined by the
  25614. // server.
  25615. Id string `json:"id,omitempty"`
  25616. // Items: A list of TargetHttpProxy resources.
  25617. Items []*TargetHttpProxy `json:"items,omitempty"`
  25618. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  25619. // of target HTTP proxies.
  25620. Kind string `json:"kind,omitempty"`
  25621. // NextPageToken: [Output Only] This token allows you to get the next
  25622. // page of results for list requests. If the number of results is larger
  25623. // than maxResults, use the nextPageToken as a value for the query
  25624. // parameter pageToken in the next list request. Subsequent list
  25625. // requests will have their own nextPageToken to continue paging through
  25626. // the results.
  25627. NextPageToken string `json:"nextPageToken,omitempty"`
  25628. // SelfLink: [Output Only] Server-defined URL for this resource.
  25629. SelfLink string `json:"selfLink,omitempty"`
  25630. // Warning: [Output Only] Informational warning message.
  25631. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  25632. // ServerResponse contains the HTTP response code and headers from the
  25633. // server.
  25634. googleapi.ServerResponse `json:"-"`
  25635. // ForceSendFields is a list of field names (e.g. "Id") to
  25636. // unconditionally include in API requests. By default, fields with
  25637. // empty values are omitted from API requests. However, any non-pointer,
  25638. // non-interface field appearing in ForceSendFields will be sent to the
  25639. // server regardless of whether the field is empty or not. This may be
  25640. // used to include empty fields in Patch requests.
  25641. ForceSendFields []string `json:"-"`
  25642. // NullFields is a list of field names (e.g. "Id") to include in API
  25643. // requests with the JSON null value. By default, fields with empty
  25644. // values are omitted from API requests. However, any field with an
  25645. // empty value appearing in NullFields will be sent to the server as
  25646. // null. It is an error if a field in this list has a non-empty value.
  25647. // This may be used to include null fields in Patch requests.
  25648. NullFields []string `json:"-"`
  25649. }
  25650. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  25651. type NoMethod TargetHttpProxyList
  25652. raw := NoMethod(*s)
  25653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25654. }
  25655. // TargetHttpProxyListWarning: [Output Only] Informational warning
  25656. // message.
  25657. type TargetHttpProxyListWarning struct {
  25658. // Code: [Output Only] A warning code, if applicable. For example,
  25659. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25660. // the response.
  25661. //
  25662. // Possible values:
  25663. // "CLEANUP_FAILED"
  25664. // "DEPRECATED_RESOURCE_USED"
  25665. // "DEPRECATED_TYPE_USED"
  25666. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25667. // "EXPERIMENTAL_TYPE_USED"
  25668. // "EXTERNAL_API_WARNING"
  25669. // "FIELD_VALUE_OVERRIDEN"
  25670. // "INJECTED_KERNELS_DEPRECATED"
  25671. // "MISSING_TYPE_DEPENDENCY"
  25672. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25673. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25674. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25675. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25676. // "NEXT_HOP_NOT_RUNNING"
  25677. // "NOT_CRITICAL_ERROR"
  25678. // "NO_RESULTS_ON_PAGE"
  25679. // "REQUIRED_TOS_AGREEMENT"
  25680. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25681. // "RESOURCE_NOT_DELETED"
  25682. // "SCHEMA_VALIDATION_IGNORED"
  25683. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25684. // "UNDECLARED_PROPERTIES"
  25685. // "UNREACHABLE"
  25686. Code string `json:"code,omitempty"`
  25687. // Data: [Output Only] Metadata about this warning in key: value format.
  25688. // For example:
  25689. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25690. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  25691. // Message: [Output Only] A human-readable description of the warning
  25692. // code.
  25693. Message string `json:"message,omitempty"`
  25694. // ForceSendFields is a list of field names (e.g. "Code") to
  25695. // unconditionally include in API requests. By default, fields with
  25696. // empty values are omitted from API requests. However, any non-pointer,
  25697. // non-interface field appearing in ForceSendFields will be sent to the
  25698. // server regardless of whether the field is empty or not. This may be
  25699. // used to include empty fields in Patch requests.
  25700. ForceSendFields []string `json:"-"`
  25701. // NullFields is a list of field names (e.g. "Code") to include in API
  25702. // requests with the JSON null value. By default, fields with empty
  25703. // values are omitted from API requests. However, any field with an
  25704. // empty value appearing in NullFields will be sent to the server as
  25705. // null. It is an error if a field in this list has a non-empty value.
  25706. // This may be used to include null fields in Patch requests.
  25707. NullFields []string `json:"-"`
  25708. }
  25709. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  25710. type NoMethod TargetHttpProxyListWarning
  25711. raw := NoMethod(*s)
  25712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25713. }
  25714. type TargetHttpProxyListWarningData struct {
  25715. // Key: [Output Only] A key that provides more detail on the warning
  25716. // being returned. For example, for warnings where there are no results
  25717. // in a list request for a particular zone, this key might be scope and
  25718. // the key value might be the zone name. Other examples might be a key
  25719. // indicating a deprecated resource and a suggested replacement, or a
  25720. // warning about invalid network settings (for example, if an instance
  25721. // attempts to perform IP forwarding but is not enabled for IP
  25722. // forwarding).
  25723. Key string `json:"key,omitempty"`
  25724. // Value: [Output Only] A warning data value corresponding to the key.
  25725. Value string `json:"value,omitempty"`
  25726. // ForceSendFields is a list of field names (e.g. "Key") to
  25727. // unconditionally include in API requests. By default, fields with
  25728. // empty values are omitted from API requests. However, any non-pointer,
  25729. // non-interface field appearing in ForceSendFields will be sent to the
  25730. // server regardless of whether the field is empty or not. This may be
  25731. // used to include empty fields in Patch requests.
  25732. ForceSendFields []string `json:"-"`
  25733. // NullFields is a list of field names (e.g. "Key") to include in API
  25734. // requests with the JSON null value. By default, fields with empty
  25735. // values are omitted from API requests. However, any field with an
  25736. // empty value appearing in NullFields will be sent to the server as
  25737. // null. It is an error if a field in this list has a non-empty value.
  25738. // This may be used to include null fields in Patch requests.
  25739. NullFields []string `json:"-"`
  25740. }
  25741. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  25742. type NoMethod TargetHttpProxyListWarningData
  25743. raw := NoMethod(*s)
  25744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25745. }
  25746. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  25747. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  25748. //
  25749. // Possible values:
  25750. // "DISABLE"
  25751. // "ENABLE"
  25752. // "NONE"
  25753. QuicOverride string `json:"quicOverride,omitempty"`
  25754. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  25755. // unconditionally include in API requests. By default, fields with
  25756. // empty values are omitted from API requests. However, any non-pointer,
  25757. // non-interface field appearing in ForceSendFields will be sent to the
  25758. // server regardless of whether the field is empty or not. This may be
  25759. // used to include empty fields in Patch requests.
  25760. ForceSendFields []string `json:"-"`
  25761. // NullFields is a list of field names (e.g. "QuicOverride") to include
  25762. // in API requests with the JSON null value. By default, fields with
  25763. // empty values are omitted from API requests. However, any field with
  25764. // an empty value appearing in NullFields will be sent to the server as
  25765. // null. It is an error if a field in this list has a non-empty value.
  25766. // This may be used to include null fields in Patch requests.
  25767. NullFields []string `json:"-"`
  25768. }
  25769. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  25770. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  25771. raw := NoMethod(*s)
  25772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25773. }
  25774. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  25775. // SslCertificates: New set of SslCertificate resources to associate
  25776. // with this TargetHttpsProxy resource. Currently exactly one
  25777. // SslCertificate resource must be specified.
  25778. SslCertificates []string `json:"sslCertificates,omitempty"`
  25779. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  25780. // unconditionally include in API requests. By default, fields with
  25781. // empty values are omitted from API requests. However, any non-pointer,
  25782. // non-interface field appearing in ForceSendFields will be sent to the
  25783. // server regardless of whether the field is empty or not. This may be
  25784. // used to include empty fields in Patch requests.
  25785. ForceSendFields []string `json:"-"`
  25786. // NullFields is a list of field names (e.g. "SslCertificates") to
  25787. // include in API requests with the JSON null value. By default, fields
  25788. // with empty values are omitted from API requests. However, any field
  25789. // with an empty value appearing in NullFields will be sent to the
  25790. // server as null. It is an error if a field in this list has a
  25791. // non-empty value. This may be used to include null fields in Patch
  25792. // requests.
  25793. NullFields []string `json:"-"`
  25794. }
  25795. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  25796. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  25797. raw := NoMethod(*s)
  25798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25799. }
  25800. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  25801. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  25802. // resource_for v1.targetHttpsProxies ==)
  25803. type TargetHttpsProxy struct {
  25804. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25805. // format.
  25806. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25807. // Description: An optional description of this resource. Provide this
  25808. // property when you create the resource.
  25809. Description string `json:"description,omitempty"`
  25810. // Id: [Output Only] The unique identifier for the resource. This
  25811. // identifier is defined by the server.
  25812. Id uint64 `json:"id,omitempty,string"`
  25813. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  25814. // for target HTTPS proxies.
  25815. Kind string `json:"kind,omitempty"`
  25816. // Name: Name of the resource. Provided by the client when the resource
  25817. // is created. The name must be 1-63 characters long, and comply with
  25818. // RFC1035. Specifically, the name must be 1-63 characters long and
  25819. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  25820. // the first character must be a lowercase letter, and all following
  25821. // characters must be a dash, lowercase letter, or digit, except the
  25822. // last character, which cannot be a dash.
  25823. Name string `json:"name,omitempty"`
  25824. // QuicOverride: Specifies the QUIC override policy for this
  25825. // TargetHttpsProxy resource. This determines whether the load balancer
  25826. // will attempt to negotiate QUIC with clients or not. Can specify one
  25827. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  25828. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  25829. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  25830. // overrides, which is equivalent to DISABLE. Not specifying this field
  25831. // is equivalent to specifying NONE.
  25832. //
  25833. // Possible values:
  25834. // "DISABLE"
  25835. // "ENABLE"
  25836. // "NONE"
  25837. QuicOverride string `json:"quicOverride,omitempty"`
  25838. // SelfLink: [Output Only] Server-defined URL for the resource.
  25839. SelfLink string `json:"selfLink,omitempty"`
  25840. // SslCertificates: URLs to SslCertificate resources that are used to
  25841. // authenticate connections between users and the load balancer. At
  25842. // least one SSL certificate must be specified. Currently, you may
  25843. // specify up to 15 SSL certificates.
  25844. SslCertificates []string `json:"sslCertificates,omitempty"`
  25845. // SslPolicy: URL of SslPolicy resource that will be associated with the
  25846. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  25847. // will not have any SSL policy configured.
  25848. SslPolicy string `json:"sslPolicy,omitempty"`
  25849. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  25850. // that defines the mapping from URL to the BackendService. For example,
  25851. // the following are all valid URLs for specifying a URL map:
  25852. // -
  25853. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  25854. // - projects/project/global/urlMaps/url-map
  25855. // - global/urlMaps/url-map
  25856. UrlMap string `json:"urlMap,omitempty"`
  25857. // ServerResponse contains the HTTP response code and headers from the
  25858. // server.
  25859. googleapi.ServerResponse `json:"-"`
  25860. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  25861. // to unconditionally include in API requests. By default, fields with
  25862. // empty values are omitted from API requests. However, any non-pointer,
  25863. // non-interface field appearing in ForceSendFields will be sent to the
  25864. // server regardless of whether the field is empty or not. This may be
  25865. // used to include empty fields in Patch requests.
  25866. ForceSendFields []string `json:"-"`
  25867. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  25868. // include in API requests with the JSON null value. By default, fields
  25869. // with empty values are omitted from API requests. However, any field
  25870. // with an empty value appearing in NullFields will be sent to the
  25871. // server as null. It is an error if a field in this list has a
  25872. // non-empty value. This may be used to include null fields in Patch
  25873. // requests.
  25874. NullFields []string `json:"-"`
  25875. }
  25876. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  25877. type NoMethod TargetHttpsProxy
  25878. raw := NoMethod(*s)
  25879. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25880. }
  25881. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  25882. type TargetHttpsProxyList struct {
  25883. // Id: [Output Only] Unique identifier for the resource; defined by the
  25884. // server.
  25885. Id string `json:"id,omitempty"`
  25886. // Items: A list of TargetHttpsProxy resources.
  25887. Items []*TargetHttpsProxy `json:"items,omitempty"`
  25888. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  25889. // of target HTTPS proxies.
  25890. Kind string `json:"kind,omitempty"`
  25891. // NextPageToken: [Output Only] This token allows you to get the next
  25892. // page of results for list requests. If the number of results is larger
  25893. // than maxResults, use the nextPageToken as a value for the query
  25894. // parameter pageToken in the next list request. Subsequent list
  25895. // requests will have their own nextPageToken to continue paging through
  25896. // the results.
  25897. NextPageToken string `json:"nextPageToken,omitempty"`
  25898. // SelfLink: [Output Only] Server-defined URL for this resource.
  25899. SelfLink string `json:"selfLink,omitempty"`
  25900. // Warning: [Output Only] Informational warning message.
  25901. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  25902. // ServerResponse contains the HTTP response code and headers from the
  25903. // server.
  25904. googleapi.ServerResponse `json:"-"`
  25905. // ForceSendFields is a list of field names (e.g. "Id") to
  25906. // unconditionally include in API requests. By default, fields with
  25907. // empty values are omitted from API requests. However, any non-pointer,
  25908. // non-interface field appearing in ForceSendFields will be sent to the
  25909. // server regardless of whether the field is empty or not. This may be
  25910. // used to include empty fields in Patch requests.
  25911. ForceSendFields []string `json:"-"`
  25912. // NullFields is a list of field names (e.g. "Id") to include in API
  25913. // requests with the JSON null value. By default, fields with empty
  25914. // values are omitted from API requests. However, any field with an
  25915. // empty value appearing in NullFields will be sent to the server as
  25916. // null. It is an error if a field in this list has a non-empty value.
  25917. // This may be used to include null fields in Patch requests.
  25918. NullFields []string `json:"-"`
  25919. }
  25920. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  25921. type NoMethod TargetHttpsProxyList
  25922. raw := NoMethod(*s)
  25923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25924. }
  25925. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  25926. // message.
  25927. type TargetHttpsProxyListWarning struct {
  25928. // Code: [Output Only] A warning code, if applicable. For example,
  25929. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25930. // the response.
  25931. //
  25932. // Possible values:
  25933. // "CLEANUP_FAILED"
  25934. // "DEPRECATED_RESOURCE_USED"
  25935. // "DEPRECATED_TYPE_USED"
  25936. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25937. // "EXPERIMENTAL_TYPE_USED"
  25938. // "EXTERNAL_API_WARNING"
  25939. // "FIELD_VALUE_OVERRIDEN"
  25940. // "INJECTED_KERNELS_DEPRECATED"
  25941. // "MISSING_TYPE_DEPENDENCY"
  25942. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25943. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25944. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25945. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25946. // "NEXT_HOP_NOT_RUNNING"
  25947. // "NOT_CRITICAL_ERROR"
  25948. // "NO_RESULTS_ON_PAGE"
  25949. // "REQUIRED_TOS_AGREEMENT"
  25950. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25951. // "RESOURCE_NOT_DELETED"
  25952. // "SCHEMA_VALIDATION_IGNORED"
  25953. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25954. // "UNDECLARED_PROPERTIES"
  25955. // "UNREACHABLE"
  25956. Code string `json:"code,omitempty"`
  25957. // Data: [Output Only] Metadata about this warning in key: value format.
  25958. // For example:
  25959. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25960. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  25961. // Message: [Output Only] A human-readable description of the warning
  25962. // code.
  25963. Message string `json:"message,omitempty"`
  25964. // ForceSendFields is a list of field names (e.g. "Code") to
  25965. // unconditionally include in API requests. By default, fields with
  25966. // empty values are omitted from API requests. However, any non-pointer,
  25967. // non-interface field appearing in ForceSendFields will be sent to the
  25968. // server regardless of whether the field is empty or not. This may be
  25969. // used to include empty fields in Patch requests.
  25970. ForceSendFields []string `json:"-"`
  25971. // NullFields is a list of field names (e.g. "Code") to include in API
  25972. // requests with the JSON null value. By default, fields with empty
  25973. // values are omitted from API requests. However, any field with an
  25974. // empty value appearing in NullFields will be sent to the server as
  25975. // null. It is an error if a field in this list has a non-empty value.
  25976. // This may be used to include null fields in Patch requests.
  25977. NullFields []string `json:"-"`
  25978. }
  25979. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  25980. type NoMethod TargetHttpsProxyListWarning
  25981. raw := NoMethod(*s)
  25982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25983. }
  25984. type TargetHttpsProxyListWarningData struct {
  25985. // Key: [Output Only] A key that provides more detail on the warning
  25986. // being returned. For example, for warnings where there are no results
  25987. // in a list request for a particular zone, this key might be scope and
  25988. // the key value might be the zone name. Other examples might be a key
  25989. // indicating a deprecated resource and a suggested replacement, or a
  25990. // warning about invalid network settings (for example, if an instance
  25991. // attempts to perform IP forwarding but is not enabled for IP
  25992. // forwarding).
  25993. Key string `json:"key,omitempty"`
  25994. // Value: [Output Only] A warning data value corresponding to the key.
  25995. Value string `json:"value,omitempty"`
  25996. // ForceSendFields is a list of field names (e.g. "Key") to
  25997. // unconditionally include in API requests. By default, fields with
  25998. // empty values are omitted from API requests. However, any non-pointer,
  25999. // non-interface field appearing in ForceSendFields will be sent to the
  26000. // server regardless of whether the field is empty or not. This may be
  26001. // used to include empty fields in Patch requests.
  26002. ForceSendFields []string `json:"-"`
  26003. // NullFields is a list of field names (e.g. "Key") to include in API
  26004. // requests with the JSON null value. By default, fields with empty
  26005. // values are omitted from API requests. However, any field with an
  26006. // empty value appearing in NullFields will be sent to the server as
  26007. // null. It is an error if a field in this list has a non-empty value.
  26008. // This may be used to include null fields in Patch requests.
  26009. NullFields []string `json:"-"`
  26010. }
  26011. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  26012. type NoMethod TargetHttpsProxyListWarningData
  26013. raw := NoMethod(*s)
  26014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26015. }
  26016. // TargetInstance: A TargetInstance resource. This resource defines an
  26017. // endpoint instance that terminates traffic of certain protocols. (==
  26018. // resource_for beta.targetInstances ==) (== resource_for
  26019. // v1.targetInstances ==)
  26020. type TargetInstance struct {
  26021. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26022. // format.
  26023. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26024. // Description: An optional description of this resource. Provide this
  26025. // property when you create the resource.
  26026. Description string `json:"description,omitempty"`
  26027. // Id: [Output Only] The unique identifier for the resource. This
  26028. // identifier is defined by the server.
  26029. Id uint64 `json:"id,omitempty,string"`
  26030. // Instance: A URL to the virtual machine instance that handles traffic
  26031. // for this target instance. When creating a target instance, you can
  26032. // provide the fully-qualified URL or a valid partial URL to the desired
  26033. // virtual machine. For example, the following are all valid URLs:
  26034. // -
  26035. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  26036. // - projects/project/zones/zone/instances/instance
  26037. // - zones/zone/instances/instance
  26038. Instance string `json:"instance,omitempty"`
  26039. // Kind: [Output Only] The type of the resource. Always
  26040. // compute#targetInstance for target instances.
  26041. Kind string `json:"kind,omitempty"`
  26042. // Name: Name of the resource. Provided by the client when the resource
  26043. // is created. The name must be 1-63 characters long, and comply with
  26044. // RFC1035. Specifically, the name must be 1-63 characters long and
  26045. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26046. // the first character must be a lowercase letter, and all following
  26047. // characters must be a dash, lowercase letter, or digit, except the
  26048. // last character, which cannot be a dash.
  26049. Name string `json:"name,omitempty"`
  26050. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  26051. // Currently only NO_NAT (default value) is supported.
  26052. //
  26053. // Possible values:
  26054. // "NO_NAT"
  26055. NatPolicy string `json:"natPolicy,omitempty"`
  26056. // SelfLink: [Output Only] Server-defined URL for the resource.
  26057. SelfLink string `json:"selfLink,omitempty"`
  26058. // Zone: [Output Only] URL of the zone where the target instance
  26059. // resides. You must specify this field as part of the HTTP request URL.
  26060. // It is not settable as a field in the request body.
  26061. Zone string `json:"zone,omitempty"`
  26062. // ServerResponse contains the HTTP response code and headers from the
  26063. // server.
  26064. googleapi.ServerResponse `json:"-"`
  26065. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26066. // to unconditionally include in API requests. By default, fields with
  26067. // empty values are omitted from API requests. However, any non-pointer,
  26068. // non-interface field appearing in ForceSendFields will be sent to the
  26069. // server regardless of whether the field is empty or not. This may be
  26070. // used to include empty fields in Patch requests.
  26071. ForceSendFields []string `json:"-"`
  26072. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26073. // include in API requests with the JSON null value. By default, fields
  26074. // with empty values are omitted from API requests. However, any field
  26075. // with an empty value appearing in NullFields will be sent to the
  26076. // server as null. It is an error if a field in this list has a
  26077. // non-empty value. This may be used to include null fields in Patch
  26078. // requests.
  26079. NullFields []string `json:"-"`
  26080. }
  26081. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  26082. type NoMethod TargetInstance
  26083. raw := NoMethod(*s)
  26084. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26085. }
  26086. type TargetInstanceAggregatedList struct {
  26087. // Id: [Output Only] Unique identifier for the resource; defined by the
  26088. // server.
  26089. Id string `json:"id,omitempty"`
  26090. // Items: A list of TargetInstance resources.
  26091. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  26092. // Kind: Type of resource.
  26093. Kind string `json:"kind,omitempty"`
  26094. // NextPageToken: [Output Only] This token allows you to get the next
  26095. // page of results for list requests. If the number of results is larger
  26096. // than maxResults, use the nextPageToken as a value for the query
  26097. // parameter pageToken in the next list request. Subsequent list
  26098. // requests will have their own nextPageToken to continue paging through
  26099. // the results.
  26100. NextPageToken string `json:"nextPageToken,omitempty"`
  26101. // SelfLink: [Output Only] Server-defined URL for this resource.
  26102. SelfLink string `json:"selfLink,omitempty"`
  26103. // Warning: [Output Only] Informational warning message.
  26104. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  26105. // ServerResponse contains the HTTP response code and headers from the
  26106. // server.
  26107. googleapi.ServerResponse `json:"-"`
  26108. // ForceSendFields is a list of field names (e.g. "Id") to
  26109. // unconditionally include in API requests. By default, fields with
  26110. // empty values are omitted from API requests. However, any non-pointer,
  26111. // non-interface field appearing in ForceSendFields will be sent to the
  26112. // server regardless of whether the field is empty or not. This may be
  26113. // used to include empty fields in Patch requests.
  26114. ForceSendFields []string `json:"-"`
  26115. // NullFields is a list of field names (e.g. "Id") to include in API
  26116. // requests with the JSON null value. By default, fields with empty
  26117. // values are omitted from API requests. However, any field with an
  26118. // empty value appearing in NullFields will be sent to the server as
  26119. // null. It is an error if a field in this list has a non-empty value.
  26120. // This may be used to include null fields in Patch requests.
  26121. NullFields []string `json:"-"`
  26122. }
  26123. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  26124. type NoMethod TargetInstanceAggregatedList
  26125. raw := NoMethod(*s)
  26126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26127. }
  26128. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  26129. // warning message.
  26130. type TargetInstanceAggregatedListWarning struct {
  26131. // Code: [Output Only] A warning code, if applicable. For example,
  26132. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26133. // the response.
  26134. //
  26135. // Possible values:
  26136. // "CLEANUP_FAILED"
  26137. // "DEPRECATED_RESOURCE_USED"
  26138. // "DEPRECATED_TYPE_USED"
  26139. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26140. // "EXPERIMENTAL_TYPE_USED"
  26141. // "EXTERNAL_API_WARNING"
  26142. // "FIELD_VALUE_OVERRIDEN"
  26143. // "INJECTED_KERNELS_DEPRECATED"
  26144. // "MISSING_TYPE_DEPENDENCY"
  26145. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26146. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26147. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26148. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26149. // "NEXT_HOP_NOT_RUNNING"
  26150. // "NOT_CRITICAL_ERROR"
  26151. // "NO_RESULTS_ON_PAGE"
  26152. // "REQUIRED_TOS_AGREEMENT"
  26153. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26154. // "RESOURCE_NOT_DELETED"
  26155. // "SCHEMA_VALIDATION_IGNORED"
  26156. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26157. // "UNDECLARED_PROPERTIES"
  26158. // "UNREACHABLE"
  26159. Code string `json:"code,omitempty"`
  26160. // Data: [Output Only] Metadata about this warning in key: value format.
  26161. // For example:
  26162. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26163. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  26164. // Message: [Output Only] A human-readable description of the warning
  26165. // code.
  26166. Message string `json:"message,omitempty"`
  26167. // ForceSendFields is a list of field names (e.g. "Code") to
  26168. // unconditionally include in API requests. By default, fields with
  26169. // empty values are omitted from API requests. However, any non-pointer,
  26170. // non-interface field appearing in ForceSendFields will be sent to the
  26171. // server regardless of whether the field is empty or not. This may be
  26172. // used to include empty fields in Patch requests.
  26173. ForceSendFields []string `json:"-"`
  26174. // NullFields is a list of field names (e.g. "Code") to include in API
  26175. // requests with the JSON null value. By default, fields with empty
  26176. // values are omitted from API requests. However, any field with an
  26177. // empty value appearing in NullFields will be sent to the server as
  26178. // null. It is an error if a field in this list has a non-empty value.
  26179. // This may be used to include null fields in Patch requests.
  26180. NullFields []string `json:"-"`
  26181. }
  26182. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  26183. type NoMethod TargetInstanceAggregatedListWarning
  26184. raw := NoMethod(*s)
  26185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26186. }
  26187. type TargetInstanceAggregatedListWarningData struct {
  26188. // Key: [Output Only] A key that provides more detail on the warning
  26189. // being returned. For example, for warnings where there are no results
  26190. // in a list request for a particular zone, this key might be scope and
  26191. // the key value might be the zone name. Other examples might be a key
  26192. // indicating a deprecated resource and a suggested replacement, or a
  26193. // warning about invalid network settings (for example, if an instance
  26194. // attempts to perform IP forwarding but is not enabled for IP
  26195. // forwarding).
  26196. Key string `json:"key,omitempty"`
  26197. // Value: [Output Only] A warning data value corresponding to the key.
  26198. Value string `json:"value,omitempty"`
  26199. // ForceSendFields is a list of field names (e.g. "Key") to
  26200. // unconditionally include in API requests. By default, fields with
  26201. // empty values are omitted from API requests. However, any non-pointer,
  26202. // non-interface field appearing in ForceSendFields will be sent to the
  26203. // server regardless of whether the field is empty or not. This may be
  26204. // used to include empty fields in Patch requests.
  26205. ForceSendFields []string `json:"-"`
  26206. // NullFields is a list of field names (e.g. "Key") to include in API
  26207. // requests with the JSON null value. By default, fields with empty
  26208. // values are omitted from API requests. However, any field with an
  26209. // empty value appearing in NullFields will be sent to the server as
  26210. // null. It is an error if a field in this list has a non-empty value.
  26211. // This may be used to include null fields in Patch requests.
  26212. NullFields []string `json:"-"`
  26213. }
  26214. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  26215. type NoMethod TargetInstanceAggregatedListWarningData
  26216. raw := NoMethod(*s)
  26217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26218. }
  26219. // TargetInstanceList: Contains a list of TargetInstance resources.
  26220. type TargetInstanceList struct {
  26221. // Id: [Output Only] Unique identifier for the resource; defined by the
  26222. // server.
  26223. Id string `json:"id,omitempty"`
  26224. // Items: A list of TargetInstance resources.
  26225. Items []*TargetInstance `json:"items,omitempty"`
  26226. // Kind: Type of resource.
  26227. Kind string `json:"kind,omitempty"`
  26228. // NextPageToken: [Output Only] This token allows you to get the next
  26229. // page of results for list requests. If the number of results is larger
  26230. // than maxResults, use the nextPageToken as a value for the query
  26231. // parameter pageToken in the next list request. Subsequent list
  26232. // requests will have their own nextPageToken to continue paging through
  26233. // the results.
  26234. NextPageToken string `json:"nextPageToken,omitempty"`
  26235. // SelfLink: [Output Only] Server-defined URL for this resource.
  26236. SelfLink string `json:"selfLink,omitempty"`
  26237. // Warning: [Output Only] Informational warning message.
  26238. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  26239. // ServerResponse contains the HTTP response code and headers from the
  26240. // server.
  26241. googleapi.ServerResponse `json:"-"`
  26242. // ForceSendFields is a list of field names (e.g. "Id") to
  26243. // unconditionally include in API requests. By default, fields with
  26244. // empty values are omitted from API requests. However, any non-pointer,
  26245. // non-interface field appearing in ForceSendFields will be sent to the
  26246. // server regardless of whether the field is empty or not. This may be
  26247. // used to include empty fields in Patch requests.
  26248. ForceSendFields []string `json:"-"`
  26249. // NullFields is a list of field names (e.g. "Id") to include in API
  26250. // requests with the JSON null value. By default, fields with empty
  26251. // values are omitted from API requests. However, any field with an
  26252. // empty value appearing in NullFields will be sent to the server as
  26253. // null. It is an error if a field in this list has a non-empty value.
  26254. // This may be used to include null fields in Patch requests.
  26255. NullFields []string `json:"-"`
  26256. }
  26257. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  26258. type NoMethod TargetInstanceList
  26259. raw := NoMethod(*s)
  26260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26261. }
  26262. // TargetInstanceListWarning: [Output Only] Informational warning
  26263. // message.
  26264. type TargetInstanceListWarning struct {
  26265. // Code: [Output Only] A warning code, if applicable. For example,
  26266. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26267. // the response.
  26268. //
  26269. // Possible values:
  26270. // "CLEANUP_FAILED"
  26271. // "DEPRECATED_RESOURCE_USED"
  26272. // "DEPRECATED_TYPE_USED"
  26273. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26274. // "EXPERIMENTAL_TYPE_USED"
  26275. // "EXTERNAL_API_WARNING"
  26276. // "FIELD_VALUE_OVERRIDEN"
  26277. // "INJECTED_KERNELS_DEPRECATED"
  26278. // "MISSING_TYPE_DEPENDENCY"
  26279. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26280. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26281. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26282. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26283. // "NEXT_HOP_NOT_RUNNING"
  26284. // "NOT_CRITICAL_ERROR"
  26285. // "NO_RESULTS_ON_PAGE"
  26286. // "REQUIRED_TOS_AGREEMENT"
  26287. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26288. // "RESOURCE_NOT_DELETED"
  26289. // "SCHEMA_VALIDATION_IGNORED"
  26290. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26291. // "UNDECLARED_PROPERTIES"
  26292. // "UNREACHABLE"
  26293. Code string `json:"code,omitempty"`
  26294. // Data: [Output Only] Metadata about this warning in key: value format.
  26295. // For example:
  26296. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26297. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  26298. // Message: [Output Only] A human-readable description of the warning
  26299. // code.
  26300. Message string `json:"message,omitempty"`
  26301. // ForceSendFields is a list of field names (e.g. "Code") to
  26302. // unconditionally include in API requests. By default, fields with
  26303. // empty values are omitted from API requests. However, any non-pointer,
  26304. // non-interface field appearing in ForceSendFields will be sent to the
  26305. // server regardless of whether the field is empty or not. This may be
  26306. // used to include empty fields in Patch requests.
  26307. ForceSendFields []string `json:"-"`
  26308. // NullFields is a list of field names (e.g. "Code") to include in API
  26309. // requests with the JSON null value. By default, fields with empty
  26310. // values are omitted from API requests. However, any field with an
  26311. // empty value appearing in NullFields will be sent to the server as
  26312. // null. It is an error if a field in this list has a non-empty value.
  26313. // This may be used to include null fields in Patch requests.
  26314. NullFields []string `json:"-"`
  26315. }
  26316. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  26317. type NoMethod TargetInstanceListWarning
  26318. raw := NoMethod(*s)
  26319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26320. }
  26321. type TargetInstanceListWarningData struct {
  26322. // Key: [Output Only] A key that provides more detail on the warning
  26323. // being returned. For example, for warnings where there are no results
  26324. // in a list request for a particular zone, this key might be scope and
  26325. // the key value might be the zone name. Other examples might be a key
  26326. // indicating a deprecated resource and a suggested replacement, or a
  26327. // warning about invalid network settings (for example, if an instance
  26328. // attempts to perform IP forwarding but is not enabled for IP
  26329. // forwarding).
  26330. Key string `json:"key,omitempty"`
  26331. // Value: [Output Only] A warning data value corresponding to the key.
  26332. Value string `json:"value,omitempty"`
  26333. // ForceSendFields is a list of field names (e.g. "Key") to
  26334. // unconditionally include in API requests. By default, fields with
  26335. // empty values are omitted from API requests. However, any non-pointer,
  26336. // non-interface field appearing in ForceSendFields will be sent to the
  26337. // server regardless of whether the field is empty or not. This may be
  26338. // used to include empty fields in Patch requests.
  26339. ForceSendFields []string `json:"-"`
  26340. // NullFields is a list of field names (e.g. "Key") to include in API
  26341. // requests with the JSON null value. By default, fields with empty
  26342. // values are omitted from API requests. However, any field with an
  26343. // empty value appearing in NullFields will be sent to the server as
  26344. // null. It is an error if a field in this list has a non-empty value.
  26345. // This may be used to include null fields in Patch requests.
  26346. NullFields []string `json:"-"`
  26347. }
  26348. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  26349. type NoMethod TargetInstanceListWarningData
  26350. raw := NoMethod(*s)
  26351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26352. }
  26353. type TargetInstancesScopedList struct {
  26354. // TargetInstances: A list of target instances contained in this scope.
  26355. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  26356. // Warning: Informational warning which replaces the list of addresses
  26357. // when the list is empty.
  26358. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  26359. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  26360. // unconditionally include in API requests. By default, fields with
  26361. // empty values are omitted from API requests. However, any non-pointer,
  26362. // non-interface field appearing in ForceSendFields will be sent to the
  26363. // server regardless of whether the field is empty or not. This may be
  26364. // used to include empty fields in Patch requests.
  26365. ForceSendFields []string `json:"-"`
  26366. // NullFields is a list of field names (e.g. "TargetInstances") to
  26367. // include in API requests with the JSON null value. By default, fields
  26368. // with empty values are omitted from API requests. However, any field
  26369. // with an empty value appearing in NullFields will be sent to the
  26370. // server as null. It is an error if a field in this list has a
  26371. // non-empty value. This may be used to include null fields in Patch
  26372. // requests.
  26373. NullFields []string `json:"-"`
  26374. }
  26375. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  26376. type NoMethod TargetInstancesScopedList
  26377. raw := NoMethod(*s)
  26378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26379. }
  26380. // TargetInstancesScopedListWarning: Informational warning which
  26381. // replaces the list of addresses when the list is empty.
  26382. type TargetInstancesScopedListWarning struct {
  26383. // Code: [Output Only] A warning code, if applicable. For example,
  26384. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26385. // the response.
  26386. //
  26387. // Possible values:
  26388. // "CLEANUP_FAILED"
  26389. // "DEPRECATED_RESOURCE_USED"
  26390. // "DEPRECATED_TYPE_USED"
  26391. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26392. // "EXPERIMENTAL_TYPE_USED"
  26393. // "EXTERNAL_API_WARNING"
  26394. // "FIELD_VALUE_OVERRIDEN"
  26395. // "INJECTED_KERNELS_DEPRECATED"
  26396. // "MISSING_TYPE_DEPENDENCY"
  26397. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26398. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26399. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26400. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26401. // "NEXT_HOP_NOT_RUNNING"
  26402. // "NOT_CRITICAL_ERROR"
  26403. // "NO_RESULTS_ON_PAGE"
  26404. // "REQUIRED_TOS_AGREEMENT"
  26405. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26406. // "RESOURCE_NOT_DELETED"
  26407. // "SCHEMA_VALIDATION_IGNORED"
  26408. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26409. // "UNDECLARED_PROPERTIES"
  26410. // "UNREACHABLE"
  26411. Code string `json:"code,omitempty"`
  26412. // Data: [Output Only] Metadata about this warning in key: value format.
  26413. // For example:
  26414. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26415. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  26416. // Message: [Output Only] A human-readable description of the warning
  26417. // code.
  26418. Message string `json:"message,omitempty"`
  26419. // ForceSendFields is a list of field names (e.g. "Code") to
  26420. // unconditionally include in API requests. By default, fields with
  26421. // empty values are omitted from API requests. However, any non-pointer,
  26422. // non-interface field appearing in ForceSendFields will be sent to the
  26423. // server regardless of whether the field is empty or not. This may be
  26424. // used to include empty fields in Patch requests.
  26425. ForceSendFields []string `json:"-"`
  26426. // NullFields is a list of field names (e.g. "Code") to include in API
  26427. // requests with the JSON null value. By default, fields with empty
  26428. // values are omitted from API requests. However, any field with an
  26429. // empty value appearing in NullFields will be sent to the server as
  26430. // null. It is an error if a field in this list has a non-empty value.
  26431. // This may be used to include null fields in Patch requests.
  26432. NullFields []string `json:"-"`
  26433. }
  26434. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  26435. type NoMethod TargetInstancesScopedListWarning
  26436. raw := NoMethod(*s)
  26437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26438. }
  26439. type TargetInstancesScopedListWarningData struct {
  26440. // Key: [Output Only] A key that provides more detail on the warning
  26441. // being returned. For example, for warnings where there are no results
  26442. // in a list request for a particular zone, this key might be scope and
  26443. // the key value might be the zone name. Other examples might be a key
  26444. // indicating a deprecated resource and a suggested replacement, or a
  26445. // warning about invalid network settings (for example, if an instance
  26446. // attempts to perform IP forwarding but is not enabled for IP
  26447. // forwarding).
  26448. Key string `json:"key,omitempty"`
  26449. // Value: [Output Only] A warning data value corresponding to the key.
  26450. Value string `json:"value,omitempty"`
  26451. // ForceSendFields is a list of field names (e.g. "Key") to
  26452. // unconditionally include in API requests. By default, fields with
  26453. // empty values are omitted from API requests. However, any non-pointer,
  26454. // non-interface field appearing in ForceSendFields will be sent to the
  26455. // server regardless of whether the field is empty or not. This may be
  26456. // used to include empty fields in Patch requests.
  26457. ForceSendFields []string `json:"-"`
  26458. // NullFields is a list of field names (e.g. "Key") to include in API
  26459. // requests with the JSON null value. By default, fields with empty
  26460. // values are omitted from API requests. However, any field with an
  26461. // empty value appearing in NullFields will be sent to the server as
  26462. // null. It is an error if a field in this list has a non-empty value.
  26463. // This may be used to include null fields in Patch requests.
  26464. NullFields []string `json:"-"`
  26465. }
  26466. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  26467. type NoMethod TargetInstancesScopedListWarningData
  26468. raw := NoMethod(*s)
  26469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26470. }
  26471. // TargetPool: A TargetPool resource. This resource defines a pool of
  26472. // instances, an associated HttpHealthCheck resource, and the fallback
  26473. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  26474. // v1.targetPools ==)
  26475. type TargetPool struct {
  26476. // BackupPool: This field is applicable only when the containing target
  26477. // pool is serving a forwarding rule as the primary pool, and its
  26478. // failoverRatio field is properly set to a value between [0,
  26479. // 1].
  26480. //
  26481. // backupPool and failoverRatio together define the fallback behavior of
  26482. // the primary target pool: if the ratio of the healthy instances in the
  26483. // primary pool is at or below failoverRatio, traffic arriving at the
  26484. // load-balanced IP will be directed to the backup pool.
  26485. //
  26486. // In case where failoverRatio and backupPool are not set, or all the
  26487. // instances in the backup pool are unhealthy, the traffic will be
  26488. // directed back to the primary pool in the "force" mode, where traffic
  26489. // will be spread to the healthy instances with the best effort, or to
  26490. // all instances when no instance is healthy.
  26491. BackupPool string `json:"backupPool,omitempty"`
  26492. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26493. // format.
  26494. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26495. // Description: An optional description of this resource. Provide this
  26496. // property when you create the resource.
  26497. Description string `json:"description,omitempty"`
  26498. // FailoverRatio: This field is applicable only when the containing
  26499. // target pool is serving a forwarding rule as the primary pool (i.e.,
  26500. // not as a backup pool to some other target pool). The value of the
  26501. // field must be in [0, 1].
  26502. //
  26503. // If set, backupPool must also be set. They together define the
  26504. // fallback behavior of the primary target pool: if the ratio of the
  26505. // healthy instances in the primary pool is at or below this number,
  26506. // traffic arriving at the load-balanced IP will be directed to the
  26507. // backup pool.
  26508. //
  26509. // In case where failoverRatio is not set or all the instances in the
  26510. // backup pool are unhealthy, the traffic will be directed back to the
  26511. // primary pool in the "force" mode, where traffic will be spread to the
  26512. // healthy instances with the best effort, or to all instances when no
  26513. // instance is healthy.
  26514. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  26515. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  26516. // instance in this pool is considered healthy if and only if the health
  26517. // checks pass. An empty list means all member instances will be
  26518. // considered healthy at all times. Only HttpHealthChecks are supported.
  26519. // Only one health check may be specified.
  26520. HealthChecks []string `json:"healthChecks,omitempty"`
  26521. // Id: [Output Only] The unique identifier for the resource. This
  26522. // identifier is defined by the server.
  26523. Id uint64 `json:"id,omitempty,string"`
  26524. // Instances: A list of resource URLs to the virtual machine instances
  26525. // serving this pool. They must live in zones contained in the same
  26526. // region as this pool.
  26527. Instances []string `json:"instances,omitempty"`
  26528. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  26529. // for target pools.
  26530. Kind string `json:"kind,omitempty"`
  26531. // Name: Name of the resource. Provided by the client when the resource
  26532. // is created. The name must be 1-63 characters long, and comply with
  26533. // RFC1035. Specifically, the name must be 1-63 characters long and
  26534. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26535. // the first character must be a lowercase letter, and all following
  26536. // characters must be a dash, lowercase letter, or digit, except the
  26537. // last character, which cannot be a dash.
  26538. Name string `json:"name,omitempty"`
  26539. // Region: [Output Only] URL of the region where the target pool
  26540. // resides.
  26541. Region string `json:"region,omitempty"`
  26542. // SelfLink: [Output Only] Server-defined URL for the resource.
  26543. SelfLink string `json:"selfLink,omitempty"`
  26544. // SessionAffinity: Session affinity option, must be one of the
  26545. // following values:
  26546. // NONE: Connections from the same client IP may go to any instance in
  26547. // the pool.
  26548. // CLIENT_IP: Connections from the same client IP will go to the same
  26549. // instance in the pool while that instance remains
  26550. // healthy.
  26551. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  26552. // protocol will go to the same instance in the pool while that instance
  26553. // remains healthy.
  26554. //
  26555. // Possible values:
  26556. // "CLIENT_IP"
  26557. // "CLIENT_IP_PORT_PROTO"
  26558. // "CLIENT_IP_PROTO"
  26559. // "GENERATED_COOKIE"
  26560. // "NONE"
  26561. SessionAffinity string `json:"sessionAffinity,omitempty"`
  26562. // ServerResponse contains the HTTP response code and headers from the
  26563. // server.
  26564. googleapi.ServerResponse `json:"-"`
  26565. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  26566. // unconditionally include in API requests. By default, fields with
  26567. // empty values are omitted from API requests. However, any non-pointer,
  26568. // non-interface field appearing in ForceSendFields will be sent to the
  26569. // server regardless of whether the field is empty or not. This may be
  26570. // used to include empty fields in Patch requests.
  26571. ForceSendFields []string `json:"-"`
  26572. // NullFields is a list of field names (e.g. "BackupPool") to include in
  26573. // API requests with the JSON null value. By default, fields with empty
  26574. // values are omitted from API requests. However, any field with an
  26575. // empty value appearing in NullFields will be sent to the server as
  26576. // null. It is an error if a field in this list has a non-empty value.
  26577. // This may be used to include null fields in Patch requests.
  26578. NullFields []string `json:"-"`
  26579. }
  26580. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  26581. type NoMethod TargetPool
  26582. raw := NoMethod(*s)
  26583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26584. }
  26585. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  26586. type NoMethod TargetPool
  26587. var s1 struct {
  26588. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  26589. *NoMethod
  26590. }
  26591. s1.NoMethod = (*NoMethod)(s)
  26592. if err := json.Unmarshal(data, &s1); err != nil {
  26593. return err
  26594. }
  26595. s.FailoverRatio = float64(s1.FailoverRatio)
  26596. return nil
  26597. }
  26598. type TargetPoolAggregatedList struct {
  26599. // Id: [Output Only] Unique identifier for the resource; defined by the
  26600. // server.
  26601. Id string `json:"id,omitempty"`
  26602. // Items: A list of TargetPool resources.
  26603. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  26604. // Kind: [Output Only] Type of resource. Always
  26605. // compute#targetPoolAggregatedList for aggregated lists of target
  26606. // pools.
  26607. Kind string `json:"kind,omitempty"`
  26608. // NextPageToken: [Output Only] This token allows you to get the next
  26609. // page of results for list requests. If the number of results is larger
  26610. // than maxResults, use the nextPageToken as a value for the query
  26611. // parameter pageToken in the next list request. Subsequent list
  26612. // requests will have their own nextPageToken to continue paging through
  26613. // the results.
  26614. NextPageToken string `json:"nextPageToken,omitempty"`
  26615. // SelfLink: [Output Only] Server-defined URL for this resource.
  26616. SelfLink string `json:"selfLink,omitempty"`
  26617. // Warning: [Output Only] Informational warning message.
  26618. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  26619. // ServerResponse contains the HTTP response code and headers from the
  26620. // server.
  26621. googleapi.ServerResponse `json:"-"`
  26622. // ForceSendFields is a list of field names (e.g. "Id") to
  26623. // unconditionally include in API requests. By default, fields with
  26624. // empty values are omitted from API requests. However, any non-pointer,
  26625. // non-interface field appearing in ForceSendFields will be sent to the
  26626. // server regardless of whether the field is empty or not. This may be
  26627. // used to include empty fields in Patch requests.
  26628. ForceSendFields []string `json:"-"`
  26629. // NullFields is a list of field names (e.g. "Id") to include in API
  26630. // requests with the JSON null value. By default, fields with empty
  26631. // values are omitted from API requests. However, any field with an
  26632. // empty value appearing in NullFields will be sent to the server as
  26633. // null. It is an error if a field in this list has a non-empty value.
  26634. // This may be used to include null fields in Patch requests.
  26635. NullFields []string `json:"-"`
  26636. }
  26637. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  26638. type NoMethod TargetPoolAggregatedList
  26639. raw := NoMethod(*s)
  26640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26641. }
  26642. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  26643. // message.
  26644. type TargetPoolAggregatedListWarning struct {
  26645. // Code: [Output Only] A warning code, if applicable. For example,
  26646. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26647. // the response.
  26648. //
  26649. // Possible values:
  26650. // "CLEANUP_FAILED"
  26651. // "DEPRECATED_RESOURCE_USED"
  26652. // "DEPRECATED_TYPE_USED"
  26653. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26654. // "EXPERIMENTAL_TYPE_USED"
  26655. // "EXTERNAL_API_WARNING"
  26656. // "FIELD_VALUE_OVERRIDEN"
  26657. // "INJECTED_KERNELS_DEPRECATED"
  26658. // "MISSING_TYPE_DEPENDENCY"
  26659. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26660. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26661. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26662. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26663. // "NEXT_HOP_NOT_RUNNING"
  26664. // "NOT_CRITICAL_ERROR"
  26665. // "NO_RESULTS_ON_PAGE"
  26666. // "REQUIRED_TOS_AGREEMENT"
  26667. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26668. // "RESOURCE_NOT_DELETED"
  26669. // "SCHEMA_VALIDATION_IGNORED"
  26670. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26671. // "UNDECLARED_PROPERTIES"
  26672. // "UNREACHABLE"
  26673. Code string `json:"code,omitempty"`
  26674. // Data: [Output Only] Metadata about this warning in key: value format.
  26675. // For example:
  26676. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26677. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  26678. // Message: [Output Only] A human-readable description of the warning
  26679. // code.
  26680. Message string `json:"message,omitempty"`
  26681. // ForceSendFields is a list of field names (e.g. "Code") to
  26682. // unconditionally include in API requests. By default, fields with
  26683. // empty values are omitted from API requests. However, any non-pointer,
  26684. // non-interface field appearing in ForceSendFields will be sent to the
  26685. // server regardless of whether the field is empty or not. This may be
  26686. // used to include empty fields in Patch requests.
  26687. ForceSendFields []string `json:"-"`
  26688. // NullFields is a list of field names (e.g. "Code") to include in API
  26689. // requests with the JSON null value. By default, fields with empty
  26690. // values are omitted from API requests. However, any field with an
  26691. // empty value appearing in NullFields will be sent to the server as
  26692. // null. It is an error if a field in this list has a non-empty value.
  26693. // This may be used to include null fields in Patch requests.
  26694. NullFields []string `json:"-"`
  26695. }
  26696. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  26697. type NoMethod TargetPoolAggregatedListWarning
  26698. raw := NoMethod(*s)
  26699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26700. }
  26701. type TargetPoolAggregatedListWarningData struct {
  26702. // Key: [Output Only] A key that provides more detail on the warning
  26703. // being returned. For example, for warnings where there are no results
  26704. // in a list request for a particular zone, this key might be scope and
  26705. // the key value might be the zone name. Other examples might be a key
  26706. // indicating a deprecated resource and a suggested replacement, or a
  26707. // warning about invalid network settings (for example, if an instance
  26708. // attempts to perform IP forwarding but is not enabled for IP
  26709. // forwarding).
  26710. Key string `json:"key,omitempty"`
  26711. // Value: [Output Only] A warning data value corresponding to the key.
  26712. Value string `json:"value,omitempty"`
  26713. // ForceSendFields is a list of field names (e.g. "Key") to
  26714. // unconditionally include in API requests. By default, fields with
  26715. // empty values are omitted from API requests. However, any non-pointer,
  26716. // non-interface field appearing in ForceSendFields will be sent to the
  26717. // server regardless of whether the field is empty or not. This may be
  26718. // used to include empty fields in Patch requests.
  26719. ForceSendFields []string `json:"-"`
  26720. // NullFields is a list of field names (e.g. "Key") to include in API
  26721. // requests with the JSON null value. By default, fields with empty
  26722. // values are omitted from API requests. However, any field with an
  26723. // empty value appearing in NullFields will be sent to the server as
  26724. // null. It is an error if a field in this list has a non-empty value.
  26725. // This may be used to include null fields in Patch requests.
  26726. NullFields []string `json:"-"`
  26727. }
  26728. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  26729. type NoMethod TargetPoolAggregatedListWarningData
  26730. raw := NoMethod(*s)
  26731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26732. }
  26733. type TargetPoolInstanceHealth struct {
  26734. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  26735. // Kind: [Output Only] Type of resource. Always
  26736. // compute#targetPoolInstanceHealth when checking the health of an
  26737. // instance.
  26738. Kind string `json:"kind,omitempty"`
  26739. // ServerResponse contains the HTTP response code and headers from the
  26740. // server.
  26741. googleapi.ServerResponse `json:"-"`
  26742. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  26743. // unconditionally include in API requests. By default, fields with
  26744. // empty values are omitted from API requests. However, any non-pointer,
  26745. // non-interface field appearing in ForceSendFields will be sent to the
  26746. // server regardless of whether the field is empty or not. This may be
  26747. // used to include empty fields in Patch requests.
  26748. ForceSendFields []string `json:"-"`
  26749. // NullFields is a list of field names (e.g. "HealthStatus") to include
  26750. // in API requests with the JSON null value. By default, fields with
  26751. // empty values are omitted from API requests. However, any field with
  26752. // an empty value appearing in NullFields will be sent to the server as
  26753. // null. It is an error if a field in this list has a non-empty value.
  26754. // This may be used to include null fields in Patch requests.
  26755. NullFields []string `json:"-"`
  26756. }
  26757. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  26758. type NoMethod TargetPoolInstanceHealth
  26759. raw := NoMethod(*s)
  26760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26761. }
  26762. // TargetPoolList: Contains a list of TargetPool resources.
  26763. type TargetPoolList struct {
  26764. // Id: [Output Only] Unique identifier for the resource; defined by the
  26765. // server.
  26766. Id string `json:"id,omitempty"`
  26767. // Items: A list of TargetPool resources.
  26768. Items []*TargetPool `json:"items,omitempty"`
  26769. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  26770. // for lists of target pools.
  26771. Kind string `json:"kind,omitempty"`
  26772. // NextPageToken: [Output Only] This token allows you to get the next
  26773. // page of results for list requests. If the number of results is larger
  26774. // than maxResults, use the nextPageToken as a value for the query
  26775. // parameter pageToken in the next list request. Subsequent list
  26776. // requests will have their own nextPageToken to continue paging through
  26777. // the results.
  26778. NextPageToken string `json:"nextPageToken,omitempty"`
  26779. // SelfLink: [Output Only] Server-defined URL for this resource.
  26780. SelfLink string `json:"selfLink,omitempty"`
  26781. // Warning: [Output Only] Informational warning message.
  26782. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  26783. // ServerResponse contains the HTTP response code and headers from the
  26784. // server.
  26785. googleapi.ServerResponse `json:"-"`
  26786. // ForceSendFields is a list of field names (e.g. "Id") to
  26787. // unconditionally include in API requests. By default, fields with
  26788. // empty values are omitted from API requests. However, any non-pointer,
  26789. // non-interface field appearing in ForceSendFields will be sent to the
  26790. // server regardless of whether the field is empty or not. This may be
  26791. // used to include empty fields in Patch requests.
  26792. ForceSendFields []string `json:"-"`
  26793. // NullFields is a list of field names (e.g. "Id") to include in API
  26794. // requests with the JSON null value. By default, fields with empty
  26795. // values are omitted from API requests. However, any field with an
  26796. // empty value appearing in NullFields will be sent to the server as
  26797. // null. It is an error if a field in this list has a non-empty value.
  26798. // This may be used to include null fields in Patch requests.
  26799. NullFields []string `json:"-"`
  26800. }
  26801. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  26802. type NoMethod TargetPoolList
  26803. raw := NoMethod(*s)
  26804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26805. }
  26806. // TargetPoolListWarning: [Output Only] Informational warning message.
  26807. type TargetPoolListWarning struct {
  26808. // Code: [Output Only] A warning code, if applicable. For example,
  26809. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26810. // the response.
  26811. //
  26812. // Possible values:
  26813. // "CLEANUP_FAILED"
  26814. // "DEPRECATED_RESOURCE_USED"
  26815. // "DEPRECATED_TYPE_USED"
  26816. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26817. // "EXPERIMENTAL_TYPE_USED"
  26818. // "EXTERNAL_API_WARNING"
  26819. // "FIELD_VALUE_OVERRIDEN"
  26820. // "INJECTED_KERNELS_DEPRECATED"
  26821. // "MISSING_TYPE_DEPENDENCY"
  26822. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26823. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26824. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26825. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26826. // "NEXT_HOP_NOT_RUNNING"
  26827. // "NOT_CRITICAL_ERROR"
  26828. // "NO_RESULTS_ON_PAGE"
  26829. // "REQUIRED_TOS_AGREEMENT"
  26830. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26831. // "RESOURCE_NOT_DELETED"
  26832. // "SCHEMA_VALIDATION_IGNORED"
  26833. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26834. // "UNDECLARED_PROPERTIES"
  26835. // "UNREACHABLE"
  26836. Code string `json:"code,omitempty"`
  26837. // Data: [Output Only] Metadata about this warning in key: value format.
  26838. // For example:
  26839. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26840. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  26841. // Message: [Output Only] A human-readable description of the warning
  26842. // code.
  26843. Message string `json:"message,omitempty"`
  26844. // ForceSendFields is a list of field names (e.g. "Code") to
  26845. // unconditionally include in API requests. By default, fields with
  26846. // empty values are omitted from API requests. However, any non-pointer,
  26847. // non-interface field appearing in ForceSendFields will be sent to the
  26848. // server regardless of whether the field is empty or not. This may be
  26849. // used to include empty fields in Patch requests.
  26850. ForceSendFields []string `json:"-"`
  26851. // NullFields is a list of field names (e.g. "Code") to include in API
  26852. // requests with the JSON null value. By default, fields with empty
  26853. // values are omitted from API requests. However, any field with an
  26854. // empty value appearing in NullFields will be sent to the server as
  26855. // null. It is an error if a field in this list has a non-empty value.
  26856. // This may be used to include null fields in Patch requests.
  26857. NullFields []string `json:"-"`
  26858. }
  26859. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  26860. type NoMethod TargetPoolListWarning
  26861. raw := NoMethod(*s)
  26862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26863. }
  26864. type TargetPoolListWarningData struct {
  26865. // Key: [Output Only] A key that provides more detail on the warning
  26866. // being returned. For example, for warnings where there are no results
  26867. // in a list request for a particular zone, this key might be scope and
  26868. // the key value might be the zone name. Other examples might be a key
  26869. // indicating a deprecated resource and a suggested replacement, or a
  26870. // warning about invalid network settings (for example, if an instance
  26871. // attempts to perform IP forwarding but is not enabled for IP
  26872. // forwarding).
  26873. Key string `json:"key,omitempty"`
  26874. // Value: [Output Only] A warning data value corresponding to the key.
  26875. Value string `json:"value,omitempty"`
  26876. // ForceSendFields is a list of field names (e.g. "Key") to
  26877. // unconditionally include in API requests. By default, fields with
  26878. // empty values are omitted from API requests. However, any non-pointer,
  26879. // non-interface field appearing in ForceSendFields will be sent to the
  26880. // server regardless of whether the field is empty or not. This may be
  26881. // used to include empty fields in Patch requests.
  26882. ForceSendFields []string `json:"-"`
  26883. // NullFields is a list of field names (e.g. "Key") to include in API
  26884. // requests with the JSON null value. By default, fields with empty
  26885. // values are omitted from API requests. However, any field with an
  26886. // empty value appearing in NullFields will be sent to the server as
  26887. // null. It is an error if a field in this list has a non-empty value.
  26888. // This may be used to include null fields in Patch requests.
  26889. NullFields []string `json:"-"`
  26890. }
  26891. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  26892. type NoMethod TargetPoolListWarningData
  26893. raw := NoMethod(*s)
  26894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26895. }
  26896. type TargetPoolsAddHealthCheckRequest struct {
  26897. // HealthChecks: The HttpHealthCheck to add to the target pool.
  26898. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  26899. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  26900. // unconditionally include in API requests. By default, fields with
  26901. // empty values are omitted from API requests. However, any non-pointer,
  26902. // non-interface field appearing in ForceSendFields will be sent to the
  26903. // server regardless of whether the field is empty or not. This may be
  26904. // used to include empty fields in Patch requests.
  26905. ForceSendFields []string `json:"-"`
  26906. // NullFields is a list of field names (e.g. "HealthChecks") to include
  26907. // in API requests with the JSON null value. By default, fields with
  26908. // empty values are omitted from API requests. However, any field with
  26909. // an empty value appearing in NullFields will be sent to the server as
  26910. // null. It is an error if a field in this list has a non-empty value.
  26911. // This may be used to include null fields in Patch requests.
  26912. NullFields []string `json:"-"`
  26913. }
  26914. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  26915. type NoMethod TargetPoolsAddHealthCheckRequest
  26916. raw := NoMethod(*s)
  26917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26918. }
  26919. type TargetPoolsAddInstanceRequest struct {
  26920. // Instances: A full or partial URL to an instance to add to this target
  26921. // pool. This can be a full or partial URL. For example, the following
  26922. // are valid URLs:
  26923. // -
  26924. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  26925. // - projects/project-id/zones/zone/instances/instance-name
  26926. // - zones/zone/instances/instance-name
  26927. Instances []*InstanceReference `json:"instances,omitempty"`
  26928. // ForceSendFields is a list of field names (e.g. "Instances") to
  26929. // unconditionally include in API requests. By default, fields with
  26930. // empty values are omitted from API requests. However, any non-pointer,
  26931. // non-interface field appearing in ForceSendFields will be sent to the
  26932. // server regardless of whether the field is empty or not. This may be
  26933. // used to include empty fields in Patch requests.
  26934. ForceSendFields []string `json:"-"`
  26935. // NullFields is a list of field names (e.g. "Instances") to include in
  26936. // API requests with the JSON null value. By default, fields with empty
  26937. // values are omitted from API requests. However, any field with an
  26938. // empty value appearing in NullFields will be sent to the server as
  26939. // null. It is an error if a field in this list has a non-empty value.
  26940. // This may be used to include null fields in Patch requests.
  26941. NullFields []string `json:"-"`
  26942. }
  26943. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  26944. type NoMethod TargetPoolsAddInstanceRequest
  26945. raw := NoMethod(*s)
  26946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26947. }
  26948. type TargetPoolsRemoveHealthCheckRequest struct {
  26949. // HealthChecks: Health check URL to be removed. This can be a full or
  26950. // valid partial URL. For example, the following are valid URLs:
  26951. // -
  26952. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  26953. // - projects/project/global/httpHealthChecks/health-check
  26954. // - global/httpHealthChecks/health-check
  26955. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  26956. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  26957. // unconditionally include in API requests. By default, fields with
  26958. // empty values are omitted from API requests. However, any non-pointer,
  26959. // non-interface field appearing in ForceSendFields will be sent to the
  26960. // server regardless of whether the field is empty or not. This may be
  26961. // used to include empty fields in Patch requests.
  26962. ForceSendFields []string `json:"-"`
  26963. // NullFields is a list of field names (e.g. "HealthChecks") to include
  26964. // in API requests with the JSON null value. By default, fields with
  26965. // empty values are omitted from API requests. However, any field with
  26966. // an empty value appearing in NullFields will be sent to the server as
  26967. // null. It is an error if a field in this list has a non-empty value.
  26968. // This may be used to include null fields in Patch requests.
  26969. NullFields []string `json:"-"`
  26970. }
  26971. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  26972. type NoMethod TargetPoolsRemoveHealthCheckRequest
  26973. raw := NoMethod(*s)
  26974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26975. }
  26976. type TargetPoolsRemoveInstanceRequest struct {
  26977. // Instances: URLs of the instances to be removed from target pool.
  26978. Instances []*InstanceReference `json:"instances,omitempty"`
  26979. // ForceSendFields is a list of field names (e.g. "Instances") to
  26980. // unconditionally include in API requests. By default, fields with
  26981. // empty values are omitted from API requests. However, any non-pointer,
  26982. // non-interface field appearing in ForceSendFields will be sent to the
  26983. // server regardless of whether the field is empty or not. This may be
  26984. // used to include empty fields in Patch requests.
  26985. ForceSendFields []string `json:"-"`
  26986. // NullFields is a list of field names (e.g. "Instances") to include in
  26987. // API requests with the JSON null value. By default, fields with empty
  26988. // values are omitted from API requests. However, any field with an
  26989. // empty value appearing in NullFields will be sent to the server as
  26990. // null. It is an error if a field in this list has a non-empty value.
  26991. // This may be used to include null fields in Patch requests.
  26992. NullFields []string `json:"-"`
  26993. }
  26994. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  26995. type NoMethod TargetPoolsRemoveInstanceRequest
  26996. raw := NoMethod(*s)
  26997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26998. }
  26999. type TargetPoolsScopedList struct {
  27000. // TargetPools: A list of target pools contained in this scope.
  27001. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  27002. // Warning: Informational warning which replaces the list of addresses
  27003. // when the list is empty.
  27004. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  27005. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  27006. // unconditionally include in API requests. By default, fields with
  27007. // empty values are omitted from API requests. However, any non-pointer,
  27008. // non-interface field appearing in ForceSendFields will be sent to the
  27009. // server regardless of whether the field is empty or not. This may be
  27010. // used to include empty fields in Patch requests.
  27011. ForceSendFields []string `json:"-"`
  27012. // NullFields is a list of field names (e.g. "TargetPools") to include
  27013. // in API requests with the JSON null value. By default, fields with
  27014. // empty values are omitted from API requests. However, any field with
  27015. // an empty value appearing in NullFields will be sent to the server as
  27016. // null. It is an error if a field in this list has a non-empty value.
  27017. // This may be used to include null fields in Patch requests.
  27018. NullFields []string `json:"-"`
  27019. }
  27020. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  27021. type NoMethod TargetPoolsScopedList
  27022. raw := NoMethod(*s)
  27023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27024. }
  27025. // TargetPoolsScopedListWarning: Informational warning which replaces
  27026. // the list of addresses when the list is empty.
  27027. type TargetPoolsScopedListWarning struct {
  27028. // Code: [Output Only] A warning code, if applicable. For example,
  27029. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27030. // the response.
  27031. //
  27032. // Possible values:
  27033. // "CLEANUP_FAILED"
  27034. // "DEPRECATED_RESOURCE_USED"
  27035. // "DEPRECATED_TYPE_USED"
  27036. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27037. // "EXPERIMENTAL_TYPE_USED"
  27038. // "EXTERNAL_API_WARNING"
  27039. // "FIELD_VALUE_OVERRIDEN"
  27040. // "INJECTED_KERNELS_DEPRECATED"
  27041. // "MISSING_TYPE_DEPENDENCY"
  27042. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27043. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27044. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27045. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27046. // "NEXT_HOP_NOT_RUNNING"
  27047. // "NOT_CRITICAL_ERROR"
  27048. // "NO_RESULTS_ON_PAGE"
  27049. // "REQUIRED_TOS_AGREEMENT"
  27050. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27051. // "RESOURCE_NOT_DELETED"
  27052. // "SCHEMA_VALIDATION_IGNORED"
  27053. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27054. // "UNDECLARED_PROPERTIES"
  27055. // "UNREACHABLE"
  27056. Code string `json:"code,omitempty"`
  27057. // Data: [Output Only] Metadata about this warning in key: value format.
  27058. // For example:
  27059. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27060. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  27061. // Message: [Output Only] A human-readable description of the warning
  27062. // code.
  27063. Message string `json:"message,omitempty"`
  27064. // ForceSendFields is a list of field names (e.g. "Code") to
  27065. // unconditionally include in API requests. By default, fields with
  27066. // empty values are omitted from API requests. However, any non-pointer,
  27067. // non-interface field appearing in ForceSendFields will be sent to the
  27068. // server regardless of whether the field is empty or not. This may be
  27069. // used to include empty fields in Patch requests.
  27070. ForceSendFields []string `json:"-"`
  27071. // NullFields is a list of field names (e.g. "Code") to include in API
  27072. // requests with the JSON null value. By default, fields with empty
  27073. // values are omitted from API requests. However, any field with an
  27074. // empty value appearing in NullFields will be sent to the server as
  27075. // null. It is an error if a field in this list has a non-empty value.
  27076. // This may be used to include null fields in Patch requests.
  27077. NullFields []string `json:"-"`
  27078. }
  27079. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  27080. type NoMethod TargetPoolsScopedListWarning
  27081. raw := NoMethod(*s)
  27082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27083. }
  27084. type TargetPoolsScopedListWarningData struct {
  27085. // Key: [Output Only] A key that provides more detail on the warning
  27086. // being returned. For example, for warnings where there are no results
  27087. // in a list request for a particular zone, this key might be scope and
  27088. // the key value might be the zone name. Other examples might be a key
  27089. // indicating a deprecated resource and a suggested replacement, or a
  27090. // warning about invalid network settings (for example, if an instance
  27091. // attempts to perform IP forwarding but is not enabled for IP
  27092. // forwarding).
  27093. Key string `json:"key,omitempty"`
  27094. // Value: [Output Only] A warning data value corresponding to the key.
  27095. Value string `json:"value,omitempty"`
  27096. // ForceSendFields is a list of field names (e.g. "Key") to
  27097. // unconditionally include in API requests. By default, fields with
  27098. // empty values are omitted from API requests. However, any non-pointer,
  27099. // non-interface field appearing in ForceSendFields will be sent to the
  27100. // server regardless of whether the field is empty or not. This may be
  27101. // used to include empty fields in Patch requests.
  27102. ForceSendFields []string `json:"-"`
  27103. // NullFields is a list of field names (e.g. "Key") to include in API
  27104. // requests with the JSON null value. By default, fields with empty
  27105. // values are omitted from API requests. However, any field with an
  27106. // empty value appearing in NullFields will be sent to the server as
  27107. // null. It is an error if a field in this list has a non-empty value.
  27108. // This may be used to include null fields in Patch requests.
  27109. NullFields []string `json:"-"`
  27110. }
  27111. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  27112. type NoMethod TargetPoolsScopedListWarningData
  27113. raw := NoMethod(*s)
  27114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27115. }
  27116. type TargetReference struct {
  27117. Target string `json:"target,omitempty"`
  27118. // ForceSendFields is a list of field names (e.g. "Target") to
  27119. // unconditionally include in API requests. By default, fields with
  27120. // empty values are omitted from API requests. However, any non-pointer,
  27121. // non-interface field appearing in ForceSendFields will be sent to the
  27122. // server regardless of whether the field is empty or not. This may be
  27123. // used to include empty fields in Patch requests.
  27124. ForceSendFields []string `json:"-"`
  27125. // NullFields is a list of field names (e.g. "Target") to include in API
  27126. // requests with the JSON null value. By default, fields with empty
  27127. // values are omitted from API requests. However, any field with an
  27128. // empty value appearing in NullFields will be sent to the server as
  27129. // null. It is an error if a field in this list has a non-empty value.
  27130. // This may be used to include null fields in Patch requests.
  27131. NullFields []string `json:"-"`
  27132. }
  27133. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  27134. type NoMethod TargetReference
  27135. raw := NoMethod(*s)
  27136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27137. }
  27138. type TargetSslProxiesSetBackendServiceRequest struct {
  27139. // Service: The URL of the new BackendService resource for the
  27140. // targetSslProxy.
  27141. Service string `json:"service,omitempty"`
  27142. // ForceSendFields is a list of field names (e.g. "Service") to
  27143. // unconditionally include in API requests. By default, fields with
  27144. // empty values are omitted from API requests. However, any non-pointer,
  27145. // non-interface field appearing in ForceSendFields will be sent to the
  27146. // server regardless of whether the field is empty or not. This may be
  27147. // used to include empty fields in Patch requests.
  27148. ForceSendFields []string `json:"-"`
  27149. // NullFields is a list of field names (e.g. "Service") to include in
  27150. // API requests with the JSON null value. By default, fields with empty
  27151. // values are omitted from API requests. However, any field with an
  27152. // empty value appearing in NullFields will be sent to the server as
  27153. // null. It is an error if a field in this list has a non-empty value.
  27154. // This may be used to include null fields in Patch requests.
  27155. NullFields []string `json:"-"`
  27156. }
  27157. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  27158. type NoMethod TargetSslProxiesSetBackendServiceRequest
  27159. raw := NoMethod(*s)
  27160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27161. }
  27162. type TargetSslProxiesSetProxyHeaderRequest struct {
  27163. // ProxyHeader: The new type of proxy header to append before sending
  27164. // data to the backend. NONE or PROXY_V1 are allowed.
  27165. //
  27166. // Possible values:
  27167. // "NONE"
  27168. // "PROXY_V1"
  27169. ProxyHeader string `json:"proxyHeader,omitempty"`
  27170. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  27171. // unconditionally include in API requests. By default, fields with
  27172. // empty values are omitted from API requests. However, any non-pointer,
  27173. // non-interface field appearing in ForceSendFields will be sent to the
  27174. // server regardless of whether the field is empty or not. This may be
  27175. // used to include empty fields in Patch requests.
  27176. ForceSendFields []string `json:"-"`
  27177. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  27178. // in API requests with the JSON null value. By default, fields with
  27179. // empty values are omitted from API requests. However, any field with
  27180. // an empty value appearing in NullFields will be sent to the server as
  27181. // null. It is an error if a field in this list has a non-empty value.
  27182. // This may be used to include null fields in Patch requests.
  27183. NullFields []string `json:"-"`
  27184. }
  27185. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  27186. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  27187. raw := NoMethod(*s)
  27188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27189. }
  27190. type TargetSslProxiesSetSslCertificatesRequest struct {
  27191. // SslCertificates: New set of URLs to SslCertificate resources to
  27192. // associate with this TargetSslProxy. Currently exactly one ssl
  27193. // certificate must be specified.
  27194. SslCertificates []string `json:"sslCertificates,omitempty"`
  27195. // ForceSendFields is a list of field names (e.g. "SslCertificates") 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. "SslCertificates") to
  27203. // include in API requests with the JSON null value. By default, fields
  27204. // with empty values are omitted from API requests. However, any field
  27205. // with an empty value appearing in NullFields will be sent to the
  27206. // server as null. It is an error if a field in this list has a
  27207. // non-empty value. This may be used to include null fields in Patch
  27208. // requests.
  27209. NullFields []string `json:"-"`
  27210. }
  27211. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  27212. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  27213. raw := NoMethod(*s)
  27214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27215. }
  27216. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  27217. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  27218. // resource_for v1.targetSslProxies ==)
  27219. type TargetSslProxy struct {
  27220. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  27221. // format.
  27222. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  27223. // Description: An optional description of this resource. Provide this
  27224. // property when you create the resource.
  27225. Description string `json:"description,omitempty"`
  27226. // Id: [Output Only] The unique identifier for the resource. This
  27227. // identifier is defined by the server.
  27228. Id uint64 `json:"id,omitempty,string"`
  27229. // Kind: [Output Only] Type of the resource. Always
  27230. // compute#targetSslProxy for target SSL proxies.
  27231. Kind string `json:"kind,omitempty"`
  27232. // Name: Name of the resource. Provided by the client when the resource
  27233. // is created. The name must be 1-63 characters long, and comply with
  27234. // RFC1035. Specifically, the name must be 1-63 characters long and
  27235. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  27236. // the first character must be a lowercase letter, and all following
  27237. // characters must be a dash, lowercase letter, or digit, except the
  27238. // last character, which cannot be a dash.
  27239. Name string `json:"name,omitempty"`
  27240. // ProxyHeader: Specifies the type of proxy header to append before
  27241. // sending data to the backend, either NONE or PROXY_V1. The default is
  27242. // NONE.
  27243. //
  27244. // Possible values:
  27245. // "NONE"
  27246. // "PROXY_V1"
  27247. ProxyHeader string `json:"proxyHeader,omitempty"`
  27248. // SelfLink: [Output Only] Server-defined URL for the resource.
  27249. SelfLink string `json:"selfLink,omitempty"`
  27250. // Service: URL to the BackendService resource.
  27251. Service string `json:"service,omitempty"`
  27252. // SslCertificates: URLs to SslCertificate resources that are used to
  27253. // authenticate connections to Backends. At least one SSL certificate
  27254. // must be specified. Currently, you may specify up to 15 SSL
  27255. // certificates.
  27256. SslCertificates []string `json:"sslCertificates,omitempty"`
  27257. // SslPolicy: URL of SslPolicy resource that will be associated with the
  27258. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  27259. // not have any SSL policy configured.
  27260. SslPolicy string `json:"sslPolicy,omitempty"`
  27261. // ServerResponse contains the HTTP response code and headers from the
  27262. // server.
  27263. googleapi.ServerResponse `json:"-"`
  27264. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  27265. // to unconditionally include in API requests. By default, fields with
  27266. // empty values are omitted from API requests. However, any non-pointer,
  27267. // non-interface field appearing in ForceSendFields will be sent to the
  27268. // server regardless of whether the field is empty or not. This may be
  27269. // used to include empty fields in Patch requests.
  27270. ForceSendFields []string `json:"-"`
  27271. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  27272. // include in API requests with the JSON null value. By default, fields
  27273. // with empty values are omitted from API requests. However, any field
  27274. // with an empty value appearing in NullFields will be sent to the
  27275. // server as null. It is an error if a field in this list has a
  27276. // non-empty value. This may be used to include null fields in Patch
  27277. // requests.
  27278. NullFields []string `json:"-"`
  27279. }
  27280. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  27281. type NoMethod TargetSslProxy
  27282. raw := NoMethod(*s)
  27283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27284. }
  27285. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  27286. type TargetSslProxyList struct {
  27287. // Id: [Output Only] Unique identifier for the resource; defined by the
  27288. // server.
  27289. Id string `json:"id,omitempty"`
  27290. // Items: A list of TargetSslProxy resources.
  27291. Items []*TargetSslProxy `json:"items,omitempty"`
  27292. // Kind: Type of resource.
  27293. Kind string `json:"kind,omitempty"`
  27294. // NextPageToken: [Output Only] This token allows you to get the next
  27295. // page of results for list requests. If the number of results is larger
  27296. // than maxResults, use the nextPageToken as a value for the query
  27297. // parameter pageToken in the next list request. Subsequent list
  27298. // requests will have their own nextPageToken to continue paging through
  27299. // the results.
  27300. NextPageToken string `json:"nextPageToken,omitempty"`
  27301. // SelfLink: [Output Only] Server-defined URL for this resource.
  27302. SelfLink string `json:"selfLink,omitempty"`
  27303. // Warning: [Output Only] Informational warning message.
  27304. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  27305. // ServerResponse contains the HTTP response code and headers from the
  27306. // server.
  27307. googleapi.ServerResponse `json:"-"`
  27308. // ForceSendFields is a list of field names (e.g. "Id") to
  27309. // unconditionally include in API requests. By default, fields with
  27310. // empty values are omitted from API requests. However, any non-pointer,
  27311. // non-interface field appearing in ForceSendFields will be sent to the
  27312. // server regardless of whether the field is empty or not. This may be
  27313. // used to include empty fields in Patch requests.
  27314. ForceSendFields []string `json:"-"`
  27315. // NullFields is a list of field names (e.g. "Id") to include in API
  27316. // requests with the JSON null value. By default, fields with empty
  27317. // values are omitted from API requests. However, any field with an
  27318. // empty value appearing in NullFields will be sent to the server as
  27319. // null. It is an error if a field in this list has a non-empty value.
  27320. // This may be used to include null fields in Patch requests.
  27321. NullFields []string `json:"-"`
  27322. }
  27323. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  27324. type NoMethod TargetSslProxyList
  27325. raw := NoMethod(*s)
  27326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27327. }
  27328. // TargetSslProxyListWarning: [Output Only] Informational warning
  27329. // message.
  27330. type TargetSslProxyListWarning struct {
  27331. // Code: [Output Only] A warning code, if applicable. For example,
  27332. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27333. // the response.
  27334. //
  27335. // Possible values:
  27336. // "CLEANUP_FAILED"
  27337. // "DEPRECATED_RESOURCE_USED"
  27338. // "DEPRECATED_TYPE_USED"
  27339. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27340. // "EXPERIMENTAL_TYPE_USED"
  27341. // "EXTERNAL_API_WARNING"
  27342. // "FIELD_VALUE_OVERRIDEN"
  27343. // "INJECTED_KERNELS_DEPRECATED"
  27344. // "MISSING_TYPE_DEPENDENCY"
  27345. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27346. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27347. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27348. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27349. // "NEXT_HOP_NOT_RUNNING"
  27350. // "NOT_CRITICAL_ERROR"
  27351. // "NO_RESULTS_ON_PAGE"
  27352. // "REQUIRED_TOS_AGREEMENT"
  27353. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27354. // "RESOURCE_NOT_DELETED"
  27355. // "SCHEMA_VALIDATION_IGNORED"
  27356. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27357. // "UNDECLARED_PROPERTIES"
  27358. // "UNREACHABLE"
  27359. Code string `json:"code,omitempty"`
  27360. // Data: [Output Only] Metadata about this warning in key: value format.
  27361. // For example:
  27362. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27363. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  27364. // Message: [Output Only] A human-readable description of the warning
  27365. // code.
  27366. Message string `json:"message,omitempty"`
  27367. // ForceSendFields is a list of field names (e.g. "Code") to
  27368. // unconditionally include in API requests. By default, fields with
  27369. // empty values are omitted from API requests. However, any non-pointer,
  27370. // non-interface field appearing in ForceSendFields will be sent to the
  27371. // server regardless of whether the field is empty or not. This may be
  27372. // used to include empty fields in Patch requests.
  27373. ForceSendFields []string `json:"-"`
  27374. // NullFields is a list of field names (e.g. "Code") to include in API
  27375. // requests with the JSON null value. By default, fields with empty
  27376. // values are omitted from API requests. However, any field with an
  27377. // empty value appearing in NullFields will be sent to the server as
  27378. // null. It is an error if a field in this list has a non-empty value.
  27379. // This may be used to include null fields in Patch requests.
  27380. NullFields []string `json:"-"`
  27381. }
  27382. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  27383. type NoMethod TargetSslProxyListWarning
  27384. raw := NoMethod(*s)
  27385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27386. }
  27387. type TargetSslProxyListWarningData struct {
  27388. // Key: [Output Only] A key that provides more detail on the warning
  27389. // being returned. For example, for warnings where there are no results
  27390. // in a list request for a particular zone, this key might be scope and
  27391. // the key value might be the zone name. Other examples might be a key
  27392. // indicating a deprecated resource and a suggested replacement, or a
  27393. // warning about invalid network settings (for example, if an instance
  27394. // attempts to perform IP forwarding but is not enabled for IP
  27395. // forwarding).
  27396. Key string `json:"key,omitempty"`
  27397. // Value: [Output Only] A warning data value corresponding to the key.
  27398. Value string `json:"value,omitempty"`
  27399. // ForceSendFields is a list of field names (e.g. "Key") to
  27400. // unconditionally include in API requests. By default, fields with
  27401. // empty values are omitted from API requests. However, any non-pointer,
  27402. // non-interface field appearing in ForceSendFields will be sent to the
  27403. // server regardless of whether the field is empty or not. This may be
  27404. // used to include empty fields in Patch requests.
  27405. ForceSendFields []string `json:"-"`
  27406. // NullFields is a list of field names (e.g. "Key") to include in API
  27407. // requests with the JSON null value. By default, fields with empty
  27408. // values are omitted from API requests. However, any field with an
  27409. // empty value appearing in NullFields will be sent to the server as
  27410. // null. It is an error if a field in this list has a non-empty value.
  27411. // This may be used to include null fields in Patch requests.
  27412. NullFields []string `json:"-"`
  27413. }
  27414. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  27415. type NoMethod TargetSslProxyListWarningData
  27416. raw := NoMethod(*s)
  27417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27418. }
  27419. type TargetTcpProxiesSetBackendServiceRequest struct {
  27420. // Service: The URL of the new BackendService resource for the
  27421. // targetTcpProxy.
  27422. Service string `json:"service,omitempty"`
  27423. // ForceSendFields is a list of field names (e.g. "Service") to
  27424. // unconditionally include in API requests. By default, fields with
  27425. // empty values are omitted from API requests. However, any non-pointer,
  27426. // non-interface field appearing in ForceSendFields will be sent to the
  27427. // server regardless of whether the field is empty or not. This may be
  27428. // used to include empty fields in Patch requests.
  27429. ForceSendFields []string `json:"-"`
  27430. // NullFields is a list of field names (e.g. "Service") to include in
  27431. // API requests with the JSON null value. By default, fields with empty
  27432. // values are omitted from API requests. However, any field with an
  27433. // empty value appearing in NullFields will be sent to the server as
  27434. // null. It is an error if a field in this list has a non-empty value.
  27435. // This may be used to include null fields in Patch requests.
  27436. NullFields []string `json:"-"`
  27437. }
  27438. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  27439. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  27440. raw := NoMethod(*s)
  27441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27442. }
  27443. type TargetTcpProxiesSetProxyHeaderRequest struct {
  27444. // ProxyHeader: The new type of proxy header to append before sending
  27445. // data to the backend. NONE or PROXY_V1 are allowed.
  27446. //
  27447. // Possible values:
  27448. // "NONE"
  27449. // "PROXY_V1"
  27450. ProxyHeader string `json:"proxyHeader,omitempty"`
  27451. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  27452. // unconditionally include in API requests. By default, fields with
  27453. // empty values are omitted from API requests. However, any non-pointer,
  27454. // non-interface field appearing in ForceSendFields will be sent to the
  27455. // server regardless of whether the field is empty or not. This may be
  27456. // used to include empty fields in Patch requests.
  27457. ForceSendFields []string `json:"-"`
  27458. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  27459. // in API requests with the JSON null value. By default, fields with
  27460. // empty values are omitted from API requests. However, any field with
  27461. // an empty value appearing in NullFields will be sent to the server as
  27462. // null. It is an error if a field in this list has a non-empty value.
  27463. // This may be used to include null fields in Patch requests.
  27464. NullFields []string `json:"-"`
  27465. }
  27466. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  27467. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  27468. raw := NoMethod(*s)
  27469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27470. }
  27471. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  27472. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  27473. // resource_for v1.targetTcpProxies ==)
  27474. type TargetTcpProxy struct {
  27475. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  27476. // format.
  27477. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  27478. // Description: An optional description of this resource. Provide this
  27479. // property when you create the resource.
  27480. Description string `json:"description,omitempty"`
  27481. // Id: [Output Only] The unique identifier for the resource. This
  27482. // identifier is defined by the server.
  27483. Id uint64 `json:"id,omitempty,string"`
  27484. // Kind: [Output Only] Type of the resource. Always
  27485. // compute#targetTcpProxy for target TCP proxies.
  27486. Kind string `json:"kind,omitempty"`
  27487. // Name: Name of the resource. Provided by the client when the resource
  27488. // is created. The name must be 1-63 characters long, and comply with
  27489. // RFC1035. Specifically, the name must be 1-63 characters long and
  27490. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  27491. // the first character must be a lowercase letter, and all following
  27492. // characters must be a dash, lowercase letter, or digit, except the
  27493. // last character, which cannot be a dash.
  27494. Name string `json:"name,omitempty"`
  27495. // ProxyHeader: Specifies the type of proxy header to append before
  27496. // sending data to the backend, either NONE or PROXY_V1. The default is
  27497. // NONE.
  27498. //
  27499. // Possible values:
  27500. // "NONE"
  27501. // "PROXY_V1"
  27502. ProxyHeader string `json:"proxyHeader,omitempty"`
  27503. // SelfLink: [Output Only] Server-defined URL for the resource.
  27504. SelfLink string `json:"selfLink,omitempty"`
  27505. // Service: URL to the BackendService resource.
  27506. Service string `json:"service,omitempty"`
  27507. // ServerResponse contains the HTTP response code and headers from the
  27508. // server.
  27509. googleapi.ServerResponse `json:"-"`
  27510. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  27511. // to unconditionally include in API requests. By default, fields with
  27512. // empty values are omitted from API requests. However, any non-pointer,
  27513. // non-interface field appearing in ForceSendFields will be sent to the
  27514. // server regardless of whether the field is empty or not. This may be
  27515. // used to include empty fields in Patch requests.
  27516. ForceSendFields []string `json:"-"`
  27517. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  27518. // include in API requests with the JSON null value. By default, fields
  27519. // with empty values are omitted from API requests. However, any field
  27520. // with an empty value appearing in NullFields will be sent to the
  27521. // server as null. It is an error if a field in this list has a
  27522. // non-empty value. This may be used to include null fields in Patch
  27523. // requests.
  27524. NullFields []string `json:"-"`
  27525. }
  27526. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  27527. type NoMethod TargetTcpProxy
  27528. raw := NoMethod(*s)
  27529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27530. }
  27531. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  27532. type TargetTcpProxyList struct {
  27533. // Id: [Output Only] Unique identifier for the resource; defined by the
  27534. // server.
  27535. Id string `json:"id,omitempty"`
  27536. // Items: A list of TargetTcpProxy resources.
  27537. Items []*TargetTcpProxy `json:"items,omitempty"`
  27538. // Kind: Type of resource.
  27539. Kind string `json:"kind,omitempty"`
  27540. // NextPageToken: [Output Only] This token allows you to get the next
  27541. // page of results for list requests. If the number of results is larger
  27542. // than maxResults, use the nextPageToken as a value for the query
  27543. // parameter pageToken in the next list request. Subsequent list
  27544. // requests will have their own nextPageToken to continue paging through
  27545. // the results.
  27546. NextPageToken string `json:"nextPageToken,omitempty"`
  27547. // SelfLink: [Output Only] Server-defined URL for this resource.
  27548. SelfLink string `json:"selfLink,omitempty"`
  27549. // Warning: [Output Only] Informational warning message.
  27550. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  27551. // ServerResponse contains the HTTP response code and headers from the
  27552. // server.
  27553. googleapi.ServerResponse `json:"-"`
  27554. // ForceSendFields is a list of field names (e.g. "Id") to
  27555. // unconditionally include in API requests. By default, fields with
  27556. // empty values are omitted from API requests. However, any non-pointer,
  27557. // non-interface field appearing in ForceSendFields will be sent to the
  27558. // server regardless of whether the field is empty or not. This may be
  27559. // used to include empty fields in Patch requests.
  27560. ForceSendFields []string `json:"-"`
  27561. // NullFields is a list of field names (e.g. "Id") to include in API
  27562. // requests with the JSON null value. By default, fields with empty
  27563. // values are omitted from API requests. However, any field with an
  27564. // empty value appearing in NullFields will be sent to the server as
  27565. // null. It is an error if a field in this list has a non-empty value.
  27566. // This may be used to include null fields in Patch requests.
  27567. NullFields []string `json:"-"`
  27568. }
  27569. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  27570. type NoMethod TargetTcpProxyList
  27571. raw := NoMethod(*s)
  27572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27573. }
  27574. // TargetTcpProxyListWarning: [Output Only] Informational warning
  27575. // message.
  27576. type TargetTcpProxyListWarning struct {
  27577. // Code: [Output Only] A warning code, if applicable. For example,
  27578. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27579. // the response.
  27580. //
  27581. // Possible values:
  27582. // "CLEANUP_FAILED"
  27583. // "DEPRECATED_RESOURCE_USED"
  27584. // "DEPRECATED_TYPE_USED"
  27585. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27586. // "EXPERIMENTAL_TYPE_USED"
  27587. // "EXTERNAL_API_WARNING"
  27588. // "FIELD_VALUE_OVERRIDEN"
  27589. // "INJECTED_KERNELS_DEPRECATED"
  27590. // "MISSING_TYPE_DEPENDENCY"
  27591. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27592. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27593. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27594. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27595. // "NEXT_HOP_NOT_RUNNING"
  27596. // "NOT_CRITICAL_ERROR"
  27597. // "NO_RESULTS_ON_PAGE"
  27598. // "REQUIRED_TOS_AGREEMENT"
  27599. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27600. // "RESOURCE_NOT_DELETED"
  27601. // "SCHEMA_VALIDATION_IGNORED"
  27602. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27603. // "UNDECLARED_PROPERTIES"
  27604. // "UNREACHABLE"
  27605. Code string `json:"code,omitempty"`
  27606. // Data: [Output Only] Metadata about this warning in key: value format.
  27607. // For example:
  27608. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27609. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  27610. // Message: [Output Only] A human-readable description of the warning
  27611. // code.
  27612. Message string `json:"message,omitempty"`
  27613. // ForceSendFields is a list of field names (e.g. "Code") to
  27614. // unconditionally include in API requests. By default, fields with
  27615. // empty values are omitted from API requests. However, any non-pointer,
  27616. // non-interface field appearing in ForceSendFields will be sent to the
  27617. // server regardless of whether the field is empty or not. This may be
  27618. // used to include empty fields in Patch requests.
  27619. ForceSendFields []string `json:"-"`
  27620. // NullFields is a list of field names (e.g. "Code") to include in API
  27621. // requests with the JSON null value. By default, fields with empty
  27622. // values are omitted from API requests. However, any field with an
  27623. // empty value appearing in NullFields will be sent to the server as
  27624. // null. It is an error if a field in this list has a non-empty value.
  27625. // This may be used to include null fields in Patch requests.
  27626. NullFields []string `json:"-"`
  27627. }
  27628. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  27629. type NoMethod TargetTcpProxyListWarning
  27630. raw := NoMethod(*s)
  27631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27632. }
  27633. type TargetTcpProxyListWarningData struct {
  27634. // Key: [Output Only] A key that provides more detail on the warning
  27635. // being returned. For example, for warnings where there are no results
  27636. // in a list request for a particular zone, this key might be scope and
  27637. // the key value might be the zone name. Other examples might be a key
  27638. // indicating a deprecated resource and a suggested replacement, or a
  27639. // warning about invalid network settings (for example, if an instance
  27640. // attempts to perform IP forwarding but is not enabled for IP
  27641. // forwarding).
  27642. Key string `json:"key,omitempty"`
  27643. // Value: [Output Only] A warning data value corresponding to the key.
  27644. Value string `json:"value,omitempty"`
  27645. // ForceSendFields is a list of field names (e.g. "Key") to
  27646. // unconditionally include in API requests. By default, fields with
  27647. // empty values are omitted from API requests. However, any non-pointer,
  27648. // non-interface field appearing in ForceSendFields will be sent to the
  27649. // server regardless of whether the field is empty or not. This may be
  27650. // used to include empty fields in Patch requests.
  27651. ForceSendFields []string `json:"-"`
  27652. // NullFields is a list of field names (e.g. "Key") to include in API
  27653. // requests with the JSON null value. By default, fields with empty
  27654. // values are omitted from API requests. However, any field with an
  27655. // empty value appearing in NullFields will be sent to the server as
  27656. // null. It is an error if a field in this list has a non-empty value.
  27657. // This may be used to include null fields in Patch requests.
  27658. NullFields []string `json:"-"`
  27659. }
  27660. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  27661. type NoMethod TargetTcpProxyListWarningData
  27662. raw := NoMethod(*s)
  27663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27664. }
  27665. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  27666. // resource_for beta.targetVpnGateways ==) (== resource_for
  27667. // v1.targetVpnGateways ==)
  27668. type TargetVpnGateway struct {
  27669. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  27670. // format.
  27671. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  27672. // Description: An optional description of this resource. Provide this
  27673. // property when you create the resource.
  27674. Description string `json:"description,omitempty"`
  27675. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  27676. // resources. ForwardingRules are created using
  27677. // compute.forwardingRules.insert and associated with a VPN gateway.
  27678. ForwardingRules []string `json:"forwardingRules,omitempty"`
  27679. // Id: [Output Only] The unique identifier for the resource. This
  27680. // identifier is defined by the server.
  27681. Id uint64 `json:"id,omitempty,string"`
  27682. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  27683. // for target VPN gateways.
  27684. Kind string `json:"kind,omitempty"`
  27685. // LabelFingerprint: A fingerprint for the labels being applied to this
  27686. // TargetVpnGateway, which is essentially a hash of the labels set used
  27687. // for optimistic locking. The fingerprint is initially generated by
  27688. // Compute Engine and changes after every request to modify or update
  27689. // labels. You must always provide an up-to-date fingerprint hash in
  27690. // order to update or change labels, otherwise the request will fail
  27691. // with error 412 conditionNotMet.
  27692. //
  27693. // To see the latest fingerprint, make a get() request to retrieve a
  27694. // TargetVpnGateway.
  27695. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  27696. // Labels: Labels to apply to this TargetVpnGateway resource. These can
  27697. // be later modified by the setLabels method. Each label key/value must
  27698. // comply with RFC1035. Label values may be empty.
  27699. Labels map[string]string `json:"labels,omitempty"`
  27700. // Name: Name of the resource. Provided by the client when the resource
  27701. // is created. The name must be 1-63 characters long, and comply with
  27702. // RFC1035. Specifically, the name must be 1-63 characters long and
  27703. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  27704. // the first character must be a lowercase letter, and all following
  27705. // characters must be a dash, lowercase letter, or digit, except the
  27706. // last character, which cannot be a dash.
  27707. Name string `json:"name,omitempty"`
  27708. // Network: URL of the network to which this VPN gateway is attached.
  27709. // Provided by the client when the VPN gateway is created.
  27710. Network string `json:"network,omitempty"`
  27711. // Region: [Output Only] URL of the region where the target VPN gateway
  27712. // resides. You must specify this field as part of the HTTP request URL.
  27713. // It is not settable as a field in the request body.
  27714. Region string `json:"region,omitempty"`
  27715. // SelfLink: [Output Only] Server-defined URL for the resource.
  27716. SelfLink string `json:"selfLink,omitempty"`
  27717. // Status: [Output Only] The status of the VPN gateway, which can be one
  27718. // of the following: CREATING, READY, FAILED, or DELETING.
  27719. //
  27720. // Possible values:
  27721. // "CREATING"
  27722. // "DELETING"
  27723. // "FAILED"
  27724. // "READY"
  27725. Status string `json:"status,omitempty"`
  27726. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  27727. // VpnTunnels are created using the compute.vpntunnels.insert method and
  27728. // associated with a VPN gateway.
  27729. Tunnels []string `json:"tunnels,omitempty"`
  27730. // ServerResponse contains the HTTP response code and headers from the
  27731. // server.
  27732. googleapi.ServerResponse `json:"-"`
  27733. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  27734. // to unconditionally include in API requests. By default, fields with
  27735. // empty values are omitted from API requests. However, any non-pointer,
  27736. // non-interface field appearing in ForceSendFields will be sent to the
  27737. // server regardless of whether the field is empty or not. This may be
  27738. // used to include empty fields in Patch requests.
  27739. ForceSendFields []string `json:"-"`
  27740. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  27741. // include in API requests with the JSON null value. By default, fields
  27742. // with empty values are omitted from API requests. However, any field
  27743. // with an empty value appearing in NullFields will be sent to the
  27744. // server as null. It is an error if a field in this list has a
  27745. // non-empty value. This may be used to include null fields in Patch
  27746. // requests.
  27747. NullFields []string `json:"-"`
  27748. }
  27749. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  27750. type NoMethod TargetVpnGateway
  27751. raw := NoMethod(*s)
  27752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27753. }
  27754. type TargetVpnGatewayAggregatedList struct {
  27755. // Id: [Output Only] Unique identifier for the resource; defined by the
  27756. // server.
  27757. Id string `json:"id,omitempty"`
  27758. // Items: A list of TargetVpnGateway resources.
  27759. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  27760. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  27761. // for target VPN gateways.
  27762. Kind string `json:"kind,omitempty"`
  27763. // NextPageToken: [Output Only] This token allows you to get the next
  27764. // page of results for list requests. If the number of results is larger
  27765. // than maxResults, use the nextPageToken as a value for the query
  27766. // parameter pageToken in the next list request. Subsequent list
  27767. // requests will have their own nextPageToken to continue paging through
  27768. // the results.
  27769. NextPageToken string `json:"nextPageToken,omitempty"`
  27770. // SelfLink: [Output Only] Server-defined URL for this resource.
  27771. SelfLink string `json:"selfLink,omitempty"`
  27772. // Warning: [Output Only] Informational warning message.
  27773. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  27774. // ServerResponse contains the HTTP response code and headers from the
  27775. // server.
  27776. googleapi.ServerResponse `json:"-"`
  27777. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") 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 *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  27793. type NoMethod TargetVpnGatewayAggregatedList
  27794. raw := NoMethod(*s)
  27795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27796. }
  27797. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  27798. // warning message.
  27799. type TargetVpnGatewayAggregatedListWarning struct {
  27800. // Code: [Output Only] A warning code, if applicable. For example,
  27801. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27802. // the response.
  27803. //
  27804. // Possible values:
  27805. // "CLEANUP_FAILED"
  27806. // "DEPRECATED_RESOURCE_USED"
  27807. // "DEPRECATED_TYPE_USED"
  27808. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27809. // "EXPERIMENTAL_TYPE_USED"
  27810. // "EXTERNAL_API_WARNING"
  27811. // "FIELD_VALUE_OVERRIDEN"
  27812. // "INJECTED_KERNELS_DEPRECATED"
  27813. // "MISSING_TYPE_DEPENDENCY"
  27814. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27815. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27816. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27817. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27818. // "NEXT_HOP_NOT_RUNNING"
  27819. // "NOT_CRITICAL_ERROR"
  27820. // "NO_RESULTS_ON_PAGE"
  27821. // "REQUIRED_TOS_AGREEMENT"
  27822. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27823. // "RESOURCE_NOT_DELETED"
  27824. // "SCHEMA_VALIDATION_IGNORED"
  27825. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27826. // "UNDECLARED_PROPERTIES"
  27827. // "UNREACHABLE"
  27828. Code string `json:"code,omitempty"`
  27829. // Data: [Output Only] Metadata about this warning in key: value format.
  27830. // For example:
  27831. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27832. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  27833. // Message: [Output Only] A human-readable description of the warning
  27834. // code.
  27835. Message string `json:"message,omitempty"`
  27836. // ForceSendFields is a list of field names (e.g. "Code") to
  27837. // unconditionally include in API requests. By default, fields with
  27838. // empty values are omitted from API requests. However, any non-pointer,
  27839. // non-interface field appearing in ForceSendFields will be sent to the
  27840. // server regardless of whether the field is empty or not. This may be
  27841. // used to include empty fields in Patch requests.
  27842. ForceSendFields []string `json:"-"`
  27843. // NullFields is a list of field names (e.g. "Code") to include in API
  27844. // requests with the JSON null value. By default, fields with empty
  27845. // values are omitted from API requests. However, any field with an
  27846. // empty value appearing in NullFields will be sent to the server as
  27847. // null. It is an error if a field in this list has a non-empty value.
  27848. // This may be used to include null fields in Patch requests.
  27849. NullFields []string `json:"-"`
  27850. }
  27851. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  27852. type NoMethod TargetVpnGatewayAggregatedListWarning
  27853. raw := NoMethod(*s)
  27854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27855. }
  27856. type TargetVpnGatewayAggregatedListWarningData struct {
  27857. // Key: [Output Only] A key that provides more detail on the warning
  27858. // being returned. For example, for warnings where there are no results
  27859. // in a list request for a particular zone, this key might be scope and
  27860. // the key value might be the zone name. Other examples might be a key
  27861. // indicating a deprecated resource and a suggested replacement, or a
  27862. // warning about invalid network settings (for example, if an instance
  27863. // attempts to perform IP forwarding but is not enabled for IP
  27864. // forwarding).
  27865. Key string `json:"key,omitempty"`
  27866. // Value: [Output Only] A warning data value corresponding to the key.
  27867. Value string `json:"value,omitempty"`
  27868. // ForceSendFields is a list of field names (e.g. "Key") to
  27869. // unconditionally include in API requests. By default, fields with
  27870. // empty values are omitted from API requests. However, any non-pointer,
  27871. // non-interface field appearing in ForceSendFields will be sent to the
  27872. // server regardless of whether the field is empty or not. This may be
  27873. // used to include empty fields in Patch requests.
  27874. ForceSendFields []string `json:"-"`
  27875. // NullFields is a list of field names (e.g. "Key") to include in API
  27876. // requests with the JSON null value. By default, fields with empty
  27877. // values are omitted from API requests. However, any field with an
  27878. // empty value appearing in NullFields will be sent to the server as
  27879. // null. It is an error if a field in this list has a non-empty value.
  27880. // This may be used to include null fields in Patch requests.
  27881. NullFields []string `json:"-"`
  27882. }
  27883. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  27884. type NoMethod TargetVpnGatewayAggregatedListWarningData
  27885. raw := NoMethod(*s)
  27886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27887. }
  27888. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  27889. type TargetVpnGatewayList struct {
  27890. // Id: [Output Only] Unique identifier for the resource; defined by the
  27891. // server.
  27892. Id string `json:"id,omitempty"`
  27893. // Items: A list of TargetVpnGateway resources.
  27894. Items []*TargetVpnGateway `json:"items,omitempty"`
  27895. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  27896. // for target VPN gateways.
  27897. Kind string `json:"kind,omitempty"`
  27898. // NextPageToken: [Output Only] This token allows you to get the next
  27899. // page of results for list requests. If the number of results is larger
  27900. // than maxResults, use the nextPageToken as a value for the query
  27901. // parameter pageToken in the next list request. Subsequent list
  27902. // requests will have their own nextPageToken to continue paging through
  27903. // the results.
  27904. NextPageToken string `json:"nextPageToken,omitempty"`
  27905. // SelfLink: [Output Only] Server-defined URL for this resource.
  27906. SelfLink string `json:"selfLink,omitempty"`
  27907. // Warning: [Output Only] Informational warning message.
  27908. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  27909. // ServerResponse contains the HTTP response code and headers from the
  27910. // server.
  27911. googleapi.ServerResponse `json:"-"`
  27912. // ForceSendFields is a list of field names (e.g. "Id") to
  27913. // unconditionally include in API requests. By default, fields with
  27914. // empty values are omitted from API requests. However, any non-pointer,
  27915. // non-interface field appearing in ForceSendFields will be sent to the
  27916. // server regardless of whether the field is empty or not. This may be
  27917. // used to include empty fields in Patch requests.
  27918. ForceSendFields []string `json:"-"`
  27919. // NullFields is a list of field names (e.g. "Id") to include in API
  27920. // requests with the JSON null value. By default, fields with empty
  27921. // values are omitted from API requests. However, any field with an
  27922. // empty value appearing in NullFields will be sent to the server as
  27923. // null. It is an error if a field in this list has a non-empty value.
  27924. // This may be used to include null fields in Patch requests.
  27925. NullFields []string `json:"-"`
  27926. }
  27927. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  27928. type NoMethod TargetVpnGatewayList
  27929. raw := NoMethod(*s)
  27930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27931. }
  27932. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  27933. // message.
  27934. type TargetVpnGatewayListWarning struct {
  27935. // Code: [Output Only] A warning code, if applicable. For example,
  27936. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27937. // the response.
  27938. //
  27939. // Possible values:
  27940. // "CLEANUP_FAILED"
  27941. // "DEPRECATED_RESOURCE_USED"
  27942. // "DEPRECATED_TYPE_USED"
  27943. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27944. // "EXPERIMENTAL_TYPE_USED"
  27945. // "EXTERNAL_API_WARNING"
  27946. // "FIELD_VALUE_OVERRIDEN"
  27947. // "INJECTED_KERNELS_DEPRECATED"
  27948. // "MISSING_TYPE_DEPENDENCY"
  27949. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27950. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27951. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27952. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27953. // "NEXT_HOP_NOT_RUNNING"
  27954. // "NOT_CRITICAL_ERROR"
  27955. // "NO_RESULTS_ON_PAGE"
  27956. // "REQUIRED_TOS_AGREEMENT"
  27957. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27958. // "RESOURCE_NOT_DELETED"
  27959. // "SCHEMA_VALIDATION_IGNORED"
  27960. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27961. // "UNDECLARED_PROPERTIES"
  27962. // "UNREACHABLE"
  27963. Code string `json:"code,omitempty"`
  27964. // Data: [Output Only] Metadata about this warning in key: value format.
  27965. // For example:
  27966. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27967. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  27968. // Message: [Output Only] A human-readable description of the warning
  27969. // code.
  27970. Message string `json:"message,omitempty"`
  27971. // ForceSendFields is a list of field names (e.g. "Code") to
  27972. // unconditionally include in API requests. By default, fields with
  27973. // empty values are omitted from API requests. However, any non-pointer,
  27974. // non-interface field appearing in ForceSendFields will be sent to the
  27975. // server regardless of whether the field is empty or not. This may be
  27976. // used to include empty fields in Patch requests.
  27977. ForceSendFields []string `json:"-"`
  27978. // NullFields is a list of field names (e.g. "Code") to include in API
  27979. // requests with the JSON null value. By default, fields with empty
  27980. // values are omitted from API requests. However, any field with an
  27981. // empty value appearing in NullFields will be sent to the server as
  27982. // null. It is an error if a field in this list has a non-empty value.
  27983. // This may be used to include null fields in Patch requests.
  27984. NullFields []string `json:"-"`
  27985. }
  27986. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  27987. type NoMethod TargetVpnGatewayListWarning
  27988. raw := NoMethod(*s)
  27989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27990. }
  27991. type TargetVpnGatewayListWarningData struct {
  27992. // Key: [Output Only] A key that provides more detail on the warning
  27993. // being returned. For example, for warnings where there are no results
  27994. // in a list request for a particular zone, this key might be scope and
  27995. // the key value might be the zone name. Other examples might be a key
  27996. // indicating a deprecated resource and a suggested replacement, or a
  27997. // warning about invalid network settings (for example, if an instance
  27998. // attempts to perform IP forwarding but is not enabled for IP
  27999. // forwarding).
  28000. Key string `json:"key,omitempty"`
  28001. // Value: [Output Only] A warning data value corresponding to the key.
  28002. Value string `json:"value,omitempty"`
  28003. // ForceSendFields is a list of field names (e.g. "Key") to
  28004. // unconditionally include in API requests. By default, fields with
  28005. // empty values are omitted from API requests. However, any non-pointer,
  28006. // non-interface field appearing in ForceSendFields will be sent to the
  28007. // server regardless of whether the field is empty or not. This may be
  28008. // used to include empty fields in Patch requests.
  28009. ForceSendFields []string `json:"-"`
  28010. // NullFields is a list of field names (e.g. "Key") to include in API
  28011. // requests with the JSON null value. By default, fields with empty
  28012. // values are omitted from API requests. However, any field with an
  28013. // empty value appearing in NullFields will be sent to the server as
  28014. // null. It is an error if a field in this list has a non-empty value.
  28015. // This may be used to include null fields in Patch requests.
  28016. NullFields []string `json:"-"`
  28017. }
  28018. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  28019. type NoMethod TargetVpnGatewayListWarningData
  28020. raw := NoMethod(*s)
  28021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28022. }
  28023. type TargetVpnGatewaysScopedList struct {
  28024. // TargetVpnGateways: [Output Only] A list of target VPN gateways
  28025. // contained in this scope.
  28026. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  28027. // Warning: [Output Only] Informational warning which replaces the list
  28028. // of addresses when the list is empty.
  28029. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  28030. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  28031. // to unconditionally include in API requests. By default, fields with
  28032. // empty values are omitted from API requests. However, any non-pointer,
  28033. // non-interface field appearing in ForceSendFields will be sent to the
  28034. // server regardless of whether the field is empty or not. This may be
  28035. // used to include empty fields in Patch requests.
  28036. ForceSendFields []string `json:"-"`
  28037. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  28038. // include in API requests with the JSON null value. By default, fields
  28039. // with empty values are omitted from API requests. However, any field
  28040. // with an empty value appearing in NullFields will be sent to the
  28041. // server as null. It is an error if a field in this list has a
  28042. // non-empty value. This may be used to include null fields in Patch
  28043. // requests.
  28044. NullFields []string `json:"-"`
  28045. }
  28046. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  28047. type NoMethod TargetVpnGatewaysScopedList
  28048. raw := NoMethod(*s)
  28049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28050. }
  28051. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  28052. // warning which replaces the list of addresses when the list is empty.
  28053. type TargetVpnGatewaysScopedListWarning struct {
  28054. // Code: [Output Only] A warning code, if applicable. For example,
  28055. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28056. // the response.
  28057. //
  28058. // Possible values:
  28059. // "CLEANUP_FAILED"
  28060. // "DEPRECATED_RESOURCE_USED"
  28061. // "DEPRECATED_TYPE_USED"
  28062. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28063. // "EXPERIMENTAL_TYPE_USED"
  28064. // "EXTERNAL_API_WARNING"
  28065. // "FIELD_VALUE_OVERRIDEN"
  28066. // "INJECTED_KERNELS_DEPRECATED"
  28067. // "MISSING_TYPE_DEPENDENCY"
  28068. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28069. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28070. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28071. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28072. // "NEXT_HOP_NOT_RUNNING"
  28073. // "NOT_CRITICAL_ERROR"
  28074. // "NO_RESULTS_ON_PAGE"
  28075. // "REQUIRED_TOS_AGREEMENT"
  28076. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28077. // "RESOURCE_NOT_DELETED"
  28078. // "SCHEMA_VALIDATION_IGNORED"
  28079. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28080. // "UNDECLARED_PROPERTIES"
  28081. // "UNREACHABLE"
  28082. Code string `json:"code,omitempty"`
  28083. // Data: [Output Only] Metadata about this warning in key: value format.
  28084. // For example:
  28085. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28086. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  28087. // Message: [Output Only] A human-readable description of the warning
  28088. // code.
  28089. Message string `json:"message,omitempty"`
  28090. // ForceSendFields is a list of field names (e.g. "Code") to
  28091. // unconditionally include in API requests. By default, fields with
  28092. // empty values are omitted from API requests. However, any non-pointer,
  28093. // non-interface field appearing in ForceSendFields will be sent to the
  28094. // server regardless of whether the field is empty or not. This may be
  28095. // used to include empty fields in Patch requests.
  28096. ForceSendFields []string `json:"-"`
  28097. // NullFields is a list of field names (e.g. "Code") to include in API
  28098. // requests with the JSON null value. By default, fields with empty
  28099. // values are omitted from API requests. However, any field with an
  28100. // empty value appearing in NullFields will be sent to the server as
  28101. // null. It is an error if a field in this list has a non-empty value.
  28102. // This may be used to include null fields in Patch requests.
  28103. NullFields []string `json:"-"`
  28104. }
  28105. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  28106. type NoMethod TargetVpnGatewaysScopedListWarning
  28107. raw := NoMethod(*s)
  28108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28109. }
  28110. type TargetVpnGatewaysScopedListWarningData struct {
  28111. // Key: [Output Only] A key that provides more detail on the warning
  28112. // being returned. For example, for warnings where there are no results
  28113. // in a list request for a particular zone, this key might be scope and
  28114. // the key value might be the zone name. Other examples might be a key
  28115. // indicating a deprecated resource and a suggested replacement, or a
  28116. // warning about invalid network settings (for example, if an instance
  28117. // attempts to perform IP forwarding but is not enabled for IP
  28118. // forwarding).
  28119. Key string `json:"key,omitempty"`
  28120. // Value: [Output Only] A warning data value corresponding to the key.
  28121. Value string `json:"value,omitempty"`
  28122. // ForceSendFields is a list of field names (e.g. "Key") to
  28123. // unconditionally include in API requests. By default, fields with
  28124. // empty values are omitted from API requests. However, any non-pointer,
  28125. // non-interface field appearing in ForceSendFields will be sent to the
  28126. // server regardless of whether the field is empty or not. This may be
  28127. // used to include empty fields in Patch requests.
  28128. ForceSendFields []string `json:"-"`
  28129. // NullFields is a list of field names (e.g. "Key") to include in API
  28130. // requests with the JSON null value. By default, fields with empty
  28131. // values are omitted from API requests. However, any field with an
  28132. // empty value appearing in NullFields will be sent to the server as
  28133. // null. It is an error if a field in this list has a non-empty value.
  28134. // This may be used to include null fields in Patch requests.
  28135. NullFields []string `json:"-"`
  28136. }
  28137. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  28138. type NoMethod TargetVpnGatewaysScopedListWarningData
  28139. raw := NoMethod(*s)
  28140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28141. }
  28142. type TestFailure struct {
  28143. ActualService string `json:"actualService,omitempty"`
  28144. ExpectedService string `json:"expectedService,omitempty"`
  28145. Host string `json:"host,omitempty"`
  28146. Path string `json:"path,omitempty"`
  28147. // ForceSendFields is a list of field names (e.g. "ActualService") to
  28148. // unconditionally include in API requests. By default, fields with
  28149. // empty values are omitted from API requests. However, any non-pointer,
  28150. // non-interface field appearing in ForceSendFields will be sent to the
  28151. // server regardless of whether the field is empty or not. This may be
  28152. // used to include empty fields in Patch requests.
  28153. ForceSendFields []string `json:"-"`
  28154. // NullFields is a list of field names (e.g. "ActualService") to include
  28155. // in API requests with the JSON null value. By default, fields with
  28156. // empty values are omitted from API requests. However, any field with
  28157. // an empty value appearing in NullFields will be sent to the server as
  28158. // null. It is an error if a field in this list has a non-empty value.
  28159. // This may be used to include null fields in Patch requests.
  28160. NullFields []string `json:"-"`
  28161. }
  28162. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  28163. type NoMethod TestFailure
  28164. raw := NoMethod(*s)
  28165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28166. }
  28167. type TestPermissionsRequest struct {
  28168. // Permissions: The set of permissions to check for the 'resource'.
  28169. // Permissions with wildcards (such as '*' or 'storage.*') are not
  28170. // allowed.
  28171. Permissions []string `json:"permissions,omitempty"`
  28172. // ForceSendFields is a list of field names (e.g. "Permissions") to
  28173. // unconditionally include in API requests. By default, fields with
  28174. // empty values are omitted from API requests. However, any non-pointer,
  28175. // non-interface field appearing in ForceSendFields will be sent to the
  28176. // server regardless of whether the field is empty or not. This may be
  28177. // used to include empty fields in Patch requests.
  28178. ForceSendFields []string `json:"-"`
  28179. // NullFields is a list of field names (e.g. "Permissions") to include
  28180. // in API requests with the JSON null value. By default, fields with
  28181. // empty values are omitted from API requests. However, any field with
  28182. // an empty value appearing in NullFields will be sent to the server as
  28183. // null. It is an error if a field in this list has a non-empty value.
  28184. // This may be used to include null fields in Patch requests.
  28185. NullFields []string `json:"-"`
  28186. }
  28187. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  28188. type NoMethod TestPermissionsRequest
  28189. raw := NoMethod(*s)
  28190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28191. }
  28192. type TestPermissionsResponse struct {
  28193. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  28194. // the caller is allowed.
  28195. Permissions []string `json:"permissions,omitempty"`
  28196. // ServerResponse contains the HTTP response code and headers from the
  28197. // server.
  28198. googleapi.ServerResponse `json:"-"`
  28199. // ForceSendFields is a list of field names (e.g. "Permissions") to
  28200. // unconditionally include in API requests. By default, fields with
  28201. // empty values are omitted from API requests. However, any non-pointer,
  28202. // non-interface field appearing in ForceSendFields will be sent to the
  28203. // server regardless of whether the field is empty or not. This may be
  28204. // used to include empty fields in Patch requests.
  28205. ForceSendFields []string `json:"-"`
  28206. // NullFields is a list of field names (e.g. "Permissions") to include
  28207. // in API requests with the JSON null value. By default, fields with
  28208. // empty values are omitted from API requests. However, any field with
  28209. // an empty value appearing in NullFields will be sent to the server as
  28210. // null. It is an error if a field in this list has a non-empty value.
  28211. // This may be used to include null fields in Patch requests.
  28212. NullFields []string `json:"-"`
  28213. }
  28214. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  28215. type NoMethod TestPermissionsResponse
  28216. raw := NoMethod(*s)
  28217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28218. }
  28219. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  28220. // to the BackendService resource, based on the "longest-match" of the
  28221. // URL's host and path.
  28222. type UrlMap struct {
  28223. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28224. // format.
  28225. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28226. // DefaultService: The full or partial URL of the defaultService
  28227. // resource to which traffic is directed if none of the hostRules match.
  28228. // If defaultRouteAction is additionally specified, advanced routing
  28229. // actions like URL Rewrites, etc. take effect prior to sending the
  28230. // request to the backend. However, if defaultService is specified,
  28231. // defaultRouteAction cannot contain any weightedBackendServices.
  28232. // Conversely, if routeAction specifies any weightedBackendServices,
  28233. // service must not be specified.
  28234. // Only one of defaultService, defaultUrlRedirect or
  28235. // defaultRouteAction.weightedBackendService must be set.
  28236. DefaultService string `json:"defaultService,omitempty"`
  28237. // Description: An optional description of this resource. Provide this
  28238. // property when you create the resource.
  28239. Description string `json:"description,omitempty"`
  28240. // Fingerprint: Fingerprint of this resource. A hash of the contents
  28241. // stored in this object. This field is used in optimistic locking. This
  28242. // field will be ignored when inserting a UrlMap. An up-to-date
  28243. // fingerprint must be provided in order to update the UrlMap, otherwise
  28244. // the request will fail with error 412 conditionNotMet.
  28245. //
  28246. // To see the latest fingerprint, make a get() request to retrieve a
  28247. // UrlMap.
  28248. Fingerprint string `json:"fingerprint,omitempty"`
  28249. // HostRules: The list of HostRules to use against the URL.
  28250. HostRules []*HostRule `json:"hostRules,omitempty"`
  28251. // Id: [Output Only] The unique identifier for the resource. This
  28252. // identifier is defined by the server.
  28253. Id uint64 `json:"id,omitempty,string"`
  28254. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  28255. // url maps.
  28256. Kind string `json:"kind,omitempty"`
  28257. // Name: Name of the resource. Provided by the client when the resource
  28258. // is created. The name must be 1-63 characters long, and comply with
  28259. // RFC1035. Specifically, the name must be 1-63 characters long and
  28260. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  28261. // the first character must be a lowercase letter, and all following
  28262. // characters must be a dash, lowercase letter, or digit, except the
  28263. // last character, which cannot be a dash.
  28264. Name string `json:"name,omitempty"`
  28265. // PathMatchers: The list of named PathMatchers to use against the URL.
  28266. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  28267. // SelfLink: [Output Only] Server-defined URL for the resource.
  28268. SelfLink string `json:"selfLink,omitempty"`
  28269. // Tests: The list of expected URL mapping tests. Request to update this
  28270. // UrlMap will succeed only if all of the test cases pass. You can
  28271. // specify a maximum of 100 tests per UrlMap.
  28272. Tests []*UrlMapTest `json:"tests,omitempty"`
  28273. // ServerResponse contains the HTTP response code and headers from the
  28274. // server.
  28275. googleapi.ServerResponse `json:"-"`
  28276. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  28277. // to unconditionally include in API requests. By default, fields with
  28278. // empty values are omitted from API requests. However, any non-pointer,
  28279. // non-interface field appearing in ForceSendFields will be sent to the
  28280. // server regardless of whether the field is empty or not. This may be
  28281. // used to include empty fields in Patch requests.
  28282. ForceSendFields []string `json:"-"`
  28283. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  28284. // include in API requests with the JSON null value. By default, fields
  28285. // with empty values are omitted from API requests. However, any field
  28286. // with an empty value appearing in NullFields will be sent to the
  28287. // server as null. It is an error if a field in this list has a
  28288. // non-empty value. This may be used to include null fields in Patch
  28289. // requests.
  28290. NullFields []string `json:"-"`
  28291. }
  28292. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  28293. type NoMethod UrlMap
  28294. raw := NoMethod(*s)
  28295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28296. }
  28297. // UrlMapList: Contains a list of UrlMap resources.
  28298. type UrlMapList struct {
  28299. // Id: [Output Only] Unique identifier for the resource; defined by the
  28300. // server.
  28301. Id string `json:"id,omitempty"`
  28302. // Items: A list of UrlMap resources.
  28303. Items []*UrlMap `json:"items,omitempty"`
  28304. // Kind: Type of resource.
  28305. Kind string `json:"kind,omitempty"`
  28306. // NextPageToken: [Output Only] This token allows you to get the next
  28307. // page of results for list requests. If the number of results is larger
  28308. // than maxResults, use the nextPageToken as a value for the query
  28309. // parameter pageToken in the next list request. Subsequent list
  28310. // requests will have their own nextPageToken to continue paging through
  28311. // the results.
  28312. NextPageToken string `json:"nextPageToken,omitempty"`
  28313. // SelfLink: [Output Only] Server-defined URL for this resource.
  28314. SelfLink string `json:"selfLink,omitempty"`
  28315. // Warning: [Output Only] Informational warning message.
  28316. Warning *UrlMapListWarning `json:"warning,omitempty"`
  28317. // ServerResponse contains the HTTP response code and headers from the
  28318. // server.
  28319. googleapi.ServerResponse `json:"-"`
  28320. // ForceSendFields is a list of field names (e.g. "Id") to
  28321. // unconditionally include in API requests. By default, fields with
  28322. // empty values are omitted from API requests. However, any non-pointer,
  28323. // non-interface field appearing in ForceSendFields will be sent to the
  28324. // server regardless of whether the field is empty or not. This may be
  28325. // used to include empty fields in Patch requests.
  28326. ForceSendFields []string `json:"-"`
  28327. // NullFields is a list of field names (e.g. "Id") to include in API
  28328. // requests with the JSON null value. By default, fields with empty
  28329. // values are omitted from API requests. However, any field with an
  28330. // empty value appearing in NullFields will be sent to the server as
  28331. // null. It is an error if a field in this list has a non-empty value.
  28332. // This may be used to include null fields in Patch requests.
  28333. NullFields []string `json:"-"`
  28334. }
  28335. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  28336. type NoMethod UrlMapList
  28337. raw := NoMethod(*s)
  28338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28339. }
  28340. // UrlMapListWarning: [Output Only] Informational warning message.
  28341. type UrlMapListWarning struct {
  28342. // Code: [Output Only] A warning code, if applicable. For example,
  28343. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28344. // the response.
  28345. //
  28346. // Possible values:
  28347. // "CLEANUP_FAILED"
  28348. // "DEPRECATED_RESOURCE_USED"
  28349. // "DEPRECATED_TYPE_USED"
  28350. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28351. // "EXPERIMENTAL_TYPE_USED"
  28352. // "EXTERNAL_API_WARNING"
  28353. // "FIELD_VALUE_OVERRIDEN"
  28354. // "INJECTED_KERNELS_DEPRECATED"
  28355. // "MISSING_TYPE_DEPENDENCY"
  28356. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28357. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28358. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28359. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28360. // "NEXT_HOP_NOT_RUNNING"
  28361. // "NOT_CRITICAL_ERROR"
  28362. // "NO_RESULTS_ON_PAGE"
  28363. // "REQUIRED_TOS_AGREEMENT"
  28364. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28365. // "RESOURCE_NOT_DELETED"
  28366. // "SCHEMA_VALIDATION_IGNORED"
  28367. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28368. // "UNDECLARED_PROPERTIES"
  28369. // "UNREACHABLE"
  28370. Code string `json:"code,omitempty"`
  28371. // Data: [Output Only] Metadata about this warning in key: value format.
  28372. // For example:
  28373. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28374. Data []*UrlMapListWarningData `json:"data,omitempty"`
  28375. // Message: [Output Only] A human-readable description of the warning
  28376. // code.
  28377. Message string `json:"message,omitempty"`
  28378. // ForceSendFields is a list of field names (e.g. "Code") to
  28379. // unconditionally include in API requests. By default, fields with
  28380. // empty values are omitted from API requests. However, any non-pointer,
  28381. // non-interface field appearing in ForceSendFields will be sent to the
  28382. // server regardless of whether the field is empty or not. This may be
  28383. // used to include empty fields in Patch requests.
  28384. ForceSendFields []string `json:"-"`
  28385. // NullFields is a list of field names (e.g. "Code") to include in API
  28386. // requests with the JSON null value. By default, fields with empty
  28387. // values are omitted from API requests. However, any field with an
  28388. // empty value appearing in NullFields will be sent to the server as
  28389. // null. It is an error if a field in this list has a non-empty value.
  28390. // This may be used to include null fields in Patch requests.
  28391. NullFields []string `json:"-"`
  28392. }
  28393. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  28394. type NoMethod UrlMapListWarning
  28395. raw := NoMethod(*s)
  28396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28397. }
  28398. type UrlMapListWarningData struct {
  28399. // Key: [Output Only] A key that provides more detail on the warning
  28400. // being returned. For example, for warnings where there are no results
  28401. // in a list request for a particular zone, this key might be scope and
  28402. // the key value might be the zone name. Other examples might be a key
  28403. // indicating a deprecated resource and a suggested replacement, or a
  28404. // warning about invalid network settings (for example, if an instance
  28405. // attempts to perform IP forwarding but is not enabled for IP
  28406. // forwarding).
  28407. Key string `json:"key,omitempty"`
  28408. // Value: [Output Only] A warning data value corresponding to the key.
  28409. Value string `json:"value,omitempty"`
  28410. // ForceSendFields is a list of field names (e.g. "Key") to
  28411. // unconditionally include in API requests. By default, fields with
  28412. // empty values are omitted from API requests. However, any non-pointer,
  28413. // non-interface field appearing in ForceSendFields will be sent to the
  28414. // server regardless of whether the field is empty or not. This may be
  28415. // used to include empty fields in Patch requests.
  28416. ForceSendFields []string `json:"-"`
  28417. // NullFields is a list of field names (e.g. "Key") to include in API
  28418. // requests with the JSON null value. By default, fields with empty
  28419. // values are omitted from API requests. However, any field with an
  28420. // empty value appearing in NullFields will be sent to the server as
  28421. // null. It is an error if a field in this list has a non-empty value.
  28422. // This may be used to include null fields in Patch requests.
  28423. NullFields []string `json:"-"`
  28424. }
  28425. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  28426. type NoMethod UrlMapListWarningData
  28427. raw := NoMethod(*s)
  28428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28429. }
  28430. type UrlMapReference struct {
  28431. UrlMap string `json:"urlMap,omitempty"`
  28432. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  28433. // unconditionally include in API requests. By default, fields with
  28434. // empty values are omitted from API requests. However, any non-pointer,
  28435. // non-interface field appearing in ForceSendFields will be sent to the
  28436. // server regardless of whether the field is empty or not. This may be
  28437. // used to include empty fields in Patch requests.
  28438. ForceSendFields []string `json:"-"`
  28439. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  28440. // requests with the JSON null value. By default, fields with empty
  28441. // values are omitted from API requests. However, any field with an
  28442. // empty value appearing in NullFields will be sent to the server as
  28443. // null. It is an error if a field in this list has a non-empty value.
  28444. // This may be used to include null fields in Patch requests.
  28445. NullFields []string `json:"-"`
  28446. }
  28447. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  28448. type NoMethod UrlMapReference
  28449. raw := NoMethod(*s)
  28450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28451. }
  28452. // UrlMapTest: Message for the expected URL mappings.
  28453. type UrlMapTest struct {
  28454. // Description: Description of this test case.
  28455. Description string `json:"description,omitempty"`
  28456. // Host: Host portion of the URL.
  28457. Host string `json:"host,omitempty"`
  28458. // Path: Path portion of the URL.
  28459. Path string `json:"path,omitempty"`
  28460. // Service: Expected BackendService resource the given URL should be
  28461. // mapped to.
  28462. Service string `json:"service,omitempty"`
  28463. // ForceSendFields is a list of field names (e.g. "Description") to
  28464. // unconditionally include in API requests. By default, fields with
  28465. // empty values are omitted from API requests. However, any non-pointer,
  28466. // non-interface field appearing in ForceSendFields will be sent to the
  28467. // server regardless of whether the field is empty or not. This may be
  28468. // used to include empty fields in Patch requests.
  28469. ForceSendFields []string `json:"-"`
  28470. // NullFields is a list of field names (e.g. "Description") to include
  28471. // in API requests with the JSON null value. By default, fields with
  28472. // empty values are omitted from API requests. However, any field with
  28473. // an empty value appearing in NullFields will be sent to the server as
  28474. // null. It is an error if a field in this list has a non-empty value.
  28475. // This may be used to include null fields in Patch requests.
  28476. NullFields []string `json:"-"`
  28477. }
  28478. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  28479. type NoMethod UrlMapTest
  28480. raw := NoMethod(*s)
  28481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28482. }
  28483. // UrlMapValidationResult: Message representing the validation result
  28484. // for a UrlMap.
  28485. type UrlMapValidationResult struct {
  28486. LoadErrors []string `json:"loadErrors,omitempty"`
  28487. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  28488. // If false, 'loadErrors' indicates the reasons.
  28489. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  28490. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  28491. // TestPassed: If successfully loaded, this field indicates whether the
  28492. // test passed. If false, 'testFailures's indicate the reason of
  28493. // failure.
  28494. TestPassed bool `json:"testPassed,omitempty"`
  28495. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  28496. // unconditionally include in API requests. By default, fields with
  28497. // empty values are omitted from API requests. However, any non-pointer,
  28498. // non-interface field appearing in ForceSendFields will be sent to the
  28499. // server regardless of whether the field is empty or not. This may be
  28500. // used to include empty fields in Patch requests.
  28501. ForceSendFields []string `json:"-"`
  28502. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  28503. // API requests with the JSON null value. By default, fields with empty
  28504. // values are omitted from API requests. However, any field with an
  28505. // empty value appearing in NullFields will be sent to the server as
  28506. // null. It is an error if a field in this list has a non-empty value.
  28507. // This may be used to include null fields in Patch requests.
  28508. NullFields []string `json:"-"`
  28509. }
  28510. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  28511. type NoMethod UrlMapValidationResult
  28512. raw := NoMethod(*s)
  28513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28514. }
  28515. type UrlMapsValidateRequest struct {
  28516. // Resource: Content of the UrlMap to be validated.
  28517. Resource *UrlMap `json:"resource,omitempty"`
  28518. // ForceSendFields is a list of field names (e.g. "Resource") to
  28519. // unconditionally include in API requests. By default, fields with
  28520. // empty values are omitted from API requests. However, any non-pointer,
  28521. // non-interface field appearing in ForceSendFields will be sent to the
  28522. // server regardless of whether the field is empty or not. This may be
  28523. // used to include empty fields in Patch requests.
  28524. ForceSendFields []string `json:"-"`
  28525. // NullFields is a list of field names (e.g. "Resource") to include in
  28526. // API requests with the JSON null value. By default, fields with empty
  28527. // values are omitted from API requests. However, any field with an
  28528. // empty value appearing in NullFields will be sent to the server as
  28529. // null. It is an error if a field in this list has a non-empty value.
  28530. // This may be used to include null fields in Patch requests.
  28531. NullFields []string `json:"-"`
  28532. }
  28533. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  28534. type NoMethod UrlMapsValidateRequest
  28535. raw := NoMethod(*s)
  28536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28537. }
  28538. type UrlMapsValidateResponse struct {
  28539. Result *UrlMapValidationResult `json:"result,omitempty"`
  28540. // ServerResponse contains the HTTP response code and headers from the
  28541. // server.
  28542. googleapi.ServerResponse `json:"-"`
  28543. // ForceSendFields is a list of field names (e.g. "Result") to
  28544. // unconditionally include in API requests. By default, fields with
  28545. // empty values are omitted from API requests. However, any non-pointer,
  28546. // non-interface field appearing in ForceSendFields will be sent to the
  28547. // server regardless of whether the field is empty or not. This may be
  28548. // used to include empty fields in Patch requests.
  28549. ForceSendFields []string `json:"-"`
  28550. // NullFields is a list of field names (e.g. "Result") to include in API
  28551. // requests with the JSON null value. By default, fields with empty
  28552. // values are omitted from API requests. However, any field with an
  28553. // empty value appearing in NullFields will be sent to the server as
  28554. // null. It is an error if a field in this list has a non-empty value.
  28555. // This may be used to include null fields in Patch requests.
  28556. NullFields []string `json:"-"`
  28557. }
  28558. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  28559. type NoMethod UrlMapsValidateResponse
  28560. raw := NoMethod(*s)
  28561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28562. }
  28563. // UsableSubnetwork: Subnetwork which the current user has
  28564. // compute.subnetworks.use permission on.
  28565. type UsableSubnetwork struct {
  28566. // IpCidrRange: The range of internal addresses that are owned by this
  28567. // subnetwork.
  28568. IpCidrRange string `json:"ipCidrRange,omitempty"`
  28569. // Network: Network URL.
  28570. Network string `json:"network,omitempty"`
  28571. // SecondaryIpRanges: Secondary IP ranges.
  28572. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  28573. // Subnetwork: Subnetwork URL.
  28574. Subnetwork string `json:"subnetwork,omitempty"`
  28575. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  28576. // unconditionally include in API requests. By default, fields with
  28577. // empty values are omitted from API requests. However, any non-pointer,
  28578. // non-interface field appearing in ForceSendFields will be sent to the
  28579. // server regardless of whether the field is empty or not. This may be
  28580. // used to include empty fields in Patch requests.
  28581. ForceSendFields []string `json:"-"`
  28582. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  28583. // in API requests with the JSON null value. By default, fields with
  28584. // empty values are omitted from API requests. However, any field with
  28585. // an empty value appearing in NullFields will be sent to the server as
  28586. // null. It is an error if a field in this list has a non-empty value.
  28587. // This may be used to include null fields in Patch requests.
  28588. NullFields []string `json:"-"`
  28589. }
  28590. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  28591. type NoMethod UsableSubnetwork
  28592. raw := NoMethod(*s)
  28593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28594. }
  28595. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  28596. // subnetwork.
  28597. type UsableSubnetworkSecondaryRange struct {
  28598. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  28599. // secondary range.
  28600. IpCidrRange string `json:"ipCidrRange,omitempty"`
  28601. // RangeName: The name associated with this subnetwork secondary range,
  28602. // used when adding an alias IP range to a VM instance. The name must be
  28603. // 1-63 characters long, and comply with RFC1035. The name must be
  28604. // unique within the subnetwork.
  28605. RangeName string `json:"rangeName,omitempty"`
  28606. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  28607. // unconditionally include in API requests. By default, fields with
  28608. // empty values are omitted from API requests. However, any non-pointer,
  28609. // non-interface field appearing in ForceSendFields will be sent to the
  28610. // server regardless of whether the field is empty or not. This may be
  28611. // used to include empty fields in Patch requests.
  28612. ForceSendFields []string `json:"-"`
  28613. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  28614. // in API requests with the JSON null value. By default, fields with
  28615. // empty values are omitted from API requests. However, any field with
  28616. // an empty value appearing in NullFields will be sent to the server as
  28617. // null. It is an error if a field in this list has a non-empty value.
  28618. // This may be used to include null fields in Patch requests.
  28619. NullFields []string `json:"-"`
  28620. }
  28621. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  28622. type NoMethod UsableSubnetworkSecondaryRange
  28623. raw := NoMethod(*s)
  28624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28625. }
  28626. type UsableSubnetworksAggregatedList struct {
  28627. // Id: [Output Only] The unique identifier for the resource. This
  28628. // identifier is defined by the server.
  28629. Id string `json:"id,omitempty"`
  28630. // Items: [Output] A list of usable subnetwork URLs.
  28631. Items []*UsableSubnetwork `json:"items,omitempty"`
  28632. // Kind: [Output Only] Type of resource. Always
  28633. // compute#usableSubnetworksAggregatedList for aggregated lists of
  28634. // usable subnetworks.
  28635. Kind string `json:"kind,omitempty"`
  28636. // NextPageToken: [Output Only] This token allows you to get the next
  28637. // page of results for list requests. If the number of results is larger
  28638. // than maxResults, use the nextPageToken as a value for the query
  28639. // parameter pageToken in the next list request. Subsequent list
  28640. // requests will have their own nextPageToken to continue paging through
  28641. // the results.
  28642. NextPageToken string `json:"nextPageToken,omitempty"`
  28643. // SelfLink: [Output Only] Server-defined URL for this resource.
  28644. SelfLink string `json:"selfLink,omitempty"`
  28645. // Warning: [Output Only] Informational warning message.
  28646. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  28647. // ServerResponse contains the HTTP response code and headers from the
  28648. // server.
  28649. googleapi.ServerResponse `json:"-"`
  28650. // ForceSendFields is a list of field names (e.g. "Id") to
  28651. // unconditionally include in API requests. By default, fields with
  28652. // empty values are omitted from API requests. However, any non-pointer,
  28653. // non-interface field appearing in ForceSendFields will be sent to the
  28654. // server regardless of whether the field is empty or not. This may be
  28655. // used to include empty fields in Patch requests.
  28656. ForceSendFields []string `json:"-"`
  28657. // NullFields is a list of field names (e.g. "Id") to include in API
  28658. // requests with the JSON null value. By default, fields with empty
  28659. // values are omitted from API requests. However, any field with an
  28660. // empty value appearing in NullFields will be sent to the server as
  28661. // null. It is an error if a field in this list has a non-empty value.
  28662. // This may be used to include null fields in Patch requests.
  28663. NullFields []string `json:"-"`
  28664. }
  28665. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  28666. type NoMethod UsableSubnetworksAggregatedList
  28667. raw := NoMethod(*s)
  28668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28669. }
  28670. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  28671. // warning message.
  28672. type UsableSubnetworksAggregatedListWarning struct {
  28673. // Code: [Output Only] A warning code, if applicable. For example,
  28674. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28675. // the response.
  28676. //
  28677. // Possible values:
  28678. // "CLEANUP_FAILED"
  28679. // "DEPRECATED_RESOURCE_USED"
  28680. // "DEPRECATED_TYPE_USED"
  28681. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28682. // "EXPERIMENTAL_TYPE_USED"
  28683. // "EXTERNAL_API_WARNING"
  28684. // "FIELD_VALUE_OVERRIDEN"
  28685. // "INJECTED_KERNELS_DEPRECATED"
  28686. // "MISSING_TYPE_DEPENDENCY"
  28687. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28688. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28689. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28690. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28691. // "NEXT_HOP_NOT_RUNNING"
  28692. // "NOT_CRITICAL_ERROR"
  28693. // "NO_RESULTS_ON_PAGE"
  28694. // "REQUIRED_TOS_AGREEMENT"
  28695. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28696. // "RESOURCE_NOT_DELETED"
  28697. // "SCHEMA_VALIDATION_IGNORED"
  28698. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28699. // "UNDECLARED_PROPERTIES"
  28700. // "UNREACHABLE"
  28701. Code string `json:"code,omitempty"`
  28702. // Data: [Output Only] Metadata about this warning in key: value format.
  28703. // For example:
  28704. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28705. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  28706. // Message: [Output Only] A human-readable description of the warning
  28707. // code.
  28708. Message string `json:"message,omitempty"`
  28709. // ForceSendFields is a list of field names (e.g. "Code") to
  28710. // unconditionally include in API requests. By default, fields with
  28711. // empty values are omitted from API requests. However, any non-pointer,
  28712. // non-interface field appearing in ForceSendFields will be sent to the
  28713. // server regardless of whether the field is empty or not. This may be
  28714. // used to include empty fields in Patch requests.
  28715. ForceSendFields []string `json:"-"`
  28716. // NullFields is a list of field names (e.g. "Code") to include in API
  28717. // requests with the JSON null value. By default, fields with empty
  28718. // values are omitted from API requests. However, any field with an
  28719. // empty value appearing in NullFields will be sent to the server as
  28720. // null. It is an error if a field in this list has a non-empty value.
  28721. // This may be used to include null fields in Patch requests.
  28722. NullFields []string `json:"-"`
  28723. }
  28724. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  28725. type NoMethod UsableSubnetworksAggregatedListWarning
  28726. raw := NoMethod(*s)
  28727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28728. }
  28729. type UsableSubnetworksAggregatedListWarningData struct {
  28730. // Key: [Output Only] A key that provides more detail on the warning
  28731. // being returned. For example, for warnings where there are no results
  28732. // in a list request for a particular zone, this key might be scope and
  28733. // the key value might be the zone name. Other examples might be a key
  28734. // indicating a deprecated resource and a suggested replacement, or a
  28735. // warning about invalid network settings (for example, if an instance
  28736. // attempts to perform IP forwarding but is not enabled for IP
  28737. // forwarding).
  28738. Key string `json:"key,omitempty"`
  28739. // Value: [Output Only] A warning data value corresponding to the key.
  28740. Value string `json:"value,omitempty"`
  28741. // ForceSendFields is a list of field names (e.g. "Key") to
  28742. // unconditionally include in API requests. By default, fields with
  28743. // empty values are omitted from API requests. However, any non-pointer,
  28744. // non-interface field appearing in ForceSendFields will be sent to the
  28745. // server regardless of whether the field is empty or not. This may be
  28746. // used to include empty fields in Patch requests.
  28747. ForceSendFields []string `json:"-"`
  28748. // NullFields is a list of field names (e.g. "Key") to include in API
  28749. // requests with the JSON null value. By default, fields with empty
  28750. // values are omitted from API requests. However, any field with an
  28751. // empty value appearing in NullFields will be sent to the server as
  28752. // null. It is an error if a field in this list has a non-empty value.
  28753. // This may be used to include null fields in Patch requests.
  28754. NullFields []string `json:"-"`
  28755. }
  28756. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  28757. type NoMethod UsableSubnetworksAggregatedListWarningData
  28758. raw := NoMethod(*s)
  28759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28760. }
  28761. // UsageExportLocation: The location in Cloud Storage and naming method
  28762. // of the daily usage report. Contains bucket_name and report_name
  28763. // prefix.
  28764. type UsageExportLocation struct {
  28765. // BucketName: The name of an existing bucket in Cloud Storage where the
  28766. // usage report object is stored. The Google Service Account is granted
  28767. // write access to this bucket. This can either be the bucket name by
  28768. // itself, such as example-bucket, or the bucket name with gs:// or
  28769. // https://storage.googleapis.com/ in front of it, such as
  28770. // gs://example-bucket.
  28771. BucketName string `json:"bucketName,omitempty"`
  28772. // ReportNamePrefix: An optional prefix for the name of the usage report
  28773. // object stored in bucketName. If not supplied, defaults to usage. The
  28774. // report is stored as a CSV file named
  28775. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  28776. // usage according to Pacific Time. If you supply a prefix, it should
  28777. // conform to Cloud Storage object naming conventions.
  28778. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  28779. // ForceSendFields is a list of field names (e.g. "BucketName") to
  28780. // unconditionally include in API requests. By default, fields with
  28781. // empty values are omitted from API requests. However, any non-pointer,
  28782. // non-interface field appearing in ForceSendFields will be sent to the
  28783. // server regardless of whether the field is empty or not. This may be
  28784. // used to include empty fields in Patch requests.
  28785. ForceSendFields []string `json:"-"`
  28786. // NullFields is a list of field names (e.g. "BucketName") to include in
  28787. // API requests with the JSON null value. By default, fields with empty
  28788. // values are omitted from API requests. However, any field with an
  28789. // empty value appearing in NullFields will be sent to the server as
  28790. // null. It is an error if a field in this list has a non-empty value.
  28791. // This may be used to include null fields in Patch requests.
  28792. NullFields []string `json:"-"`
  28793. }
  28794. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  28795. type NoMethod UsageExportLocation
  28796. raw := NoMethod(*s)
  28797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28798. }
  28799. // VmEndpointNatMappings: Contain information of Nat mapping for a VM
  28800. // endpoint (i.e., NIC).
  28801. type VmEndpointNatMappings struct {
  28802. // InstanceName: Name of the VM instance which the endpoint belongs to
  28803. InstanceName string `json:"instanceName,omitempty"`
  28804. InterfaceNatMappings []*VmEndpointNatMappingsInterfaceNatMappings `json:"interfaceNatMappings,omitempty"`
  28805. // ForceSendFields is a list of field names (e.g. "InstanceName") to
  28806. // unconditionally include in API requests. By default, fields with
  28807. // empty values are omitted from API requests. However, any non-pointer,
  28808. // non-interface field appearing in ForceSendFields will be sent to the
  28809. // server regardless of whether the field is empty or not. This may be
  28810. // used to include empty fields in Patch requests.
  28811. ForceSendFields []string `json:"-"`
  28812. // NullFields is a list of field names (e.g. "InstanceName") to include
  28813. // in API requests with the JSON null value. By default, fields with
  28814. // empty values are omitted from API requests. However, any field with
  28815. // an empty value appearing in NullFields will be sent to the server as
  28816. // null. It is an error if a field in this list has a non-empty value.
  28817. // This may be used to include null fields in Patch requests.
  28818. NullFields []string `json:"-"`
  28819. }
  28820. func (s *VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
  28821. type NoMethod VmEndpointNatMappings
  28822. raw := NoMethod(*s)
  28823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28824. }
  28825. // VmEndpointNatMappingsInterfaceNatMappings: Contain information of Nat
  28826. // mapping for an interface of this endpoint.
  28827. type VmEndpointNatMappingsInterfaceNatMappings struct {
  28828. // NatIpPortRanges: A list of all IP:port-range mappings assigned to
  28829. // this interface. These ranges are inclusive, that is, both the first
  28830. // and the last ports can be used for NAT. Example:
  28831. // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
  28832. NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
  28833. // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
  28834. // to this interface. It equals to the aggregated port number in the
  28835. // field nat_ip_port_ranges.
  28836. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
  28837. // SourceAliasIpRange: Alias IP range for this interface endpoint. It
  28838. // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or
  28839. // "192.168.5.0/24".
  28840. SourceAliasIpRange string `json:"sourceAliasIpRange,omitempty"`
  28841. // SourceVirtualIp: Primary IP of the VM for this NIC.
  28842. SourceVirtualIp string `json:"sourceVirtualIp,omitempty"`
  28843. // ForceSendFields is a list of field names (e.g. "NatIpPortRanges") to
  28844. // unconditionally include in API requests. By default, fields with
  28845. // empty values are omitted from API requests. However, any non-pointer,
  28846. // non-interface field appearing in ForceSendFields will be sent to the
  28847. // server regardless of whether the field is empty or not. This may be
  28848. // used to include empty fields in Patch requests.
  28849. ForceSendFields []string `json:"-"`
  28850. // NullFields is a list of field names (e.g. "NatIpPortRanges") to
  28851. // include in API requests with the JSON null value. By default, fields
  28852. // with empty values are omitted from API requests. However, any field
  28853. // with an empty value appearing in NullFields will be sent to the
  28854. // server as null. It is an error if a field in this list has a
  28855. // non-empty value. This may be used to include null fields in Patch
  28856. // requests.
  28857. NullFields []string `json:"-"`
  28858. }
  28859. func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
  28860. type NoMethod VmEndpointNatMappingsInterfaceNatMappings
  28861. raw := NoMethod(*s)
  28862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28863. }
  28864. // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings.
  28865. type VmEndpointNatMappingsList struct {
  28866. // Id: [Output Only] The unique identifier for the resource. This
  28867. // identifier is defined by the server.
  28868. Id string `json:"id,omitempty"`
  28869. // Kind: [Output Only] Type of resource. Always
  28870. // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM
  28871. // endpoints.
  28872. Kind string `json:"kind,omitempty"`
  28873. // NextPageToken: [Output Only] This token allows you to get the next
  28874. // page of results for list requests. If the number of results is larger
  28875. // than maxResults, use the nextPageToken as a value for the query
  28876. // parameter pageToken in the next list request. Subsequent list
  28877. // requests will have their own nextPageToken to continue paging through
  28878. // the results.
  28879. NextPageToken string `json:"nextPageToken,omitempty"`
  28880. // Result: [Output Only] A list of Nat mapping information of VM
  28881. // endpoints.
  28882. Result []*VmEndpointNatMappings `json:"result,omitempty"`
  28883. // SelfLink: [Output Only] Server-defined URL for this resource.
  28884. SelfLink string `json:"selfLink,omitempty"`
  28885. // Warning: [Output Only] Informational warning message.
  28886. Warning *VmEndpointNatMappingsListWarning `json:"warning,omitempty"`
  28887. // ServerResponse contains the HTTP response code and headers from the
  28888. // server.
  28889. googleapi.ServerResponse `json:"-"`
  28890. // ForceSendFields is a list of field names (e.g. "Id") to
  28891. // unconditionally include in API requests. By default, fields with
  28892. // empty values are omitted from API requests. However, any non-pointer,
  28893. // non-interface field appearing in ForceSendFields will be sent to the
  28894. // server regardless of whether the field is empty or not. This may be
  28895. // used to include empty fields in Patch requests.
  28896. ForceSendFields []string `json:"-"`
  28897. // NullFields is a list of field names (e.g. "Id") to include in API
  28898. // requests with the JSON null value. By default, fields with empty
  28899. // values are omitted from API requests. However, any field with an
  28900. // empty value appearing in NullFields will be sent to the server as
  28901. // null. It is an error if a field in this list has a non-empty value.
  28902. // This may be used to include null fields in Patch requests.
  28903. NullFields []string `json:"-"`
  28904. }
  28905. func (s *VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
  28906. type NoMethod VmEndpointNatMappingsList
  28907. raw := NoMethod(*s)
  28908. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28909. }
  28910. // VmEndpointNatMappingsListWarning: [Output Only] Informational warning
  28911. // message.
  28912. type VmEndpointNatMappingsListWarning struct {
  28913. // Code: [Output Only] A warning code, if applicable. For example,
  28914. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28915. // the response.
  28916. //
  28917. // Possible values:
  28918. // "CLEANUP_FAILED"
  28919. // "DEPRECATED_RESOURCE_USED"
  28920. // "DEPRECATED_TYPE_USED"
  28921. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28922. // "EXPERIMENTAL_TYPE_USED"
  28923. // "EXTERNAL_API_WARNING"
  28924. // "FIELD_VALUE_OVERRIDEN"
  28925. // "INJECTED_KERNELS_DEPRECATED"
  28926. // "MISSING_TYPE_DEPENDENCY"
  28927. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28928. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28929. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28930. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28931. // "NEXT_HOP_NOT_RUNNING"
  28932. // "NOT_CRITICAL_ERROR"
  28933. // "NO_RESULTS_ON_PAGE"
  28934. // "REQUIRED_TOS_AGREEMENT"
  28935. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28936. // "RESOURCE_NOT_DELETED"
  28937. // "SCHEMA_VALIDATION_IGNORED"
  28938. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28939. // "UNDECLARED_PROPERTIES"
  28940. // "UNREACHABLE"
  28941. Code string `json:"code,omitempty"`
  28942. // Data: [Output Only] Metadata about this warning in key: value format.
  28943. // For example:
  28944. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28945. Data []*VmEndpointNatMappingsListWarningData `json:"data,omitempty"`
  28946. // Message: [Output Only] A human-readable description of the warning
  28947. // code.
  28948. Message string `json:"message,omitempty"`
  28949. // ForceSendFields is a list of field names (e.g. "Code") to
  28950. // unconditionally include in API requests. By default, fields with
  28951. // empty values are omitted from API requests. However, any non-pointer,
  28952. // non-interface field appearing in ForceSendFields will be sent to the
  28953. // server regardless of whether the field is empty or not. This may be
  28954. // used to include empty fields in Patch requests.
  28955. ForceSendFields []string `json:"-"`
  28956. // NullFields is a list of field names (e.g. "Code") to include in API
  28957. // requests with the JSON null value. By default, fields with empty
  28958. // values are omitted from API requests. However, any field with an
  28959. // empty value appearing in NullFields will be sent to the server as
  28960. // null. It is an error if a field in this list has a non-empty value.
  28961. // This may be used to include null fields in Patch requests.
  28962. NullFields []string `json:"-"`
  28963. }
  28964. func (s *VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
  28965. type NoMethod VmEndpointNatMappingsListWarning
  28966. raw := NoMethod(*s)
  28967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28968. }
  28969. type VmEndpointNatMappingsListWarningData struct {
  28970. // Key: [Output Only] A key that provides more detail on the warning
  28971. // being returned. For example, for warnings where there are no results
  28972. // in a list request for a particular zone, this key might be scope and
  28973. // the key value might be the zone name. Other examples might be a key
  28974. // indicating a deprecated resource and a suggested replacement, or a
  28975. // warning about invalid network settings (for example, if an instance
  28976. // attempts to perform IP forwarding but is not enabled for IP
  28977. // forwarding).
  28978. Key string `json:"key,omitempty"`
  28979. // Value: [Output Only] A warning data value corresponding to the key.
  28980. Value string `json:"value,omitempty"`
  28981. // ForceSendFields is a list of field names (e.g. "Key") to
  28982. // unconditionally include in API requests. By default, fields with
  28983. // empty values are omitted from API requests. However, any non-pointer,
  28984. // non-interface field appearing in ForceSendFields will be sent to the
  28985. // server regardless of whether the field is empty or not. This may be
  28986. // used to include empty fields in Patch requests.
  28987. ForceSendFields []string `json:"-"`
  28988. // NullFields is a list of field names (e.g. "Key") to include in API
  28989. // requests with the JSON null value. By default, fields with empty
  28990. // values are omitted from API requests. However, any field with an
  28991. // empty value appearing in NullFields will be sent to the server as
  28992. // null. It is an error if a field in this list has a non-empty value.
  28993. // This may be used to include null fields in Patch requests.
  28994. NullFields []string `json:"-"`
  28995. }
  28996. func (s *VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
  28997. type NoMethod VmEndpointNatMappingsListWarningData
  28998. raw := NoMethod(*s)
  28999. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29000. }
  29001. // VpnGateway: Represents a VPN gateway resource.
  29002. type VpnGateway struct {
  29003. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  29004. // format.
  29005. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  29006. // Description: An optional description of this resource. Provide this
  29007. // property when you create the resource.
  29008. Description string `json:"description,omitempty"`
  29009. // Id: [Output Only] The unique identifier for the resource. This
  29010. // identifier is defined by the server.
  29011. Id uint64 `json:"id,omitempty,string"`
  29012. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  29013. // VPN gateways.
  29014. Kind string `json:"kind,omitempty"`
  29015. // LabelFingerprint: A fingerprint for the labels being applied to this
  29016. // VpnGateway, which is essentially a hash of the labels set used for
  29017. // optimistic locking. The fingerprint is initially generated by Compute
  29018. // Engine and changes after every request to modify or update labels.
  29019. // You must always provide an up-to-date fingerprint hash in order to
  29020. // update or change labels, otherwise the request will fail with error
  29021. // 412 conditionNotMet.
  29022. //
  29023. // To see the latest fingerprint, make a get() request to retrieve an
  29024. // VpnGateway.
  29025. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  29026. // Labels: Labels to apply to this VpnGateway resource. These can be
  29027. // later modified by the setLabels method. Each label key/value must
  29028. // comply with RFC1035. Label values may be empty.
  29029. Labels map[string]string `json:"labels,omitempty"`
  29030. // Name: Name of the resource. Provided by the client when the resource
  29031. // is created. The name must be 1-63 characters long, and comply with
  29032. // RFC1035. Specifically, the name must be 1-63 characters long and
  29033. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  29034. // the first character must be a lowercase letter, and all following
  29035. // characters must be a dash, lowercase letter, or digit, except the
  29036. // last character, which cannot be a dash.
  29037. Name string `json:"name,omitempty"`
  29038. // Network: URL of the network to which this VPN gateway is attached.
  29039. // Provided by the client when the VPN gateway is created.
  29040. Network string `json:"network,omitempty"`
  29041. // Region: [Output Only] URL of the region where the VPN gateway
  29042. // resides.
  29043. Region string `json:"region,omitempty"`
  29044. // SelfLink: [Output Only] Server-defined URL for the resource.
  29045. SelfLink string `json:"selfLink,omitempty"`
  29046. // VpnInterfaces: [Output Only] A list of interfaces on this VPN
  29047. // gateway.
  29048. VpnInterfaces []*VpnGatewayVpnGatewayInterface `json:"vpnInterfaces,omitempty"`
  29049. // ServerResponse contains the HTTP response code and headers from the
  29050. // server.
  29051. googleapi.ServerResponse `json:"-"`
  29052. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  29053. // to unconditionally include in API requests. By default, fields with
  29054. // empty values are omitted from API requests. However, any non-pointer,
  29055. // non-interface field appearing in ForceSendFields will be sent to the
  29056. // server regardless of whether the field is empty or not. This may be
  29057. // used to include empty fields in Patch requests.
  29058. ForceSendFields []string `json:"-"`
  29059. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  29060. // include in API requests with the JSON null value. By default, fields
  29061. // with empty values are omitted from API requests. However, any field
  29062. // with an empty value appearing in NullFields will be sent to the
  29063. // server as null. It is an error if a field in this list has a
  29064. // non-empty value. This may be used to include null fields in Patch
  29065. // requests.
  29066. NullFields []string `json:"-"`
  29067. }
  29068. func (s *VpnGateway) MarshalJSON() ([]byte, error) {
  29069. type NoMethod VpnGateway
  29070. raw := NoMethod(*s)
  29071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29072. }
  29073. type VpnGatewayAggregatedList struct {
  29074. // Id: [Output Only] Unique identifier for the resource; defined by the
  29075. // server.
  29076. Id string `json:"id,omitempty"`
  29077. // Items: A list of VpnGateway resources.
  29078. Items map[string]VpnGatewaysScopedList `json:"items,omitempty"`
  29079. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  29080. // VPN gateways.
  29081. Kind string `json:"kind,omitempty"`
  29082. // NextPageToken: [Output Only] This token allows you to get the next
  29083. // page of results for list requests. If the number of results is larger
  29084. // than maxResults, use the nextPageToken as a value for the query
  29085. // parameter pageToken in the next list request. Subsequent list
  29086. // requests will have their own nextPageToken to continue paging through
  29087. // the results.
  29088. NextPageToken string `json:"nextPageToken,omitempty"`
  29089. // SelfLink: [Output Only] Server-defined URL for this resource.
  29090. SelfLink string `json:"selfLink,omitempty"`
  29091. // Warning: [Output Only] Informational warning message.
  29092. Warning *VpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  29093. // ServerResponse contains the HTTP response code and headers from the
  29094. // server.
  29095. googleapi.ServerResponse `json:"-"`
  29096. // ForceSendFields is a list of field names (e.g. "Id") to
  29097. // unconditionally include in API requests. By default, fields with
  29098. // empty values are omitted from API requests. However, any non-pointer,
  29099. // non-interface field appearing in ForceSendFields will be sent to the
  29100. // server regardless of whether the field is empty or not. This may be
  29101. // used to include empty fields in Patch requests.
  29102. ForceSendFields []string `json:"-"`
  29103. // NullFields is a list of field names (e.g. "Id") to include in API
  29104. // requests with the JSON null value. By default, fields with empty
  29105. // values are omitted from API requests. However, any field with an
  29106. // empty value appearing in NullFields will be sent to the server as
  29107. // null. It is an error if a field in this list has a non-empty value.
  29108. // This may be used to include null fields in Patch requests.
  29109. NullFields []string `json:"-"`
  29110. }
  29111. func (s *VpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  29112. type NoMethod VpnGatewayAggregatedList
  29113. raw := NoMethod(*s)
  29114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29115. }
  29116. // VpnGatewayAggregatedListWarning: [Output Only] Informational warning
  29117. // message.
  29118. type VpnGatewayAggregatedListWarning struct {
  29119. // Code: [Output Only] A warning code, if applicable. For example,
  29120. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29121. // the response.
  29122. //
  29123. // Possible values:
  29124. // "CLEANUP_FAILED"
  29125. // "DEPRECATED_RESOURCE_USED"
  29126. // "DEPRECATED_TYPE_USED"
  29127. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29128. // "EXPERIMENTAL_TYPE_USED"
  29129. // "EXTERNAL_API_WARNING"
  29130. // "FIELD_VALUE_OVERRIDEN"
  29131. // "INJECTED_KERNELS_DEPRECATED"
  29132. // "MISSING_TYPE_DEPENDENCY"
  29133. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29134. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29135. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29136. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29137. // "NEXT_HOP_NOT_RUNNING"
  29138. // "NOT_CRITICAL_ERROR"
  29139. // "NO_RESULTS_ON_PAGE"
  29140. // "REQUIRED_TOS_AGREEMENT"
  29141. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29142. // "RESOURCE_NOT_DELETED"
  29143. // "SCHEMA_VALIDATION_IGNORED"
  29144. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29145. // "UNDECLARED_PROPERTIES"
  29146. // "UNREACHABLE"
  29147. Code string `json:"code,omitempty"`
  29148. // Data: [Output Only] Metadata about this warning in key: value format.
  29149. // For example:
  29150. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29151. Data []*VpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  29152. // Message: [Output Only] A human-readable description of the warning
  29153. // code.
  29154. Message string `json:"message,omitempty"`
  29155. // ForceSendFields is a list of field names (e.g. "Code") to
  29156. // unconditionally include in API requests. By default, fields with
  29157. // empty values are omitted from API requests. However, any non-pointer,
  29158. // non-interface field appearing in ForceSendFields will be sent to the
  29159. // server regardless of whether the field is empty or not. This may be
  29160. // used to include empty fields in Patch requests.
  29161. ForceSendFields []string `json:"-"`
  29162. // NullFields is a list of field names (e.g. "Code") to include in API
  29163. // requests with the JSON null value. By default, fields with empty
  29164. // values are omitted from API requests. However, any field with an
  29165. // empty value appearing in NullFields will be sent to the server as
  29166. // null. It is an error if a field in this list has a non-empty value.
  29167. // This may be used to include null fields in Patch requests.
  29168. NullFields []string `json:"-"`
  29169. }
  29170. func (s *VpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  29171. type NoMethod VpnGatewayAggregatedListWarning
  29172. raw := NoMethod(*s)
  29173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29174. }
  29175. type VpnGatewayAggregatedListWarningData struct {
  29176. // Key: [Output Only] A key that provides more detail on the warning
  29177. // being returned. For example, for warnings where there are no results
  29178. // in a list request for a particular zone, this key might be scope and
  29179. // the key value might be the zone name. Other examples might be a key
  29180. // indicating a deprecated resource and a suggested replacement, or a
  29181. // warning about invalid network settings (for example, if an instance
  29182. // attempts to perform IP forwarding but is not enabled for IP
  29183. // forwarding).
  29184. Key string `json:"key,omitempty"`
  29185. // Value: [Output Only] A warning data value corresponding to the key.
  29186. Value string `json:"value,omitempty"`
  29187. // ForceSendFields is a list of field names (e.g. "Key") to
  29188. // unconditionally include in API requests. By default, fields with
  29189. // empty values are omitted from API requests. However, any non-pointer,
  29190. // non-interface field appearing in ForceSendFields will be sent to the
  29191. // server regardless of whether the field is empty or not. This may be
  29192. // used to include empty fields in Patch requests.
  29193. ForceSendFields []string `json:"-"`
  29194. // NullFields is a list of field names (e.g. "Key") to include in API
  29195. // requests with the JSON null value. By default, fields with empty
  29196. // values are omitted from API requests. However, any field with an
  29197. // empty value appearing in NullFields will be sent to the server as
  29198. // null. It is an error if a field in this list has a non-empty value.
  29199. // This may be used to include null fields in Patch requests.
  29200. NullFields []string `json:"-"`
  29201. }
  29202. func (s *VpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  29203. type NoMethod VpnGatewayAggregatedListWarningData
  29204. raw := NoMethod(*s)
  29205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29206. }
  29207. // VpnGatewayList: Contains a list of VpnGateway resources.
  29208. type VpnGatewayList struct {
  29209. // Id: [Output Only] Unique identifier for the resource; defined by the
  29210. // server.
  29211. Id string `json:"id,omitempty"`
  29212. // Items: A list of VpnGateway resources.
  29213. Items []*VpnGateway `json:"items,omitempty"`
  29214. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  29215. // VPN gateways.
  29216. Kind string `json:"kind,omitempty"`
  29217. // NextPageToken: [Output Only] This token allows you to get the next
  29218. // page of results for list requests. If the number of results is larger
  29219. // than maxResults, use the nextPageToken as a value for the query
  29220. // parameter pageToken in the next list request. Subsequent list
  29221. // requests will have their own nextPageToken to continue paging through
  29222. // the results.
  29223. NextPageToken string `json:"nextPageToken,omitempty"`
  29224. // SelfLink: [Output Only] Server-defined URL for this resource.
  29225. SelfLink string `json:"selfLink,omitempty"`
  29226. // Warning: [Output Only] Informational warning message.
  29227. Warning *VpnGatewayListWarning `json:"warning,omitempty"`
  29228. // ServerResponse contains the HTTP response code and headers from the
  29229. // server.
  29230. googleapi.ServerResponse `json:"-"`
  29231. // ForceSendFields is a list of field names (e.g. "Id") to
  29232. // unconditionally include in API requests. By default, fields with
  29233. // empty values are omitted from API requests. However, any non-pointer,
  29234. // non-interface field appearing in ForceSendFields will be sent to the
  29235. // server regardless of whether the field is empty or not. This may be
  29236. // used to include empty fields in Patch requests.
  29237. ForceSendFields []string `json:"-"`
  29238. // NullFields is a list of field names (e.g. "Id") to include in API
  29239. // requests with the JSON null value. By default, fields with empty
  29240. // values are omitted from API requests. However, any field with an
  29241. // empty value appearing in NullFields will be sent to the server as
  29242. // null. It is an error if a field in this list has a non-empty value.
  29243. // This may be used to include null fields in Patch requests.
  29244. NullFields []string `json:"-"`
  29245. }
  29246. func (s *VpnGatewayList) MarshalJSON() ([]byte, error) {
  29247. type NoMethod VpnGatewayList
  29248. raw := NoMethod(*s)
  29249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29250. }
  29251. // VpnGatewayListWarning: [Output Only] Informational warning message.
  29252. type VpnGatewayListWarning struct {
  29253. // Code: [Output Only] A warning code, if applicable. For example,
  29254. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29255. // the response.
  29256. //
  29257. // Possible values:
  29258. // "CLEANUP_FAILED"
  29259. // "DEPRECATED_RESOURCE_USED"
  29260. // "DEPRECATED_TYPE_USED"
  29261. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29262. // "EXPERIMENTAL_TYPE_USED"
  29263. // "EXTERNAL_API_WARNING"
  29264. // "FIELD_VALUE_OVERRIDEN"
  29265. // "INJECTED_KERNELS_DEPRECATED"
  29266. // "MISSING_TYPE_DEPENDENCY"
  29267. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29268. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29269. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29270. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29271. // "NEXT_HOP_NOT_RUNNING"
  29272. // "NOT_CRITICAL_ERROR"
  29273. // "NO_RESULTS_ON_PAGE"
  29274. // "REQUIRED_TOS_AGREEMENT"
  29275. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29276. // "RESOURCE_NOT_DELETED"
  29277. // "SCHEMA_VALIDATION_IGNORED"
  29278. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29279. // "UNDECLARED_PROPERTIES"
  29280. // "UNREACHABLE"
  29281. Code string `json:"code,omitempty"`
  29282. // Data: [Output Only] Metadata about this warning in key: value format.
  29283. // For example:
  29284. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29285. Data []*VpnGatewayListWarningData `json:"data,omitempty"`
  29286. // Message: [Output Only] A human-readable description of the warning
  29287. // code.
  29288. Message string `json:"message,omitempty"`
  29289. // ForceSendFields is a list of field names (e.g. "Code") to
  29290. // unconditionally include in API requests. By default, fields with
  29291. // empty values are omitted from API requests. However, any non-pointer,
  29292. // non-interface field appearing in ForceSendFields will be sent to the
  29293. // server regardless of whether the field is empty or not. This may be
  29294. // used to include empty fields in Patch requests.
  29295. ForceSendFields []string `json:"-"`
  29296. // NullFields is a list of field names (e.g. "Code") to include in API
  29297. // requests with the JSON null value. By default, fields with empty
  29298. // values are omitted from API requests. However, any field with an
  29299. // empty value appearing in NullFields will be sent to the server as
  29300. // null. It is an error if a field in this list has a non-empty value.
  29301. // This may be used to include null fields in Patch requests.
  29302. NullFields []string `json:"-"`
  29303. }
  29304. func (s *VpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  29305. type NoMethod VpnGatewayListWarning
  29306. raw := NoMethod(*s)
  29307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29308. }
  29309. type VpnGatewayListWarningData struct {
  29310. // Key: [Output Only] A key that provides more detail on the warning
  29311. // being returned. For example, for warnings where there are no results
  29312. // in a list request for a particular zone, this key might be scope and
  29313. // the key value might be the zone name. Other examples might be a key
  29314. // indicating a deprecated resource and a suggested replacement, or a
  29315. // warning about invalid network settings (for example, if an instance
  29316. // attempts to perform IP forwarding but is not enabled for IP
  29317. // forwarding).
  29318. Key string `json:"key,omitempty"`
  29319. // Value: [Output Only] A warning data value corresponding to the key.
  29320. Value string `json:"value,omitempty"`
  29321. // ForceSendFields is a list of field names (e.g. "Key") to
  29322. // unconditionally include in API requests. By default, fields with
  29323. // empty values are omitted from API requests. However, any non-pointer,
  29324. // non-interface field appearing in ForceSendFields will be sent to the
  29325. // server regardless of whether the field is empty or not. This may be
  29326. // used to include empty fields in Patch requests.
  29327. ForceSendFields []string `json:"-"`
  29328. // NullFields is a list of field names (e.g. "Key") to include in API
  29329. // requests with the JSON null value. By default, fields with empty
  29330. // values are omitted from API requests. However, any field with an
  29331. // empty value appearing in NullFields will be sent to the server as
  29332. // null. It is an error if a field in this list has a non-empty value.
  29333. // This may be used to include null fields in Patch requests.
  29334. NullFields []string `json:"-"`
  29335. }
  29336. func (s *VpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  29337. type NoMethod VpnGatewayListWarningData
  29338. raw := NoMethod(*s)
  29339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29340. }
  29341. // VpnGatewayVpnGatewayInterface: A VPN gateway interface.
  29342. type VpnGatewayVpnGatewayInterface struct {
  29343. // Id: The numeric ID of this VPN gateway interface.
  29344. Id int64 `json:"id,omitempty"`
  29345. // IpAddress: The external IP address for this VPN gateway interface.
  29346. IpAddress string `json:"ipAddress,omitempty"`
  29347. // ForceSendFields is a list of field names (e.g. "Id") to
  29348. // unconditionally include in API requests. By default, fields with
  29349. // empty values are omitted from API requests. However, any non-pointer,
  29350. // non-interface field appearing in ForceSendFields will be sent to the
  29351. // server regardless of whether the field is empty or not. This may be
  29352. // used to include empty fields in Patch requests.
  29353. ForceSendFields []string `json:"-"`
  29354. // NullFields is a list of field names (e.g. "Id") to include in API
  29355. // requests with the JSON null value. By default, fields with empty
  29356. // values are omitted from API requests. However, any field with an
  29357. // empty value appearing in NullFields will be sent to the server as
  29358. // null. It is an error if a field in this list has a non-empty value.
  29359. // This may be used to include null fields in Patch requests.
  29360. NullFields []string `json:"-"`
  29361. }
  29362. func (s *VpnGatewayVpnGatewayInterface) MarshalJSON() ([]byte, error) {
  29363. type NoMethod VpnGatewayVpnGatewayInterface
  29364. raw := NoMethod(*s)
  29365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29366. }
  29367. type VpnGatewaysScopedList struct {
  29368. // VpnGateways: [Output Only] A list of VPN gateways contained in this
  29369. // scope.
  29370. VpnGateways []*VpnGateway `json:"vpnGateways,omitempty"`
  29371. // Warning: [Output Only] Informational warning which replaces the list
  29372. // of addresses when the list is empty.
  29373. Warning *VpnGatewaysScopedListWarning `json:"warning,omitempty"`
  29374. // ForceSendFields is a list of field names (e.g. "VpnGateways") to
  29375. // unconditionally include in API requests. By default, fields with
  29376. // empty values are omitted from API requests. However, any non-pointer,
  29377. // non-interface field appearing in ForceSendFields will be sent to the
  29378. // server regardless of whether the field is empty or not. This may be
  29379. // used to include empty fields in Patch requests.
  29380. ForceSendFields []string `json:"-"`
  29381. // NullFields is a list of field names (e.g. "VpnGateways") to include
  29382. // in API requests with the JSON null value. By default, fields with
  29383. // empty values are omitted from API requests. However, any field with
  29384. // an empty value appearing in NullFields will be sent to the server as
  29385. // null. It is an error if a field in this list has a non-empty value.
  29386. // This may be used to include null fields in Patch requests.
  29387. NullFields []string `json:"-"`
  29388. }
  29389. func (s *VpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  29390. type NoMethod VpnGatewaysScopedList
  29391. raw := NoMethod(*s)
  29392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29393. }
  29394. // VpnGatewaysScopedListWarning: [Output Only] Informational warning
  29395. // which replaces the list of addresses when the list is empty.
  29396. type VpnGatewaysScopedListWarning struct {
  29397. // Code: [Output Only] A warning code, if applicable. For example,
  29398. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29399. // the response.
  29400. //
  29401. // Possible values:
  29402. // "CLEANUP_FAILED"
  29403. // "DEPRECATED_RESOURCE_USED"
  29404. // "DEPRECATED_TYPE_USED"
  29405. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29406. // "EXPERIMENTAL_TYPE_USED"
  29407. // "EXTERNAL_API_WARNING"
  29408. // "FIELD_VALUE_OVERRIDEN"
  29409. // "INJECTED_KERNELS_DEPRECATED"
  29410. // "MISSING_TYPE_DEPENDENCY"
  29411. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29412. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29413. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29414. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29415. // "NEXT_HOP_NOT_RUNNING"
  29416. // "NOT_CRITICAL_ERROR"
  29417. // "NO_RESULTS_ON_PAGE"
  29418. // "REQUIRED_TOS_AGREEMENT"
  29419. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29420. // "RESOURCE_NOT_DELETED"
  29421. // "SCHEMA_VALIDATION_IGNORED"
  29422. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29423. // "UNDECLARED_PROPERTIES"
  29424. // "UNREACHABLE"
  29425. Code string `json:"code,omitempty"`
  29426. // Data: [Output Only] Metadata about this warning in key: value format.
  29427. // For example:
  29428. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29429. Data []*VpnGatewaysScopedListWarningData `json:"data,omitempty"`
  29430. // Message: [Output Only] A human-readable description of the warning
  29431. // code.
  29432. Message string `json:"message,omitempty"`
  29433. // ForceSendFields is a list of field names (e.g. "Code") to
  29434. // unconditionally include in API requests. By default, fields with
  29435. // empty values are omitted from API requests. However, any non-pointer,
  29436. // non-interface field appearing in ForceSendFields will be sent to the
  29437. // server regardless of whether the field is empty or not. This may be
  29438. // used to include empty fields in Patch requests.
  29439. ForceSendFields []string `json:"-"`
  29440. // NullFields is a list of field names (e.g. "Code") to include in API
  29441. // requests with the JSON null value. By default, fields with empty
  29442. // values are omitted from API requests. However, any field with an
  29443. // empty value appearing in NullFields will be sent to the server as
  29444. // null. It is an error if a field in this list has a non-empty value.
  29445. // This may be used to include null fields in Patch requests.
  29446. NullFields []string `json:"-"`
  29447. }
  29448. func (s *VpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  29449. type NoMethod VpnGatewaysScopedListWarning
  29450. raw := NoMethod(*s)
  29451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29452. }
  29453. type VpnGatewaysScopedListWarningData struct {
  29454. // Key: [Output Only] A key that provides more detail on the warning
  29455. // being returned. For example, for warnings where there are no results
  29456. // in a list request for a particular zone, this key might be scope and
  29457. // the key value might be the zone name. Other examples might be a key
  29458. // indicating a deprecated resource and a suggested replacement, or a
  29459. // warning about invalid network settings (for example, if an instance
  29460. // attempts to perform IP forwarding but is not enabled for IP
  29461. // forwarding).
  29462. Key string `json:"key,omitempty"`
  29463. // Value: [Output Only] A warning data value corresponding to the key.
  29464. Value string `json:"value,omitempty"`
  29465. // ForceSendFields is a list of field names (e.g. "Key") to
  29466. // unconditionally include in API requests. By default, fields with
  29467. // empty values are omitted from API requests. However, any non-pointer,
  29468. // non-interface field appearing in ForceSendFields will be sent to the
  29469. // server regardless of whether the field is empty or not. This may be
  29470. // used to include empty fields in Patch requests.
  29471. ForceSendFields []string `json:"-"`
  29472. // NullFields is a list of field names (e.g. "Key") to include in API
  29473. // requests with the JSON null value. By default, fields with empty
  29474. // values are omitted from API requests. However, any field with an
  29475. // empty value appearing in NullFields will be sent to the server as
  29476. // null. It is an error if a field in this list has a non-empty value.
  29477. // This may be used to include null fields in Patch requests.
  29478. NullFields []string `json:"-"`
  29479. }
  29480. func (s *VpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  29481. type NoMethod VpnGatewaysScopedListWarningData
  29482. raw := NoMethod(*s)
  29483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29484. }
  29485. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  29486. // (== resource_for v1.vpnTunnels ==)
  29487. type VpnTunnel struct {
  29488. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  29489. // format.
  29490. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  29491. // Description: An optional description of this resource. Provide this
  29492. // property when you create the resource.
  29493. Description string `json:"description,omitempty"`
  29494. // DetailedStatus: [Output Only] Detailed status message for the VPN
  29495. // tunnel.
  29496. DetailedStatus string `json:"detailedStatus,omitempty"`
  29497. // Id: [Output Only] The unique identifier for the resource. This
  29498. // identifier is defined by the server.
  29499. Id uint64 `json:"id,omitempty,string"`
  29500. // IkeVersion: IKE protocol version to use when establishing the VPN
  29501. // tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2.
  29502. // The default version is 2.
  29503. IkeVersion int64 `json:"ikeVersion,omitempty"`
  29504. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  29505. // VPN tunnels.
  29506. Kind string `json:"kind,omitempty"`
  29507. // LabelFingerprint: A fingerprint for the labels being applied to this
  29508. // VpnTunnel, which is essentially a hash of the labels set used for
  29509. // optimistic locking. The fingerprint is initially generated by Compute
  29510. // Engine and changes after every request to modify or update labels.
  29511. // You must always provide an up-to-date fingerprint hash in order to
  29512. // update or change labels, otherwise the request will fail with error
  29513. // 412 conditionNotMet.
  29514. //
  29515. // To see the latest fingerprint, make a get() request to retrieve a
  29516. // VpnTunnel.
  29517. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  29518. // Labels: Labels to apply to this VpnTunnel. These can be later
  29519. // modified by the setLabels method. Each label key/value pair must
  29520. // comply with RFC1035. Label values may be empty.
  29521. Labels map[string]string `json:"labels,omitempty"`
  29522. // LocalTrafficSelector: Local traffic selector to use when establishing
  29523. // the VPN tunnel with the peer VPN gateway. The value should be a CIDR
  29524. // formatted string, for example: 192.168.0.0/16. The ranges must be
  29525. // disjoint. Only IPv4 is supported.
  29526. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  29527. // Name: Name of the resource. Provided by the client when the resource
  29528. // is created. The name must be 1-63 characters long, and comply with
  29529. // RFC1035. Specifically, the name must be 1-63 characters long and
  29530. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  29531. // the first character must be a lowercase letter, and all following
  29532. // characters must be a dash, lowercase letter, or digit, except the
  29533. // last character, which cannot be a dash.
  29534. Name string `json:"name,omitempty"`
  29535. // PeerExternalGateway: URL of the peer side external VPN gateway to
  29536. // which this VPN tunnel is connected. Provided by the client when the
  29537. // VPN tunnel is created. This field is exclusive with the field
  29538. // peerGcpGateway.
  29539. PeerExternalGateway string `json:"peerExternalGateway,omitempty"`
  29540. // PeerExternalGatewayInterface: The interface ID of the external VPN
  29541. // gateway to which this VPN tunnel is connected. Provided by the client
  29542. // when the VPN tunnel is created.
  29543. PeerExternalGatewayInterface int64 `json:"peerExternalGatewayInterface,omitempty"`
  29544. // PeerGcpGateway: URL of the peer side HA GCP VPN gateway to which this
  29545. // VPN tunnel is connected. Provided by the client when the VPN tunnel
  29546. // is created. This field can be used when creating highly available VPN
  29547. // from VPC network to VPC network, the field is exclusive with the
  29548. // field peerExternalGateway. If provided, the VPN tunnel will
  29549. // automatically use the same vpnGatewayInterface ID in the peer GCP VPN
  29550. // gateway.
  29551. PeerGcpGateway string `json:"peerGcpGateway,omitempty"`
  29552. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  29553. PeerIp string `json:"peerIp,omitempty"`
  29554. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  29555. // You must specify this field as part of the HTTP request URL. It is
  29556. // not settable as a field in the request body.
  29557. Region string `json:"region,omitempty"`
  29558. // RemoteTrafficSelector: Remote traffic selectors to use when
  29559. // establishing the VPN tunnel with the peer VPN gateway. The value
  29560. // should be a CIDR formatted string, for example: 192.168.0.0/16. The
  29561. // ranges should be disjoint. Only IPv4 is supported.
  29562. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  29563. // Router: URL of the router resource to be used for dynamic routing.
  29564. Router string `json:"router,omitempty"`
  29565. // SelfLink: [Output Only] Server-defined URL for the resource.
  29566. SelfLink string `json:"selfLink,omitempty"`
  29567. // SharedSecret: Shared secret used to set the secure session between
  29568. // the Cloud VPN gateway and the peer VPN gateway.
  29569. SharedSecret string `json:"sharedSecret,omitempty"`
  29570. // SharedSecretHash: Hash of the shared secret.
  29571. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  29572. // Status: [Output Only] The status of the VPN tunnel, which can be one
  29573. // of the following:
  29574. // - PROVISIONING: Resource is being allocated for the VPN tunnel.
  29575. // - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs
  29576. // from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule,
  29577. // and Route resources are needed to setup the VPN tunnel.
  29578. // - FIRST_HANDSHAKE: Successful first handshake with the peer VPN.
  29579. // - ESTABLISHED: Secure session is successfully established with the
  29580. // peer VPN.
  29581. // - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS
  29582. // - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret).
  29583. //
  29584. // - NEGOTIATION_FAILURE: Handshake failed.
  29585. // - DEPROVISIONING: Resources are being deallocated for the VPN tunnel.
  29586. //
  29587. // - FAILED: Tunnel creation has failed and the tunnel is not ready to
  29588. // be used.
  29589. //
  29590. // Possible values:
  29591. // "ALLOCATING_RESOURCES"
  29592. // "AUTHORIZATION_ERROR"
  29593. // "DEPROVISIONING"
  29594. // "ESTABLISHED"
  29595. // "FAILED"
  29596. // "FIRST_HANDSHAKE"
  29597. // "NEGOTIATION_FAILURE"
  29598. // "NETWORK_ERROR"
  29599. // "NO_INCOMING_PACKETS"
  29600. // "PROVISIONING"
  29601. // "REJECTED"
  29602. // "WAITING_FOR_FULL_CONFIG"
  29603. Status string `json:"status,omitempty"`
  29604. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  29605. // tunnel is associated. Provided by the client when the VPN tunnel is
  29606. // created.
  29607. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  29608. // VpnGateway: URL of the VPN gateway with which this VPN tunnel is
  29609. // associated. Provided by the client when the VPN tunnel is created.
  29610. // This must be used (instead of target_vpn_gateway) if a High
  29611. // Availability VPN gateway resource is created.
  29612. VpnGateway string `json:"vpnGateway,omitempty"`
  29613. // VpnGatewayInterface: The interface ID of the VPN gateway with which
  29614. // this VPN tunnel is associated.
  29615. VpnGatewayInterface int64 `json:"vpnGatewayInterface,omitempty"`
  29616. // ServerResponse contains the HTTP response code and headers from the
  29617. // server.
  29618. googleapi.ServerResponse `json:"-"`
  29619. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  29620. // to unconditionally include in API requests. By default, fields with
  29621. // empty values are omitted from API requests. However, any non-pointer,
  29622. // non-interface field appearing in ForceSendFields will be sent to the
  29623. // server regardless of whether the field is empty or not. This may be
  29624. // used to include empty fields in Patch requests.
  29625. ForceSendFields []string `json:"-"`
  29626. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  29627. // include in API requests with the JSON null value. By default, fields
  29628. // with empty values are omitted from API requests. However, any field
  29629. // with an empty value appearing in NullFields will be sent to the
  29630. // server as null. It is an error if a field in this list has a
  29631. // non-empty value. This may be used to include null fields in Patch
  29632. // requests.
  29633. NullFields []string `json:"-"`
  29634. }
  29635. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  29636. type NoMethod VpnTunnel
  29637. raw := NoMethod(*s)
  29638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29639. }
  29640. type VpnTunnelAggregatedList struct {
  29641. // Id: [Output Only] Unique identifier for the resource; defined by the
  29642. // server.
  29643. Id string `json:"id,omitempty"`
  29644. // Items: A list of VpnTunnelsScopedList resources.
  29645. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  29646. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  29647. // VPN tunnels.
  29648. Kind string `json:"kind,omitempty"`
  29649. // NextPageToken: [Output Only] This token allows you to get the next
  29650. // page of results for list requests. If the number of results is larger
  29651. // than maxResults, use the nextPageToken as a value for the query
  29652. // parameter pageToken in the next list request. Subsequent list
  29653. // requests will have their own nextPageToken to continue paging through
  29654. // the results.
  29655. NextPageToken string `json:"nextPageToken,omitempty"`
  29656. // SelfLink: [Output Only] Server-defined URL for this resource.
  29657. SelfLink string `json:"selfLink,omitempty"`
  29658. // Warning: [Output Only] Informational warning message.
  29659. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  29660. // ServerResponse contains the HTTP response code and headers from the
  29661. // server.
  29662. googleapi.ServerResponse `json:"-"`
  29663. // ForceSendFields is a list of field names (e.g. "Id") to
  29664. // unconditionally include in API requests. By default, fields with
  29665. // empty values are omitted from API requests. However, any non-pointer,
  29666. // non-interface field appearing in ForceSendFields will be sent to the
  29667. // server regardless of whether the field is empty or not. This may be
  29668. // used to include empty fields in Patch requests.
  29669. ForceSendFields []string `json:"-"`
  29670. // NullFields is a list of field names (e.g. "Id") to include in API
  29671. // requests with the JSON null value. By default, fields with empty
  29672. // values are omitted from API requests. However, any field with an
  29673. // empty value appearing in NullFields will be sent to the server as
  29674. // null. It is an error if a field in this list has a non-empty value.
  29675. // This may be used to include null fields in Patch requests.
  29676. NullFields []string `json:"-"`
  29677. }
  29678. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  29679. type NoMethod VpnTunnelAggregatedList
  29680. raw := NoMethod(*s)
  29681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29682. }
  29683. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  29684. // message.
  29685. type VpnTunnelAggregatedListWarning struct {
  29686. // Code: [Output Only] A warning code, if applicable. For example,
  29687. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29688. // the response.
  29689. //
  29690. // Possible values:
  29691. // "CLEANUP_FAILED"
  29692. // "DEPRECATED_RESOURCE_USED"
  29693. // "DEPRECATED_TYPE_USED"
  29694. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29695. // "EXPERIMENTAL_TYPE_USED"
  29696. // "EXTERNAL_API_WARNING"
  29697. // "FIELD_VALUE_OVERRIDEN"
  29698. // "INJECTED_KERNELS_DEPRECATED"
  29699. // "MISSING_TYPE_DEPENDENCY"
  29700. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29701. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29702. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29703. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29704. // "NEXT_HOP_NOT_RUNNING"
  29705. // "NOT_CRITICAL_ERROR"
  29706. // "NO_RESULTS_ON_PAGE"
  29707. // "REQUIRED_TOS_AGREEMENT"
  29708. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29709. // "RESOURCE_NOT_DELETED"
  29710. // "SCHEMA_VALIDATION_IGNORED"
  29711. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29712. // "UNDECLARED_PROPERTIES"
  29713. // "UNREACHABLE"
  29714. Code string `json:"code,omitempty"`
  29715. // Data: [Output Only] Metadata about this warning in key: value format.
  29716. // For example:
  29717. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29718. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  29719. // Message: [Output Only] A human-readable description of the warning
  29720. // code.
  29721. Message string `json:"message,omitempty"`
  29722. // ForceSendFields is a list of field names (e.g. "Code") to
  29723. // unconditionally include in API requests. By default, fields with
  29724. // empty values are omitted from API requests. However, any non-pointer,
  29725. // non-interface field appearing in ForceSendFields will be sent to the
  29726. // server regardless of whether the field is empty or not. This may be
  29727. // used to include empty fields in Patch requests.
  29728. ForceSendFields []string `json:"-"`
  29729. // NullFields is a list of field names (e.g. "Code") to include in API
  29730. // requests with the JSON null value. By default, fields with empty
  29731. // values are omitted from API requests. However, any field with an
  29732. // empty value appearing in NullFields will be sent to the server as
  29733. // null. It is an error if a field in this list has a non-empty value.
  29734. // This may be used to include null fields in Patch requests.
  29735. NullFields []string `json:"-"`
  29736. }
  29737. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  29738. type NoMethod VpnTunnelAggregatedListWarning
  29739. raw := NoMethod(*s)
  29740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29741. }
  29742. type VpnTunnelAggregatedListWarningData struct {
  29743. // Key: [Output Only] A key that provides more detail on the warning
  29744. // being returned. For example, for warnings where there are no results
  29745. // in a list request for a particular zone, this key might be scope and
  29746. // the key value might be the zone name. Other examples might be a key
  29747. // indicating a deprecated resource and a suggested replacement, or a
  29748. // warning about invalid network settings (for example, if an instance
  29749. // attempts to perform IP forwarding but is not enabled for IP
  29750. // forwarding).
  29751. Key string `json:"key,omitempty"`
  29752. // Value: [Output Only] A warning data value corresponding to the key.
  29753. Value string `json:"value,omitempty"`
  29754. // ForceSendFields is a list of field names (e.g. "Key") to
  29755. // unconditionally include in API requests. By default, fields with
  29756. // empty values are omitted from API requests. However, any non-pointer,
  29757. // non-interface field appearing in ForceSendFields will be sent to the
  29758. // server regardless of whether the field is empty or not. This may be
  29759. // used to include empty fields in Patch requests.
  29760. ForceSendFields []string `json:"-"`
  29761. // NullFields is a list of field names (e.g. "Key") to include in API
  29762. // requests with the JSON null value. By default, fields with empty
  29763. // values are omitted from API requests. However, any field with an
  29764. // empty value appearing in NullFields will be sent to the server as
  29765. // null. It is an error if a field in this list has a non-empty value.
  29766. // This may be used to include null fields in Patch requests.
  29767. NullFields []string `json:"-"`
  29768. }
  29769. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  29770. type NoMethod VpnTunnelAggregatedListWarningData
  29771. raw := NoMethod(*s)
  29772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29773. }
  29774. // VpnTunnelList: Contains a list of VpnTunnel resources.
  29775. type VpnTunnelList struct {
  29776. // Id: [Output Only] Unique identifier for the resource; defined by the
  29777. // server.
  29778. Id string `json:"id,omitempty"`
  29779. // Items: A list of VpnTunnel resources.
  29780. Items []*VpnTunnel `json:"items,omitempty"`
  29781. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  29782. // VPN tunnels.
  29783. Kind string `json:"kind,omitempty"`
  29784. // NextPageToken: [Output Only] This token allows you to get the next
  29785. // page of results for list requests. If the number of results is larger
  29786. // than maxResults, use the nextPageToken as a value for the query
  29787. // parameter pageToken in the next list request. Subsequent list
  29788. // requests will have their own nextPageToken to continue paging through
  29789. // the results.
  29790. NextPageToken string `json:"nextPageToken,omitempty"`
  29791. // SelfLink: [Output Only] Server-defined URL for this resource.
  29792. SelfLink string `json:"selfLink,omitempty"`
  29793. // Warning: [Output Only] Informational warning message.
  29794. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  29795. // ServerResponse contains the HTTP response code and headers from the
  29796. // server.
  29797. googleapi.ServerResponse `json:"-"`
  29798. // ForceSendFields is a list of field names (e.g. "Id") to
  29799. // unconditionally include in API requests. By default, fields with
  29800. // empty values are omitted from API requests. However, any non-pointer,
  29801. // non-interface field appearing in ForceSendFields will be sent to the
  29802. // server regardless of whether the field is empty or not. This may be
  29803. // used to include empty fields in Patch requests.
  29804. ForceSendFields []string `json:"-"`
  29805. // NullFields is a list of field names (e.g. "Id") to include in API
  29806. // requests with the JSON null value. By default, fields with empty
  29807. // values are omitted from API requests. However, any field with an
  29808. // empty value appearing in NullFields will be sent to the server as
  29809. // null. It is an error if a field in this list has a non-empty value.
  29810. // This may be used to include null fields in Patch requests.
  29811. NullFields []string `json:"-"`
  29812. }
  29813. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  29814. type NoMethod VpnTunnelList
  29815. raw := NoMethod(*s)
  29816. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29817. }
  29818. // VpnTunnelListWarning: [Output Only] Informational warning message.
  29819. type VpnTunnelListWarning struct {
  29820. // Code: [Output Only] A warning code, if applicable. For example,
  29821. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29822. // the response.
  29823. //
  29824. // Possible values:
  29825. // "CLEANUP_FAILED"
  29826. // "DEPRECATED_RESOURCE_USED"
  29827. // "DEPRECATED_TYPE_USED"
  29828. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29829. // "EXPERIMENTAL_TYPE_USED"
  29830. // "EXTERNAL_API_WARNING"
  29831. // "FIELD_VALUE_OVERRIDEN"
  29832. // "INJECTED_KERNELS_DEPRECATED"
  29833. // "MISSING_TYPE_DEPENDENCY"
  29834. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29835. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29836. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29837. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29838. // "NEXT_HOP_NOT_RUNNING"
  29839. // "NOT_CRITICAL_ERROR"
  29840. // "NO_RESULTS_ON_PAGE"
  29841. // "REQUIRED_TOS_AGREEMENT"
  29842. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29843. // "RESOURCE_NOT_DELETED"
  29844. // "SCHEMA_VALIDATION_IGNORED"
  29845. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29846. // "UNDECLARED_PROPERTIES"
  29847. // "UNREACHABLE"
  29848. Code string `json:"code,omitempty"`
  29849. // Data: [Output Only] Metadata about this warning in key: value format.
  29850. // For example:
  29851. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29852. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  29853. // Message: [Output Only] A human-readable description of the warning
  29854. // code.
  29855. Message string `json:"message,omitempty"`
  29856. // ForceSendFields is a list of field names (e.g. "Code") to
  29857. // unconditionally include in API requests. By default, fields with
  29858. // empty values are omitted from API requests. However, any non-pointer,
  29859. // non-interface field appearing in ForceSendFields will be sent to the
  29860. // server regardless of whether the field is empty or not. This may be
  29861. // used to include empty fields in Patch requests.
  29862. ForceSendFields []string `json:"-"`
  29863. // NullFields is a list of field names (e.g. "Code") to include in API
  29864. // requests with the JSON null value. By default, fields with empty
  29865. // values are omitted from API requests. However, any field with an
  29866. // empty value appearing in NullFields will be sent to the server as
  29867. // null. It is an error if a field in this list has a non-empty value.
  29868. // This may be used to include null fields in Patch requests.
  29869. NullFields []string `json:"-"`
  29870. }
  29871. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  29872. type NoMethod VpnTunnelListWarning
  29873. raw := NoMethod(*s)
  29874. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29875. }
  29876. type VpnTunnelListWarningData struct {
  29877. // Key: [Output Only] A key that provides more detail on the warning
  29878. // being returned. For example, for warnings where there are no results
  29879. // in a list request for a particular zone, this key might be scope and
  29880. // the key value might be the zone name. Other examples might be a key
  29881. // indicating a deprecated resource and a suggested replacement, or a
  29882. // warning about invalid network settings (for example, if an instance
  29883. // attempts to perform IP forwarding but is not enabled for IP
  29884. // forwarding).
  29885. Key string `json:"key,omitempty"`
  29886. // Value: [Output Only] A warning data value corresponding to the key.
  29887. Value string `json:"value,omitempty"`
  29888. // ForceSendFields is a list of field names (e.g. "Key") to
  29889. // unconditionally include in API requests. By default, fields with
  29890. // empty values are omitted from API requests. However, any non-pointer,
  29891. // non-interface field appearing in ForceSendFields will be sent to the
  29892. // server regardless of whether the field is empty or not. This may be
  29893. // used to include empty fields in Patch requests.
  29894. ForceSendFields []string `json:"-"`
  29895. // NullFields is a list of field names (e.g. "Key") to include in API
  29896. // requests with the JSON null value. By default, fields with empty
  29897. // values are omitted from API requests. However, any field with an
  29898. // empty value appearing in NullFields will be sent to the server as
  29899. // null. It is an error if a field in this list has a non-empty value.
  29900. // This may be used to include null fields in Patch requests.
  29901. NullFields []string `json:"-"`
  29902. }
  29903. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  29904. type NoMethod VpnTunnelListWarningData
  29905. raw := NoMethod(*s)
  29906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29907. }
  29908. type VpnTunnelsScopedList struct {
  29909. // VpnTunnels: A list of VPN tunnels contained in this scope.
  29910. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  29911. // Warning: Informational warning which replaces the list of addresses
  29912. // when the list is empty.
  29913. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  29914. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  29915. // unconditionally include in API requests. By default, fields with
  29916. // empty values are omitted from API requests. However, any non-pointer,
  29917. // non-interface field appearing in ForceSendFields will be sent to the
  29918. // server regardless of whether the field is empty or not. This may be
  29919. // used to include empty fields in Patch requests.
  29920. ForceSendFields []string `json:"-"`
  29921. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  29922. // API requests with the JSON null value. By default, fields with empty
  29923. // values are omitted from API requests. However, any field with an
  29924. // empty value appearing in NullFields will be sent to the server as
  29925. // null. It is an error if a field in this list has a non-empty value.
  29926. // This may be used to include null fields in Patch requests.
  29927. NullFields []string `json:"-"`
  29928. }
  29929. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  29930. type NoMethod VpnTunnelsScopedList
  29931. raw := NoMethod(*s)
  29932. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29933. }
  29934. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  29935. // list of addresses when the list is empty.
  29936. type VpnTunnelsScopedListWarning struct {
  29937. // Code: [Output Only] A warning code, if applicable. For example,
  29938. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29939. // the response.
  29940. //
  29941. // Possible values:
  29942. // "CLEANUP_FAILED"
  29943. // "DEPRECATED_RESOURCE_USED"
  29944. // "DEPRECATED_TYPE_USED"
  29945. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29946. // "EXPERIMENTAL_TYPE_USED"
  29947. // "EXTERNAL_API_WARNING"
  29948. // "FIELD_VALUE_OVERRIDEN"
  29949. // "INJECTED_KERNELS_DEPRECATED"
  29950. // "MISSING_TYPE_DEPENDENCY"
  29951. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29952. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29953. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29954. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29955. // "NEXT_HOP_NOT_RUNNING"
  29956. // "NOT_CRITICAL_ERROR"
  29957. // "NO_RESULTS_ON_PAGE"
  29958. // "REQUIRED_TOS_AGREEMENT"
  29959. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29960. // "RESOURCE_NOT_DELETED"
  29961. // "SCHEMA_VALIDATION_IGNORED"
  29962. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29963. // "UNDECLARED_PROPERTIES"
  29964. // "UNREACHABLE"
  29965. Code string `json:"code,omitempty"`
  29966. // Data: [Output Only] Metadata about this warning in key: value format.
  29967. // For example:
  29968. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29969. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  29970. // Message: [Output Only] A human-readable description of the warning
  29971. // code.
  29972. Message string `json:"message,omitempty"`
  29973. // ForceSendFields is a list of field names (e.g. "Code") to
  29974. // unconditionally include in API requests. By default, fields with
  29975. // empty values are omitted from API requests. However, any non-pointer,
  29976. // non-interface field appearing in ForceSendFields will be sent to the
  29977. // server regardless of whether the field is empty or not. This may be
  29978. // used to include empty fields in Patch requests.
  29979. ForceSendFields []string `json:"-"`
  29980. // NullFields is a list of field names (e.g. "Code") to include in API
  29981. // requests with the JSON null value. By default, fields with empty
  29982. // values are omitted from API requests. However, any field with an
  29983. // empty value appearing in NullFields will be sent to the server as
  29984. // null. It is an error if a field in this list has a non-empty value.
  29985. // This may be used to include null fields in Patch requests.
  29986. NullFields []string `json:"-"`
  29987. }
  29988. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  29989. type NoMethod VpnTunnelsScopedListWarning
  29990. raw := NoMethod(*s)
  29991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29992. }
  29993. type VpnTunnelsScopedListWarningData struct {
  29994. // Key: [Output Only] A key that provides more detail on the warning
  29995. // being returned. For example, for warnings where there are no results
  29996. // in a list request for a particular zone, this key might be scope and
  29997. // the key value might be the zone name. Other examples might be a key
  29998. // indicating a deprecated resource and a suggested replacement, or a
  29999. // warning about invalid network settings (for example, if an instance
  30000. // attempts to perform IP forwarding but is not enabled for IP
  30001. // forwarding).
  30002. Key string `json:"key,omitempty"`
  30003. // Value: [Output Only] A warning data value corresponding to the key.
  30004. Value string `json:"value,omitempty"`
  30005. // ForceSendFields is a list of field names (e.g. "Key") to
  30006. // unconditionally include in API requests. By default, fields with
  30007. // empty values are omitted from API requests. However, any non-pointer,
  30008. // non-interface field appearing in ForceSendFields will be sent to the
  30009. // server regardless of whether the field is empty or not. This may be
  30010. // used to include empty fields in Patch requests.
  30011. ForceSendFields []string `json:"-"`
  30012. // NullFields is a list of field names (e.g. "Key") to include in API
  30013. // requests with the JSON null value. By default, fields with empty
  30014. // values are omitted from API requests. However, any field with an
  30015. // empty value appearing in NullFields will be sent to the server as
  30016. // null. It is an error if a field in this list has a non-empty value.
  30017. // This may be used to include null fields in Patch requests.
  30018. NullFields []string `json:"-"`
  30019. }
  30020. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  30021. type NoMethod VpnTunnelsScopedListWarningData
  30022. raw := NoMethod(*s)
  30023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30024. }
  30025. type WafExpressionSet struct {
  30026. // Aliases: A list of alternate IDs. The format should be: - E.g.
  30027. // XSS-stable Generic suffix like "stable" is particularly useful if a
  30028. // policy likes to avail newer set of expressions without having to
  30029. // change the policy. A given alias name can't be used for more than one
  30030. // entity set.
  30031. Aliases []string `json:"aliases,omitempty"`
  30032. // Expressions: List of available expressions.
  30033. Expressions []*WafExpressionSetExpression `json:"expressions,omitempty"`
  30034. // Id: Google specified expression set ID. The format should be: - E.g.
  30035. // XSS-20170329
  30036. Id string `json:"id,omitempty"`
  30037. // ForceSendFields is a list of field names (e.g. "Aliases") to
  30038. // unconditionally include in API requests. By default, fields with
  30039. // empty values are omitted from API requests. However, any non-pointer,
  30040. // non-interface field appearing in ForceSendFields will be sent to the
  30041. // server regardless of whether the field is empty or not. This may be
  30042. // used to include empty fields in Patch requests.
  30043. ForceSendFields []string `json:"-"`
  30044. // NullFields is a list of field names (e.g. "Aliases") to include in
  30045. // API requests with the JSON null value. By default, fields with empty
  30046. // values are omitted from API requests. However, any field with an
  30047. // empty value appearing in NullFields will be sent to the server as
  30048. // null. It is an error if a field in this list has a non-empty value.
  30049. // This may be used to include null fields in Patch requests.
  30050. NullFields []string `json:"-"`
  30051. }
  30052. func (s *WafExpressionSet) MarshalJSON() ([]byte, error) {
  30053. type NoMethod WafExpressionSet
  30054. raw := NoMethod(*s)
  30055. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30056. }
  30057. type WafExpressionSetExpression struct {
  30058. // Id: Expression ID should uniquely identify the origin of the
  30059. // expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core
  30060. // rule set version 2.9.1 rule id 973337. The ID could be used to
  30061. // determine the individual attack definition that has been detected. It
  30062. // could also be used to exclude it from the policy in case of false
  30063. // positive.
  30064. Id string `json:"id,omitempty"`
  30065. // ForceSendFields is a list of field names (e.g. "Id") to
  30066. // unconditionally include in API requests. By default, fields with
  30067. // empty values are omitted from API requests. However, any non-pointer,
  30068. // non-interface field appearing in ForceSendFields will be sent to the
  30069. // server regardless of whether the field is empty or not. This may be
  30070. // used to include empty fields in Patch requests.
  30071. ForceSendFields []string `json:"-"`
  30072. // NullFields is a list of field names (e.g. "Id") to include in API
  30073. // requests with the JSON null value. By default, fields with empty
  30074. // values are omitted from API requests. However, any field with an
  30075. // empty value appearing in NullFields will be sent to the server as
  30076. // null. It is an error if a field in this list has a non-empty value.
  30077. // This may be used to include null fields in Patch requests.
  30078. NullFields []string `json:"-"`
  30079. }
  30080. func (s *WafExpressionSetExpression) MarshalJSON() ([]byte, error) {
  30081. type NoMethod WafExpressionSetExpression
  30082. raw := NoMethod(*s)
  30083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30084. }
  30085. type XpnHostList struct {
  30086. // Id: [Output Only] Unique identifier for the resource; defined by the
  30087. // server.
  30088. Id string `json:"id,omitempty"`
  30089. // Items: [Output Only] A list of shared VPC host project URLs.
  30090. Items []*Project `json:"items,omitempty"`
  30091. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  30092. // lists of shared VPC hosts.
  30093. Kind string `json:"kind,omitempty"`
  30094. // NextPageToken: [Output Only] This token allows you to get the next
  30095. // page of results for list requests. If the number of results is larger
  30096. // than maxResults, use the nextPageToken as a value for the query
  30097. // parameter pageToken in the next list request. Subsequent list
  30098. // requests will have their own nextPageToken to continue paging through
  30099. // the results.
  30100. NextPageToken string `json:"nextPageToken,omitempty"`
  30101. // SelfLink: [Output Only] Server-defined URL for this resource.
  30102. SelfLink string `json:"selfLink,omitempty"`
  30103. // Warning: [Output Only] Informational warning message.
  30104. Warning *XpnHostListWarning `json:"warning,omitempty"`
  30105. // ServerResponse contains the HTTP response code and headers from the
  30106. // server.
  30107. googleapi.ServerResponse `json:"-"`
  30108. // ForceSendFields is a list of field names (e.g. "Id") to
  30109. // unconditionally include in API requests. By default, fields with
  30110. // empty values are omitted from API requests. However, any non-pointer,
  30111. // non-interface field appearing in ForceSendFields will be sent to the
  30112. // server regardless of whether the field is empty or not. This may be
  30113. // used to include empty fields in Patch requests.
  30114. ForceSendFields []string `json:"-"`
  30115. // NullFields is a list of field names (e.g. "Id") to include in API
  30116. // requests with the JSON null value. By default, fields with empty
  30117. // values are omitted from API requests. However, any field with an
  30118. // empty value appearing in NullFields will be sent to the server as
  30119. // null. It is an error if a field in this list has a non-empty value.
  30120. // This may be used to include null fields in Patch requests.
  30121. NullFields []string `json:"-"`
  30122. }
  30123. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  30124. type NoMethod XpnHostList
  30125. raw := NoMethod(*s)
  30126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30127. }
  30128. // XpnHostListWarning: [Output Only] Informational warning message.
  30129. type XpnHostListWarning struct {
  30130. // Code: [Output Only] A warning code, if applicable. For example,
  30131. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30132. // the response.
  30133. //
  30134. // Possible values:
  30135. // "CLEANUP_FAILED"
  30136. // "DEPRECATED_RESOURCE_USED"
  30137. // "DEPRECATED_TYPE_USED"
  30138. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30139. // "EXPERIMENTAL_TYPE_USED"
  30140. // "EXTERNAL_API_WARNING"
  30141. // "FIELD_VALUE_OVERRIDEN"
  30142. // "INJECTED_KERNELS_DEPRECATED"
  30143. // "MISSING_TYPE_DEPENDENCY"
  30144. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30145. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30146. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30147. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30148. // "NEXT_HOP_NOT_RUNNING"
  30149. // "NOT_CRITICAL_ERROR"
  30150. // "NO_RESULTS_ON_PAGE"
  30151. // "REQUIRED_TOS_AGREEMENT"
  30152. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30153. // "RESOURCE_NOT_DELETED"
  30154. // "SCHEMA_VALIDATION_IGNORED"
  30155. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30156. // "UNDECLARED_PROPERTIES"
  30157. // "UNREACHABLE"
  30158. Code string `json:"code,omitempty"`
  30159. // Data: [Output Only] Metadata about this warning in key: value format.
  30160. // For example:
  30161. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30162. Data []*XpnHostListWarningData `json:"data,omitempty"`
  30163. // Message: [Output Only] A human-readable description of the warning
  30164. // code.
  30165. Message string `json:"message,omitempty"`
  30166. // ForceSendFields is a list of field names (e.g. "Code") to
  30167. // unconditionally include in API requests. By default, fields with
  30168. // empty values are omitted from API requests. However, any non-pointer,
  30169. // non-interface field appearing in ForceSendFields will be sent to the
  30170. // server regardless of whether the field is empty or not. This may be
  30171. // used to include empty fields in Patch requests.
  30172. ForceSendFields []string `json:"-"`
  30173. // NullFields is a list of field names (e.g. "Code") to include in API
  30174. // requests with the JSON null value. By default, fields with empty
  30175. // values are omitted from API requests. However, any field with an
  30176. // empty value appearing in NullFields will be sent to the server as
  30177. // null. It is an error if a field in this list has a non-empty value.
  30178. // This may be used to include null fields in Patch requests.
  30179. NullFields []string `json:"-"`
  30180. }
  30181. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  30182. type NoMethod XpnHostListWarning
  30183. raw := NoMethod(*s)
  30184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30185. }
  30186. type XpnHostListWarningData struct {
  30187. // Key: [Output Only] A key that provides more detail on the warning
  30188. // being returned. For example, for warnings where there are no results
  30189. // in a list request for a particular zone, this key might be scope and
  30190. // the key value might be the zone name. Other examples might be a key
  30191. // indicating a deprecated resource and a suggested replacement, or a
  30192. // warning about invalid network settings (for example, if an instance
  30193. // attempts to perform IP forwarding but is not enabled for IP
  30194. // forwarding).
  30195. Key string `json:"key,omitempty"`
  30196. // Value: [Output Only] A warning data value corresponding to the key.
  30197. Value string `json:"value,omitempty"`
  30198. // ForceSendFields is a list of field names (e.g. "Key") to
  30199. // unconditionally include in API requests. By default, fields with
  30200. // empty values are omitted from API requests. However, any non-pointer,
  30201. // non-interface field appearing in ForceSendFields will be sent to the
  30202. // server regardless of whether the field is empty or not. This may be
  30203. // used to include empty fields in Patch requests.
  30204. ForceSendFields []string `json:"-"`
  30205. // NullFields is a list of field names (e.g. "Key") to include in API
  30206. // requests with the JSON null value. By default, fields with empty
  30207. // values are omitted from API requests. However, any field with an
  30208. // empty value appearing in NullFields will be sent to the server as
  30209. // null. It is an error if a field in this list has a non-empty value.
  30210. // This may be used to include null fields in Patch requests.
  30211. NullFields []string `json:"-"`
  30212. }
  30213. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  30214. type NoMethod XpnHostListWarningData
  30215. raw := NoMethod(*s)
  30216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30217. }
  30218. // XpnResourceId: Service resource (a.k.a service project) ID.
  30219. type XpnResourceId struct {
  30220. // Id: The ID of the service resource. In the case of projects, this
  30221. // field supports project id (e.g., my-project-123) and project number
  30222. // (e.g. 12345678).
  30223. Id string `json:"id,omitempty"`
  30224. // Type: The type of the service resource.
  30225. //
  30226. // Possible values:
  30227. // "PROJECT"
  30228. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  30229. Type string `json:"type,omitempty"`
  30230. // ForceSendFields is a list of field names (e.g. "Id") to
  30231. // unconditionally include in API requests. By default, fields with
  30232. // empty values are omitted from API requests. However, any non-pointer,
  30233. // non-interface field appearing in ForceSendFields will be sent to the
  30234. // server regardless of whether the field is empty or not. This may be
  30235. // used to include empty fields in Patch requests.
  30236. ForceSendFields []string `json:"-"`
  30237. // NullFields is a list of field names (e.g. "Id") to include in API
  30238. // requests with the JSON null value. By default, fields with empty
  30239. // values are omitted from API requests. However, any field with an
  30240. // empty value appearing in NullFields will be sent to the server as
  30241. // null. It is an error if a field in this list has a non-empty value.
  30242. // This may be used to include null fields in Patch requests.
  30243. NullFields []string `json:"-"`
  30244. }
  30245. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  30246. type NoMethod XpnResourceId
  30247. raw := NoMethod(*s)
  30248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30249. }
  30250. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  30251. // resource_for v1.zones ==)
  30252. type Zone struct {
  30253. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  30254. // selections for the zone.
  30255. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  30256. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  30257. // format.
  30258. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  30259. // Deprecated: [Output Only] The deprecation status associated with this
  30260. // zone.
  30261. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  30262. // Description: [Output Only] Textual description of the resource.
  30263. Description string `json:"description,omitempty"`
  30264. // Id: [Output Only] The unique identifier for the resource. This
  30265. // identifier is defined by the server.
  30266. Id uint64 `json:"id,omitempty,string"`
  30267. // Kind: [Output Only] Type of the resource. Always compute#zone for
  30268. // zones.
  30269. Kind string `json:"kind,omitempty"`
  30270. // Name: [Output Only] Name of the resource.
  30271. Name string `json:"name,omitempty"`
  30272. // Region: [Output Only] Full URL reference to the region which hosts
  30273. // the zone.
  30274. Region string `json:"region,omitempty"`
  30275. // SelfLink: [Output Only] Server-defined URL for the resource.
  30276. SelfLink string `json:"selfLink,omitempty"`
  30277. // Status: [Output Only] Status of the zone, either UP or DOWN.
  30278. //
  30279. // Possible values:
  30280. // "DOWN"
  30281. // "UP"
  30282. Status string `json:"status,omitempty"`
  30283. // ServerResponse contains the HTTP response code and headers from the
  30284. // server.
  30285. googleapi.ServerResponse `json:"-"`
  30286. // ForceSendFields is a list of field names (e.g.
  30287. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  30288. // By default, fields with empty values are omitted from API requests.
  30289. // However, any non-pointer, non-interface field appearing in
  30290. // ForceSendFields will be sent to the server regardless of whether the
  30291. // field is empty or not. This may be used to include empty fields in
  30292. // Patch requests.
  30293. ForceSendFields []string `json:"-"`
  30294. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  30295. // include in API requests with the JSON null value. By default, fields
  30296. // with empty values are omitted from API requests. However, any field
  30297. // with an empty value appearing in NullFields will be sent to the
  30298. // server as null. It is an error if a field in this list has a
  30299. // non-empty value. This may be used to include null fields in Patch
  30300. // requests.
  30301. NullFields []string `json:"-"`
  30302. }
  30303. func (s *Zone) MarshalJSON() ([]byte, error) {
  30304. type NoMethod Zone
  30305. raw := NoMethod(*s)
  30306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30307. }
  30308. // ZoneList: Contains a list of zone resources.
  30309. type ZoneList struct {
  30310. // Id: [Output Only] Unique identifier for the resource; defined by the
  30311. // server.
  30312. Id string `json:"id,omitempty"`
  30313. // Items: A list of Zone resources.
  30314. Items []*Zone `json:"items,omitempty"`
  30315. // Kind: Type of resource.
  30316. Kind string `json:"kind,omitempty"`
  30317. // NextPageToken: [Output Only] This token allows you to get the next
  30318. // page of results for list requests. If the number of results is larger
  30319. // than maxResults, use the nextPageToken as a value for the query
  30320. // parameter pageToken in the next list request. Subsequent list
  30321. // requests will have their own nextPageToken to continue paging through
  30322. // the results.
  30323. NextPageToken string `json:"nextPageToken,omitempty"`
  30324. // SelfLink: [Output Only] Server-defined URL for this resource.
  30325. SelfLink string `json:"selfLink,omitempty"`
  30326. // Warning: [Output Only] Informational warning message.
  30327. Warning *ZoneListWarning `json:"warning,omitempty"`
  30328. // ServerResponse contains the HTTP response code and headers from the
  30329. // server.
  30330. googleapi.ServerResponse `json:"-"`
  30331. // ForceSendFields is a list of field names (e.g. "Id") to
  30332. // unconditionally include in API requests. By default, fields with
  30333. // empty values are omitted from API requests. However, any non-pointer,
  30334. // non-interface field appearing in ForceSendFields will be sent to the
  30335. // server regardless of whether the field is empty or not. This may be
  30336. // used to include empty fields in Patch requests.
  30337. ForceSendFields []string `json:"-"`
  30338. // NullFields is a list of field names (e.g. "Id") to include in API
  30339. // requests with the JSON null value. By default, fields with empty
  30340. // values are omitted from API requests. However, any field with an
  30341. // empty value appearing in NullFields will be sent to the server as
  30342. // null. It is an error if a field in this list has a non-empty value.
  30343. // This may be used to include null fields in Patch requests.
  30344. NullFields []string `json:"-"`
  30345. }
  30346. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  30347. type NoMethod ZoneList
  30348. raw := NoMethod(*s)
  30349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30350. }
  30351. // ZoneListWarning: [Output Only] Informational warning message.
  30352. type ZoneListWarning struct {
  30353. // Code: [Output Only] A warning code, if applicable. For example,
  30354. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30355. // the response.
  30356. //
  30357. // Possible values:
  30358. // "CLEANUP_FAILED"
  30359. // "DEPRECATED_RESOURCE_USED"
  30360. // "DEPRECATED_TYPE_USED"
  30361. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30362. // "EXPERIMENTAL_TYPE_USED"
  30363. // "EXTERNAL_API_WARNING"
  30364. // "FIELD_VALUE_OVERRIDEN"
  30365. // "INJECTED_KERNELS_DEPRECATED"
  30366. // "MISSING_TYPE_DEPENDENCY"
  30367. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30368. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30369. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30370. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30371. // "NEXT_HOP_NOT_RUNNING"
  30372. // "NOT_CRITICAL_ERROR"
  30373. // "NO_RESULTS_ON_PAGE"
  30374. // "REQUIRED_TOS_AGREEMENT"
  30375. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30376. // "RESOURCE_NOT_DELETED"
  30377. // "SCHEMA_VALIDATION_IGNORED"
  30378. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30379. // "UNDECLARED_PROPERTIES"
  30380. // "UNREACHABLE"
  30381. Code string `json:"code,omitempty"`
  30382. // Data: [Output Only] Metadata about this warning in key: value format.
  30383. // For example:
  30384. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30385. Data []*ZoneListWarningData `json:"data,omitempty"`
  30386. // Message: [Output Only] A human-readable description of the warning
  30387. // code.
  30388. Message string `json:"message,omitempty"`
  30389. // ForceSendFields is a list of field names (e.g. "Code") to
  30390. // unconditionally include in API requests. By default, fields with
  30391. // empty values are omitted from API requests. However, any non-pointer,
  30392. // non-interface field appearing in ForceSendFields will be sent to the
  30393. // server regardless of whether the field is empty or not. This may be
  30394. // used to include empty fields in Patch requests.
  30395. ForceSendFields []string `json:"-"`
  30396. // NullFields is a list of field names (e.g. "Code") to include in API
  30397. // requests with the JSON null value. By default, fields with empty
  30398. // values are omitted from API requests. However, any field with an
  30399. // empty value appearing in NullFields will be sent to the server as
  30400. // null. It is an error if a field in this list has a non-empty value.
  30401. // This may be used to include null fields in Patch requests.
  30402. NullFields []string `json:"-"`
  30403. }
  30404. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  30405. type NoMethod ZoneListWarning
  30406. raw := NoMethod(*s)
  30407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30408. }
  30409. type ZoneListWarningData struct {
  30410. // Key: [Output Only] A key that provides more detail on the warning
  30411. // being returned. For example, for warnings where there are no results
  30412. // in a list request for a particular zone, this key might be scope and
  30413. // the key value might be the zone name. Other examples might be a key
  30414. // indicating a deprecated resource and a suggested replacement, or a
  30415. // warning about invalid network settings (for example, if an instance
  30416. // attempts to perform IP forwarding but is not enabled for IP
  30417. // forwarding).
  30418. Key string `json:"key,omitempty"`
  30419. // Value: [Output Only] A warning data value corresponding to the key.
  30420. Value string `json:"value,omitempty"`
  30421. // ForceSendFields is a list of field names (e.g. "Key") to
  30422. // unconditionally include in API requests. By default, fields with
  30423. // empty values are omitted from API requests. However, any non-pointer,
  30424. // non-interface field appearing in ForceSendFields will be sent to the
  30425. // server regardless of whether the field is empty or not. This may be
  30426. // used to include empty fields in Patch requests.
  30427. ForceSendFields []string `json:"-"`
  30428. // NullFields is a list of field names (e.g. "Key") to include in API
  30429. // requests with the JSON null value. By default, fields with empty
  30430. // values are omitted from API requests. However, any field with an
  30431. // empty value appearing in NullFields will be sent to the server as
  30432. // null. It is an error if a field in this list has a non-empty value.
  30433. // This may be used to include null fields in Patch requests.
  30434. NullFields []string `json:"-"`
  30435. }
  30436. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  30437. type NoMethod ZoneListWarningData
  30438. raw := NoMethod(*s)
  30439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30440. }
  30441. type ZoneSetLabelsRequest struct {
  30442. // LabelFingerprint: The fingerprint of the previous set of labels for
  30443. // this resource, used to detect conflicts. The fingerprint is initially
  30444. // generated by Compute Engine and changes after every request to modify
  30445. // or update labels. You must always provide an up-to-date fingerprint
  30446. // hash in order to update or change labels. Make a get() request to the
  30447. // resource to get the latest fingerprint.
  30448. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  30449. // Labels: The labels to set for this resource.
  30450. Labels map[string]string `json:"labels,omitempty"`
  30451. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  30452. // unconditionally include in API requests. By default, fields with
  30453. // empty values are omitted from API requests. However, any non-pointer,
  30454. // non-interface field appearing in ForceSendFields will be sent to the
  30455. // server regardless of whether the field is empty or not. This may be
  30456. // used to include empty fields in Patch requests.
  30457. ForceSendFields []string `json:"-"`
  30458. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  30459. // include in API requests with the JSON null value. By default, fields
  30460. // with empty values are omitted from API requests. However, any field
  30461. // with an empty value appearing in NullFields will be sent to the
  30462. // server as null. It is an error if a field in this list has a
  30463. // non-empty value. This may be used to include null fields in Patch
  30464. // requests.
  30465. NullFields []string `json:"-"`
  30466. }
  30467. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  30468. type NoMethod ZoneSetLabelsRequest
  30469. raw := NoMethod(*s)
  30470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30471. }
  30472. type ZoneSetPolicyRequest struct {
  30473. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  30474. // Deprecated. Use 'policy' to specify bindings.
  30475. Bindings []*Binding `json:"bindings,omitempty"`
  30476. // Etag: Flatten Policy to create a backward compatible wire-format.
  30477. // Deprecated. Use 'policy' to specify the etag.
  30478. Etag string `json:"etag,omitempty"`
  30479. // Policy: REQUIRED: The complete policy to be applied to the
  30480. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  30481. // empty policy is in general a valid policy but certain services (like
  30482. // Projects) might reject them.
  30483. Policy *Policy `json:"policy,omitempty"`
  30484. // ForceSendFields is a list of field names (e.g. "Bindings") to
  30485. // unconditionally include in API requests. By default, fields with
  30486. // empty values are omitted from API requests. However, any non-pointer,
  30487. // non-interface field appearing in ForceSendFields will be sent to the
  30488. // server regardless of whether the field is empty or not. This may be
  30489. // used to include empty fields in Patch requests.
  30490. ForceSendFields []string `json:"-"`
  30491. // NullFields is a list of field names (e.g. "Bindings") to include in
  30492. // API requests with the JSON null value. By default, fields with empty
  30493. // values are omitted from API requests. However, any field with an
  30494. // empty value appearing in NullFields will be sent to the server as
  30495. // null. It is an error if a field in this list has a non-empty value.
  30496. // This may be used to include null fields in Patch requests.
  30497. NullFields []string `json:"-"`
  30498. }
  30499. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  30500. type NoMethod ZoneSetPolicyRequest
  30501. raw := NoMethod(*s)
  30502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30503. }
  30504. // method id "compute.acceleratorTypes.aggregatedList":
  30505. type AcceleratorTypesAggregatedListCall struct {
  30506. s *Service
  30507. project string
  30508. urlParams_ gensupport.URLParams
  30509. ifNoneMatch_ string
  30510. ctx_ context.Context
  30511. header_ http.Header
  30512. }
  30513. // AggregatedList: Retrieves an aggregated list of accelerator types.
  30514. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  30515. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30516. c.project = project
  30517. return c
  30518. }
  30519. // Filter sets the optional parameter "filter": A filter expression that
  30520. // filters resources listed in the response. The expression must specify
  30521. // the field name, a comparison operator, and the value that you want to
  30522. // use for filtering. The value must be a string, a number, or a
  30523. // boolean. The comparison operator must be either =, !=, >, or <.
  30524. //
  30525. // For example, if you are filtering Compute Engine instances, you can
  30526. // exclude instances named example-instance by specifying name !=
  30527. // example-instance.
  30528. //
  30529. // You can also filter nested fields. For example, you could specify
  30530. // scheduling.automaticRestart = false to include instances only if they
  30531. // are not scheduled for automatic restarts. You can use filtering on
  30532. // nested fields to filter based on resource labels.
  30533. //
  30534. // To filter on multiple expressions, provide each separate expression
  30535. // within parentheses. For example, (scheduling.automaticRestart = true)
  30536. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  30537. // AND expression. However, you can include AND and OR expressions
  30538. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  30539. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  30540. // true).
  30541. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  30542. c.urlParams_.Set("filter", filter)
  30543. return c
  30544. }
  30545. // MaxResults sets the optional parameter "maxResults": The maximum
  30546. // number of results per page that should be returned. If the number of
  30547. // available results is larger than maxResults, Compute Engine returns a
  30548. // nextPageToken that can be used to get the next page of results in
  30549. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30550. // (Default: 500)
  30551. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  30552. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30553. return c
  30554. }
  30555. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30556. // a certain order. By default, results are returned in alphanumerical
  30557. // order based on the resource name.
  30558. //
  30559. // You can also sort results in descending order based on the creation
  30560. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30561. // based on the creationTimestamp field in reverse chronological order
  30562. // (newest result first). Use this to sort resources like operations so
  30563. // that the newest operation is returned first.
  30564. //
  30565. // Currently, only sorting by name or creationTimestamp desc is
  30566. // supported.
  30567. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  30568. c.urlParams_.Set("orderBy", orderBy)
  30569. return c
  30570. }
  30571. // PageToken sets the optional parameter "pageToken": Specifies a page
  30572. // token to use. Set pageToken to the nextPageToken returned by a
  30573. // previous list request to get the next page of results.
  30574. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  30575. c.urlParams_.Set("pageToken", pageToken)
  30576. return c
  30577. }
  30578. // Fields allows partial responses to be retrieved. See
  30579. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30580. // for more information.
  30581. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  30582. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30583. return c
  30584. }
  30585. // IfNoneMatch sets the optional parameter which makes the operation
  30586. // fail if the object's ETag matches the given value. This is useful for
  30587. // getting updates only after the object has changed since the last
  30588. // request. Use googleapi.IsNotModified to check whether the response
  30589. // error from Do is the result of In-None-Match.
  30590. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  30591. c.ifNoneMatch_ = entityTag
  30592. return c
  30593. }
  30594. // Context sets the context to be used in this call's Do method. Any
  30595. // pending HTTP request will be aborted if the provided context is
  30596. // canceled.
  30597. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  30598. c.ctx_ = ctx
  30599. return c
  30600. }
  30601. // Header returns an http.Header that can be modified by the caller to
  30602. // add HTTP headers to the request.
  30603. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  30604. if c.header_ == nil {
  30605. c.header_ = make(http.Header)
  30606. }
  30607. return c.header_
  30608. }
  30609. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  30610. reqHeaders := make(http.Header)
  30611. for k, v := range c.header_ {
  30612. reqHeaders[k] = v
  30613. }
  30614. reqHeaders.Set("User-Agent", c.s.userAgent())
  30615. if c.ifNoneMatch_ != "" {
  30616. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30617. }
  30618. var body io.Reader = nil
  30619. c.urlParams_.Set("alt", alt)
  30620. c.urlParams_.Set("prettyPrint", "false")
  30621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  30622. urls += "?" + c.urlParams_.Encode()
  30623. req, err := http.NewRequest("GET", urls, body)
  30624. if err != nil {
  30625. return nil, err
  30626. }
  30627. req.Header = reqHeaders
  30628. googleapi.Expand(req.URL, map[string]string{
  30629. "project": c.project,
  30630. })
  30631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30632. }
  30633. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  30634. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  30635. // non-nil. Any non-2xx status code is an error. Response headers are in
  30636. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  30637. // response was returned at all) in error.(*googleapi.Error).Header. Use
  30638. // googleapi.IsNotModified to check whether the returned error was
  30639. // because http.StatusNotModified was returned.
  30640. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  30641. gensupport.SetOptions(c.urlParams_, opts...)
  30642. res, err := c.doRequest("json")
  30643. if res != nil && res.StatusCode == http.StatusNotModified {
  30644. if res.Body != nil {
  30645. res.Body.Close()
  30646. }
  30647. return nil, &googleapi.Error{
  30648. Code: res.StatusCode,
  30649. Header: res.Header,
  30650. }
  30651. }
  30652. if err != nil {
  30653. return nil, err
  30654. }
  30655. defer googleapi.CloseBody(res)
  30656. if err := googleapi.CheckResponse(res); err != nil {
  30657. return nil, err
  30658. }
  30659. ret := &AcceleratorTypeAggregatedList{
  30660. ServerResponse: googleapi.ServerResponse{
  30661. Header: res.Header,
  30662. HTTPStatusCode: res.StatusCode,
  30663. },
  30664. }
  30665. target := &ret
  30666. if err := gensupport.DecodeResponse(target, res); err != nil {
  30667. return nil, err
  30668. }
  30669. return ret, nil
  30670. // {
  30671. // "description": "Retrieves an aggregated list of accelerator types.",
  30672. // "httpMethod": "GET",
  30673. // "id": "compute.acceleratorTypes.aggregatedList",
  30674. // "parameterOrder": [
  30675. // "project"
  30676. // ],
  30677. // "parameters": {
  30678. // "filter": {
  30679. // "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).",
  30680. // "location": "query",
  30681. // "type": "string"
  30682. // },
  30683. // "maxResults": {
  30684. // "default": "500",
  30685. // "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)",
  30686. // "format": "uint32",
  30687. // "location": "query",
  30688. // "minimum": "0",
  30689. // "type": "integer"
  30690. // },
  30691. // "orderBy": {
  30692. // "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.",
  30693. // "location": "query",
  30694. // "type": "string"
  30695. // },
  30696. // "pageToken": {
  30697. // "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.",
  30698. // "location": "query",
  30699. // "type": "string"
  30700. // },
  30701. // "project": {
  30702. // "description": "Project ID for this request.",
  30703. // "location": "path",
  30704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30705. // "required": true,
  30706. // "type": "string"
  30707. // }
  30708. // },
  30709. // "path": "{project}/aggregated/acceleratorTypes",
  30710. // "response": {
  30711. // "$ref": "AcceleratorTypeAggregatedList"
  30712. // },
  30713. // "scopes": [
  30714. // "https://www.googleapis.com/auth/cloud-platform",
  30715. // "https://www.googleapis.com/auth/compute",
  30716. // "https://www.googleapis.com/auth/compute.readonly"
  30717. // ]
  30718. // }
  30719. }
  30720. // Pages invokes f for each page of results.
  30721. // A non-nil error returned from f will halt the iteration.
  30722. // The provided context supersedes any context provided to the Context method.
  30723. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  30724. c.ctx_ = ctx
  30725. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30726. for {
  30727. x, err := c.Do()
  30728. if err != nil {
  30729. return err
  30730. }
  30731. if err := f(x); err != nil {
  30732. return err
  30733. }
  30734. if x.NextPageToken == "" {
  30735. return nil
  30736. }
  30737. c.PageToken(x.NextPageToken)
  30738. }
  30739. }
  30740. // method id "compute.acceleratorTypes.get":
  30741. type AcceleratorTypesGetCall struct {
  30742. s *Service
  30743. project string
  30744. zone string
  30745. acceleratorType string
  30746. urlParams_ gensupport.URLParams
  30747. ifNoneMatch_ string
  30748. ctx_ context.Context
  30749. header_ http.Header
  30750. }
  30751. // Get: Returns the specified accelerator type.
  30752. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  30753. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30754. c.project = project
  30755. c.zone = zone
  30756. c.acceleratorType = acceleratorType
  30757. return c
  30758. }
  30759. // Fields allows partial responses to be retrieved. See
  30760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30761. // for more information.
  30762. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  30763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30764. return c
  30765. }
  30766. // IfNoneMatch sets the optional parameter which makes the operation
  30767. // fail if the object's ETag matches the given value. This is useful for
  30768. // getting updates only after the object has changed since the last
  30769. // request. Use googleapi.IsNotModified to check whether the response
  30770. // error from Do is the result of In-None-Match.
  30771. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  30772. c.ifNoneMatch_ = entityTag
  30773. return c
  30774. }
  30775. // Context sets the context to be used in this call's Do method. Any
  30776. // pending HTTP request will be aborted if the provided context is
  30777. // canceled.
  30778. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  30779. c.ctx_ = ctx
  30780. return c
  30781. }
  30782. // Header returns an http.Header that can be modified by the caller to
  30783. // add HTTP headers to the request.
  30784. func (c *AcceleratorTypesGetCall) Header() http.Header {
  30785. if c.header_ == nil {
  30786. c.header_ = make(http.Header)
  30787. }
  30788. return c.header_
  30789. }
  30790. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  30791. reqHeaders := make(http.Header)
  30792. for k, v := range c.header_ {
  30793. reqHeaders[k] = v
  30794. }
  30795. reqHeaders.Set("User-Agent", c.s.userAgent())
  30796. if c.ifNoneMatch_ != "" {
  30797. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30798. }
  30799. var body io.Reader = nil
  30800. c.urlParams_.Set("alt", alt)
  30801. c.urlParams_.Set("prettyPrint", "false")
  30802. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  30803. urls += "?" + c.urlParams_.Encode()
  30804. req, err := http.NewRequest("GET", urls, body)
  30805. if err != nil {
  30806. return nil, err
  30807. }
  30808. req.Header = reqHeaders
  30809. googleapi.Expand(req.URL, map[string]string{
  30810. "project": c.project,
  30811. "zone": c.zone,
  30812. "acceleratorType": c.acceleratorType,
  30813. })
  30814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30815. }
  30816. // Do executes the "compute.acceleratorTypes.get" call.
  30817. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  30818. // status code is an error. Response headers are in either
  30819. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  30820. // at all) in error.(*googleapi.Error).Header. Use
  30821. // googleapi.IsNotModified to check whether the returned error was
  30822. // because http.StatusNotModified was returned.
  30823. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  30824. gensupport.SetOptions(c.urlParams_, opts...)
  30825. res, err := c.doRequest("json")
  30826. if res != nil && res.StatusCode == http.StatusNotModified {
  30827. if res.Body != nil {
  30828. res.Body.Close()
  30829. }
  30830. return nil, &googleapi.Error{
  30831. Code: res.StatusCode,
  30832. Header: res.Header,
  30833. }
  30834. }
  30835. if err != nil {
  30836. return nil, err
  30837. }
  30838. defer googleapi.CloseBody(res)
  30839. if err := googleapi.CheckResponse(res); err != nil {
  30840. return nil, err
  30841. }
  30842. ret := &AcceleratorType{
  30843. ServerResponse: googleapi.ServerResponse{
  30844. Header: res.Header,
  30845. HTTPStatusCode: res.StatusCode,
  30846. },
  30847. }
  30848. target := &ret
  30849. if err := gensupport.DecodeResponse(target, res); err != nil {
  30850. return nil, err
  30851. }
  30852. return ret, nil
  30853. // {
  30854. // "description": "Returns the specified accelerator type.",
  30855. // "httpMethod": "GET",
  30856. // "id": "compute.acceleratorTypes.get",
  30857. // "parameterOrder": [
  30858. // "project",
  30859. // "zone",
  30860. // "acceleratorType"
  30861. // ],
  30862. // "parameters": {
  30863. // "acceleratorType": {
  30864. // "description": "Name of the accelerator type to return.",
  30865. // "location": "path",
  30866. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  30867. // "required": true,
  30868. // "type": "string"
  30869. // },
  30870. // "project": {
  30871. // "description": "Project ID for this request.",
  30872. // "location": "path",
  30873. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30874. // "required": true,
  30875. // "type": "string"
  30876. // },
  30877. // "zone": {
  30878. // "description": "The name of the zone for this request.",
  30879. // "location": "path",
  30880. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30881. // "required": true,
  30882. // "type": "string"
  30883. // }
  30884. // },
  30885. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  30886. // "response": {
  30887. // "$ref": "AcceleratorType"
  30888. // },
  30889. // "scopes": [
  30890. // "https://www.googleapis.com/auth/cloud-platform",
  30891. // "https://www.googleapis.com/auth/compute",
  30892. // "https://www.googleapis.com/auth/compute.readonly"
  30893. // ]
  30894. // }
  30895. }
  30896. // method id "compute.acceleratorTypes.list":
  30897. type AcceleratorTypesListCall struct {
  30898. s *Service
  30899. project string
  30900. zone string
  30901. urlParams_ gensupport.URLParams
  30902. ifNoneMatch_ string
  30903. ctx_ context.Context
  30904. header_ http.Header
  30905. }
  30906. // List: Retrieves a list of accelerator types available to the
  30907. // specified project.
  30908. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  30909. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30910. c.project = project
  30911. c.zone = zone
  30912. return c
  30913. }
  30914. // Filter sets the optional parameter "filter": A filter expression that
  30915. // filters resources listed in the response. The expression must specify
  30916. // the field name, a comparison operator, and the value that you want to
  30917. // use for filtering. The value must be a string, a number, or a
  30918. // boolean. The comparison operator must be either =, !=, >, or <.
  30919. //
  30920. // For example, if you are filtering Compute Engine instances, you can
  30921. // exclude instances named example-instance by specifying name !=
  30922. // example-instance.
  30923. //
  30924. // You can also filter nested fields. For example, you could specify
  30925. // scheduling.automaticRestart = false to include instances only if they
  30926. // are not scheduled for automatic restarts. You can use filtering on
  30927. // nested fields to filter based on resource labels.
  30928. //
  30929. // To filter on multiple expressions, provide each separate expression
  30930. // within parentheses. For example, (scheduling.automaticRestart = true)
  30931. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  30932. // AND expression. However, you can include AND and OR expressions
  30933. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  30934. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  30935. // true).
  30936. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  30937. c.urlParams_.Set("filter", filter)
  30938. return c
  30939. }
  30940. // MaxResults sets the optional parameter "maxResults": The maximum
  30941. // number of results per page that should be returned. If the number of
  30942. // available results is larger than maxResults, Compute Engine returns a
  30943. // nextPageToken that can be used to get the next page of results in
  30944. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30945. // (Default: 500)
  30946. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  30947. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30948. return c
  30949. }
  30950. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30951. // a certain order. By default, results are returned in alphanumerical
  30952. // order based on the resource name.
  30953. //
  30954. // You can also sort results in descending order based on the creation
  30955. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30956. // based on the creationTimestamp field in reverse chronological order
  30957. // (newest result first). Use this to sort resources like operations so
  30958. // that the newest operation is returned first.
  30959. //
  30960. // Currently, only sorting by name or creationTimestamp desc is
  30961. // supported.
  30962. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  30963. c.urlParams_.Set("orderBy", orderBy)
  30964. return c
  30965. }
  30966. // PageToken sets the optional parameter "pageToken": Specifies a page
  30967. // token to use. Set pageToken to the nextPageToken returned by a
  30968. // previous list request to get the next page of results.
  30969. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  30970. c.urlParams_.Set("pageToken", pageToken)
  30971. return c
  30972. }
  30973. // Fields allows partial responses to be retrieved. See
  30974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30975. // for more information.
  30976. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  30977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30978. return c
  30979. }
  30980. // IfNoneMatch sets the optional parameter which makes the operation
  30981. // fail if the object's ETag matches the given value. This is useful for
  30982. // getting updates only after the object has changed since the last
  30983. // request. Use googleapi.IsNotModified to check whether the response
  30984. // error from Do is the result of In-None-Match.
  30985. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  30986. c.ifNoneMatch_ = entityTag
  30987. return c
  30988. }
  30989. // Context sets the context to be used in this call's Do method. Any
  30990. // pending HTTP request will be aborted if the provided context is
  30991. // canceled.
  30992. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  30993. c.ctx_ = ctx
  30994. return c
  30995. }
  30996. // Header returns an http.Header that can be modified by the caller to
  30997. // add HTTP headers to the request.
  30998. func (c *AcceleratorTypesListCall) Header() http.Header {
  30999. if c.header_ == nil {
  31000. c.header_ = make(http.Header)
  31001. }
  31002. return c.header_
  31003. }
  31004. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  31005. reqHeaders := make(http.Header)
  31006. for k, v := range c.header_ {
  31007. reqHeaders[k] = v
  31008. }
  31009. reqHeaders.Set("User-Agent", c.s.userAgent())
  31010. if c.ifNoneMatch_ != "" {
  31011. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31012. }
  31013. var body io.Reader = nil
  31014. c.urlParams_.Set("alt", alt)
  31015. c.urlParams_.Set("prettyPrint", "false")
  31016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  31017. urls += "?" + c.urlParams_.Encode()
  31018. req, err := http.NewRequest("GET", urls, body)
  31019. if err != nil {
  31020. return nil, err
  31021. }
  31022. req.Header = reqHeaders
  31023. googleapi.Expand(req.URL, map[string]string{
  31024. "project": c.project,
  31025. "zone": c.zone,
  31026. })
  31027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31028. }
  31029. // Do executes the "compute.acceleratorTypes.list" call.
  31030. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  31031. // non-2xx status code is an error. Response headers are in either
  31032. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  31033. // returned at all) in error.(*googleapi.Error).Header. Use
  31034. // googleapi.IsNotModified to check whether the returned error was
  31035. // because http.StatusNotModified was returned.
  31036. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  31037. gensupport.SetOptions(c.urlParams_, opts...)
  31038. res, err := c.doRequest("json")
  31039. if res != nil && res.StatusCode == http.StatusNotModified {
  31040. if res.Body != nil {
  31041. res.Body.Close()
  31042. }
  31043. return nil, &googleapi.Error{
  31044. Code: res.StatusCode,
  31045. Header: res.Header,
  31046. }
  31047. }
  31048. if err != nil {
  31049. return nil, err
  31050. }
  31051. defer googleapi.CloseBody(res)
  31052. if err := googleapi.CheckResponse(res); err != nil {
  31053. return nil, err
  31054. }
  31055. ret := &AcceleratorTypeList{
  31056. ServerResponse: googleapi.ServerResponse{
  31057. Header: res.Header,
  31058. HTTPStatusCode: res.StatusCode,
  31059. },
  31060. }
  31061. target := &ret
  31062. if err := gensupport.DecodeResponse(target, res); err != nil {
  31063. return nil, err
  31064. }
  31065. return ret, nil
  31066. // {
  31067. // "description": "Retrieves a list of accelerator types available to the specified project.",
  31068. // "httpMethod": "GET",
  31069. // "id": "compute.acceleratorTypes.list",
  31070. // "parameterOrder": [
  31071. // "project",
  31072. // "zone"
  31073. // ],
  31074. // "parameters": {
  31075. // "filter": {
  31076. // "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).",
  31077. // "location": "query",
  31078. // "type": "string"
  31079. // },
  31080. // "maxResults": {
  31081. // "default": "500",
  31082. // "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)",
  31083. // "format": "uint32",
  31084. // "location": "query",
  31085. // "minimum": "0",
  31086. // "type": "integer"
  31087. // },
  31088. // "orderBy": {
  31089. // "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.",
  31090. // "location": "query",
  31091. // "type": "string"
  31092. // },
  31093. // "pageToken": {
  31094. // "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.",
  31095. // "location": "query",
  31096. // "type": "string"
  31097. // },
  31098. // "project": {
  31099. // "description": "Project ID for this request.",
  31100. // "location": "path",
  31101. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31102. // "required": true,
  31103. // "type": "string"
  31104. // },
  31105. // "zone": {
  31106. // "description": "The name of the zone for this request.",
  31107. // "location": "path",
  31108. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31109. // "required": true,
  31110. // "type": "string"
  31111. // }
  31112. // },
  31113. // "path": "{project}/zones/{zone}/acceleratorTypes",
  31114. // "response": {
  31115. // "$ref": "AcceleratorTypeList"
  31116. // },
  31117. // "scopes": [
  31118. // "https://www.googleapis.com/auth/cloud-platform",
  31119. // "https://www.googleapis.com/auth/compute",
  31120. // "https://www.googleapis.com/auth/compute.readonly"
  31121. // ]
  31122. // }
  31123. }
  31124. // Pages invokes f for each page of results.
  31125. // A non-nil error returned from f will halt the iteration.
  31126. // The provided context supersedes any context provided to the Context method.
  31127. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  31128. c.ctx_ = ctx
  31129. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31130. for {
  31131. x, err := c.Do()
  31132. if err != nil {
  31133. return err
  31134. }
  31135. if err := f(x); err != nil {
  31136. return err
  31137. }
  31138. if x.NextPageToken == "" {
  31139. return nil
  31140. }
  31141. c.PageToken(x.NextPageToken)
  31142. }
  31143. }
  31144. // method id "compute.addresses.aggregatedList":
  31145. type AddressesAggregatedListCall struct {
  31146. s *Service
  31147. project string
  31148. urlParams_ gensupport.URLParams
  31149. ifNoneMatch_ string
  31150. ctx_ context.Context
  31151. header_ http.Header
  31152. }
  31153. // AggregatedList: Retrieves an aggregated list of addresses.
  31154. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  31155. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  31156. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31157. c.project = project
  31158. return c
  31159. }
  31160. // Filter sets the optional parameter "filter": A filter expression that
  31161. // filters resources listed in the response. The expression must specify
  31162. // the field name, a comparison operator, and the value that you want to
  31163. // use for filtering. The value must be a string, a number, or a
  31164. // boolean. The comparison operator must be either =, !=, >, or <.
  31165. //
  31166. // For example, if you are filtering Compute Engine instances, you can
  31167. // exclude instances named example-instance by specifying name !=
  31168. // example-instance.
  31169. //
  31170. // You can also filter nested fields. For example, you could specify
  31171. // scheduling.automaticRestart = false to include instances only if they
  31172. // are not scheduled for automatic restarts. You can use filtering on
  31173. // nested fields to filter based on resource labels.
  31174. //
  31175. // To filter on multiple expressions, provide each separate expression
  31176. // within parentheses. For example, (scheduling.automaticRestart = true)
  31177. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31178. // AND expression. However, you can include AND and OR expressions
  31179. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31180. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31181. // true).
  31182. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  31183. c.urlParams_.Set("filter", filter)
  31184. return c
  31185. }
  31186. // MaxResults sets the optional parameter "maxResults": The maximum
  31187. // number of results per page that should be returned. If the number of
  31188. // available results is larger than maxResults, Compute Engine returns a
  31189. // nextPageToken that can be used to get the next page of results in
  31190. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31191. // (Default: 500)
  31192. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  31193. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31194. return c
  31195. }
  31196. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31197. // a certain order. By default, results are returned in alphanumerical
  31198. // order based on the resource name.
  31199. //
  31200. // You can also sort results in descending order based on the creation
  31201. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31202. // based on the creationTimestamp field in reverse chronological order
  31203. // (newest result first). Use this to sort resources like operations so
  31204. // that the newest operation is returned first.
  31205. //
  31206. // Currently, only sorting by name or creationTimestamp desc is
  31207. // supported.
  31208. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  31209. c.urlParams_.Set("orderBy", orderBy)
  31210. return c
  31211. }
  31212. // PageToken sets the optional parameter "pageToken": Specifies a page
  31213. // token to use. Set pageToken to the nextPageToken returned by a
  31214. // previous list request to get the next page of results.
  31215. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  31216. c.urlParams_.Set("pageToken", pageToken)
  31217. return c
  31218. }
  31219. // Fields allows partial responses to be retrieved. See
  31220. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31221. // for more information.
  31222. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  31223. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31224. return c
  31225. }
  31226. // IfNoneMatch sets the optional parameter which makes the operation
  31227. // fail if the object's ETag matches the given value. This is useful for
  31228. // getting updates only after the object has changed since the last
  31229. // request. Use googleapi.IsNotModified to check whether the response
  31230. // error from Do is the result of In-None-Match.
  31231. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  31232. c.ifNoneMatch_ = entityTag
  31233. return c
  31234. }
  31235. // Context sets the context to be used in this call's Do method. Any
  31236. // pending HTTP request will be aborted if the provided context is
  31237. // canceled.
  31238. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  31239. c.ctx_ = ctx
  31240. return c
  31241. }
  31242. // Header returns an http.Header that can be modified by the caller to
  31243. // add HTTP headers to the request.
  31244. func (c *AddressesAggregatedListCall) Header() http.Header {
  31245. if c.header_ == nil {
  31246. c.header_ = make(http.Header)
  31247. }
  31248. return c.header_
  31249. }
  31250. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  31251. reqHeaders := make(http.Header)
  31252. for k, v := range c.header_ {
  31253. reqHeaders[k] = v
  31254. }
  31255. reqHeaders.Set("User-Agent", c.s.userAgent())
  31256. if c.ifNoneMatch_ != "" {
  31257. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31258. }
  31259. var body io.Reader = nil
  31260. c.urlParams_.Set("alt", alt)
  31261. c.urlParams_.Set("prettyPrint", "false")
  31262. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  31263. urls += "?" + c.urlParams_.Encode()
  31264. req, err := http.NewRequest("GET", urls, body)
  31265. if err != nil {
  31266. return nil, err
  31267. }
  31268. req.Header = reqHeaders
  31269. googleapi.Expand(req.URL, map[string]string{
  31270. "project": c.project,
  31271. })
  31272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31273. }
  31274. // Do executes the "compute.addresses.aggregatedList" call.
  31275. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  31276. // non-2xx status code is an error. Response headers are in either
  31277. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  31278. // returned at all) in error.(*googleapi.Error).Header. Use
  31279. // googleapi.IsNotModified to check whether the returned error was
  31280. // because http.StatusNotModified was returned.
  31281. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  31282. gensupport.SetOptions(c.urlParams_, opts...)
  31283. res, err := c.doRequest("json")
  31284. if res != nil && res.StatusCode == http.StatusNotModified {
  31285. if res.Body != nil {
  31286. res.Body.Close()
  31287. }
  31288. return nil, &googleapi.Error{
  31289. Code: res.StatusCode,
  31290. Header: res.Header,
  31291. }
  31292. }
  31293. if err != nil {
  31294. return nil, err
  31295. }
  31296. defer googleapi.CloseBody(res)
  31297. if err := googleapi.CheckResponse(res); err != nil {
  31298. return nil, err
  31299. }
  31300. ret := &AddressAggregatedList{
  31301. ServerResponse: googleapi.ServerResponse{
  31302. Header: res.Header,
  31303. HTTPStatusCode: res.StatusCode,
  31304. },
  31305. }
  31306. target := &ret
  31307. if err := gensupport.DecodeResponse(target, res); err != nil {
  31308. return nil, err
  31309. }
  31310. return ret, nil
  31311. // {
  31312. // "description": "Retrieves an aggregated list of addresses.",
  31313. // "httpMethod": "GET",
  31314. // "id": "compute.addresses.aggregatedList",
  31315. // "parameterOrder": [
  31316. // "project"
  31317. // ],
  31318. // "parameters": {
  31319. // "filter": {
  31320. // "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).",
  31321. // "location": "query",
  31322. // "type": "string"
  31323. // },
  31324. // "maxResults": {
  31325. // "default": "500",
  31326. // "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)",
  31327. // "format": "uint32",
  31328. // "location": "query",
  31329. // "minimum": "0",
  31330. // "type": "integer"
  31331. // },
  31332. // "orderBy": {
  31333. // "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.",
  31334. // "location": "query",
  31335. // "type": "string"
  31336. // },
  31337. // "pageToken": {
  31338. // "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.",
  31339. // "location": "query",
  31340. // "type": "string"
  31341. // },
  31342. // "project": {
  31343. // "description": "Project ID for this request.",
  31344. // "location": "path",
  31345. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31346. // "required": true,
  31347. // "type": "string"
  31348. // }
  31349. // },
  31350. // "path": "{project}/aggregated/addresses",
  31351. // "response": {
  31352. // "$ref": "AddressAggregatedList"
  31353. // },
  31354. // "scopes": [
  31355. // "https://www.googleapis.com/auth/cloud-platform",
  31356. // "https://www.googleapis.com/auth/compute",
  31357. // "https://www.googleapis.com/auth/compute.readonly"
  31358. // ]
  31359. // }
  31360. }
  31361. // Pages invokes f for each page of results.
  31362. // A non-nil error returned from f will halt the iteration.
  31363. // The provided context supersedes any context provided to the Context method.
  31364. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  31365. c.ctx_ = ctx
  31366. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31367. for {
  31368. x, err := c.Do()
  31369. if err != nil {
  31370. return err
  31371. }
  31372. if err := f(x); err != nil {
  31373. return err
  31374. }
  31375. if x.NextPageToken == "" {
  31376. return nil
  31377. }
  31378. c.PageToken(x.NextPageToken)
  31379. }
  31380. }
  31381. // method id "compute.addresses.delete":
  31382. type AddressesDeleteCall struct {
  31383. s *Service
  31384. project string
  31385. region string
  31386. address string
  31387. urlParams_ gensupport.URLParams
  31388. ctx_ context.Context
  31389. header_ http.Header
  31390. }
  31391. // Delete: Deletes the specified address resource.
  31392. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  31393. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  31394. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31395. c.project = project
  31396. c.region = region
  31397. c.address = address
  31398. return c
  31399. }
  31400. // RequestId sets the optional parameter "requestId": An optional
  31401. // request ID to identify requests. Specify a unique request ID so that
  31402. // if you must retry your request, the server will know to ignore the
  31403. // request if it has already been completed.
  31404. //
  31405. // For example, consider a situation where you make an initial request
  31406. // and the request times out. If you make the request again with the
  31407. // same request ID, the server can check if original operation with the
  31408. // same request ID was received, and if so, will ignore the second
  31409. // request. This prevents clients from accidentally creating duplicate
  31410. // commitments.
  31411. //
  31412. // The request ID must be a valid UUID with the exception that zero UUID
  31413. // is not supported (00000000-0000-0000-0000-000000000000).
  31414. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  31415. c.urlParams_.Set("requestId", requestId)
  31416. return c
  31417. }
  31418. // Fields allows partial responses to be retrieved. See
  31419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31420. // for more information.
  31421. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  31422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31423. return c
  31424. }
  31425. // Context sets the context to be used in this call's Do method. Any
  31426. // pending HTTP request will be aborted if the provided context is
  31427. // canceled.
  31428. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  31429. c.ctx_ = ctx
  31430. return c
  31431. }
  31432. // Header returns an http.Header that can be modified by the caller to
  31433. // add HTTP headers to the request.
  31434. func (c *AddressesDeleteCall) Header() http.Header {
  31435. if c.header_ == nil {
  31436. c.header_ = make(http.Header)
  31437. }
  31438. return c.header_
  31439. }
  31440. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  31441. reqHeaders := make(http.Header)
  31442. for k, v := range c.header_ {
  31443. reqHeaders[k] = v
  31444. }
  31445. reqHeaders.Set("User-Agent", c.s.userAgent())
  31446. var body io.Reader = nil
  31447. c.urlParams_.Set("alt", alt)
  31448. c.urlParams_.Set("prettyPrint", "false")
  31449. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  31450. urls += "?" + c.urlParams_.Encode()
  31451. req, err := http.NewRequest("DELETE", urls, body)
  31452. if err != nil {
  31453. return nil, err
  31454. }
  31455. req.Header = reqHeaders
  31456. googleapi.Expand(req.URL, map[string]string{
  31457. "project": c.project,
  31458. "region": c.region,
  31459. "address": c.address,
  31460. })
  31461. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31462. }
  31463. // Do executes the "compute.addresses.delete" call.
  31464. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31465. // status code is an error. Response headers are in either
  31466. // *Operation.ServerResponse.Header or (if a response was returned at
  31467. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31468. // to check whether the returned error was because
  31469. // http.StatusNotModified was returned.
  31470. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31471. gensupport.SetOptions(c.urlParams_, opts...)
  31472. res, err := c.doRequest("json")
  31473. if res != nil && res.StatusCode == http.StatusNotModified {
  31474. if res.Body != nil {
  31475. res.Body.Close()
  31476. }
  31477. return nil, &googleapi.Error{
  31478. Code: res.StatusCode,
  31479. Header: res.Header,
  31480. }
  31481. }
  31482. if err != nil {
  31483. return nil, err
  31484. }
  31485. defer googleapi.CloseBody(res)
  31486. if err := googleapi.CheckResponse(res); err != nil {
  31487. return nil, err
  31488. }
  31489. ret := &Operation{
  31490. ServerResponse: googleapi.ServerResponse{
  31491. Header: res.Header,
  31492. HTTPStatusCode: res.StatusCode,
  31493. },
  31494. }
  31495. target := &ret
  31496. if err := gensupport.DecodeResponse(target, res); err != nil {
  31497. return nil, err
  31498. }
  31499. return ret, nil
  31500. // {
  31501. // "description": "Deletes the specified address resource.",
  31502. // "httpMethod": "DELETE",
  31503. // "id": "compute.addresses.delete",
  31504. // "parameterOrder": [
  31505. // "project",
  31506. // "region",
  31507. // "address"
  31508. // ],
  31509. // "parameters": {
  31510. // "address": {
  31511. // "description": "Name of the address resource to delete.",
  31512. // "location": "path",
  31513. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31514. // "required": true,
  31515. // "type": "string"
  31516. // },
  31517. // "project": {
  31518. // "description": "Project ID for this request.",
  31519. // "location": "path",
  31520. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31521. // "required": true,
  31522. // "type": "string"
  31523. // },
  31524. // "region": {
  31525. // "description": "Name of the region for this request.",
  31526. // "location": "path",
  31527. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31528. // "required": true,
  31529. // "type": "string"
  31530. // },
  31531. // "requestId": {
  31532. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31533. // "location": "query",
  31534. // "type": "string"
  31535. // }
  31536. // },
  31537. // "path": "{project}/regions/{region}/addresses/{address}",
  31538. // "response": {
  31539. // "$ref": "Operation"
  31540. // },
  31541. // "scopes": [
  31542. // "https://www.googleapis.com/auth/cloud-platform",
  31543. // "https://www.googleapis.com/auth/compute"
  31544. // ]
  31545. // }
  31546. }
  31547. // method id "compute.addresses.get":
  31548. type AddressesGetCall struct {
  31549. s *Service
  31550. project string
  31551. region string
  31552. address string
  31553. urlParams_ gensupport.URLParams
  31554. ifNoneMatch_ string
  31555. ctx_ context.Context
  31556. header_ http.Header
  31557. }
  31558. // Get: Returns the specified address resource.
  31559. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  31560. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  31561. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31562. c.project = project
  31563. c.region = region
  31564. c.address = address
  31565. return c
  31566. }
  31567. // Fields allows partial responses to be retrieved. See
  31568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31569. // for more information.
  31570. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  31571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31572. return c
  31573. }
  31574. // IfNoneMatch sets the optional parameter which makes the operation
  31575. // fail if the object's ETag matches the given value. This is useful for
  31576. // getting updates only after the object has changed since the last
  31577. // request. Use googleapi.IsNotModified to check whether the response
  31578. // error from Do is the result of In-None-Match.
  31579. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  31580. c.ifNoneMatch_ = entityTag
  31581. return c
  31582. }
  31583. // Context sets the context to be used in this call's Do method. Any
  31584. // pending HTTP request will be aborted if the provided context is
  31585. // canceled.
  31586. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  31587. c.ctx_ = ctx
  31588. return c
  31589. }
  31590. // Header returns an http.Header that can be modified by the caller to
  31591. // add HTTP headers to the request.
  31592. func (c *AddressesGetCall) Header() http.Header {
  31593. if c.header_ == nil {
  31594. c.header_ = make(http.Header)
  31595. }
  31596. return c.header_
  31597. }
  31598. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  31599. reqHeaders := make(http.Header)
  31600. for k, v := range c.header_ {
  31601. reqHeaders[k] = v
  31602. }
  31603. reqHeaders.Set("User-Agent", c.s.userAgent())
  31604. if c.ifNoneMatch_ != "" {
  31605. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31606. }
  31607. var body io.Reader = nil
  31608. c.urlParams_.Set("alt", alt)
  31609. c.urlParams_.Set("prettyPrint", "false")
  31610. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  31611. urls += "?" + c.urlParams_.Encode()
  31612. req, err := http.NewRequest("GET", urls, body)
  31613. if err != nil {
  31614. return nil, err
  31615. }
  31616. req.Header = reqHeaders
  31617. googleapi.Expand(req.URL, map[string]string{
  31618. "project": c.project,
  31619. "region": c.region,
  31620. "address": c.address,
  31621. })
  31622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31623. }
  31624. // Do executes the "compute.addresses.get" call.
  31625. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  31626. // code is an error. Response headers are in either
  31627. // *Address.ServerResponse.Header or (if a response was returned at all)
  31628. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  31629. // check whether the returned error was because http.StatusNotModified
  31630. // was returned.
  31631. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  31632. gensupport.SetOptions(c.urlParams_, opts...)
  31633. res, err := c.doRequest("json")
  31634. if res != nil && res.StatusCode == http.StatusNotModified {
  31635. if res.Body != nil {
  31636. res.Body.Close()
  31637. }
  31638. return nil, &googleapi.Error{
  31639. Code: res.StatusCode,
  31640. Header: res.Header,
  31641. }
  31642. }
  31643. if err != nil {
  31644. return nil, err
  31645. }
  31646. defer googleapi.CloseBody(res)
  31647. if err := googleapi.CheckResponse(res); err != nil {
  31648. return nil, err
  31649. }
  31650. ret := &Address{
  31651. ServerResponse: googleapi.ServerResponse{
  31652. Header: res.Header,
  31653. HTTPStatusCode: res.StatusCode,
  31654. },
  31655. }
  31656. target := &ret
  31657. if err := gensupport.DecodeResponse(target, res); err != nil {
  31658. return nil, err
  31659. }
  31660. return ret, nil
  31661. // {
  31662. // "description": "Returns the specified address resource.",
  31663. // "httpMethod": "GET",
  31664. // "id": "compute.addresses.get",
  31665. // "parameterOrder": [
  31666. // "project",
  31667. // "region",
  31668. // "address"
  31669. // ],
  31670. // "parameters": {
  31671. // "address": {
  31672. // "description": "Name of the address resource to return.",
  31673. // "location": "path",
  31674. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31675. // "required": true,
  31676. // "type": "string"
  31677. // },
  31678. // "project": {
  31679. // "description": "Project ID for this request.",
  31680. // "location": "path",
  31681. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31682. // "required": true,
  31683. // "type": "string"
  31684. // },
  31685. // "region": {
  31686. // "description": "Name of the region for this request.",
  31687. // "location": "path",
  31688. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31689. // "required": true,
  31690. // "type": "string"
  31691. // }
  31692. // },
  31693. // "path": "{project}/regions/{region}/addresses/{address}",
  31694. // "response": {
  31695. // "$ref": "Address"
  31696. // },
  31697. // "scopes": [
  31698. // "https://www.googleapis.com/auth/cloud-platform",
  31699. // "https://www.googleapis.com/auth/compute",
  31700. // "https://www.googleapis.com/auth/compute.readonly"
  31701. // ]
  31702. // }
  31703. }
  31704. // method id "compute.addresses.insert":
  31705. type AddressesInsertCall struct {
  31706. s *Service
  31707. project string
  31708. region string
  31709. address *Address
  31710. urlParams_ gensupport.URLParams
  31711. ctx_ context.Context
  31712. header_ http.Header
  31713. }
  31714. // Insert: Creates an address resource in the specified project using
  31715. // the data included in the request.
  31716. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  31717. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  31718. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31719. c.project = project
  31720. c.region = region
  31721. c.address = address
  31722. return c
  31723. }
  31724. // RequestId sets the optional parameter "requestId": An optional
  31725. // request ID to identify requests. Specify a unique request ID so that
  31726. // if you must retry your request, the server will know to ignore the
  31727. // request if it has already been completed.
  31728. //
  31729. // For example, consider a situation where you make an initial request
  31730. // and the request times out. If you make the request again with the
  31731. // same request ID, the server can check if original operation with the
  31732. // same request ID was received, and if so, will ignore the second
  31733. // request. This prevents clients from accidentally creating duplicate
  31734. // commitments.
  31735. //
  31736. // The request ID must be a valid UUID with the exception that zero UUID
  31737. // is not supported (00000000-0000-0000-0000-000000000000).
  31738. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  31739. c.urlParams_.Set("requestId", requestId)
  31740. return c
  31741. }
  31742. // Fields allows partial responses to be retrieved. See
  31743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31744. // for more information.
  31745. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  31746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31747. return c
  31748. }
  31749. // Context sets the context to be used in this call's Do method. Any
  31750. // pending HTTP request will be aborted if the provided context is
  31751. // canceled.
  31752. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  31753. c.ctx_ = ctx
  31754. return c
  31755. }
  31756. // Header returns an http.Header that can be modified by the caller to
  31757. // add HTTP headers to the request.
  31758. func (c *AddressesInsertCall) Header() http.Header {
  31759. if c.header_ == nil {
  31760. c.header_ = make(http.Header)
  31761. }
  31762. return c.header_
  31763. }
  31764. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  31765. reqHeaders := make(http.Header)
  31766. for k, v := range c.header_ {
  31767. reqHeaders[k] = v
  31768. }
  31769. reqHeaders.Set("User-Agent", c.s.userAgent())
  31770. var body io.Reader = nil
  31771. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  31772. if err != nil {
  31773. return nil, err
  31774. }
  31775. reqHeaders.Set("Content-Type", "application/json")
  31776. c.urlParams_.Set("alt", alt)
  31777. c.urlParams_.Set("prettyPrint", "false")
  31778. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  31779. urls += "?" + c.urlParams_.Encode()
  31780. req, err := http.NewRequest("POST", urls, body)
  31781. if err != nil {
  31782. return nil, err
  31783. }
  31784. req.Header = reqHeaders
  31785. googleapi.Expand(req.URL, map[string]string{
  31786. "project": c.project,
  31787. "region": c.region,
  31788. })
  31789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31790. }
  31791. // Do executes the "compute.addresses.insert" call.
  31792. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31793. // status code is an error. Response headers are in either
  31794. // *Operation.ServerResponse.Header or (if a response was returned at
  31795. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31796. // to check whether the returned error was because
  31797. // http.StatusNotModified was returned.
  31798. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31799. gensupport.SetOptions(c.urlParams_, opts...)
  31800. res, err := c.doRequest("json")
  31801. if res != nil && res.StatusCode == http.StatusNotModified {
  31802. if res.Body != nil {
  31803. res.Body.Close()
  31804. }
  31805. return nil, &googleapi.Error{
  31806. Code: res.StatusCode,
  31807. Header: res.Header,
  31808. }
  31809. }
  31810. if err != nil {
  31811. return nil, err
  31812. }
  31813. defer googleapi.CloseBody(res)
  31814. if err := googleapi.CheckResponse(res); err != nil {
  31815. return nil, err
  31816. }
  31817. ret := &Operation{
  31818. ServerResponse: googleapi.ServerResponse{
  31819. Header: res.Header,
  31820. HTTPStatusCode: res.StatusCode,
  31821. },
  31822. }
  31823. target := &ret
  31824. if err := gensupport.DecodeResponse(target, res); err != nil {
  31825. return nil, err
  31826. }
  31827. return ret, nil
  31828. // {
  31829. // "description": "Creates an address resource in the specified project using the data included in the request.",
  31830. // "httpMethod": "POST",
  31831. // "id": "compute.addresses.insert",
  31832. // "parameterOrder": [
  31833. // "project",
  31834. // "region"
  31835. // ],
  31836. // "parameters": {
  31837. // "project": {
  31838. // "description": "Project ID for this request.",
  31839. // "location": "path",
  31840. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31841. // "required": true,
  31842. // "type": "string"
  31843. // },
  31844. // "region": {
  31845. // "description": "Name of the region for this request.",
  31846. // "location": "path",
  31847. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31848. // "required": true,
  31849. // "type": "string"
  31850. // },
  31851. // "requestId": {
  31852. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31853. // "location": "query",
  31854. // "type": "string"
  31855. // }
  31856. // },
  31857. // "path": "{project}/regions/{region}/addresses",
  31858. // "request": {
  31859. // "$ref": "Address"
  31860. // },
  31861. // "response": {
  31862. // "$ref": "Operation"
  31863. // },
  31864. // "scopes": [
  31865. // "https://www.googleapis.com/auth/cloud-platform",
  31866. // "https://www.googleapis.com/auth/compute"
  31867. // ]
  31868. // }
  31869. }
  31870. // method id "compute.addresses.list":
  31871. type AddressesListCall struct {
  31872. s *Service
  31873. project string
  31874. region string
  31875. urlParams_ gensupport.URLParams
  31876. ifNoneMatch_ string
  31877. ctx_ context.Context
  31878. header_ http.Header
  31879. }
  31880. // List: Retrieves a list of addresses contained within the specified
  31881. // region.
  31882. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  31883. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  31884. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31885. c.project = project
  31886. c.region = region
  31887. return c
  31888. }
  31889. // Filter sets the optional parameter "filter": A filter expression that
  31890. // filters resources listed in the response. The expression must specify
  31891. // the field name, a comparison operator, and the value that you want to
  31892. // use for filtering. The value must be a string, a number, or a
  31893. // boolean. The comparison operator must be either =, !=, >, or <.
  31894. //
  31895. // For example, if you are filtering Compute Engine instances, you can
  31896. // exclude instances named example-instance by specifying name !=
  31897. // example-instance.
  31898. //
  31899. // You can also filter nested fields. For example, you could specify
  31900. // scheduling.automaticRestart = false to include instances only if they
  31901. // are not scheduled for automatic restarts. You can use filtering on
  31902. // nested fields to filter based on resource labels.
  31903. //
  31904. // To filter on multiple expressions, provide each separate expression
  31905. // within parentheses. For example, (scheduling.automaticRestart = true)
  31906. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31907. // AND expression. However, you can include AND and OR expressions
  31908. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31909. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31910. // true).
  31911. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  31912. c.urlParams_.Set("filter", filter)
  31913. return c
  31914. }
  31915. // MaxResults sets the optional parameter "maxResults": The maximum
  31916. // number of results per page that should be returned. If the number of
  31917. // available results is larger than maxResults, Compute Engine returns a
  31918. // nextPageToken that can be used to get the next page of results in
  31919. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31920. // (Default: 500)
  31921. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  31922. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31923. return c
  31924. }
  31925. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31926. // a certain order. By default, results are returned in alphanumerical
  31927. // order based on the resource name.
  31928. //
  31929. // You can also sort results in descending order based on the creation
  31930. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31931. // based on the creationTimestamp field in reverse chronological order
  31932. // (newest result first). Use this to sort resources like operations so
  31933. // that the newest operation is returned first.
  31934. //
  31935. // Currently, only sorting by name or creationTimestamp desc is
  31936. // supported.
  31937. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  31938. c.urlParams_.Set("orderBy", orderBy)
  31939. return c
  31940. }
  31941. // PageToken sets the optional parameter "pageToken": Specifies a page
  31942. // token to use. Set pageToken to the nextPageToken returned by a
  31943. // previous list request to get the next page of results.
  31944. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  31945. c.urlParams_.Set("pageToken", pageToken)
  31946. return c
  31947. }
  31948. // Fields allows partial responses to be retrieved. See
  31949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31950. // for more information.
  31951. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  31952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31953. return c
  31954. }
  31955. // IfNoneMatch sets the optional parameter which makes the operation
  31956. // fail if the object's ETag matches the given value. This is useful for
  31957. // getting updates only after the object has changed since the last
  31958. // request. Use googleapi.IsNotModified to check whether the response
  31959. // error from Do is the result of In-None-Match.
  31960. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  31961. c.ifNoneMatch_ = entityTag
  31962. return c
  31963. }
  31964. // Context sets the context to be used in this call's Do method. Any
  31965. // pending HTTP request will be aborted if the provided context is
  31966. // canceled.
  31967. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  31968. c.ctx_ = ctx
  31969. return c
  31970. }
  31971. // Header returns an http.Header that can be modified by the caller to
  31972. // add HTTP headers to the request.
  31973. func (c *AddressesListCall) Header() http.Header {
  31974. if c.header_ == nil {
  31975. c.header_ = make(http.Header)
  31976. }
  31977. return c.header_
  31978. }
  31979. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  31980. reqHeaders := make(http.Header)
  31981. for k, v := range c.header_ {
  31982. reqHeaders[k] = v
  31983. }
  31984. reqHeaders.Set("User-Agent", c.s.userAgent())
  31985. if c.ifNoneMatch_ != "" {
  31986. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31987. }
  31988. var body io.Reader = nil
  31989. c.urlParams_.Set("alt", alt)
  31990. c.urlParams_.Set("prettyPrint", "false")
  31991. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  31992. urls += "?" + c.urlParams_.Encode()
  31993. req, err := http.NewRequest("GET", urls, body)
  31994. if err != nil {
  31995. return nil, err
  31996. }
  31997. req.Header = reqHeaders
  31998. googleapi.Expand(req.URL, map[string]string{
  31999. "project": c.project,
  32000. "region": c.region,
  32001. })
  32002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32003. }
  32004. // Do executes the "compute.addresses.list" call.
  32005. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  32006. // status code is an error. Response headers are in either
  32007. // *AddressList.ServerResponse.Header or (if a response was returned at
  32008. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32009. // to check whether the returned error was because
  32010. // http.StatusNotModified was returned.
  32011. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  32012. gensupport.SetOptions(c.urlParams_, opts...)
  32013. res, err := c.doRequest("json")
  32014. if res != nil && res.StatusCode == http.StatusNotModified {
  32015. if res.Body != nil {
  32016. res.Body.Close()
  32017. }
  32018. return nil, &googleapi.Error{
  32019. Code: res.StatusCode,
  32020. Header: res.Header,
  32021. }
  32022. }
  32023. if err != nil {
  32024. return nil, err
  32025. }
  32026. defer googleapi.CloseBody(res)
  32027. if err := googleapi.CheckResponse(res); err != nil {
  32028. return nil, err
  32029. }
  32030. ret := &AddressList{
  32031. ServerResponse: googleapi.ServerResponse{
  32032. Header: res.Header,
  32033. HTTPStatusCode: res.StatusCode,
  32034. },
  32035. }
  32036. target := &ret
  32037. if err := gensupport.DecodeResponse(target, res); err != nil {
  32038. return nil, err
  32039. }
  32040. return ret, nil
  32041. // {
  32042. // "description": "Retrieves a list of addresses contained within the specified region.",
  32043. // "httpMethod": "GET",
  32044. // "id": "compute.addresses.list",
  32045. // "parameterOrder": [
  32046. // "project",
  32047. // "region"
  32048. // ],
  32049. // "parameters": {
  32050. // "filter": {
  32051. // "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).",
  32052. // "location": "query",
  32053. // "type": "string"
  32054. // },
  32055. // "maxResults": {
  32056. // "default": "500",
  32057. // "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)",
  32058. // "format": "uint32",
  32059. // "location": "query",
  32060. // "minimum": "0",
  32061. // "type": "integer"
  32062. // },
  32063. // "orderBy": {
  32064. // "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.",
  32065. // "location": "query",
  32066. // "type": "string"
  32067. // },
  32068. // "pageToken": {
  32069. // "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.",
  32070. // "location": "query",
  32071. // "type": "string"
  32072. // },
  32073. // "project": {
  32074. // "description": "Project ID for this request.",
  32075. // "location": "path",
  32076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32077. // "required": true,
  32078. // "type": "string"
  32079. // },
  32080. // "region": {
  32081. // "description": "Name of the region for this request.",
  32082. // "location": "path",
  32083. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32084. // "required": true,
  32085. // "type": "string"
  32086. // }
  32087. // },
  32088. // "path": "{project}/regions/{region}/addresses",
  32089. // "response": {
  32090. // "$ref": "AddressList"
  32091. // },
  32092. // "scopes": [
  32093. // "https://www.googleapis.com/auth/cloud-platform",
  32094. // "https://www.googleapis.com/auth/compute",
  32095. // "https://www.googleapis.com/auth/compute.readonly"
  32096. // ]
  32097. // }
  32098. }
  32099. // Pages invokes f for each page of results.
  32100. // A non-nil error returned from f will halt the iteration.
  32101. // The provided context supersedes any context provided to the Context method.
  32102. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  32103. c.ctx_ = ctx
  32104. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32105. for {
  32106. x, err := c.Do()
  32107. if err != nil {
  32108. return err
  32109. }
  32110. if err := f(x); err != nil {
  32111. return err
  32112. }
  32113. if x.NextPageToken == "" {
  32114. return nil
  32115. }
  32116. c.PageToken(x.NextPageToken)
  32117. }
  32118. }
  32119. // method id "compute.addresses.setLabels":
  32120. type AddressesSetLabelsCall struct {
  32121. s *Service
  32122. project string
  32123. region string
  32124. resource string
  32125. regionsetlabelsrequest *RegionSetLabelsRequest
  32126. urlParams_ gensupport.URLParams
  32127. ctx_ context.Context
  32128. header_ http.Header
  32129. }
  32130. // SetLabels: Sets the labels on an Address. To learn more about labels,
  32131. // read the Labeling Resources documentation.
  32132. func (r *AddressesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *AddressesSetLabelsCall {
  32133. c := &AddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32134. c.project = project
  32135. c.region = region
  32136. c.resource = resource
  32137. c.regionsetlabelsrequest = regionsetlabelsrequest
  32138. return c
  32139. }
  32140. // RequestId sets the optional parameter "requestId": An optional
  32141. // request ID to identify requests. Specify a unique request ID so that
  32142. // if you must retry your request, the server will know to ignore the
  32143. // request if it has already been completed.
  32144. //
  32145. // For example, consider a situation where you make an initial request
  32146. // and the request times out. If you make the request again with the
  32147. // same request ID, the server can check if original operation with the
  32148. // same request ID was received, and if so, will ignore the second
  32149. // request. This prevents clients from accidentally creating duplicate
  32150. // commitments.
  32151. //
  32152. // The request ID must be a valid UUID with the exception that zero UUID
  32153. // is not supported (00000000-0000-0000-0000-000000000000).
  32154. func (c *AddressesSetLabelsCall) RequestId(requestId string) *AddressesSetLabelsCall {
  32155. c.urlParams_.Set("requestId", requestId)
  32156. return c
  32157. }
  32158. // Fields allows partial responses to be retrieved. See
  32159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32160. // for more information.
  32161. func (c *AddressesSetLabelsCall) Fields(s ...googleapi.Field) *AddressesSetLabelsCall {
  32162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32163. return c
  32164. }
  32165. // Context sets the context to be used in this call's Do method. Any
  32166. // pending HTTP request will be aborted if the provided context is
  32167. // canceled.
  32168. func (c *AddressesSetLabelsCall) Context(ctx context.Context) *AddressesSetLabelsCall {
  32169. c.ctx_ = ctx
  32170. return c
  32171. }
  32172. // Header returns an http.Header that can be modified by the caller to
  32173. // add HTTP headers to the request.
  32174. func (c *AddressesSetLabelsCall) Header() http.Header {
  32175. if c.header_ == nil {
  32176. c.header_ = make(http.Header)
  32177. }
  32178. return c.header_
  32179. }
  32180. func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  32181. reqHeaders := make(http.Header)
  32182. for k, v := range c.header_ {
  32183. reqHeaders[k] = v
  32184. }
  32185. reqHeaders.Set("User-Agent", c.s.userAgent())
  32186. var body io.Reader = nil
  32187. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  32188. if err != nil {
  32189. return nil, err
  32190. }
  32191. reqHeaders.Set("Content-Type", "application/json")
  32192. c.urlParams_.Set("alt", alt)
  32193. c.urlParams_.Set("prettyPrint", "false")
  32194. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/setLabels")
  32195. urls += "?" + c.urlParams_.Encode()
  32196. req, err := http.NewRequest("POST", urls, body)
  32197. if err != nil {
  32198. return nil, err
  32199. }
  32200. req.Header = reqHeaders
  32201. googleapi.Expand(req.URL, map[string]string{
  32202. "project": c.project,
  32203. "region": c.region,
  32204. "resource": c.resource,
  32205. })
  32206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32207. }
  32208. // Do executes the "compute.addresses.setLabels" call.
  32209. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32210. // status code is an error. Response headers are in either
  32211. // *Operation.ServerResponse.Header or (if a response was returned at
  32212. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32213. // to check whether the returned error was because
  32214. // http.StatusNotModified was returned.
  32215. func (c *AddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32216. gensupport.SetOptions(c.urlParams_, opts...)
  32217. res, err := c.doRequest("json")
  32218. if res != nil && res.StatusCode == http.StatusNotModified {
  32219. if res.Body != nil {
  32220. res.Body.Close()
  32221. }
  32222. return nil, &googleapi.Error{
  32223. Code: res.StatusCode,
  32224. Header: res.Header,
  32225. }
  32226. }
  32227. if err != nil {
  32228. return nil, err
  32229. }
  32230. defer googleapi.CloseBody(res)
  32231. if err := googleapi.CheckResponse(res); err != nil {
  32232. return nil, err
  32233. }
  32234. ret := &Operation{
  32235. ServerResponse: googleapi.ServerResponse{
  32236. Header: res.Header,
  32237. HTTPStatusCode: res.StatusCode,
  32238. },
  32239. }
  32240. target := &ret
  32241. if err := gensupport.DecodeResponse(target, res); err != nil {
  32242. return nil, err
  32243. }
  32244. return ret, nil
  32245. // {
  32246. // "description": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.",
  32247. // "httpMethod": "POST",
  32248. // "id": "compute.addresses.setLabels",
  32249. // "parameterOrder": [
  32250. // "project",
  32251. // "region",
  32252. // "resource"
  32253. // ],
  32254. // "parameters": {
  32255. // "project": {
  32256. // "description": "Project ID for this request.",
  32257. // "location": "path",
  32258. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32259. // "required": true,
  32260. // "type": "string"
  32261. // },
  32262. // "region": {
  32263. // "description": "The region for this request.",
  32264. // "location": "path",
  32265. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32266. // "required": true,
  32267. // "type": "string"
  32268. // },
  32269. // "requestId": {
  32270. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32271. // "location": "query",
  32272. // "type": "string"
  32273. // },
  32274. // "resource": {
  32275. // "description": "Name or id of the resource for this request.",
  32276. // "location": "path",
  32277. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32278. // "required": true,
  32279. // "type": "string"
  32280. // }
  32281. // },
  32282. // "path": "{project}/regions/{region}/addresses/{resource}/setLabels",
  32283. // "request": {
  32284. // "$ref": "RegionSetLabelsRequest"
  32285. // },
  32286. // "response": {
  32287. // "$ref": "Operation"
  32288. // },
  32289. // "scopes": [
  32290. // "https://www.googleapis.com/auth/cloud-platform",
  32291. // "https://www.googleapis.com/auth/compute"
  32292. // ]
  32293. // }
  32294. }
  32295. // method id "compute.addresses.testIamPermissions":
  32296. type AddressesTestIamPermissionsCall struct {
  32297. s *Service
  32298. project string
  32299. region string
  32300. resource string
  32301. testpermissionsrequest *TestPermissionsRequest
  32302. urlParams_ gensupport.URLParams
  32303. ctx_ context.Context
  32304. header_ http.Header
  32305. }
  32306. // TestIamPermissions: Returns permissions that a caller has on the
  32307. // specified resource.
  32308. func (r *AddressesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *AddressesTestIamPermissionsCall {
  32309. c := &AddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32310. c.project = project
  32311. c.region = region
  32312. c.resource = resource
  32313. c.testpermissionsrequest = testpermissionsrequest
  32314. return c
  32315. }
  32316. // Fields allows partial responses to be retrieved. See
  32317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32318. // for more information.
  32319. func (c *AddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *AddressesTestIamPermissionsCall {
  32320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32321. return c
  32322. }
  32323. // Context sets the context to be used in this call's Do method. Any
  32324. // pending HTTP request will be aborted if the provided context is
  32325. // canceled.
  32326. func (c *AddressesTestIamPermissionsCall) Context(ctx context.Context) *AddressesTestIamPermissionsCall {
  32327. c.ctx_ = ctx
  32328. return c
  32329. }
  32330. // Header returns an http.Header that can be modified by the caller to
  32331. // add HTTP headers to the request.
  32332. func (c *AddressesTestIamPermissionsCall) Header() http.Header {
  32333. if c.header_ == nil {
  32334. c.header_ = make(http.Header)
  32335. }
  32336. return c.header_
  32337. }
  32338. func (c *AddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  32339. reqHeaders := make(http.Header)
  32340. for k, v := range c.header_ {
  32341. reqHeaders[k] = v
  32342. }
  32343. reqHeaders.Set("User-Agent", c.s.userAgent())
  32344. var body io.Reader = nil
  32345. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  32346. if err != nil {
  32347. return nil, err
  32348. }
  32349. reqHeaders.Set("Content-Type", "application/json")
  32350. c.urlParams_.Set("alt", alt)
  32351. c.urlParams_.Set("prettyPrint", "false")
  32352. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/testIamPermissions")
  32353. urls += "?" + c.urlParams_.Encode()
  32354. req, err := http.NewRequest("POST", urls, body)
  32355. if err != nil {
  32356. return nil, err
  32357. }
  32358. req.Header = reqHeaders
  32359. googleapi.Expand(req.URL, map[string]string{
  32360. "project": c.project,
  32361. "region": c.region,
  32362. "resource": c.resource,
  32363. })
  32364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32365. }
  32366. // Do executes the "compute.addresses.testIamPermissions" call.
  32367. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  32368. // non-2xx status code is an error. Response headers are in either
  32369. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  32370. // returned at all) in error.(*googleapi.Error).Header. Use
  32371. // googleapi.IsNotModified to check whether the returned error was
  32372. // because http.StatusNotModified was returned.
  32373. func (c *AddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  32374. gensupport.SetOptions(c.urlParams_, opts...)
  32375. res, err := c.doRequest("json")
  32376. if res != nil && res.StatusCode == http.StatusNotModified {
  32377. if res.Body != nil {
  32378. res.Body.Close()
  32379. }
  32380. return nil, &googleapi.Error{
  32381. Code: res.StatusCode,
  32382. Header: res.Header,
  32383. }
  32384. }
  32385. if err != nil {
  32386. return nil, err
  32387. }
  32388. defer googleapi.CloseBody(res)
  32389. if err := googleapi.CheckResponse(res); err != nil {
  32390. return nil, err
  32391. }
  32392. ret := &TestPermissionsResponse{
  32393. ServerResponse: googleapi.ServerResponse{
  32394. Header: res.Header,
  32395. HTTPStatusCode: res.StatusCode,
  32396. },
  32397. }
  32398. target := &ret
  32399. if err := gensupport.DecodeResponse(target, res); err != nil {
  32400. return nil, err
  32401. }
  32402. return ret, nil
  32403. // {
  32404. // "description": "Returns permissions that a caller has on the specified resource.",
  32405. // "httpMethod": "POST",
  32406. // "id": "compute.addresses.testIamPermissions",
  32407. // "parameterOrder": [
  32408. // "project",
  32409. // "region",
  32410. // "resource"
  32411. // ],
  32412. // "parameters": {
  32413. // "project": {
  32414. // "description": "Project ID for this request.",
  32415. // "location": "path",
  32416. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32417. // "required": true,
  32418. // "type": "string"
  32419. // },
  32420. // "region": {
  32421. // "description": "The name of the region for this request.",
  32422. // "location": "path",
  32423. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32424. // "required": true,
  32425. // "type": "string"
  32426. // },
  32427. // "resource": {
  32428. // "description": "Name or id of the resource for this request.",
  32429. // "location": "path",
  32430. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32431. // "required": true,
  32432. // "type": "string"
  32433. // }
  32434. // },
  32435. // "path": "{project}/regions/{region}/addresses/{resource}/testIamPermissions",
  32436. // "request": {
  32437. // "$ref": "TestPermissionsRequest"
  32438. // },
  32439. // "response": {
  32440. // "$ref": "TestPermissionsResponse"
  32441. // },
  32442. // "scopes": [
  32443. // "https://www.googleapis.com/auth/cloud-platform",
  32444. // "https://www.googleapis.com/auth/compute",
  32445. // "https://www.googleapis.com/auth/compute.readonly"
  32446. // ]
  32447. // }
  32448. }
  32449. // method id "compute.allocations.aggregatedList":
  32450. type AllocationsAggregatedListCall struct {
  32451. s *Service
  32452. project string
  32453. urlParams_ gensupport.URLParams
  32454. ifNoneMatch_ string
  32455. ctx_ context.Context
  32456. header_ http.Header
  32457. }
  32458. // AggregatedList: Retrieves an aggregated list of allocations.
  32459. func (r *AllocationsService) AggregatedList(project string) *AllocationsAggregatedListCall {
  32460. c := &AllocationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32461. c.project = project
  32462. return c
  32463. }
  32464. // Filter sets the optional parameter "filter": A filter expression that
  32465. // filters resources listed in the response. The expression must specify
  32466. // the field name, a comparison operator, and the value that you want to
  32467. // use for filtering. The value must be a string, a number, or a
  32468. // boolean. The comparison operator must be either =, !=, >, or <.
  32469. //
  32470. // For example, if you are filtering Compute Engine instances, you can
  32471. // exclude instances named example-instance by specifying name !=
  32472. // example-instance.
  32473. //
  32474. // You can also filter nested fields. For example, you could specify
  32475. // scheduling.automaticRestart = false to include instances only if they
  32476. // are not scheduled for automatic restarts. You can use filtering on
  32477. // nested fields to filter based on resource labels.
  32478. //
  32479. // To filter on multiple expressions, provide each separate expression
  32480. // within parentheses. For example, (scheduling.automaticRestart = true)
  32481. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32482. // AND expression. However, you can include AND and OR expressions
  32483. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32484. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32485. // true).
  32486. func (c *AllocationsAggregatedListCall) Filter(filter string) *AllocationsAggregatedListCall {
  32487. c.urlParams_.Set("filter", filter)
  32488. return c
  32489. }
  32490. // MaxResults sets the optional parameter "maxResults": The maximum
  32491. // number of results per page that should be returned. If the number of
  32492. // available results is larger than maxResults, Compute Engine returns a
  32493. // nextPageToken that can be used to get the next page of results in
  32494. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32495. // (Default: 500)
  32496. func (c *AllocationsAggregatedListCall) MaxResults(maxResults int64) *AllocationsAggregatedListCall {
  32497. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32498. return c
  32499. }
  32500. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32501. // a certain order. By default, results are returned in alphanumerical
  32502. // order based on the resource name.
  32503. //
  32504. // You can also sort results in descending order based on the creation
  32505. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32506. // based on the creationTimestamp field in reverse chronological order
  32507. // (newest result first). Use this to sort resources like operations so
  32508. // that the newest operation is returned first.
  32509. //
  32510. // Currently, only sorting by name or creationTimestamp desc is
  32511. // supported.
  32512. func (c *AllocationsAggregatedListCall) OrderBy(orderBy string) *AllocationsAggregatedListCall {
  32513. c.urlParams_.Set("orderBy", orderBy)
  32514. return c
  32515. }
  32516. // PageToken sets the optional parameter "pageToken": Specifies a page
  32517. // token to use. Set pageToken to the nextPageToken returned by a
  32518. // previous list request to get the next page of results.
  32519. func (c *AllocationsAggregatedListCall) PageToken(pageToken string) *AllocationsAggregatedListCall {
  32520. c.urlParams_.Set("pageToken", pageToken)
  32521. return c
  32522. }
  32523. // Fields allows partial responses to be retrieved. See
  32524. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32525. // for more information.
  32526. func (c *AllocationsAggregatedListCall) Fields(s ...googleapi.Field) *AllocationsAggregatedListCall {
  32527. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32528. return c
  32529. }
  32530. // IfNoneMatch sets the optional parameter which makes the operation
  32531. // fail if the object's ETag matches the given value. This is useful for
  32532. // getting updates only after the object has changed since the last
  32533. // request. Use googleapi.IsNotModified to check whether the response
  32534. // error from Do is the result of In-None-Match.
  32535. func (c *AllocationsAggregatedListCall) IfNoneMatch(entityTag string) *AllocationsAggregatedListCall {
  32536. c.ifNoneMatch_ = entityTag
  32537. return c
  32538. }
  32539. // Context sets the context to be used in this call's Do method. Any
  32540. // pending HTTP request will be aborted if the provided context is
  32541. // canceled.
  32542. func (c *AllocationsAggregatedListCall) Context(ctx context.Context) *AllocationsAggregatedListCall {
  32543. c.ctx_ = ctx
  32544. return c
  32545. }
  32546. // Header returns an http.Header that can be modified by the caller to
  32547. // add HTTP headers to the request.
  32548. func (c *AllocationsAggregatedListCall) Header() http.Header {
  32549. if c.header_ == nil {
  32550. c.header_ = make(http.Header)
  32551. }
  32552. return c.header_
  32553. }
  32554. func (c *AllocationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  32555. reqHeaders := make(http.Header)
  32556. for k, v := range c.header_ {
  32557. reqHeaders[k] = v
  32558. }
  32559. reqHeaders.Set("User-Agent", c.s.userAgent())
  32560. if c.ifNoneMatch_ != "" {
  32561. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32562. }
  32563. var body io.Reader = nil
  32564. c.urlParams_.Set("alt", alt)
  32565. c.urlParams_.Set("prettyPrint", "false")
  32566. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/allocations")
  32567. urls += "?" + c.urlParams_.Encode()
  32568. req, err := http.NewRequest("GET", urls, body)
  32569. if err != nil {
  32570. return nil, err
  32571. }
  32572. req.Header = reqHeaders
  32573. googleapi.Expand(req.URL, map[string]string{
  32574. "project": c.project,
  32575. })
  32576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32577. }
  32578. // Do executes the "compute.allocations.aggregatedList" call.
  32579. // Exactly one of *AllocationAggregatedList or error will be non-nil.
  32580. // Any non-2xx status code is an error. Response headers are in either
  32581. // *AllocationAggregatedList.ServerResponse.Header or (if a response was
  32582. // returned at all) in error.(*googleapi.Error).Header. Use
  32583. // googleapi.IsNotModified to check whether the returned error was
  32584. // because http.StatusNotModified was returned.
  32585. func (c *AllocationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*AllocationAggregatedList, error) {
  32586. gensupport.SetOptions(c.urlParams_, opts...)
  32587. res, err := c.doRequest("json")
  32588. if res != nil && res.StatusCode == http.StatusNotModified {
  32589. if res.Body != nil {
  32590. res.Body.Close()
  32591. }
  32592. return nil, &googleapi.Error{
  32593. Code: res.StatusCode,
  32594. Header: res.Header,
  32595. }
  32596. }
  32597. if err != nil {
  32598. return nil, err
  32599. }
  32600. defer googleapi.CloseBody(res)
  32601. if err := googleapi.CheckResponse(res); err != nil {
  32602. return nil, err
  32603. }
  32604. ret := &AllocationAggregatedList{
  32605. ServerResponse: googleapi.ServerResponse{
  32606. Header: res.Header,
  32607. HTTPStatusCode: res.StatusCode,
  32608. },
  32609. }
  32610. target := &ret
  32611. if err := gensupport.DecodeResponse(target, res); err != nil {
  32612. return nil, err
  32613. }
  32614. return ret, nil
  32615. // {
  32616. // "description": "Retrieves an aggregated list of allocations.",
  32617. // "httpMethod": "GET",
  32618. // "id": "compute.allocations.aggregatedList",
  32619. // "parameterOrder": [
  32620. // "project"
  32621. // ],
  32622. // "parameters": {
  32623. // "filter": {
  32624. // "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).",
  32625. // "location": "query",
  32626. // "type": "string"
  32627. // },
  32628. // "maxResults": {
  32629. // "default": "500",
  32630. // "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)",
  32631. // "format": "uint32",
  32632. // "location": "query",
  32633. // "minimum": "0",
  32634. // "type": "integer"
  32635. // },
  32636. // "orderBy": {
  32637. // "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.",
  32638. // "location": "query",
  32639. // "type": "string"
  32640. // },
  32641. // "pageToken": {
  32642. // "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.",
  32643. // "location": "query",
  32644. // "type": "string"
  32645. // },
  32646. // "project": {
  32647. // "description": "Project ID for this request.",
  32648. // "location": "path",
  32649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32650. // "required": true,
  32651. // "type": "string"
  32652. // }
  32653. // },
  32654. // "path": "{project}/aggregated/allocations",
  32655. // "response": {
  32656. // "$ref": "AllocationAggregatedList"
  32657. // },
  32658. // "scopes": [
  32659. // "https://www.googleapis.com/auth/cloud-platform",
  32660. // "https://www.googleapis.com/auth/compute",
  32661. // "https://www.googleapis.com/auth/compute.readonly"
  32662. // ]
  32663. // }
  32664. }
  32665. // Pages invokes f for each page of results.
  32666. // A non-nil error returned from f will halt the iteration.
  32667. // The provided context supersedes any context provided to the Context method.
  32668. func (c *AllocationsAggregatedListCall) Pages(ctx context.Context, f func(*AllocationAggregatedList) error) error {
  32669. c.ctx_ = ctx
  32670. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32671. for {
  32672. x, err := c.Do()
  32673. if err != nil {
  32674. return err
  32675. }
  32676. if err := f(x); err != nil {
  32677. return err
  32678. }
  32679. if x.NextPageToken == "" {
  32680. return nil
  32681. }
  32682. c.PageToken(x.NextPageToken)
  32683. }
  32684. }
  32685. // method id "compute.allocations.delete":
  32686. type AllocationsDeleteCall struct {
  32687. s *Service
  32688. project string
  32689. zone string
  32690. allocation string
  32691. urlParams_ gensupport.URLParams
  32692. ctx_ context.Context
  32693. header_ http.Header
  32694. }
  32695. // Delete: Deletes the specified allocation.
  32696. func (r *AllocationsService) Delete(project string, zone string, allocation string) *AllocationsDeleteCall {
  32697. c := &AllocationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32698. c.project = project
  32699. c.zone = zone
  32700. c.allocation = allocation
  32701. return c
  32702. }
  32703. // RequestId sets the optional parameter "requestId": An optional
  32704. // request ID to identify requests. Specify a unique request ID so that
  32705. // if you must retry your request, the server will know to ignore the
  32706. // request if it has already been completed.
  32707. //
  32708. // For example, consider a situation where you make an initial request
  32709. // and the request times out. If you make the request again with the
  32710. // same request ID, the server can check if original operation with the
  32711. // same request ID was received, and if so, will ignore the second
  32712. // request. This prevents clients from accidentally creating duplicate
  32713. // commitments.
  32714. //
  32715. // The request ID must be a valid UUID with the exception that zero UUID
  32716. // is not supported (00000000-0000-0000-0000-000000000000).
  32717. func (c *AllocationsDeleteCall) RequestId(requestId string) *AllocationsDeleteCall {
  32718. c.urlParams_.Set("requestId", requestId)
  32719. return c
  32720. }
  32721. // Fields allows partial responses to be retrieved. See
  32722. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32723. // for more information.
  32724. func (c *AllocationsDeleteCall) Fields(s ...googleapi.Field) *AllocationsDeleteCall {
  32725. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32726. return c
  32727. }
  32728. // Context sets the context to be used in this call's Do method. Any
  32729. // pending HTTP request will be aborted if the provided context is
  32730. // canceled.
  32731. func (c *AllocationsDeleteCall) Context(ctx context.Context) *AllocationsDeleteCall {
  32732. c.ctx_ = ctx
  32733. return c
  32734. }
  32735. // Header returns an http.Header that can be modified by the caller to
  32736. // add HTTP headers to the request.
  32737. func (c *AllocationsDeleteCall) Header() http.Header {
  32738. if c.header_ == nil {
  32739. c.header_ = make(http.Header)
  32740. }
  32741. return c.header_
  32742. }
  32743. func (c *AllocationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  32744. reqHeaders := make(http.Header)
  32745. for k, v := range c.header_ {
  32746. reqHeaders[k] = v
  32747. }
  32748. reqHeaders.Set("User-Agent", c.s.userAgent())
  32749. var body io.Reader = nil
  32750. c.urlParams_.Set("alt", alt)
  32751. c.urlParams_.Set("prettyPrint", "false")
  32752. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}")
  32753. urls += "?" + c.urlParams_.Encode()
  32754. req, err := http.NewRequest("DELETE", urls, body)
  32755. if err != nil {
  32756. return nil, err
  32757. }
  32758. req.Header = reqHeaders
  32759. googleapi.Expand(req.URL, map[string]string{
  32760. "project": c.project,
  32761. "zone": c.zone,
  32762. "allocation": c.allocation,
  32763. })
  32764. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32765. }
  32766. // Do executes the "compute.allocations.delete" call.
  32767. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32768. // status code is an error. Response headers are in either
  32769. // *Operation.ServerResponse.Header or (if a response was returned at
  32770. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32771. // to check whether the returned error was because
  32772. // http.StatusNotModified was returned.
  32773. func (c *AllocationsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32774. gensupport.SetOptions(c.urlParams_, opts...)
  32775. res, err := c.doRequest("json")
  32776. if res != nil && res.StatusCode == http.StatusNotModified {
  32777. if res.Body != nil {
  32778. res.Body.Close()
  32779. }
  32780. return nil, &googleapi.Error{
  32781. Code: res.StatusCode,
  32782. Header: res.Header,
  32783. }
  32784. }
  32785. if err != nil {
  32786. return nil, err
  32787. }
  32788. defer googleapi.CloseBody(res)
  32789. if err := googleapi.CheckResponse(res); err != nil {
  32790. return nil, err
  32791. }
  32792. ret := &Operation{
  32793. ServerResponse: googleapi.ServerResponse{
  32794. Header: res.Header,
  32795. HTTPStatusCode: res.StatusCode,
  32796. },
  32797. }
  32798. target := &ret
  32799. if err := gensupport.DecodeResponse(target, res); err != nil {
  32800. return nil, err
  32801. }
  32802. return ret, nil
  32803. // {
  32804. // "description": "Deletes the specified allocation.",
  32805. // "httpMethod": "DELETE",
  32806. // "id": "compute.allocations.delete",
  32807. // "parameterOrder": [
  32808. // "project",
  32809. // "zone",
  32810. // "allocation"
  32811. // ],
  32812. // "parameters": {
  32813. // "allocation": {
  32814. // "description": "Name of the allocation to delete.",
  32815. // "location": "path",
  32816. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32817. // "required": true,
  32818. // "type": "string"
  32819. // },
  32820. // "project": {
  32821. // "description": "Project ID for this request.",
  32822. // "location": "path",
  32823. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32824. // "required": true,
  32825. // "type": "string"
  32826. // },
  32827. // "requestId": {
  32828. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32829. // "location": "query",
  32830. // "type": "string"
  32831. // },
  32832. // "zone": {
  32833. // "description": "Name of the zone for this request.",
  32834. // "location": "path",
  32835. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32836. // "required": true,
  32837. // "type": "string"
  32838. // }
  32839. // },
  32840. // "path": "{project}/zones/{zone}/allocations/{allocation}",
  32841. // "response": {
  32842. // "$ref": "Operation"
  32843. // },
  32844. // "scopes": [
  32845. // "https://www.googleapis.com/auth/cloud-platform",
  32846. // "https://www.googleapis.com/auth/compute"
  32847. // ]
  32848. // }
  32849. }
  32850. // method id "compute.allocations.get":
  32851. type AllocationsGetCall struct {
  32852. s *Service
  32853. project string
  32854. zone string
  32855. allocation string
  32856. urlParams_ gensupport.URLParams
  32857. ifNoneMatch_ string
  32858. ctx_ context.Context
  32859. header_ http.Header
  32860. }
  32861. // Get: Retrieves all information of the specified allocation.
  32862. func (r *AllocationsService) Get(project string, zone string, allocation string) *AllocationsGetCall {
  32863. c := &AllocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32864. c.project = project
  32865. c.zone = zone
  32866. c.allocation = allocation
  32867. return c
  32868. }
  32869. // Fields allows partial responses to be retrieved. See
  32870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32871. // for more information.
  32872. func (c *AllocationsGetCall) Fields(s ...googleapi.Field) *AllocationsGetCall {
  32873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32874. return c
  32875. }
  32876. // IfNoneMatch sets the optional parameter which makes the operation
  32877. // fail if the object's ETag matches the given value. This is useful for
  32878. // getting updates only after the object has changed since the last
  32879. // request. Use googleapi.IsNotModified to check whether the response
  32880. // error from Do is the result of In-None-Match.
  32881. func (c *AllocationsGetCall) IfNoneMatch(entityTag string) *AllocationsGetCall {
  32882. c.ifNoneMatch_ = entityTag
  32883. return c
  32884. }
  32885. // Context sets the context to be used in this call's Do method. Any
  32886. // pending HTTP request will be aborted if the provided context is
  32887. // canceled.
  32888. func (c *AllocationsGetCall) Context(ctx context.Context) *AllocationsGetCall {
  32889. c.ctx_ = ctx
  32890. return c
  32891. }
  32892. // Header returns an http.Header that can be modified by the caller to
  32893. // add HTTP headers to the request.
  32894. func (c *AllocationsGetCall) Header() http.Header {
  32895. if c.header_ == nil {
  32896. c.header_ = make(http.Header)
  32897. }
  32898. return c.header_
  32899. }
  32900. func (c *AllocationsGetCall) doRequest(alt string) (*http.Response, error) {
  32901. reqHeaders := make(http.Header)
  32902. for k, v := range c.header_ {
  32903. reqHeaders[k] = v
  32904. }
  32905. reqHeaders.Set("User-Agent", c.s.userAgent())
  32906. if c.ifNoneMatch_ != "" {
  32907. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32908. }
  32909. var body io.Reader = nil
  32910. c.urlParams_.Set("alt", alt)
  32911. c.urlParams_.Set("prettyPrint", "false")
  32912. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}")
  32913. urls += "?" + c.urlParams_.Encode()
  32914. req, err := http.NewRequest("GET", urls, body)
  32915. if err != nil {
  32916. return nil, err
  32917. }
  32918. req.Header = reqHeaders
  32919. googleapi.Expand(req.URL, map[string]string{
  32920. "project": c.project,
  32921. "zone": c.zone,
  32922. "allocation": c.allocation,
  32923. })
  32924. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32925. }
  32926. // Do executes the "compute.allocations.get" call.
  32927. // Exactly one of *Allocation or error will be non-nil. Any non-2xx
  32928. // status code is an error. Response headers are in either
  32929. // *Allocation.ServerResponse.Header or (if a response was returned at
  32930. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32931. // to check whether the returned error was because
  32932. // http.StatusNotModified was returned.
  32933. func (c *AllocationsGetCall) Do(opts ...googleapi.CallOption) (*Allocation, error) {
  32934. gensupport.SetOptions(c.urlParams_, opts...)
  32935. res, err := c.doRequest("json")
  32936. if res != nil && res.StatusCode == http.StatusNotModified {
  32937. if res.Body != nil {
  32938. res.Body.Close()
  32939. }
  32940. return nil, &googleapi.Error{
  32941. Code: res.StatusCode,
  32942. Header: res.Header,
  32943. }
  32944. }
  32945. if err != nil {
  32946. return nil, err
  32947. }
  32948. defer googleapi.CloseBody(res)
  32949. if err := googleapi.CheckResponse(res); err != nil {
  32950. return nil, err
  32951. }
  32952. ret := &Allocation{
  32953. ServerResponse: googleapi.ServerResponse{
  32954. Header: res.Header,
  32955. HTTPStatusCode: res.StatusCode,
  32956. },
  32957. }
  32958. target := &ret
  32959. if err := gensupport.DecodeResponse(target, res); err != nil {
  32960. return nil, err
  32961. }
  32962. return ret, nil
  32963. // {
  32964. // "description": "Retrieves all information of the specified allocation.",
  32965. // "httpMethod": "GET",
  32966. // "id": "compute.allocations.get",
  32967. // "parameterOrder": [
  32968. // "project",
  32969. // "zone",
  32970. // "allocation"
  32971. // ],
  32972. // "parameters": {
  32973. // "allocation": {
  32974. // "description": "Name of the allocation to retrieve.",
  32975. // "location": "path",
  32976. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32977. // "required": true,
  32978. // "type": "string"
  32979. // },
  32980. // "project": {
  32981. // "description": "Project ID for this request.",
  32982. // "location": "path",
  32983. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32984. // "required": true,
  32985. // "type": "string"
  32986. // },
  32987. // "zone": {
  32988. // "description": "Name of the zone for this request.",
  32989. // "location": "path",
  32990. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32991. // "required": true,
  32992. // "type": "string"
  32993. // }
  32994. // },
  32995. // "path": "{project}/zones/{zone}/allocations/{allocation}",
  32996. // "response": {
  32997. // "$ref": "Allocation"
  32998. // },
  32999. // "scopes": [
  33000. // "https://www.googleapis.com/auth/cloud-platform",
  33001. // "https://www.googleapis.com/auth/compute",
  33002. // "https://www.googleapis.com/auth/compute.readonly"
  33003. // ]
  33004. // }
  33005. }
  33006. // method id "compute.allocations.getIamPolicy":
  33007. type AllocationsGetIamPolicyCall struct {
  33008. s *Service
  33009. project string
  33010. zone string
  33011. resource string
  33012. urlParams_ gensupport.URLParams
  33013. ifNoneMatch_ string
  33014. ctx_ context.Context
  33015. header_ http.Header
  33016. }
  33017. // GetIamPolicy: Gets the access control policy for a resource. May be
  33018. // empty if no such policy or resource exists.
  33019. func (r *AllocationsService) GetIamPolicy(project string, zone string, resource string) *AllocationsGetIamPolicyCall {
  33020. c := &AllocationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33021. c.project = project
  33022. c.zone = zone
  33023. c.resource = resource
  33024. return c
  33025. }
  33026. // Fields allows partial responses to be retrieved. See
  33027. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33028. // for more information.
  33029. func (c *AllocationsGetIamPolicyCall) Fields(s ...googleapi.Field) *AllocationsGetIamPolicyCall {
  33030. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33031. return c
  33032. }
  33033. // IfNoneMatch sets the optional parameter which makes the operation
  33034. // fail if the object's ETag matches the given value. This is useful for
  33035. // getting updates only after the object has changed since the last
  33036. // request. Use googleapi.IsNotModified to check whether the response
  33037. // error from Do is the result of In-None-Match.
  33038. func (c *AllocationsGetIamPolicyCall) IfNoneMatch(entityTag string) *AllocationsGetIamPolicyCall {
  33039. c.ifNoneMatch_ = entityTag
  33040. return c
  33041. }
  33042. // Context sets the context to be used in this call's Do method. Any
  33043. // pending HTTP request will be aborted if the provided context is
  33044. // canceled.
  33045. func (c *AllocationsGetIamPolicyCall) Context(ctx context.Context) *AllocationsGetIamPolicyCall {
  33046. c.ctx_ = ctx
  33047. return c
  33048. }
  33049. // Header returns an http.Header that can be modified by the caller to
  33050. // add HTTP headers to the request.
  33051. func (c *AllocationsGetIamPolicyCall) Header() http.Header {
  33052. if c.header_ == nil {
  33053. c.header_ = make(http.Header)
  33054. }
  33055. return c.header_
  33056. }
  33057. func (c *AllocationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  33058. reqHeaders := make(http.Header)
  33059. for k, v := range c.header_ {
  33060. reqHeaders[k] = v
  33061. }
  33062. reqHeaders.Set("User-Agent", c.s.userAgent())
  33063. if c.ifNoneMatch_ != "" {
  33064. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33065. }
  33066. var body io.Reader = nil
  33067. c.urlParams_.Set("alt", alt)
  33068. c.urlParams_.Set("prettyPrint", "false")
  33069. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/getIamPolicy")
  33070. urls += "?" + c.urlParams_.Encode()
  33071. req, err := http.NewRequest("GET", urls, body)
  33072. if err != nil {
  33073. return nil, err
  33074. }
  33075. req.Header = reqHeaders
  33076. googleapi.Expand(req.URL, map[string]string{
  33077. "project": c.project,
  33078. "zone": c.zone,
  33079. "resource": c.resource,
  33080. })
  33081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33082. }
  33083. // Do executes the "compute.allocations.getIamPolicy" call.
  33084. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  33085. // code is an error. Response headers are in either
  33086. // *Policy.ServerResponse.Header or (if a response was returned at all)
  33087. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33088. // check whether the returned error was because http.StatusNotModified
  33089. // was returned.
  33090. func (c *AllocationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  33091. gensupport.SetOptions(c.urlParams_, opts...)
  33092. res, err := c.doRequest("json")
  33093. if res != nil && res.StatusCode == http.StatusNotModified {
  33094. if res.Body != nil {
  33095. res.Body.Close()
  33096. }
  33097. return nil, &googleapi.Error{
  33098. Code: res.StatusCode,
  33099. Header: res.Header,
  33100. }
  33101. }
  33102. if err != nil {
  33103. return nil, err
  33104. }
  33105. defer googleapi.CloseBody(res)
  33106. if err := googleapi.CheckResponse(res); err != nil {
  33107. return nil, err
  33108. }
  33109. ret := &Policy{
  33110. ServerResponse: googleapi.ServerResponse{
  33111. Header: res.Header,
  33112. HTTPStatusCode: res.StatusCode,
  33113. },
  33114. }
  33115. target := &ret
  33116. if err := gensupport.DecodeResponse(target, res); err != nil {
  33117. return nil, err
  33118. }
  33119. return ret, nil
  33120. // {
  33121. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  33122. // "httpMethod": "GET",
  33123. // "id": "compute.allocations.getIamPolicy",
  33124. // "parameterOrder": [
  33125. // "project",
  33126. // "zone",
  33127. // "resource"
  33128. // ],
  33129. // "parameters": {
  33130. // "project": {
  33131. // "description": "Project ID for this request.",
  33132. // "location": "path",
  33133. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33134. // "required": true,
  33135. // "type": "string"
  33136. // },
  33137. // "resource": {
  33138. // "description": "Name or id of the resource for this request.",
  33139. // "location": "path",
  33140. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33141. // "required": true,
  33142. // "type": "string"
  33143. // },
  33144. // "zone": {
  33145. // "description": "The name of the zone for this request.",
  33146. // "location": "path",
  33147. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33148. // "required": true,
  33149. // "type": "string"
  33150. // }
  33151. // },
  33152. // "path": "{project}/zones/{zone}/allocations/{resource}/getIamPolicy",
  33153. // "response": {
  33154. // "$ref": "Policy"
  33155. // },
  33156. // "scopes": [
  33157. // "https://www.googleapis.com/auth/cloud-platform",
  33158. // "https://www.googleapis.com/auth/compute",
  33159. // "https://www.googleapis.com/auth/compute.readonly"
  33160. // ]
  33161. // }
  33162. }
  33163. // method id "compute.allocations.insert":
  33164. type AllocationsInsertCall struct {
  33165. s *Service
  33166. project string
  33167. zone string
  33168. allocation *Allocation
  33169. urlParams_ gensupport.URLParams
  33170. ctx_ context.Context
  33171. header_ http.Header
  33172. }
  33173. // Insert: Creates a new allocation.
  33174. func (r *AllocationsService) Insert(project string, zone string, allocation *Allocation) *AllocationsInsertCall {
  33175. c := &AllocationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33176. c.project = project
  33177. c.zone = zone
  33178. c.allocation = allocation
  33179. return c
  33180. }
  33181. // RequestId sets the optional parameter "requestId": An optional
  33182. // request ID to identify requests. Specify a unique request ID so that
  33183. // if you must retry your request, the server will know to ignore the
  33184. // request if it has already been completed.
  33185. //
  33186. // For example, consider a situation where you make an initial request
  33187. // and the request times out. If you make the request again with the
  33188. // same request ID, the server can check if original operation with the
  33189. // same request ID was received, and if so, will ignore the second
  33190. // request. This prevents clients from accidentally creating duplicate
  33191. // commitments.
  33192. //
  33193. // The request ID must be a valid UUID with the exception that zero UUID
  33194. // is not supported (00000000-0000-0000-0000-000000000000).
  33195. func (c *AllocationsInsertCall) RequestId(requestId string) *AllocationsInsertCall {
  33196. c.urlParams_.Set("requestId", requestId)
  33197. return c
  33198. }
  33199. // Fields allows partial responses to be retrieved. See
  33200. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33201. // for more information.
  33202. func (c *AllocationsInsertCall) Fields(s ...googleapi.Field) *AllocationsInsertCall {
  33203. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33204. return c
  33205. }
  33206. // Context sets the context to be used in this call's Do method. Any
  33207. // pending HTTP request will be aborted if the provided context is
  33208. // canceled.
  33209. func (c *AllocationsInsertCall) Context(ctx context.Context) *AllocationsInsertCall {
  33210. c.ctx_ = ctx
  33211. return c
  33212. }
  33213. // Header returns an http.Header that can be modified by the caller to
  33214. // add HTTP headers to the request.
  33215. func (c *AllocationsInsertCall) Header() http.Header {
  33216. if c.header_ == nil {
  33217. c.header_ = make(http.Header)
  33218. }
  33219. return c.header_
  33220. }
  33221. func (c *AllocationsInsertCall) doRequest(alt string) (*http.Response, error) {
  33222. reqHeaders := make(http.Header)
  33223. for k, v := range c.header_ {
  33224. reqHeaders[k] = v
  33225. }
  33226. reqHeaders.Set("User-Agent", c.s.userAgent())
  33227. var body io.Reader = nil
  33228. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocation)
  33229. if err != nil {
  33230. return nil, err
  33231. }
  33232. reqHeaders.Set("Content-Type", "application/json")
  33233. c.urlParams_.Set("alt", alt)
  33234. c.urlParams_.Set("prettyPrint", "false")
  33235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations")
  33236. urls += "?" + c.urlParams_.Encode()
  33237. req, err := http.NewRequest("POST", urls, body)
  33238. if err != nil {
  33239. return nil, err
  33240. }
  33241. req.Header = reqHeaders
  33242. googleapi.Expand(req.URL, map[string]string{
  33243. "project": c.project,
  33244. "zone": c.zone,
  33245. })
  33246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33247. }
  33248. // Do executes the "compute.allocations.insert" call.
  33249. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33250. // status code is an error. Response headers are in either
  33251. // *Operation.ServerResponse.Header or (if a response was returned at
  33252. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33253. // to check whether the returned error was because
  33254. // http.StatusNotModified was returned.
  33255. func (c *AllocationsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33256. gensupport.SetOptions(c.urlParams_, opts...)
  33257. res, err := c.doRequest("json")
  33258. if res != nil && res.StatusCode == http.StatusNotModified {
  33259. if res.Body != nil {
  33260. res.Body.Close()
  33261. }
  33262. return nil, &googleapi.Error{
  33263. Code: res.StatusCode,
  33264. Header: res.Header,
  33265. }
  33266. }
  33267. if err != nil {
  33268. return nil, err
  33269. }
  33270. defer googleapi.CloseBody(res)
  33271. if err := googleapi.CheckResponse(res); err != nil {
  33272. return nil, err
  33273. }
  33274. ret := &Operation{
  33275. ServerResponse: googleapi.ServerResponse{
  33276. Header: res.Header,
  33277. HTTPStatusCode: res.StatusCode,
  33278. },
  33279. }
  33280. target := &ret
  33281. if err := gensupport.DecodeResponse(target, res); err != nil {
  33282. return nil, err
  33283. }
  33284. return ret, nil
  33285. // {
  33286. // "description": "Creates a new allocation.",
  33287. // "httpMethod": "POST",
  33288. // "id": "compute.allocations.insert",
  33289. // "parameterOrder": [
  33290. // "project",
  33291. // "zone"
  33292. // ],
  33293. // "parameters": {
  33294. // "project": {
  33295. // "description": "Project ID for this request.",
  33296. // "location": "path",
  33297. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33298. // "required": true,
  33299. // "type": "string"
  33300. // },
  33301. // "requestId": {
  33302. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33303. // "location": "query",
  33304. // "type": "string"
  33305. // },
  33306. // "zone": {
  33307. // "description": "Name of the zone for this request.",
  33308. // "location": "path",
  33309. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33310. // "required": true,
  33311. // "type": "string"
  33312. // }
  33313. // },
  33314. // "path": "{project}/zones/{zone}/allocations",
  33315. // "request": {
  33316. // "$ref": "Allocation"
  33317. // },
  33318. // "response": {
  33319. // "$ref": "Operation"
  33320. // },
  33321. // "scopes": [
  33322. // "https://www.googleapis.com/auth/cloud-platform",
  33323. // "https://www.googleapis.com/auth/compute"
  33324. // ]
  33325. // }
  33326. }
  33327. // method id "compute.allocations.list":
  33328. type AllocationsListCall struct {
  33329. s *Service
  33330. project string
  33331. zone string
  33332. urlParams_ gensupport.URLParams
  33333. ifNoneMatch_ string
  33334. ctx_ context.Context
  33335. header_ http.Header
  33336. }
  33337. // List: A list all the allocations that have been configured for the
  33338. // specified project in specified zone.
  33339. func (r *AllocationsService) List(project string, zone string) *AllocationsListCall {
  33340. c := &AllocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33341. c.project = project
  33342. c.zone = zone
  33343. return c
  33344. }
  33345. // Filter sets the optional parameter "filter": A filter expression that
  33346. // filters resources listed in the response. The expression must specify
  33347. // the field name, a comparison operator, and the value that you want to
  33348. // use for filtering. The value must be a string, a number, or a
  33349. // boolean. The comparison operator must be either =, !=, >, or <.
  33350. //
  33351. // For example, if you are filtering Compute Engine instances, you can
  33352. // exclude instances named example-instance by specifying name !=
  33353. // example-instance.
  33354. //
  33355. // You can also filter nested fields. For example, you could specify
  33356. // scheduling.automaticRestart = false to include instances only if they
  33357. // are not scheduled for automatic restarts. You can use filtering on
  33358. // nested fields to filter based on resource labels.
  33359. //
  33360. // To filter on multiple expressions, provide each separate expression
  33361. // within parentheses. For example, (scheduling.automaticRestart = true)
  33362. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33363. // AND expression. However, you can include AND and OR expressions
  33364. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33365. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33366. // true).
  33367. func (c *AllocationsListCall) Filter(filter string) *AllocationsListCall {
  33368. c.urlParams_.Set("filter", filter)
  33369. return c
  33370. }
  33371. // MaxResults sets the optional parameter "maxResults": The maximum
  33372. // number of results per page that should be returned. If the number of
  33373. // available results is larger than maxResults, Compute Engine returns a
  33374. // nextPageToken that can be used to get the next page of results in
  33375. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33376. // (Default: 500)
  33377. func (c *AllocationsListCall) MaxResults(maxResults int64) *AllocationsListCall {
  33378. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33379. return c
  33380. }
  33381. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33382. // a certain order. By default, results are returned in alphanumerical
  33383. // order based on the resource name.
  33384. //
  33385. // You can also sort results in descending order based on the creation
  33386. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33387. // based on the creationTimestamp field in reverse chronological order
  33388. // (newest result first). Use this to sort resources like operations so
  33389. // that the newest operation is returned first.
  33390. //
  33391. // Currently, only sorting by name or creationTimestamp desc is
  33392. // supported.
  33393. func (c *AllocationsListCall) OrderBy(orderBy string) *AllocationsListCall {
  33394. c.urlParams_.Set("orderBy", orderBy)
  33395. return c
  33396. }
  33397. // PageToken sets the optional parameter "pageToken": Specifies a page
  33398. // token to use. Set pageToken to the nextPageToken returned by a
  33399. // previous list request to get the next page of results.
  33400. func (c *AllocationsListCall) PageToken(pageToken string) *AllocationsListCall {
  33401. c.urlParams_.Set("pageToken", pageToken)
  33402. return c
  33403. }
  33404. // Fields allows partial responses to be retrieved. See
  33405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33406. // for more information.
  33407. func (c *AllocationsListCall) Fields(s ...googleapi.Field) *AllocationsListCall {
  33408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33409. return c
  33410. }
  33411. // IfNoneMatch sets the optional parameter which makes the operation
  33412. // fail if the object's ETag matches the given value. This is useful for
  33413. // getting updates only after the object has changed since the last
  33414. // request. Use googleapi.IsNotModified to check whether the response
  33415. // error from Do is the result of In-None-Match.
  33416. func (c *AllocationsListCall) IfNoneMatch(entityTag string) *AllocationsListCall {
  33417. c.ifNoneMatch_ = entityTag
  33418. return c
  33419. }
  33420. // Context sets the context to be used in this call's Do method. Any
  33421. // pending HTTP request will be aborted if the provided context is
  33422. // canceled.
  33423. func (c *AllocationsListCall) Context(ctx context.Context) *AllocationsListCall {
  33424. c.ctx_ = ctx
  33425. return c
  33426. }
  33427. // Header returns an http.Header that can be modified by the caller to
  33428. // add HTTP headers to the request.
  33429. func (c *AllocationsListCall) Header() http.Header {
  33430. if c.header_ == nil {
  33431. c.header_ = make(http.Header)
  33432. }
  33433. return c.header_
  33434. }
  33435. func (c *AllocationsListCall) doRequest(alt string) (*http.Response, error) {
  33436. reqHeaders := make(http.Header)
  33437. for k, v := range c.header_ {
  33438. reqHeaders[k] = v
  33439. }
  33440. reqHeaders.Set("User-Agent", c.s.userAgent())
  33441. if c.ifNoneMatch_ != "" {
  33442. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33443. }
  33444. var body io.Reader = nil
  33445. c.urlParams_.Set("alt", alt)
  33446. c.urlParams_.Set("prettyPrint", "false")
  33447. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations")
  33448. urls += "?" + c.urlParams_.Encode()
  33449. req, err := http.NewRequest("GET", urls, body)
  33450. if err != nil {
  33451. return nil, err
  33452. }
  33453. req.Header = reqHeaders
  33454. googleapi.Expand(req.URL, map[string]string{
  33455. "project": c.project,
  33456. "zone": c.zone,
  33457. })
  33458. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33459. }
  33460. // Do executes the "compute.allocations.list" call.
  33461. // Exactly one of *AllocationList or error will be non-nil. Any non-2xx
  33462. // status code is an error. Response headers are in either
  33463. // *AllocationList.ServerResponse.Header or (if a response was returned
  33464. // at all) in error.(*googleapi.Error).Header. Use
  33465. // googleapi.IsNotModified to check whether the returned error was
  33466. // because http.StatusNotModified was returned.
  33467. func (c *AllocationsListCall) Do(opts ...googleapi.CallOption) (*AllocationList, error) {
  33468. gensupport.SetOptions(c.urlParams_, opts...)
  33469. res, err := c.doRequest("json")
  33470. if res != nil && res.StatusCode == http.StatusNotModified {
  33471. if res.Body != nil {
  33472. res.Body.Close()
  33473. }
  33474. return nil, &googleapi.Error{
  33475. Code: res.StatusCode,
  33476. Header: res.Header,
  33477. }
  33478. }
  33479. if err != nil {
  33480. return nil, err
  33481. }
  33482. defer googleapi.CloseBody(res)
  33483. if err := googleapi.CheckResponse(res); err != nil {
  33484. return nil, err
  33485. }
  33486. ret := &AllocationList{
  33487. ServerResponse: googleapi.ServerResponse{
  33488. Header: res.Header,
  33489. HTTPStatusCode: res.StatusCode,
  33490. },
  33491. }
  33492. target := &ret
  33493. if err := gensupport.DecodeResponse(target, res); err != nil {
  33494. return nil, err
  33495. }
  33496. return ret, nil
  33497. // {
  33498. // "description": "A list all the allocations that have been configured for the specified project in specified zone.",
  33499. // "httpMethod": "GET",
  33500. // "id": "compute.allocations.list",
  33501. // "parameterOrder": [
  33502. // "project",
  33503. // "zone"
  33504. // ],
  33505. // "parameters": {
  33506. // "filter": {
  33507. // "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).",
  33508. // "location": "query",
  33509. // "type": "string"
  33510. // },
  33511. // "maxResults": {
  33512. // "default": "500",
  33513. // "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)",
  33514. // "format": "uint32",
  33515. // "location": "query",
  33516. // "minimum": "0",
  33517. // "type": "integer"
  33518. // },
  33519. // "orderBy": {
  33520. // "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.",
  33521. // "location": "query",
  33522. // "type": "string"
  33523. // },
  33524. // "pageToken": {
  33525. // "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.",
  33526. // "location": "query",
  33527. // "type": "string"
  33528. // },
  33529. // "project": {
  33530. // "description": "Project ID for this request.",
  33531. // "location": "path",
  33532. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33533. // "required": true,
  33534. // "type": "string"
  33535. // },
  33536. // "zone": {
  33537. // "description": "Name of the zone for this request.",
  33538. // "location": "path",
  33539. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33540. // "required": true,
  33541. // "type": "string"
  33542. // }
  33543. // },
  33544. // "path": "{project}/zones/{zone}/allocations",
  33545. // "response": {
  33546. // "$ref": "AllocationList"
  33547. // },
  33548. // "scopes": [
  33549. // "https://www.googleapis.com/auth/cloud-platform",
  33550. // "https://www.googleapis.com/auth/compute",
  33551. // "https://www.googleapis.com/auth/compute.readonly"
  33552. // ]
  33553. // }
  33554. }
  33555. // Pages invokes f for each page of results.
  33556. // A non-nil error returned from f will halt the iteration.
  33557. // The provided context supersedes any context provided to the Context method.
  33558. func (c *AllocationsListCall) Pages(ctx context.Context, f func(*AllocationList) error) error {
  33559. c.ctx_ = ctx
  33560. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33561. for {
  33562. x, err := c.Do()
  33563. if err != nil {
  33564. return err
  33565. }
  33566. if err := f(x); err != nil {
  33567. return err
  33568. }
  33569. if x.NextPageToken == "" {
  33570. return nil
  33571. }
  33572. c.PageToken(x.NextPageToken)
  33573. }
  33574. }
  33575. // method id "compute.allocations.resize":
  33576. type AllocationsResizeCall struct {
  33577. s *Service
  33578. project string
  33579. zone string
  33580. allocation string
  33581. allocationsresizerequest *AllocationsResizeRequest
  33582. urlParams_ gensupport.URLParams
  33583. ctx_ context.Context
  33584. header_ http.Header
  33585. }
  33586. // Resize: Resizes the allocation (applicable to standalone allocations
  33587. // only)
  33588. func (r *AllocationsService) Resize(project string, zone string, allocation string, allocationsresizerequest *AllocationsResizeRequest) *AllocationsResizeCall {
  33589. c := &AllocationsResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33590. c.project = project
  33591. c.zone = zone
  33592. c.allocation = allocation
  33593. c.allocationsresizerequest = allocationsresizerequest
  33594. return c
  33595. }
  33596. // RequestId sets the optional parameter "requestId": An optional
  33597. // request ID to identify requests. Specify a unique request ID so that
  33598. // if you must retry your request, the server will know to ignore the
  33599. // request if it has already been completed.
  33600. //
  33601. // For example, consider a situation where you make an initial request
  33602. // and the request times out. If you make the request again with the
  33603. // same request ID, the server can check if original operation with the
  33604. // same request ID was received, and if so, will ignore the second
  33605. // request. This prevents clients from accidentally creating duplicate
  33606. // commitments.
  33607. //
  33608. // The request ID must be a valid UUID with the exception that zero UUID
  33609. // is not supported (00000000-0000-0000-0000-000000000000).
  33610. func (c *AllocationsResizeCall) RequestId(requestId string) *AllocationsResizeCall {
  33611. c.urlParams_.Set("requestId", requestId)
  33612. return c
  33613. }
  33614. // Fields allows partial responses to be retrieved. See
  33615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33616. // for more information.
  33617. func (c *AllocationsResizeCall) Fields(s ...googleapi.Field) *AllocationsResizeCall {
  33618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33619. return c
  33620. }
  33621. // Context sets the context to be used in this call's Do method. Any
  33622. // pending HTTP request will be aborted if the provided context is
  33623. // canceled.
  33624. func (c *AllocationsResizeCall) Context(ctx context.Context) *AllocationsResizeCall {
  33625. c.ctx_ = ctx
  33626. return c
  33627. }
  33628. // Header returns an http.Header that can be modified by the caller to
  33629. // add HTTP headers to the request.
  33630. func (c *AllocationsResizeCall) Header() http.Header {
  33631. if c.header_ == nil {
  33632. c.header_ = make(http.Header)
  33633. }
  33634. return c.header_
  33635. }
  33636. func (c *AllocationsResizeCall) doRequest(alt string) (*http.Response, error) {
  33637. reqHeaders := make(http.Header)
  33638. for k, v := range c.header_ {
  33639. reqHeaders[k] = v
  33640. }
  33641. reqHeaders.Set("User-Agent", c.s.userAgent())
  33642. var body io.Reader = nil
  33643. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocationsresizerequest)
  33644. if err != nil {
  33645. return nil, err
  33646. }
  33647. reqHeaders.Set("Content-Type", "application/json")
  33648. c.urlParams_.Set("alt", alt)
  33649. c.urlParams_.Set("prettyPrint", "false")
  33650. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}/resize")
  33651. urls += "?" + c.urlParams_.Encode()
  33652. req, err := http.NewRequest("POST", urls, body)
  33653. if err != nil {
  33654. return nil, err
  33655. }
  33656. req.Header = reqHeaders
  33657. googleapi.Expand(req.URL, map[string]string{
  33658. "project": c.project,
  33659. "zone": c.zone,
  33660. "allocation": c.allocation,
  33661. })
  33662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33663. }
  33664. // Do executes the "compute.allocations.resize" call.
  33665. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33666. // status code is an error. Response headers are in either
  33667. // *Operation.ServerResponse.Header or (if a response was returned at
  33668. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33669. // to check whether the returned error was because
  33670. // http.StatusNotModified was returned.
  33671. func (c *AllocationsResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33672. gensupport.SetOptions(c.urlParams_, opts...)
  33673. res, err := c.doRequest("json")
  33674. if res != nil && res.StatusCode == http.StatusNotModified {
  33675. if res.Body != nil {
  33676. res.Body.Close()
  33677. }
  33678. return nil, &googleapi.Error{
  33679. Code: res.StatusCode,
  33680. Header: res.Header,
  33681. }
  33682. }
  33683. if err != nil {
  33684. return nil, err
  33685. }
  33686. defer googleapi.CloseBody(res)
  33687. if err := googleapi.CheckResponse(res); err != nil {
  33688. return nil, err
  33689. }
  33690. ret := &Operation{
  33691. ServerResponse: googleapi.ServerResponse{
  33692. Header: res.Header,
  33693. HTTPStatusCode: res.StatusCode,
  33694. },
  33695. }
  33696. target := &ret
  33697. if err := gensupport.DecodeResponse(target, res); err != nil {
  33698. return nil, err
  33699. }
  33700. return ret, nil
  33701. // {
  33702. // "description": "Resizes the allocation (applicable to standalone allocations only)",
  33703. // "httpMethod": "POST",
  33704. // "id": "compute.allocations.resize",
  33705. // "parameterOrder": [
  33706. // "project",
  33707. // "zone",
  33708. // "allocation"
  33709. // ],
  33710. // "parameters": {
  33711. // "allocation": {
  33712. // "description": "Name of the allocation to update.",
  33713. // "location": "path",
  33714. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33715. // "required": true,
  33716. // "type": "string"
  33717. // },
  33718. // "project": {
  33719. // "description": "Project ID for this request.",
  33720. // "location": "path",
  33721. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33722. // "required": true,
  33723. // "type": "string"
  33724. // },
  33725. // "requestId": {
  33726. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33727. // "location": "query",
  33728. // "type": "string"
  33729. // },
  33730. // "zone": {
  33731. // "description": "Name of the zone for this request.",
  33732. // "location": "path",
  33733. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33734. // "required": true,
  33735. // "type": "string"
  33736. // }
  33737. // },
  33738. // "path": "{project}/zones/{zone}/allocations/{allocation}/resize",
  33739. // "request": {
  33740. // "$ref": "AllocationsResizeRequest"
  33741. // },
  33742. // "response": {
  33743. // "$ref": "Operation"
  33744. // },
  33745. // "scopes": [
  33746. // "https://www.googleapis.com/auth/cloud-platform",
  33747. // "https://www.googleapis.com/auth/compute"
  33748. // ]
  33749. // }
  33750. }
  33751. // method id "compute.allocations.setIamPolicy":
  33752. type AllocationsSetIamPolicyCall struct {
  33753. s *Service
  33754. project string
  33755. zone string
  33756. resource string
  33757. zonesetpolicyrequest *ZoneSetPolicyRequest
  33758. urlParams_ gensupport.URLParams
  33759. ctx_ context.Context
  33760. header_ http.Header
  33761. }
  33762. // SetIamPolicy: Sets the access control policy on the specified
  33763. // resource. Replaces any existing policy.
  33764. func (r *AllocationsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *AllocationsSetIamPolicyCall {
  33765. c := &AllocationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33766. c.project = project
  33767. c.zone = zone
  33768. c.resource = resource
  33769. c.zonesetpolicyrequest = zonesetpolicyrequest
  33770. return c
  33771. }
  33772. // Fields allows partial responses to be retrieved. See
  33773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33774. // for more information.
  33775. func (c *AllocationsSetIamPolicyCall) Fields(s ...googleapi.Field) *AllocationsSetIamPolicyCall {
  33776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33777. return c
  33778. }
  33779. // Context sets the context to be used in this call's Do method. Any
  33780. // pending HTTP request will be aborted if the provided context is
  33781. // canceled.
  33782. func (c *AllocationsSetIamPolicyCall) Context(ctx context.Context) *AllocationsSetIamPolicyCall {
  33783. c.ctx_ = ctx
  33784. return c
  33785. }
  33786. // Header returns an http.Header that can be modified by the caller to
  33787. // add HTTP headers to the request.
  33788. func (c *AllocationsSetIamPolicyCall) Header() http.Header {
  33789. if c.header_ == nil {
  33790. c.header_ = make(http.Header)
  33791. }
  33792. return c.header_
  33793. }
  33794. func (c *AllocationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  33795. reqHeaders := make(http.Header)
  33796. for k, v := range c.header_ {
  33797. reqHeaders[k] = v
  33798. }
  33799. reqHeaders.Set("User-Agent", c.s.userAgent())
  33800. var body io.Reader = nil
  33801. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  33802. if err != nil {
  33803. return nil, err
  33804. }
  33805. reqHeaders.Set("Content-Type", "application/json")
  33806. c.urlParams_.Set("alt", alt)
  33807. c.urlParams_.Set("prettyPrint", "false")
  33808. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/setIamPolicy")
  33809. urls += "?" + c.urlParams_.Encode()
  33810. req, err := http.NewRequest("POST", urls, body)
  33811. if err != nil {
  33812. return nil, err
  33813. }
  33814. req.Header = reqHeaders
  33815. googleapi.Expand(req.URL, map[string]string{
  33816. "project": c.project,
  33817. "zone": c.zone,
  33818. "resource": c.resource,
  33819. })
  33820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33821. }
  33822. // Do executes the "compute.allocations.setIamPolicy" call.
  33823. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  33824. // code is an error. Response headers are in either
  33825. // *Policy.ServerResponse.Header or (if a response was returned at all)
  33826. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33827. // check whether the returned error was because http.StatusNotModified
  33828. // was returned.
  33829. func (c *AllocationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  33830. gensupport.SetOptions(c.urlParams_, opts...)
  33831. res, err := c.doRequest("json")
  33832. if res != nil && res.StatusCode == http.StatusNotModified {
  33833. if res.Body != nil {
  33834. res.Body.Close()
  33835. }
  33836. return nil, &googleapi.Error{
  33837. Code: res.StatusCode,
  33838. Header: res.Header,
  33839. }
  33840. }
  33841. if err != nil {
  33842. return nil, err
  33843. }
  33844. defer googleapi.CloseBody(res)
  33845. if err := googleapi.CheckResponse(res); err != nil {
  33846. return nil, err
  33847. }
  33848. ret := &Policy{
  33849. ServerResponse: googleapi.ServerResponse{
  33850. Header: res.Header,
  33851. HTTPStatusCode: res.StatusCode,
  33852. },
  33853. }
  33854. target := &ret
  33855. if err := gensupport.DecodeResponse(target, res); err != nil {
  33856. return nil, err
  33857. }
  33858. return ret, nil
  33859. // {
  33860. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  33861. // "httpMethod": "POST",
  33862. // "id": "compute.allocations.setIamPolicy",
  33863. // "parameterOrder": [
  33864. // "project",
  33865. // "zone",
  33866. // "resource"
  33867. // ],
  33868. // "parameters": {
  33869. // "project": {
  33870. // "description": "Project ID for this request.",
  33871. // "location": "path",
  33872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33873. // "required": true,
  33874. // "type": "string"
  33875. // },
  33876. // "resource": {
  33877. // "description": "Name or id of the resource for this request.",
  33878. // "location": "path",
  33879. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33880. // "required": true,
  33881. // "type": "string"
  33882. // },
  33883. // "zone": {
  33884. // "description": "The name of the zone for this request.",
  33885. // "location": "path",
  33886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33887. // "required": true,
  33888. // "type": "string"
  33889. // }
  33890. // },
  33891. // "path": "{project}/zones/{zone}/allocations/{resource}/setIamPolicy",
  33892. // "request": {
  33893. // "$ref": "ZoneSetPolicyRequest"
  33894. // },
  33895. // "response": {
  33896. // "$ref": "Policy"
  33897. // },
  33898. // "scopes": [
  33899. // "https://www.googleapis.com/auth/cloud-platform",
  33900. // "https://www.googleapis.com/auth/compute"
  33901. // ]
  33902. // }
  33903. }
  33904. // method id "compute.allocations.testIamPermissions":
  33905. type AllocationsTestIamPermissionsCall struct {
  33906. s *Service
  33907. project string
  33908. zone string
  33909. resource string
  33910. testpermissionsrequest *TestPermissionsRequest
  33911. urlParams_ gensupport.URLParams
  33912. ctx_ context.Context
  33913. header_ http.Header
  33914. }
  33915. // TestIamPermissions: Returns permissions that a caller has on the
  33916. // specified resource.
  33917. func (r *AllocationsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AllocationsTestIamPermissionsCall {
  33918. c := &AllocationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33919. c.project = project
  33920. c.zone = zone
  33921. c.resource = resource
  33922. c.testpermissionsrequest = testpermissionsrequest
  33923. return c
  33924. }
  33925. // Fields allows partial responses to be retrieved. See
  33926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33927. // for more information.
  33928. func (c *AllocationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *AllocationsTestIamPermissionsCall {
  33929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33930. return c
  33931. }
  33932. // Context sets the context to be used in this call's Do method. Any
  33933. // pending HTTP request will be aborted if the provided context is
  33934. // canceled.
  33935. func (c *AllocationsTestIamPermissionsCall) Context(ctx context.Context) *AllocationsTestIamPermissionsCall {
  33936. c.ctx_ = ctx
  33937. return c
  33938. }
  33939. // Header returns an http.Header that can be modified by the caller to
  33940. // add HTTP headers to the request.
  33941. func (c *AllocationsTestIamPermissionsCall) Header() http.Header {
  33942. if c.header_ == nil {
  33943. c.header_ = make(http.Header)
  33944. }
  33945. return c.header_
  33946. }
  33947. func (c *AllocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  33948. reqHeaders := make(http.Header)
  33949. for k, v := range c.header_ {
  33950. reqHeaders[k] = v
  33951. }
  33952. reqHeaders.Set("User-Agent", c.s.userAgent())
  33953. var body io.Reader = nil
  33954. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  33955. if err != nil {
  33956. return nil, err
  33957. }
  33958. reqHeaders.Set("Content-Type", "application/json")
  33959. c.urlParams_.Set("alt", alt)
  33960. c.urlParams_.Set("prettyPrint", "false")
  33961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/testIamPermissions")
  33962. urls += "?" + c.urlParams_.Encode()
  33963. req, err := http.NewRequest("POST", urls, body)
  33964. if err != nil {
  33965. return nil, err
  33966. }
  33967. req.Header = reqHeaders
  33968. googleapi.Expand(req.URL, map[string]string{
  33969. "project": c.project,
  33970. "zone": c.zone,
  33971. "resource": c.resource,
  33972. })
  33973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33974. }
  33975. // Do executes the "compute.allocations.testIamPermissions" call.
  33976. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  33977. // non-2xx status code is an error. Response headers are in either
  33978. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  33979. // returned at all) in error.(*googleapi.Error).Header. Use
  33980. // googleapi.IsNotModified to check whether the returned error was
  33981. // because http.StatusNotModified was returned.
  33982. func (c *AllocationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  33983. gensupport.SetOptions(c.urlParams_, opts...)
  33984. res, err := c.doRequest("json")
  33985. if res != nil && res.StatusCode == http.StatusNotModified {
  33986. if res.Body != nil {
  33987. res.Body.Close()
  33988. }
  33989. return nil, &googleapi.Error{
  33990. Code: res.StatusCode,
  33991. Header: res.Header,
  33992. }
  33993. }
  33994. if err != nil {
  33995. return nil, err
  33996. }
  33997. defer googleapi.CloseBody(res)
  33998. if err := googleapi.CheckResponse(res); err != nil {
  33999. return nil, err
  34000. }
  34001. ret := &TestPermissionsResponse{
  34002. ServerResponse: googleapi.ServerResponse{
  34003. Header: res.Header,
  34004. HTTPStatusCode: res.StatusCode,
  34005. },
  34006. }
  34007. target := &ret
  34008. if err := gensupport.DecodeResponse(target, res); err != nil {
  34009. return nil, err
  34010. }
  34011. return ret, nil
  34012. // {
  34013. // "description": "Returns permissions that a caller has on the specified resource.",
  34014. // "httpMethod": "POST",
  34015. // "id": "compute.allocations.testIamPermissions",
  34016. // "parameterOrder": [
  34017. // "project",
  34018. // "zone",
  34019. // "resource"
  34020. // ],
  34021. // "parameters": {
  34022. // "project": {
  34023. // "description": "Project ID for this request.",
  34024. // "location": "path",
  34025. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34026. // "required": true,
  34027. // "type": "string"
  34028. // },
  34029. // "resource": {
  34030. // "description": "Name or id of the resource for this request.",
  34031. // "location": "path",
  34032. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34033. // "required": true,
  34034. // "type": "string"
  34035. // },
  34036. // "zone": {
  34037. // "description": "The name of the zone for this request.",
  34038. // "location": "path",
  34039. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34040. // "required": true,
  34041. // "type": "string"
  34042. // }
  34043. // },
  34044. // "path": "{project}/zones/{zone}/allocations/{resource}/testIamPermissions",
  34045. // "request": {
  34046. // "$ref": "TestPermissionsRequest"
  34047. // },
  34048. // "response": {
  34049. // "$ref": "TestPermissionsResponse"
  34050. // },
  34051. // "scopes": [
  34052. // "https://www.googleapis.com/auth/cloud-platform",
  34053. // "https://www.googleapis.com/auth/compute",
  34054. // "https://www.googleapis.com/auth/compute.readonly"
  34055. // ]
  34056. // }
  34057. }
  34058. // method id "compute.autoscalers.aggregatedList":
  34059. type AutoscalersAggregatedListCall struct {
  34060. s *Service
  34061. project string
  34062. urlParams_ gensupport.URLParams
  34063. ifNoneMatch_ string
  34064. ctx_ context.Context
  34065. header_ http.Header
  34066. }
  34067. // AggregatedList: Retrieves an aggregated list of autoscalers.
  34068. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  34069. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34070. c.project = project
  34071. return c
  34072. }
  34073. // Filter sets the optional parameter "filter": A filter expression that
  34074. // filters resources listed in the response. The expression must specify
  34075. // the field name, a comparison operator, and the value that you want to
  34076. // use for filtering. The value must be a string, a number, or a
  34077. // boolean. The comparison operator must be either =, !=, >, or <.
  34078. //
  34079. // For example, if you are filtering Compute Engine instances, you can
  34080. // exclude instances named example-instance by specifying name !=
  34081. // example-instance.
  34082. //
  34083. // You can also filter nested fields. For example, you could specify
  34084. // scheduling.automaticRestart = false to include instances only if they
  34085. // are not scheduled for automatic restarts. You can use filtering on
  34086. // nested fields to filter based on resource labels.
  34087. //
  34088. // To filter on multiple expressions, provide each separate expression
  34089. // within parentheses. For example, (scheduling.automaticRestart = true)
  34090. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  34091. // AND expression. However, you can include AND and OR expressions
  34092. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  34093. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  34094. // true).
  34095. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  34096. c.urlParams_.Set("filter", filter)
  34097. return c
  34098. }
  34099. // MaxResults sets the optional parameter "maxResults": The maximum
  34100. // number of results per page that should be returned. If the number of
  34101. // available results is larger than maxResults, Compute Engine returns a
  34102. // nextPageToken that can be used to get the next page of results in
  34103. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34104. // (Default: 500)
  34105. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  34106. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34107. return c
  34108. }
  34109. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34110. // a certain order. By default, results are returned in alphanumerical
  34111. // order based on the resource name.
  34112. //
  34113. // You can also sort results in descending order based on the creation
  34114. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34115. // based on the creationTimestamp field in reverse chronological order
  34116. // (newest result first). Use this to sort resources like operations so
  34117. // that the newest operation is returned first.
  34118. //
  34119. // Currently, only sorting by name or creationTimestamp desc is
  34120. // supported.
  34121. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  34122. c.urlParams_.Set("orderBy", orderBy)
  34123. return c
  34124. }
  34125. // PageToken sets the optional parameter "pageToken": Specifies a page
  34126. // token to use. Set pageToken to the nextPageToken returned by a
  34127. // previous list request to get the next page of results.
  34128. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  34129. c.urlParams_.Set("pageToken", pageToken)
  34130. return c
  34131. }
  34132. // Fields allows partial responses to be retrieved. See
  34133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34134. // for more information.
  34135. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  34136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34137. return c
  34138. }
  34139. // IfNoneMatch sets the optional parameter which makes the operation
  34140. // fail if the object's ETag matches the given value. This is useful for
  34141. // getting updates only after the object has changed since the last
  34142. // request. Use googleapi.IsNotModified to check whether the response
  34143. // error from Do is the result of In-None-Match.
  34144. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  34145. c.ifNoneMatch_ = entityTag
  34146. return c
  34147. }
  34148. // Context sets the context to be used in this call's Do method. Any
  34149. // pending HTTP request will be aborted if the provided context is
  34150. // canceled.
  34151. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  34152. c.ctx_ = ctx
  34153. return c
  34154. }
  34155. // Header returns an http.Header that can be modified by the caller to
  34156. // add HTTP headers to the request.
  34157. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  34158. if c.header_ == nil {
  34159. c.header_ = make(http.Header)
  34160. }
  34161. return c.header_
  34162. }
  34163. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  34164. reqHeaders := make(http.Header)
  34165. for k, v := range c.header_ {
  34166. reqHeaders[k] = v
  34167. }
  34168. reqHeaders.Set("User-Agent", c.s.userAgent())
  34169. if c.ifNoneMatch_ != "" {
  34170. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34171. }
  34172. var body io.Reader = nil
  34173. c.urlParams_.Set("alt", alt)
  34174. c.urlParams_.Set("prettyPrint", "false")
  34175. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  34176. urls += "?" + c.urlParams_.Encode()
  34177. req, err := http.NewRequest("GET", urls, body)
  34178. if err != nil {
  34179. return nil, err
  34180. }
  34181. req.Header = reqHeaders
  34182. googleapi.Expand(req.URL, map[string]string{
  34183. "project": c.project,
  34184. })
  34185. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34186. }
  34187. // Do executes the "compute.autoscalers.aggregatedList" call.
  34188. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  34189. // Any non-2xx status code is an error. Response headers are in either
  34190. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  34191. // returned at all) in error.(*googleapi.Error).Header. Use
  34192. // googleapi.IsNotModified to check whether the returned error was
  34193. // because http.StatusNotModified was returned.
  34194. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  34195. gensupport.SetOptions(c.urlParams_, opts...)
  34196. res, err := c.doRequest("json")
  34197. if res != nil && res.StatusCode == http.StatusNotModified {
  34198. if res.Body != nil {
  34199. res.Body.Close()
  34200. }
  34201. return nil, &googleapi.Error{
  34202. Code: res.StatusCode,
  34203. Header: res.Header,
  34204. }
  34205. }
  34206. if err != nil {
  34207. return nil, err
  34208. }
  34209. defer googleapi.CloseBody(res)
  34210. if err := googleapi.CheckResponse(res); err != nil {
  34211. return nil, err
  34212. }
  34213. ret := &AutoscalerAggregatedList{
  34214. ServerResponse: googleapi.ServerResponse{
  34215. Header: res.Header,
  34216. HTTPStatusCode: res.StatusCode,
  34217. },
  34218. }
  34219. target := &ret
  34220. if err := gensupport.DecodeResponse(target, res); err != nil {
  34221. return nil, err
  34222. }
  34223. return ret, nil
  34224. // {
  34225. // "description": "Retrieves an aggregated list of autoscalers.",
  34226. // "httpMethod": "GET",
  34227. // "id": "compute.autoscalers.aggregatedList",
  34228. // "parameterOrder": [
  34229. // "project"
  34230. // ],
  34231. // "parameters": {
  34232. // "filter": {
  34233. // "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).",
  34234. // "location": "query",
  34235. // "type": "string"
  34236. // },
  34237. // "maxResults": {
  34238. // "default": "500",
  34239. // "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)",
  34240. // "format": "uint32",
  34241. // "location": "query",
  34242. // "minimum": "0",
  34243. // "type": "integer"
  34244. // },
  34245. // "orderBy": {
  34246. // "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.",
  34247. // "location": "query",
  34248. // "type": "string"
  34249. // },
  34250. // "pageToken": {
  34251. // "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.",
  34252. // "location": "query",
  34253. // "type": "string"
  34254. // },
  34255. // "project": {
  34256. // "description": "Project ID for this request.",
  34257. // "location": "path",
  34258. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34259. // "required": true,
  34260. // "type": "string"
  34261. // }
  34262. // },
  34263. // "path": "{project}/aggregated/autoscalers",
  34264. // "response": {
  34265. // "$ref": "AutoscalerAggregatedList"
  34266. // },
  34267. // "scopes": [
  34268. // "https://www.googleapis.com/auth/cloud-platform",
  34269. // "https://www.googleapis.com/auth/compute",
  34270. // "https://www.googleapis.com/auth/compute.readonly"
  34271. // ]
  34272. // }
  34273. }
  34274. // Pages invokes f for each page of results.
  34275. // A non-nil error returned from f will halt the iteration.
  34276. // The provided context supersedes any context provided to the Context method.
  34277. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  34278. c.ctx_ = ctx
  34279. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34280. for {
  34281. x, err := c.Do()
  34282. if err != nil {
  34283. return err
  34284. }
  34285. if err := f(x); err != nil {
  34286. return err
  34287. }
  34288. if x.NextPageToken == "" {
  34289. return nil
  34290. }
  34291. c.PageToken(x.NextPageToken)
  34292. }
  34293. }
  34294. // method id "compute.autoscalers.delete":
  34295. type AutoscalersDeleteCall struct {
  34296. s *Service
  34297. project string
  34298. zone string
  34299. autoscaler string
  34300. urlParams_ gensupport.URLParams
  34301. ctx_ context.Context
  34302. header_ http.Header
  34303. }
  34304. // Delete: Deletes the specified autoscaler.
  34305. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  34306. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34307. c.project = project
  34308. c.zone = zone
  34309. c.autoscaler = autoscaler
  34310. return c
  34311. }
  34312. // RequestId sets the optional parameter "requestId": An optional
  34313. // request ID to identify requests. Specify a unique request ID so that
  34314. // if you must retry your request, the server will know to ignore the
  34315. // request if it has already been completed.
  34316. //
  34317. // For example, consider a situation where you make an initial request
  34318. // and the request times out. If you make the request again with the
  34319. // same request ID, the server can check if original operation with the
  34320. // same request ID was received, and if so, will ignore the second
  34321. // request. This prevents clients from accidentally creating duplicate
  34322. // commitments.
  34323. //
  34324. // The request ID must be a valid UUID with the exception that zero UUID
  34325. // is not supported (00000000-0000-0000-0000-000000000000).
  34326. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  34327. c.urlParams_.Set("requestId", requestId)
  34328. return c
  34329. }
  34330. // Fields allows partial responses to be retrieved. See
  34331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34332. // for more information.
  34333. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  34334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34335. return c
  34336. }
  34337. // Context sets the context to be used in this call's Do method. Any
  34338. // pending HTTP request will be aborted if the provided context is
  34339. // canceled.
  34340. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  34341. c.ctx_ = ctx
  34342. return c
  34343. }
  34344. // Header returns an http.Header that can be modified by the caller to
  34345. // add HTTP headers to the request.
  34346. func (c *AutoscalersDeleteCall) Header() http.Header {
  34347. if c.header_ == nil {
  34348. c.header_ = make(http.Header)
  34349. }
  34350. return c.header_
  34351. }
  34352. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  34353. reqHeaders := make(http.Header)
  34354. for k, v := range c.header_ {
  34355. reqHeaders[k] = v
  34356. }
  34357. reqHeaders.Set("User-Agent", c.s.userAgent())
  34358. var body io.Reader = nil
  34359. c.urlParams_.Set("alt", alt)
  34360. c.urlParams_.Set("prettyPrint", "false")
  34361. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  34362. urls += "?" + c.urlParams_.Encode()
  34363. req, err := http.NewRequest("DELETE", urls, body)
  34364. if err != nil {
  34365. return nil, err
  34366. }
  34367. req.Header = reqHeaders
  34368. googleapi.Expand(req.URL, map[string]string{
  34369. "project": c.project,
  34370. "zone": c.zone,
  34371. "autoscaler": c.autoscaler,
  34372. })
  34373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34374. }
  34375. // Do executes the "compute.autoscalers.delete" call.
  34376. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34377. // status code is an error. Response headers are in either
  34378. // *Operation.ServerResponse.Header or (if a response was returned at
  34379. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34380. // to check whether the returned error was because
  34381. // http.StatusNotModified was returned.
  34382. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34383. gensupport.SetOptions(c.urlParams_, opts...)
  34384. res, err := c.doRequest("json")
  34385. if res != nil && res.StatusCode == http.StatusNotModified {
  34386. if res.Body != nil {
  34387. res.Body.Close()
  34388. }
  34389. return nil, &googleapi.Error{
  34390. Code: res.StatusCode,
  34391. Header: res.Header,
  34392. }
  34393. }
  34394. if err != nil {
  34395. return nil, err
  34396. }
  34397. defer googleapi.CloseBody(res)
  34398. if err := googleapi.CheckResponse(res); err != nil {
  34399. return nil, err
  34400. }
  34401. ret := &Operation{
  34402. ServerResponse: googleapi.ServerResponse{
  34403. Header: res.Header,
  34404. HTTPStatusCode: res.StatusCode,
  34405. },
  34406. }
  34407. target := &ret
  34408. if err := gensupport.DecodeResponse(target, res); err != nil {
  34409. return nil, err
  34410. }
  34411. return ret, nil
  34412. // {
  34413. // "description": "Deletes the specified autoscaler.",
  34414. // "httpMethod": "DELETE",
  34415. // "id": "compute.autoscalers.delete",
  34416. // "parameterOrder": [
  34417. // "project",
  34418. // "zone",
  34419. // "autoscaler"
  34420. // ],
  34421. // "parameters": {
  34422. // "autoscaler": {
  34423. // "description": "Name of the autoscaler to delete.",
  34424. // "location": "path",
  34425. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34426. // "required": true,
  34427. // "type": "string"
  34428. // },
  34429. // "project": {
  34430. // "description": "Project ID for this request.",
  34431. // "location": "path",
  34432. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34433. // "required": true,
  34434. // "type": "string"
  34435. // },
  34436. // "requestId": {
  34437. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34438. // "location": "query",
  34439. // "type": "string"
  34440. // },
  34441. // "zone": {
  34442. // "description": "Name of the zone for this request.",
  34443. // "location": "path",
  34444. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34445. // "required": true,
  34446. // "type": "string"
  34447. // }
  34448. // },
  34449. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  34450. // "response": {
  34451. // "$ref": "Operation"
  34452. // },
  34453. // "scopes": [
  34454. // "https://www.googleapis.com/auth/cloud-platform",
  34455. // "https://www.googleapis.com/auth/compute"
  34456. // ]
  34457. // }
  34458. }
  34459. // method id "compute.autoscalers.get":
  34460. type AutoscalersGetCall struct {
  34461. s *Service
  34462. project string
  34463. zone string
  34464. autoscaler string
  34465. urlParams_ gensupport.URLParams
  34466. ifNoneMatch_ string
  34467. ctx_ context.Context
  34468. header_ http.Header
  34469. }
  34470. // Get: Returns the specified autoscaler resource. Gets a list of
  34471. // available autoscalers by making a list() request.
  34472. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  34473. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34474. c.project = project
  34475. c.zone = zone
  34476. c.autoscaler = autoscaler
  34477. return c
  34478. }
  34479. // Fields allows partial responses to be retrieved. See
  34480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34481. // for more information.
  34482. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  34483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34484. return c
  34485. }
  34486. // IfNoneMatch sets the optional parameter which makes the operation
  34487. // fail if the object's ETag matches the given value. This is useful for
  34488. // getting updates only after the object has changed since the last
  34489. // request. Use googleapi.IsNotModified to check whether the response
  34490. // error from Do is the result of In-None-Match.
  34491. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  34492. c.ifNoneMatch_ = entityTag
  34493. return c
  34494. }
  34495. // Context sets the context to be used in this call's Do method. Any
  34496. // pending HTTP request will be aborted if the provided context is
  34497. // canceled.
  34498. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  34499. c.ctx_ = ctx
  34500. return c
  34501. }
  34502. // Header returns an http.Header that can be modified by the caller to
  34503. // add HTTP headers to the request.
  34504. func (c *AutoscalersGetCall) Header() http.Header {
  34505. if c.header_ == nil {
  34506. c.header_ = make(http.Header)
  34507. }
  34508. return c.header_
  34509. }
  34510. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  34511. reqHeaders := make(http.Header)
  34512. for k, v := range c.header_ {
  34513. reqHeaders[k] = v
  34514. }
  34515. reqHeaders.Set("User-Agent", c.s.userAgent())
  34516. if c.ifNoneMatch_ != "" {
  34517. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34518. }
  34519. var body io.Reader = nil
  34520. c.urlParams_.Set("alt", alt)
  34521. c.urlParams_.Set("prettyPrint", "false")
  34522. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  34523. urls += "?" + c.urlParams_.Encode()
  34524. req, err := http.NewRequest("GET", urls, body)
  34525. if err != nil {
  34526. return nil, err
  34527. }
  34528. req.Header = reqHeaders
  34529. googleapi.Expand(req.URL, map[string]string{
  34530. "project": c.project,
  34531. "zone": c.zone,
  34532. "autoscaler": c.autoscaler,
  34533. })
  34534. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34535. }
  34536. // Do executes the "compute.autoscalers.get" call.
  34537. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  34538. // status code is an error. Response headers are in either
  34539. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  34540. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34541. // to check whether the returned error was because
  34542. // http.StatusNotModified was returned.
  34543. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  34544. gensupport.SetOptions(c.urlParams_, opts...)
  34545. res, err := c.doRequest("json")
  34546. if res != nil && res.StatusCode == http.StatusNotModified {
  34547. if res.Body != nil {
  34548. res.Body.Close()
  34549. }
  34550. return nil, &googleapi.Error{
  34551. Code: res.StatusCode,
  34552. Header: res.Header,
  34553. }
  34554. }
  34555. if err != nil {
  34556. return nil, err
  34557. }
  34558. defer googleapi.CloseBody(res)
  34559. if err := googleapi.CheckResponse(res); err != nil {
  34560. return nil, err
  34561. }
  34562. ret := &Autoscaler{
  34563. ServerResponse: googleapi.ServerResponse{
  34564. Header: res.Header,
  34565. HTTPStatusCode: res.StatusCode,
  34566. },
  34567. }
  34568. target := &ret
  34569. if err := gensupport.DecodeResponse(target, res); err != nil {
  34570. return nil, err
  34571. }
  34572. return ret, nil
  34573. // {
  34574. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  34575. // "httpMethod": "GET",
  34576. // "id": "compute.autoscalers.get",
  34577. // "parameterOrder": [
  34578. // "project",
  34579. // "zone",
  34580. // "autoscaler"
  34581. // ],
  34582. // "parameters": {
  34583. // "autoscaler": {
  34584. // "description": "Name of the autoscaler to return.",
  34585. // "location": "path",
  34586. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34587. // "required": true,
  34588. // "type": "string"
  34589. // },
  34590. // "project": {
  34591. // "description": "Project ID for this request.",
  34592. // "location": "path",
  34593. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34594. // "required": true,
  34595. // "type": "string"
  34596. // },
  34597. // "zone": {
  34598. // "description": "Name of the zone for this request.",
  34599. // "location": "path",
  34600. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34601. // "required": true,
  34602. // "type": "string"
  34603. // }
  34604. // },
  34605. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  34606. // "response": {
  34607. // "$ref": "Autoscaler"
  34608. // },
  34609. // "scopes": [
  34610. // "https://www.googleapis.com/auth/cloud-platform",
  34611. // "https://www.googleapis.com/auth/compute",
  34612. // "https://www.googleapis.com/auth/compute.readonly"
  34613. // ]
  34614. // }
  34615. }
  34616. // method id "compute.autoscalers.insert":
  34617. type AutoscalersInsertCall struct {
  34618. s *Service
  34619. project string
  34620. zone string
  34621. autoscaler *Autoscaler
  34622. urlParams_ gensupport.URLParams
  34623. ctx_ context.Context
  34624. header_ http.Header
  34625. }
  34626. // Insert: Creates an autoscaler in the specified project using the data
  34627. // included in the request.
  34628. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  34629. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34630. c.project = project
  34631. c.zone = zone
  34632. c.autoscaler = autoscaler
  34633. return c
  34634. }
  34635. // RequestId sets the optional parameter "requestId": An optional
  34636. // request ID to identify requests. Specify a unique request ID so that
  34637. // if you must retry your request, the server will know to ignore the
  34638. // request if it has already been completed.
  34639. //
  34640. // For example, consider a situation where you make an initial request
  34641. // and the request times out. If you make the request again with the
  34642. // same request ID, the server can check if original operation with the
  34643. // same request ID was received, and if so, will ignore the second
  34644. // request. This prevents clients from accidentally creating duplicate
  34645. // commitments.
  34646. //
  34647. // The request ID must be a valid UUID with the exception that zero UUID
  34648. // is not supported (00000000-0000-0000-0000-000000000000).
  34649. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  34650. c.urlParams_.Set("requestId", requestId)
  34651. return c
  34652. }
  34653. // Fields allows partial responses to be retrieved. See
  34654. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34655. // for more information.
  34656. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  34657. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34658. return c
  34659. }
  34660. // Context sets the context to be used in this call's Do method. Any
  34661. // pending HTTP request will be aborted if the provided context is
  34662. // canceled.
  34663. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  34664. c.ctx_ = ctx
  34665. return c
  34666. }
  34667. // Header returns an http.Header that can be modified by the caller to
  34668. // add HTTP headers to the request.
  34669. func (c *AutoscalersInsertCall) Header() http.Header {
  34670. if c.header_ == nil {
  34671. c.header_ = make(http.Header)
  34672. }
  34673. return c.header_
  34674. }
  34675. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  34676. reqHeaders := make(http.Header)
  34677. for k, v := range c.header_ {
  34678. reqHeaders[k] = v
  34679. }
  34680. reqHeaders.Set("User-Agent", c.s.userAgent())
  34681. var body io.Reader = nil
  34682. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  34683. if err != nil {
  34684. return nil, err
  34685. }
  34686. reqHeaders.Set("Content-Type", "application/json")
  34687. c.urlParams_.Set("alt", alt)
  34688. c.urlParams_.Set("prettyPrint", "false")
  34689. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  34690. urls += "?" + c.urlParams_.Encode()
  34691. req, err := http.NewRequest("POST", urls, body)
  34692. if err != nil {
  34693. return nil, err
  34694. }
  34695. req.Header = reqHeaders
  34696. googleapi.Expand(req.URL, map[string]string{
  34697. "project": c.project,
  34698. "zone": c.zone,
  34699. })
  34700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34701. }
  34702. // Do executes the "compute.autoscalers.insert" call.
  34703. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34704. // status code is an error. Response headers are in either
  34705. // *Operation.ServerResponse.Header or (if a response was returned at
  34706. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34707. // to check whether the returned error was because
  34708. // http.StatusNotModified was returned.
  34709. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34710. gensupport.SetOptions(c.urlParams_, opts...)
  34711. res, err := c.doRequest("json")
  34712. if res != nil && res.StatusCode == http.StatusNotModified {
  34713. if res.Body != nil {
  34714. res.Body.Close()
  34715. }
  34716. return nil, &googleapi.Error{
  34717. Code: res.StatusCode,
  34718. Header: res.Header,
  34719. }
  34720. }
  34721. if err != nil {
  34722. return nil, err
  34723. }
  34724. defer googleapi.CloseBody(res)
  34725. if err := googleapi.CheckResponse(res); err != nil {
  34726. return nil, err
  34727. }
  34728. ret := &Operation{
  34729. ServerResponse: googleapi.ServerResponse{
  34730. Header: res.Header,
  34731. HTTPStatusCode: res.StatusCode,
  34732. },
  34733. }
  34734. target := &ret
  34735. if err := gensupport.DecodeResponse(target, res); err != nil {
  34736. return nil, err
  34737. }
  34738. return ret, nil
  34739. // {
  34740. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  34741. // "httpMethod": "POST",
  34742. // "id": "compute.autoscalers.insert",
  34743. // "parameterOrder": [
  34744. // "project",
  34745. // "zone"
  34746. // ],
  34747. // "parameters": {
  34748. // "project": {
  34749. // "description": "Project ID for this request.",
  34750. // "location": "path",
  34751. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34752. // "required": true,
  34753. // "type": "string"
  34754. // },
  34755. // "requestId": {
  34756. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34757. // "location": "query",
  34758. // "type": "string"
  34759. // },
  34760. // "zone": {
  34761. // "description": "Name of the zone for this request.",
  34762. // "location": "path",
  34763. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34764. // "required": true,
  34765. // "type": "string"
  34766. // }
  34767. // },
  34768. // "path": "{project}/zones/{zone}/autoscalers",
  34769. // "request": {
  34770. // "$ref": "Autoscaler"
  34771. // },
  34772. // "response": {
  34773. // "$ref": "Operation"
  34774. // },
  34775. // "scopes": [
  34776. // "https://www.googleapis.com/auth/cloud-platform",
  34777. // "https://www.googleapis.com/auth/compute"
  34778. // ]
  34779. // }
  34780. }
  34781. // method id "compute.autoscalers.list":
  34782. type AutoscalersListCall struct {
  34783. s *Service
  34784. project string
  34785. zone string
  34786. urlParams_ gensupport.URLParams
  34787. ifNoneMatch_ string
  34788. ctx_ context.Context
  34789. header_ http.Header
  34790. }
  34791. // List: Retrieves a list of autoscalers contained within the specified
  34792. // zone.
  34793. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  34794. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34795. c.project = project
  34796. c.zone = zone
  34797. return c
  34798. }
  34799. // Filter sets the optional parameter "filter": A filter expression that
  34800. // filters resources listed in the response. The expression must specify
  34801. // the field name, a comparison operator, and the value that you want to
  34802. // use for filtering. The value must be a string, a number, or a
  34803. // boolean. The comparison operator must be either =, !=, >, or <.
  34804. //
  34805. // For example, if you are filtering Compute Engine instances, you can
  34806. // exclude instances named example-instance by specifying name !=
  34807. // example-instance.
  34808. //
  34809. // You can also filter nested fields. For example, you could specify
  34810. // scheduling.automaticRestart = false to include instances only if they
  34811. // are not scheduled for automatic restarts. You can use filtering on
  34812. // nested fields to filter based on resource labels.
  34813. //
  34814. // To filter on multiple expressions, provide each separate expression
  34815. // within parentheses. For example, (scheduling.automaticRestart = true)
  34816. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  34817. // AND expression. However, you can include AND and OR expressions
  34818. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  34819. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  34820. // true).
  34821. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  34822. c.urlParams_.Set("filter", filter)
  34823. return c
  34824. }
  34825. // MaxResults sets the optional parameter "maxResults": The maximum
  34826. // number of results per page that should be returned. If the number of
  34827. // available results is larger than maxResults, Compute Engine returns a
  34828. // nextPageToken that can be used to get the next page of results in
  34829. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34830. // (Default: 500)
  34831. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  34832. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34833. return c
  34834. }
  34835. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34836. // a certain order. By default, results are returned in alphanumerical
  34837. // order based on the resource name.
  34838. //
  34839. // You can also sort results in descending order based on the creation
  34840. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34841. // based on the creationTimestamp field in reverse chronological order
  34842. // (newest result first). Use this to sort resources like operations so
  34843. // that the newest operation is returned first.
  34844. //
  34845. // Currently, only sorting by name or creationTimestamp desc is
  34846. // supported.
  34847. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  34848. c.urlParams_.Set("orderBy", orderBy)
  34849. return c
  34850. }
  34851. // PageToken sets the optional parameter "pageToken": Specifies a page
  34852. // token to use. Set pageToken to the nextPageToken returned by a
  34853. // previous list request to get the next page of results.
  34854. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  34855. c.urlParams_.Set("pageToken", pageToken)
  34856. return c
  34857. }
  34858. // Fields allows partial responses to be retrieved. See
  34859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34860. // for more information.
  34861. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  34862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34863. return c
  34864. }
  34865. // IfNoneMatch sets the optional parameter which makes the operation
  34866. // fail if the object's ETag matches the given value. This is useful for
  34867. // getting updates only after the object has changed since the last
  34868. // request. Use googleapi.IsNotModified to check whether the response
  34869. // error from Do is the result of In-None-Match.
  34870. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  34871. c.ifNoneMatch_ = entityTag
  34872. return c
  34873. }
  34874. // Context sets the context to be used in this call's Do method. Any
  34875. // pending HTTP request will be aborted if the provided context is
  34876. // canceled.
  34877. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  34878. c.ctx_ = ctx
  34879. return c
  34880. }
  34881. // Header returns an http.Header that can be modified by the caller to
  34882. // add HTTP headers to the request.
  34883. func (c *AutoscalersListCall) Header() http.Header {
  34884. if c.header_ == nil {
  34885. c.header_ = make(http.Header)
  34886. }
  34887. return c.header_
  34888. }
  34889. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  34890. reqHeaders := make(http.Header)
  34891. for k, v := range c.header_ {
  34892. reqHeaders[k] = v
  34893. }
  34894. reqHeaders.Set("User-Agent", c.s.userAgent())
  34895. if c.ifNoneMatch_ != "" {
  34896. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34897. }
  34898. var body io.Reader = nil
  34899. c.urlParams_.Set("alt", alt)
  34900. c.urlParams_.Set("prettyPrint", "false")
  34901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  34902. urls += "?" + c.urlParams_.Encode()
  34903. req, err := http.NewRequest("GET", urls, body)
  34904. if err != nil {
  34905. return nil, err
  34906. }
  34907. req.Header = reqHeaders
  34908. googleapi.Expand(req.URL, map[string]string{
  34909. "project": c.project,
  34910. "zone": c.zone,
  34911. })
  34912. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34913. }
  34914. // Do executes the "compute.autoscalers.list" call.
  34915. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  34916. // status code is an error. Response headers are in either
  34917. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  34918. // at all) in error.(*googleapi.Error).Header. Use
  34919. // googleapi.IsNotModified to check whether the returned error was
  34920. // because http.StatusNotModified was returned.
  34921. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  34922. gensupport.SetOptions(c.urlParams_, opts...)
  34923. res, err := c.doRequest("json")
  34924. if res != nil && res.StatusCode == http.StatusNotModified {
  34925. if res.Body != nil {
  34926. res.Body.Close()
  34927. }
  34928. return nil, &googleapi.Error{
  34929. Code: res.StatusCode,
  34930. Header: res.Header,
  34931. }
  34932. }
  34933. if err != nil {
  34934. return nil, err
  34935. }
  34936. defer googleapi.CloseBody(res)
  34937. if err := googleapi.CheckResponse(res); err != nil {
  34938. return nil, err
  34939. }
  34940. ret := &AutoscalerList{
  34941. ServerResponse: googleapi.ServerResponse{
  34942. Header: res.Header,
  34943. HTTPStatusCode: res.StatusCode,
  34944. },
  34945. }
  34946. target := &ret
  34947. if err := gensupport.DecodeResponse(target, res); err != nil {
  34948. return nil, err
  34949. }
  34950. return ret, nil
  34951. // {
  34952. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  34953. // "httpMethod": "GET",
  34954. // "id": "compute.autoscalers.list",
  34955. // "parameterOrder": [
  34956. // "project",
  34957. // "zone"
  34958. // ],
  34959. // "parameters": {
  34960. // "filter": {
  34961. // "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).",
  34962. // "location": "query",
  34963. // "type": "string"
  34964. // },
  34965. // "maxResults": {
  34966. // "default": "500",
  34967. // "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)",
  34968. // "format": "uint32",
  34969. // "location": "query",
  34970. // "minimum": "0",
  34971. // "type": "integer"
  34972. // },
  34973. // "orderBy": {
  34974. // "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.",
  34975. // "location": "query",
  34976. // "type": "string"
  34977. // },
  34978. // "pageToken": {
  34979. // "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.",
  34980. // "location": "query",
  34981. // "type": "string"
  34982. // },
  34983. // "project": {
  34984. // "description": "Project ID for this request.",
  34985. // "location": "path",
  34986. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34987. // "required": true,
  34988. // "type": "string"
  34989. // },
  34990. // "zone": {
  34991. // "description": "Name of the zone for this request.",
  34992. // "location": "path",
  34993. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34994. // "required": true,
  34995. // "type": "string"
  34996. // }
  34997. // },
  34998. // "path": "{project}/zones/{zone}/autoscalers",
  34999. // "response": {
  35000. // "$ref": "AutoscalerList"
  35001. // },
  35002. // "scopes": [
  35003. // "https://www.googleapis.com/auth/cloud-platform",
  35004. // "https://www.googleapis.com/auth/compute",
  35005. // "https://www.googleapis.com/auth/compute.readonly"
  35006. // ]
  35007. // }
  35008. }
  35009. // Pages invokes f for each page of results.
  35010. // A non-nil error returned from f will halt the iteration.
  35011. // The provided context supersedes any context provided to the Context method.
  35012. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  35013. c.ctx_ = ctx
  35014. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35015. for {
  35016. x, err := c.Do()
  35017. if err != nil {
  35018. return err
  35019. }
  35020. if err := f(x); err != nil {
  35021. return err
  35022. }
  35023. if x.NextPageToken == "" {
  35024. return nil
  35025. }
  35026. c.PageToken(x.NextPageToken)
  35027. }
  35028. }
  35029. // method id "compute.autoscalers.patch":
  35030. type AutoscalersPatchCall struct {
  35031. s *Service
  35032. project string
  35033. zone string
  35034. autoscaler *Autoscaler
  35035. urlParams_ gensupport.URLParams
  35036. ctx_ context.Context
  35037. header_ http.Header
  35038. }
  35039. // Patch: Updates an autoscaler in the specified project using the data
  35040. // included in the request. This method supports PATCH semantics and
  35041. // uses the JSON merge patch format and processing rules.
  35042. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  35043. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35044. c.project = project
  35045. c.zone = zone
  35046. c.autoscaler = autoscaler
  35047. return c
  35048. }
  35049. // Autoscaler sets the optional parameter "autoscaler": Name of the
  35050. // autoscaler to patch.
  35051. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  35052. c.urlParams_.Set("autoscaler", autoscaler)
  35053. return c
  35054. }
  35055. // RequestId sets the optional parameter "requestId": An optional
  35056. // request ID to identify requests. Specify a unique request ID so that
  35057. // if you must retry your request, the server will know to ignore the
  35058. // request if it has already been completed.
  35059. //
  35060. // For example, consider a situation where you make an initial request
  35061. // and the request times out. If you make the request again with the
  35062. // same request ID, the server can check if original operation with the
  35063. // same request ID was received, and if so, will ignore the second
  35064. // request. This prevents clients from accidentally creating duplicate
  35065. // commitments.
  35066. //
  35067. // The request ID must be a valid UUID with the exception that zero UUID
  35068. // is not supported (00000000-0000-0000-0000-000000000000).
  35069. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  35070. c.urlParams_.Set("requestId", requestId)
  35071. return c
  35072. }
  35073. // Fields allows partial responses to be retrieved. See
  35074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35075. // for more information.
  35076. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  35077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35078. return c
  35079. }
  35080. // Context sets the context to be used in this call's Do method. Any
  35081. // pending HTTP request will be aborted if the provided context is
  35082. // canceled.
  35083. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  35084. c.ctx_ = ctx
  35085. return c
  35086. }
  35087. // Header returns an http.Header that can be modified by the caller to
  35088. // add HTTP headers to the request.
  35089. func (c *AutoscalersPatchCall) Header() http.Header {
  35090. if c.header_ == nil {
  35091. c.header_ = make(http.Header)
  35092. }
  35093. return c.header_
  35094. }
  35095. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  35096. reqHeaders := make(http.Header)
  35097. for k, v := range c.header_ {
  35098. reqHeaders[k] = v
  35099. }
  35100. reqHeaders.Set("User-Agent", c.s.userAgent())
  35101. var body io.Reader = nil
  35102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  35103. if err != nil {
  35104. return nil, err
  35105. }
  35106. reqHeaders.Set("Content-Type", "application/json")
  35107. c.urlParams_.Set("alt", alt)
  35108. c.urlParams_.Set("prettyPrint", "false")
  35109. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  35110. urls += "?" + c.urlParams_.Encode()
  35111. req, err := http.NewRequest("PATCH", urls, body)
  35112. if err != nil {
  35113. return nil, err
  35114. }
  35115. req.Header = reqHeaders
  35116. googleapi.Expand(req.URL, map[string]string{
  35117. "project": c.project,
  35118. "zone": c.zone,
  35119. })
  35120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35121. }
  35122. // Do executes the "compute.autoscalers.patch" call.
  35123. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35124. // status code is an error. Response headers are in either
  35125. // *Operation.ServerResponse.Header or (if a response was returned at
  35126. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35127. // to check whether the returned error was because
  35128. // http.StatusNotModified was returned.
  35129. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35130. gensupport.SetOptions(c.urlParams_, opts...)
  35131. res, err := c.doRequest("json")
  35132. if res != nil && res.StatusCode == http.StatusNotModified {
  35133. if res.Body != nil {
  35134. res.Body.Close()
  35135. }
  35136. return nil, &googleapi.Error{
  35137. Code: res.StatusCode,
  35138. Header: res.Header,
  35139. }
  35140. }
  35141. if err != nil {
  35142. return nil, err
  35143. }
  35144. defer googleapi.CloseBody(res)
  35145. if err := googleapi.CheckResponse(res); err != nil {
  35146. return nil, err
  35147. }
  35148. ret := &Operation{
  35149. ServerResponse: googleapi.ServerResponse{
  35150. Header: res.Header,
  35151. HTTPStatusCode: res.StatusCode,
  35152. },
  35153. }
  35154. target := &ret
  35155. if err := gensupport.DecodeResponse(target, res); err != nil {
  35156. return nil, err
  35157. }
  35158. return ret, nil
  35159. // {
  35160. // "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.",
  35161. // "httpMethod": "PATCH",
  35162. // "id": "compute.autoscalers.patch",
  35163. // "parameterOrder": [
  35164. // "project",
  35165. // "zone"
  35166. // ],
  35167. // "parameters": {
  35168. // "autoscaler": {
  35169. // "description": "Name of the autoscaler to patch.",
  35170. // "location": "query",
  35171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35172. // "type": "string"
  35173. // },
  35174. // "project": {
  35175. // "description": "Project ID for this request.",
  35176. // "location": "path",
  35177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35178. // "required": true,
  35179. // "type": "string"
  35180. // },
  35181. // "requestId": {
  35182. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35183. // "location": "query",
  35184. // "type": "string"
  35185. // },
  35186. // "zone": {
  35187. // "description": "Name of the zone for this request.",
  35188. // "location": "path",
  35189. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35190. // "required": true,
  35191. // "type": "string"
  35192. // }
  35193. // },
  35194. // "path": "{project}/zones/{zone}/autoscalers",
  35195. // "request": {
  35196. // "$ref": "Autoscaler"
  35197. // },
  35198. // "response": {
  35199. // "$ref": "Operation"
  35200. // },
  35201. // "scopes": [
  35202. // "https://www.googleapis.com/auth/cloud-platform",
  35203. // "https://www.googleapis.com/auth/compute"
  35204. // ]
  35205. // }
  35206. }
  35207. // method id "compute.autoscalers.testIamPermissions":
  35208. type AutoscalersTestIamPermissionsCall struct {
  35209. s *Service
  35210. project string
  35211. zone string
  35212. resource string
  35213. testpermissionsrequest *TestPermissionsRequest
  35214. urlParams_ gensupport.URLParams
  35215. ctx_ context.Context
  35216. header_ http.Header
  35217. }
  35218. // TestIamPermissions: Returns permissions that a caller has on the
  35219. // specified resource.
  35220. func (r *AutoscalersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AutoscalersTestIamPermissionsCall {
  35221. c := &AutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35222. c.project = project
  35223. c.zone = zone
  35224. c.resource = resource
  35225. c.testpermissionsrequest = testpermissionsrequest
  35226. return c
  35227. }
  35228. // Fields allows partial responses to be retrieved. See
  35229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35230. // for more information.
  35231. func (c *AutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *AutoscalersTestIamPermissionsCall {
  35232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35233. return c
  35234. }
  35235. // Context sets the context to be used in this call's Do method. Any
  35236. // pending HTTP request will be aborted if the provided context is
  35237. // canceled.
  35238. func (c *AutoscalersTestIamPermissionsCall) Context(ctx context.Context) *AutoscalersTestIamPermissionsCall {
  35239. c.ctx_ = ctx
  35240. return c
  35241. }
  35242. // Header returns an http.Header that can be modified by the caller to
  35243. // add HTTP headers to the request.
  35244. func (c *AutoscalersTestIamPermissionsCall) Header() http.Header {
  35245. if c.header_ == nil {
  35246. c.header_ = make(http.Header)
  35247. }
  35248. return c.header_
  35249. }
  35250. func (c *AutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  35251. reqHeaders := make(http.Header)
  35252. for k, v := range c.header_ {
  35253. reqHeaders[k] = v
  35254. }
  35255. reqHeaders.Set("User-Agent", c.s.userAgent())
  35256. var body io.Reader = nil
  35257. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  35258. if err != nil {
  35259. return nil, err
  35260. }
  35261. reqHeaders.Set("Content-Type", "application/json")
  35262. c.urlParams_.Set("alt", alt)
  35263. c.urlParams_.Set("prettyPrint", "false")
  35264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions")
  35265. urls += "?" + c.urlParams_.Encode()
  35266. req, err := http.NewRequest("POST", urls, body)
  35267. if err != nil {
  35268. return nil, err
  35269. }
  35270. req.Header = reqHeaders
  35271. googleapi.Expand(req.URL, map[string]string{
  35272. "project": c.project,
  35273. "zone": c.zone,
  35274. "resource": c.resource,
  35275. })
  35276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35277. }
  35278. // Do executes the "compute.autoscalers.testIamPermissions" call.
  35279. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  35280. // non-2xx status code is an error. Response headers are in either
  35281. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  35282. // returned at all) in error.(*googleapi.Error).Header. Use
  35283. // googleapi.IsNotModified to check whether the returned error was
  35284. // because http.StatusNotModified was returned.
  35285. func (c *AutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  35286. gensupport.SetOptions(c.urlParams_, opts...)
  35287. res, err := c.doRequest("json")
  35288. if res != nil && res.StatusCode == http.StatusNotModified {
  35289. if res.Body != nil {
  35290. res.Body.Close()
  35291. }
  35292. return nil, &googleapi.Error{
  35293. Code: res.StatusCode,
  35294. Header: res.Header,
  35295. }
  35296. }
  35297. if err != nil {
  35298. return nil, err
  35299. }
  35300. defer googleapi.CloseBody(res)
  35301. if err := googleapi.CheckResponse(res); err != nil {
  35302. return nil, err
  35303. }
  35304. ret := &TestPermissionsResponse{
  35305. ServerResponse: googleapi.ServerResponse{
  35306. Header: res.Header,
  35307. HTTPStatusCode: res.StatusCode,
  35308. },
  35309. }
  35310. target := &ret
  35311. if err := gensupport.DecodeResponse(target, res); err != nil {
  35312. return nil, err
  35313. }
  35314. return ret, nil
  35315. // {
  35316. // "description": "Returns permissions that a caller has on the specified resource.",
  35317. // "httpMethod": "POST",
  35318. // "id": "compute.autoscalers.testIamPermissions",
  35319. // "parameterOrder": [
  35320. // "project",
  35321. // "zone",
  35322. // "resource"
  35323. // ],
  35324. // "parameters": {
  35325. // "project": {
  35326. // "description": "Project ID for this request.",
  35327. // "location": "path",
  35328. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35329. // "required": true,
  35330. // "type": "string"
  35331. // },
  35332. // "resource": {
  35333. // "description": "Name or id of the resource for this request.",
  35334. // "location": "path",
  35335. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35336. // "required": true,
  35337. // "type": "string"
  35338. // },
  35339. // "zone": {
  35340. // "description": "The name of the zone for this request.",
  35341. // "location": "path",
  35342. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35343. // "required": true,
  35344. // "type": "string"
  35345. // }
  35346. // },
  35347. // "path": "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions",
  35348. // "request": {
  35349. // "$ref": "TestPermissionsRequest"
  35350. // },
  35351. // "response": {
  35352. // "$ref": "TestPermissionsResponse"
  35353. // },
  35354. // "scopes": [
  35355. // "https://www.googleapis.com/auth/cloud-platform",
  35356. // "https://www.googleapis.com/auth/compute",
  35357. // "https://www.googleapis.com/auth/compute.readonly"
  35358. // ]
  35359. // }
  35360. }
  35361. // method id "compute.autoscalers.update":
  35362. type AutoscalersUpdateCall struct {
  35363. s *Service
  35364. project string
  35365. zone string
  35366. autoscaler *Autoscaler
  35367. urlParams_ gensupport.URLParams
  35368. ctx_ context.Context
  35369. header_ http.Header
  35370. }
  35371. // Update: Updates an autoscaler in the specified project using the data
  35372. // included in the request.
  35373. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  35374. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35375. c.project = project
  35376. c.zone = zone
  35377. c.autoscaler = autoscaler
  35378. return c
  35379. }
  35380. // Autoscaler sets the optional parameter "autoscaler": Name of the
  35381. // autoscaler to update.
  35382. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  35383. c.urlParams_.Set("autoscaler", autoscaler)
  35384. return c
  35385. }
  35386. // RequestId sets the optional parameter "requestId": An optional
  35387. // request ID to identify requests. Specify a unique request ID so that
  35388. // if you must retry your request, the server will know to ignore the
  35389. // request if it has already been completed.
  35390. //
  35391. // For example, consider a situation where you make an initial request
  35392. // and the request times out. If you make the request again with the
  35393. // same request ID, the server can check if original operation with the
  35394. // same request ID was received, and if so, will ignore the second
  35395. // request. This prevents clients from accidentally creating duplicate
  35396. // commitments.
  35397. //
  35398. // The request ID must be a valid UUID with the exception that zero UUID
  35399. // is not supported (00000000-0000-0000-0000-000000000000).
  35400. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  35401. c.urlParams_.Set("requestId", requestId)
  35402. return c
  35403. }
  35404. // Fields allows partial responses to be retrieved. See
  35405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35406. // for more information.
  35407. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  35408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35409. return c
  35410. }
  35411. // Context sets the context to be used in this call's Do method. Any
  35412. // pending HTTP request will be aborted if the provided context is
  35413. // canceled.
  35414. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  35415. c.ctx_ = ctx
  35416. return c
  35417. }
  35418. // Header returns an http.Header that can be modified by the caller to
  35419. // add HTTP headers to the request.
  35420. func (c *AutoscalersUpdateCall) Header() http.Header {
  35421. if c.header_ == nil {
  35422. c.header_ = make(http.Header)
  35423. }
  35424. return c.header_
  35425. }
  35426. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  35427. reqHeaders := make(http.Header)
  35428. for k, v := range c.header_ {
  35429. reqHeaders[k] = v
  35430. }
  35431. reqHeaders.Set("User-Agent", c.s.userAgent())
  35432. var body io.Reader = nil
  35433. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  35434. if err != nil {
  35435. return nil, err
  35436. }
  35437. reqHeaders.Set("Content-Type", "application/json")
  35438. c.urlParams_.Set("alt", alt)
  35439. c.urlParams_.Set("prettyPrint", "false")
  35440. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  35441. urls += "?" + c.urlParams_.Encode()
  35442. req, err := http.NewRequest("PUT", urls, body)
  35443. if err != nil {
  35444. return nil, err
  35445. }
  35446. req.Header = reqHeaders
  35447. googleapi.Expand(req.URL, map[string]string{
  35448. "project": c.project,
  35449. "zone": c.zone,
  35450. })
  35451. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35452. }
  35453. // Do executes the "compute.autoscalers.update" call.
  35454. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35455. // status code is an error. Response headers are in either
  35456. // *Operation.ServerResponse.Header or (if a response was returned at
  35457. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35458. // to check whether the returned error was because
  35459. // http.StatusNotModified was returned.
  35460. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35461. gensupport.SetOptions(c.urlParams_, opts...)
  35462. res, err := c.doRequest("json")
  35463. if res != nil && res.StatusCode == http.StatusNotModified {
  35464. if res.Body != nil {
  35465. res.Body.Close()
  35466. }
  35467. return nil, &googleapi.Error{
  35468. Code: res.StatusCode,
  35469. Header: res.Header,
  35470. }
  35471. }
  35472. if err != nil {
  35473. return nil, err
  35474. }
  35475. defer googleapi.CloseBody(res)
  35476. if err := googleapi.CheckResponse(res); err != nil {
  35477. return nil, err
  35478. }
  35479. ret := &Operation{
  35480. ServerResponse: googleapi.ServerResponse{
  35481. Header: res.Header,
  35482. HTTPStatusCode: res.StatusCode,
  35483. },
  35484. }
  35485. target := &ret
  35486. if err := gensupport.DecodeResponse(target, res); err != nil {
  35487. return nil, err
  35488. }
  35489. return ret, nil
  35490. // {
  35491. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  35492. // "httpMethod": "PUT",
  35493. // "id": "compute.autoscalers.update",
  35494. // "parameterOrder": [
  35495. // "project",
  35496. // "zone"
  35497. // ],
  35498. // "parameters": {
  35499. // "autoscaler": {
  35500. // "description": "Name of the autoscaler to update.",
  35501. // "location": "query",
  35502. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35503. // "type": "string"
  35504. // },
  35505. // "project": {
  35506. // "description": "Project ID for this request.",
  35507. // "location": "path",
  35508. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35509. // "required": true,
  35510. // "type": "string"
  35511. // },
  35512. // "requestId": {
  35513. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35514. // "location": "query",
  35515. // "type": "string"
  35516. // },
  35517. // "zone": {
  35518. // "description": "Name of the zone for this request.",
  35519. // "location": "path",
  35520. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35521. // "required": true,
  35522. // "type": "string"
  35523. // }
  35524. // },
  35525. // "path": "{project}/zones/{zone}/autoscalers",
  35526. // "request": {
  35527. // "$ref": "Autoscaler"
  35528. // },
  35529. // "response": {
  35530. // "$ref": "Operation"
  35531. // },
  35532. // "scopes": [
  35533. // "https://www.googleapis.com/auth/cloud-platform",
  35534. // "https://www.googleapis.com/auth/compute"
  35535. // ]
  35536. // }
  35537. }
  35538. // method id "compute.backendBuckets.addSignedUrlKey":
  35539. type BackendBucketsAddSignedUrlKeyCall struct {
  35540. s *Service
  35541. project string
  35542. backendBucket string
  35543. signedurlkey *SignedUrlKey
  35544. urlParams_ gensupport.URLParams
  35545. ctx_ context.Context
  35546. header_ http.Header
  35547. }
  35548. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  35549. // for this backend bucket.
  35550. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  35551. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35552. c.project = project
  35553. c.backendBucket = backendBucket
  35554. c.signedurlkey = signedurlkey
  35555. return c
  35556. }
  35557. // RequestId sets the optional parameter "requestId": An optional
  35558. // request ID to identify requests. Specify a unique request ID so that
  35559. // if you must retry your request, the server will know to ignore the
  35560. // request if it has already been completed.
  35561. //
  35562. // For example, consider a situation where you make an initial request
  35563. // and the request times out. If you make the request again with the
  35564. // same request ID, the server can check if original operation with the
  35565. // same request ID was received, and if so, will ignore the second
  35566. // request. This prevents clients from accidentally creating duplicate
  35567. // commitments.
  35568. //
  35569. // The request ID must be a valid UUID with the exception that zero UUID
  35570. // is not supported (00000000-0000-0000-0000-000000000000).
  35571. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  35572. c.urlParams_.Set("requestId", requestId)
  35573. return c
  35574. }
  35575. // Fields allows partial responses to be retrieved. See
  35576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35577. // for more information.
  35578. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  35579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35580. return c
  35581. }
  35582. // Context sets the context to be used in this call's Do method. Any
  35583. // pending HTTP request will be aborted if the provided context is
  35584. // canceled.
  35585. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  35586. c.ctx_ = ctx
  35587. return c
  35588. }
  35589. // Header returns an http.Header that can be modified by the caller to
  35590. // add HTTP headers to the request.
  35591. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  35592. if c.header_ == nil {
  35593. c.header_ = make(http.Header)
  35594. }
  35595. return c.header_
  35596. }
  35597. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  35598. reqHeaders := make(http.Header)
  35599. for k, v := range c.header_ {
  35600. reqHeaders[k] = v
  35601. }
  35602. reqHeaders.Set("User-Agent", c.s.userAgent())
  35603. var body io.Reader = nil
  35604. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  35605. if err != nil {
  35606. return nil, err
  35607. }
  35608. reqHeaders.Set("Content-Type", "application/json")
  35609. c.urlParams_.Set("alt", alt)
  35610. c.urlParams_.Set("prettyPrint", "false")
  35611. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  35612. urls += "?" + c.urlParams_.Encode()
  35613. req, err := http.NewRequest("POST", urls, body)
  35614. if err != nil {
  35615. return nil, err
  35616. }
  35617. req.Header = reqHeaders
  35618. googleapi.Expand(req.URL, map[string]string{
  35619. "project": c.project,
  35620. "backendBucket": c.backendBucket,
  35621. })
  35622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35623. }
  35624. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  35625. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35626. // status code is an error. Response headers are in either
  35627. // *Operation.ServerResponse.Header or (if a response was returned at
  35628. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35629. // to check whether the returned error was because
  35630. // http.StatusNotModified was returned.
  35631. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35632. gensupport.SetOptions(c.urlParams_, opts...)
  35633. res, err := c.doRequest("json")
  35634. if res != nil && res.StatusCode == http.StatusNotModified {
  35635. if res.Body != nil {
  35636. res.Body.Close()
  35637. }
  35638. return nil, &googleapi.Error{
  35639. Code: res.StatusCode,
  35640. Header: res.Header,
  35641. }
  35642. }
  35643. if err != nil {
  35644. return nil, err
  35645. }
  35646. defer googleapi.CloseBody(res)
  35647. if err := googleapi.CheckResponse(res); err != nil {
  35648. return nil, err
  35649. }
  35650. ret := &Operation{
  35651. ServerResponse: googleapi.ServerResponse{
  35652. Header: res.Header,
  35653. HTTPStatusCode: res.StatusCode,
  35654. },
  35655. }
  35656. target := &ret
  35657. if err := gensupport.DecodeResponse(target, res); err != nil {
  35658. return nil, err
  35659. }
  35660. return ret, nil
  35661. // {
  35662. // "description": "Adds a key for validating requests with signed URLs for this backend bucket.",
  35663. // "httpMethod": "POST",
  35664. // "id": "compute.backendBuckets.addSignedUrlKey",
  35665. // "parameterOrder": [
  35666. // "project",
  35667. // "backendBucket"
  35668. // ],
  35669. // "parameters": {
  35670. // "backendBucket": {
  35671. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  35672. // "location": "path",
  35673. // "required": true,
  35674. // "type": "string"
  35675. // },
  35676. // "project": {
  35677. // "description": "Project ID for this request.",
  35678. // "location": "path",
  35679. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35680. // "required": true,
  35681. // "type": "string"
  35682. // },
  35683. // "requestId": {
  35684. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35685. // "location": "query",
  35686. // "type": "string"
  35687. // }
  35688. // },
  35689. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  35690. // "request": {
  35691. // "$ref": "SignedUrlKey"
  35692. // },
  35693. // "response": {
  35694. // "$ref": "Operation"
  35695. // },
  35696. // "scopes": [
  35697. // "https://www.googleapis.com/auth/cloud-platform",
  35698. // "https://www.googleapis.com/auth/compute"
  35699. // ]
  35700. // }
  35701. }
  35702. // method id "compute.backendBuckets.delete":
  35703. type BackendBucketsDeleteCall struct {
  35704. s *Service
  35705. project string
  35706. backendBucket string
  35707. urlParams_ gensupport.URLParams
  35708. ctx_ context.Context
  35709. header_ http.Header
  35710. }
  35711. // Delete: Deletes the specified BackendBucket resource.
  35712. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  35713. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35714. c.project = project
  35715. c.backendBucket = backendBucket
  35716. return c
  35717. }
  35718. // RequestId sets the optional parameter "requestId": An optional
  35719. // request ID to identify requests. Specify a unique request ID so that
  35720. // if you must retry your request, the server will know to ignore the
  35721. // request if it has already been completed.
  35722. //
  35723. // For example, consider a situation where you make an initial request
  35724. // and the request times out. If you make the request again with the
  35725. // same request ID, the server can check if original operation with the
  35726. // same request ID was received, and if so, will ignore the second
  35727. // request. This prevents clients from accidentally creating duplicate
  35728. // commitments.
  35729. //
  35730. // The request ID must be a valid UUID with the exception that zero UUID
  35731. // is not supported (00000000-0000-0000-0000-000000000000).
  35732. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  35733. c.urlParams_.Set("requestId", requestId)
  35734. return c
  35735. }
  35736. // Fields allows partial responses to be retrieved. See
  35737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35738. // for more information.
  35739. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  35740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35741. return c
  35742. }
  35743. // Context sets the context to be used in this call's Do method. Any
  35744. // pending HTTP request will be aborted if the provided context is
  35745. // canceled.
  35746. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  35747. c.ctx_ = ctx
  35748. return c
  35749. }
  35750. // Header returns an http.Header that can be modified by the caller to
  35751. // add HTTP headers to the request.
  35752. func (c *BackendBucketsDeleteCall) Header() http.Header {
  35753. if c.header_ == nil {
  35754. c.header_ = make(http.Header)
  35755. }
  35756. return c.header_
  35757. }
  35758. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  35759. reqHeaders := make(http.Header)
  35760. for k, v := range c.header_ {
  35761. reqHeaders[k] = v
  35762. }
  35763. reqHeaders.Set("User-Agent", c.s.userAgent())
  35764. var body io.Reader = nil
  35765. c.urlParams_.Set("alt", alt)
  35766. c.urlParams_.Set("prettyPrint", "false")
  35767. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  35768. urls += "?" + c.urlParams_.Encode()
  35769. req, err := http.NewRequest("DELETE", urls, body)
  35770. if err != nil {
  35771. return nil, err
  35772. }
  35773. req.Header = reqHeaders
  35774. googleapi.Expand(req.URL, map[string]string{
  35775. "project": c.project,
  35776. "backendBucket": c.backendBucket,
  35777. })
  35778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35779. }
  35780. // Do executes the "compute.backendBuckets.delete" call.
  35781. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35782. // status code is an error. Response headers are in either
  35783. // *Operation.ServerResponse.Header or (if a response was returned at
  35784. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35785. // to check whether the returned error was because
  35786. // http.StatusNotModified was returned.
  35787. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35788. gensupport.SetOptions(c.urlParams_, opts...)
  35789. res, err := c.doRequest("json")
  35790. if res != nil && res.StatusCode == http.StatusNotModified {
  35791. if res.Body != nil {
  35792. res.Body.Close()
  35793. }
  35794. return nil, &googleapi.Error{
  35795. Code: res.StatusCode,
  35796. Header: res.Header,
  35797. }
  35798. }
  35799. if err != nil {
  35800. return nil, err
  35801. }
  35802. defer googleapi.CloseBody(res)
  35803. if err := googleapi.CheckResponse(res); err != nil {
  35804. return nil, err
  35805. }
  35806. ret := &Operation{
  35807. ServerResponse: googleapi.ServerResponse{
  35808. Header: res.Header,
  35809. HTTPStatusCode: res.StatusCode,
  35810. },
  35811. }
  35812. target := &ret
  35813. if err := gensupport.DecodeResponse(target, res); err != nil {
  35814. return nil, err
  35815. }
  35816. return ret, nil
  35817. // {
  35818. // "description": "Deletes the specified BackendBucket resource.",
  35819. // "httpMethod": "DELETE",
  35820. // "id": "compute.backendBuckets.delete",
  35821. // "parameterOrder": [
  35822. // "project",
  35823. // "backendBucket"
  35824. // ],
  35825. // "parameters": {
  35826. // "backendBucket": {
  35827. // "description": "Name of the BackendBucket resource to delete.",
  35828. // "location": "path",
  35829. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35830. // "required": true,
  35831. // "type": "string"
  35832. // },
  35833. // "project": {
  35834. // "description": "Project ID for this request.",
  35835. // "location": "path",
  35836. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35837. // "required": true,
  35838. // "type": "string"
  35839. // },
  35840. // "requestId": {
  35841. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35842. // "location": "query",
  35843. // "type": "string"
  35844. // }
  35845. // },
  35846. // "path": "{project}/global/backendBuckets/{backendBucket}",
  35847. // "response": {
  35848. // "$ref": "Operation"
  35849. // },
  35850. // "scopes": [
  35851. // "https://www.googleapis.com/auth/cloud-platform",
  35852. // "https://www.googleapis.com/auth/compute"
  35853. // ]
  35854. // }
  35855. }
  35856. // method id "compute.backendBuckets.deleteSignedUrlKey":
  35857. type BackendBucketsDeleteSignedUrlKeyCall struct {
  35858. s *Service
  35859. project string
  35860. backendBucket string
  35861. urlParams_ gensupport.URLParams
  35862. ctx_ context.Context
  35863. header_ http.Header
  35864. }
  35865. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  35866. // URLs for this backend bucket.
  35867. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  35868. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35869. c.project = project
  35870. c.backendBucket = backendBucket
  35871. c.urlParams_.Set("keyName", keyName)
  35872. return c
  35873. }
  35874. // RequestId sets the optional parameter "requestId": An optional
  35875. // request ID to identify requests. Specify a unique request ID so that
  35876. // if you must retry your request, the server will know to ignore the
  35877. // request if it has already been completed.
  35878. //
  35879. // For example, consider a situation where you make an initial request
  35880. // and the request times out. If you make the request again with the
  35881. // same request ID, the server can check if original operation with the
  35882. // same request ID was received, and if so, will ignore the second
  35883. // request. This prevents clients from accidentally creating duplicate
  35884. // commitments.
  35885. //
  35886. // The request ID must be a valid UUID with the exception that zero UUID
  35887. // is not supported (00000000-0000-0000-0000-000000000000).
  35888. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  35889. c.urlParams_.Set("requestId", requestId)
  35890. return c
  35891. }
  35892. // Fields allows partial responses to be retrieved. See
  35893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35894. // for more information.
  35895. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  35896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35897. return c
  35898. }
  35899. // Context sets the context to be used in this call's Do method. Any
  35900. // pending HTTP request will be aborted if the provided context is
  35901. // canceled.
  35902. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  35903. c.ctx_ = ctx
  35904. return c
  35905. }
  35906. // Header returns an http.Header that can be modified by the caller to
  35907. // add HTTP headers to the request.
  35908. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  35909. if c.header_ == nil {
  35910. c.header_ = make(http.Header)
  35911. }
  35912. return c.header_
  35913. }
  35914. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  35915. reqHeaders := make(http.Header)
  35916. for k, v := range c.header_ {
  35917. reqHeaders[k] = v
  35918. }
  35919. reqHeaders.Set("User-Agent", c.s.userAgent())
  35920. var body io.Reader = nil
  35921. c.urlParams_.Set("alt", alt)
  35922. c.urlParams_.Set("prettyPrint", "false")
  35923. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  35924. urls += "?" + c.urlParams_.Encode()
  35925. req, err := http.NewRequest("POST", urls, body)
  35926. if err != nil {
  35927. return nil, err
  35928. }
  35929. req.Header = reqHeaders
  35930. googleapi.Expand(req.URL, map[string]string{
  35931. "project": c.project,
  35932. "backendBucket": c.backendBucket,
  35933. })
  35934. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35935. }
  35936. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  35937. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35938. // status code is an error. Response headers are in either
  35939. // *Operation.ServerResponse.Header or (if a response was returned at
  35940. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35941. // to check whether the returned error was because
  35942. // http.StatusNotModified was returned.
  35943. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35944. gensupport.SetOptions(c.urlParams_, opts...)
  35945. res, err := c.doRequest("json")
  35946. if res != nil && res.StatusCode == http.StatusNotModified {
  35947. if res.Body != nil {
  35948. res.Body.Close()
  35949. }
  35950. return nil, &googleapi.Error{
  35951. Code: res.StatusCode,
  35952. Header: res.Header,
  35953. }
  35954. }
  35955. if err != nil {
  35956. return nil, err
  35957. }
  35958. defer googleapi.CloseBody(res)
  35959. if err := googleapi.CheckResponse(res); err != nil {
  35960. return nil, err
  35961. }
  35962. ret := &Operation{
  35963. ServerResponse: googleapi.ServerResponse{
  35964. Header: res.Header,
  35965. HTTPStatusCode: res.StatusCode,
  35966. },
  35967. }
  35968. target := &ret
  35969. if err := gensupport.DecodeResponse(target, res); err != nil {
  35970. return nil, err
  35971. }
  35972. return ret, nil
  35973. // {
  35974. // "description": "Deletes a key for validating requests with signed URLs for this backend bucket.",
  35975. // "httpMethod": "POST",
  35976. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  35977. // "parameterOrder": [
  35978. // "project",
  35979. // "backendBucket",
  35980. // "keyName"
  35981. // ],
  35982. // "parameters": {
  35983. // "backendBucket": {
  35984. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  35985. // "location": "path",
  35986. // "required": true,
  35987. // "type": "string"
  35988. // },
  35989. // "keyName": {
  35990. // "description": "The name of the Signed URL Key to delete.",
  35991. // "location": "query",
  35992. // "required": true,
  35993. // "type": "string"
  35994. // },
  35995. // "project": {
  35996. // "description": "Project ID for this request.",
  35997. // "location": "path",
  35998. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35999. // "required": true,
  36000. // "type": "string"
  36001. // },
  36002. // "requestId": {
  36003. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36004. // "location": "query",
  36005. // "type": "string"
  36006. // }
  36007. // },
  36008. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  36009. // "response": {
  36010. // "$ref": "Operation"
  36011. // },
  36012. // "scopes": [
  36013. // "https://www.googleapis.com/auth/cloud-platform",
  36014. // "https://www.googleapis.com/auth/compute"
  36015. // ]
  36016. // }
  36017. }
  36018. // method id "compute.backendBuckets.get":
  36019. type BackendBucketsGetCall struct {
  36020. s *Service
  36021. project string
  36022. backendBucket string
  36023. urlParams_ gensupport.URLParams
  36024. ifNoneMatch_ string
  36025. ctx_ context.Context
  36026. header_ http.Header
  36027. }
  36028. // Get: Returns the specified BackendBucket resource. Gets a list of
  36029. // available backend buckets by making a list() request.
  36030. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  36031. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36032. c.project = project
  36033. c.backendBucket = backendBucket
  36034. return c
  36035. }
  36036. // Fields allows partial responses to be retrieved. See
  36037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36038. // for more information.
  36039. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  36040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36041. return c
  36042. }
  36043. // IfNoneMatch sets the optional parameter which makes the operation
  36044. // fail if the object's ETag matches the given value. This is useful for
  36045. // getting updates only after the object has changed since the last
  36046. // request. Use googleapi.IsNotModified to check whether the response
  36047. // error from Do is the result of In-None-Match.
  36048. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  36049. c.ifNoneMatch_ = entityTag
  36050. return c
  36051. }
  36052. // Context sets the context to be used in this call's Do method. Any
  36053. // pending HTTP request will be aborted if the provided context is
  36054. // canceled.
  36055. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  36056. c.ctx_ = ctx
  36057. return c
  36058. }
  36059. // Header returns an http.Header that can be modified by the caller to
  36060. // add HTTP headers to the request.
  36061. func (c *BackendBucketsGetCall) Header() http.Header {
  36062. if c.header_ == nil {
  36063. c.header_ = make(http.Header)
  36064. }
  36065. return c.header_
  36066. }
  36067. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  36068. reqHeaders := make(http.Header)
  36069. for k, v := range c.header_ {
  36070. reqHeaders[k] = v
  36071. }
  36072. reqHeaders.Set("User-Agent", c.s.userAgent())
  36073. if c.ifNoneMatch_ != "" {
  36074. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36075. }
  36076. var body io.Reader = nil
  36077. c.urlParams_.Set("alt", alt)
  36078. c.urlParams_.Set("prettyPrint", "false")
  36079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  36080. urls += "?" + c.urlParams_.Encode()
  36081. req, err := http.NewRequest("GET", urls, body)
  36082. if err != nil {
  36083. return nil, err
  36084. }
  36085. req.Header = reqHeaders
  36086. googleapi.Expand(req.URL, map[string]string{
  36087. "project": c.project,
  36088. "backendBucket": c.backendBucket,
  36089. })
  36090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36091. }
  36092. // Do executes the "compute.backendBuckets.get" call.
  36093. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  36094. // status code is an error. Response headers are in either
  36095. // *BackendBucket.ServerResponse.Header or (if a response was returned
  36096. // at all) in error.(*googleapi.Error).Header. Use
  36097. // googleapi.IsNotModified to check whether the returned error was
  36098. // because http.StatusNotModified was returned.
  36099. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  36100. gensupport.SetOptions(c.urlParams_, opts...)
  36101. res, err := c.doRequest("json")
  36102. if res != nil && res.StatusCode == http.StatusNotModified {
  36103. if res.Body != nil {
  36104. res.Body.Close()
  36105. }
  36106. return nil, &googleapi.Error{
  36107. Code: res.StatusCode,
  36108. Header: res.Header,
  36109. }
  36110. }
  36111. if err != nil {
  36112. return nil, err
  36113. }
  36114. defer googleapi.CloseBody(res)
  36115. if err := googleapi.CheckResponse(res); err != nil {
  36116. return nil, err
  36117. }
  36118. ret := &BackendBucket{
  36119. ServerResponse: googleapi.ServerResponse{
  36120. Header: res.Header,
  36121. HTTPStatusCode: res.StatusCode,
  36122. },
  36123. }
  36124. target := &ret
  36125. if err := gensupport.DecodeResponse(target, res); err != nil {
  36126. return nil, err
  36127. }
  36128. return ret, nil
  36129. // {
  36130. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  36131. // "httpMethod": "GET",
  36132. // "id": "compute.backendBuckets.get",
  36133. // "parameterOrder": [
  36134. // "project",
  36135. // "backendBucket"
  36136. // ],
  36137. // "parameters": {
  36138. // "backendBucket": {
  36139. // "description": "Name of the BackendBucket resource to return.",
  36140. // "location": "path",
  36141. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36142. // "required": true,
  36143. // "type": "string"
  36144. // },
  36145. // "project": {
  36146. // "description": "Project ID for this request.",
  36147. // "location": "path",
  36148. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36149. // "required": true,
  36150. // "type": "string"
  36151. // }
  36152. // },
  36153. // "path": "{project}/global/backendBuckets/{backendBucket}",
  36154. // "response": {
  36155. // "$ref": "BackendBucket"
  36156. // },
  36157. // "scopes": [
  36158. // "https://www.googleapis.com/auth/cloud-platform",
  36159. // "https://www.googleapis.com/auth/compute",
  36160. // "https://www.googleapis.com/auth/compute.readonly"
  36161. // ]
  36162. // }
  36163. }
  36164. // method id "compute.backendBuckets.insert":
  36165. type BackendBucketsInsertCall struct {
  36166. s *Service
  36167. project string
  36168. backendbucket *BackendBucket
  36169. urlParams_ gensupport.URLParams
  36170. ctx_ context.Context
  36171. header_ http.Header
  36172. }
  36173. // Insert: Creates a BackendBucket resource in the specified project
  36174. // using the data included in the request.
  36175. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  36176. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36177. c.project = project
  36178. c.backendbucket = backendbucket
  36179. return c
  36180. }
  36181. // RequestId sets the optional parameter "requestId": An optional
  36182. // request ID to identify requests. Specify a unique request ID so that
  36183. // if you must retry your request, the server will know to ignore the
  36184. // request if it has already been completed.
  36185. //
  36186. // For example, consider a situation where you make an initial request
  36187. // and the request times out. If you make the request again with the
  36188. // same request ID, the server can check if original operation with the
  36189. // same request ID was received, and if so, will ignore the second
  36190. // request. This prevents clients from accidentally creating duplicate
  36191. // commitments.
  36192. //
  36193. // The request ID must be a valid UUID with the exception that zero UUID
  36194. // is not supported (00000000-0000-0000-0000-000000000000).
  36195. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  36196. c.urlParams_.Set("requestId", requestId)
  36197. return c
  36198. }
  36199. // Fields allows partial responses to be retrieved. See
  36200. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36201. // for more information.
  36202. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  36203. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36204. return c
  36205. }
  36206. // Context sets the context to be used in this call's Do method. Any
  36207. // pending HTTP request will be aborted if the provided context is
  36208. // canceled.
  36209. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  36210. c.ctx_ = ctx
  36211. return c
  36212. }
  36213. // Header returns an http.Header that can be modified by the caller to
  36214. // add HTTP headers to the request.
  36215. func (c *BackendBucketsInsertCall) Header() http.Header {
  36216. if c.header_ == nil {
  36217. c.header_ = make(http.Header)
  36218. }
  36219. return c.header_
  36220. }
  36221. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  36222. reqHeaders := make(http.Header)
  36223. for k, v := range c.header_ {
  36224. reqHeaders[k] = v
  36225. }
  36226. reqHeaders.Set("User-Agent", c.s.userAgent())
  36227. var body io.Reader = nil
  36228. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  36229. if err != nil {
  36230. return nil, err
  36231. }
  36232. reqHeaders.Set("Content-Type", "application/json")
  36233. c.urlParams_.Set("alt", alt)
  36234. c.urlParams_.Set("prettyPrint", "false")
  36235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  36236. urls += "?" + c.urlParams_.Encode()
  36237. req, err := http.NewRequest("POST", urls, body)
  36238. if err != nil {
  36239. return nil, err
  36240. }
  36241. req.Header = reqHeaders
  36242. googleapi.Expand(req.URL, map[string]string{
  36243. "project": c.project,
  36244. })
  36245. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36246. }
  36247. // Do executes the "compute.backendBuckets.insert" call.
  36248. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36249. // status code is an error. Response headers are in either
  36250. // *Operation.ServerResponse.Header or (if a response was returned at
  36251. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36252. // to check whether the returned error was because
  36253. // http.StatusNotModified was returned.
  36254. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36255. gensupport.SetOptions(c.urlParams_, opts...)
  36256. res, err := c.doRequest("json")
  36257. if res != nil && res.StatusCode == http.StatusNotModified {
  36258. if res.Body != nil {
  36259. res.Body.Close()
  36260. }
  36261. return nil, &googleapi.Error{
  36262. Code: res.StatusCode,
  36263. Header: res.Header,
  36264. }
  36265. }
  36266. if err != nil {
  36267. return nil, err
  36268. }
  36269. defer googleapi.CloseBody(res)
  36270. if err := googleapi.CheckResponse(res); err != nil {
  36271. return nil, err
  36272. }
  36273. ret := &Operation{
  36274. ServerResponse: googleapi.ServerResponse{
  36275. Header: res.Header,
  36276. HTTPStatusCode: res.StatusCode,
  36277. },
  36278. }
  36279. target := &ret
  36280. if err := gensupport.DecodeResponse(target, res); err != nil {
  36281. return nil, err
  36282. }
  36283. return ret, nil
  36284. // {
  36285. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  36286. // "httpMethod": "POST",
  36287. // "id": "compute.backendBuckets.insert",
  36288. // "parameterOrder": [
  36289. // "project"
  36290. // ],
  36291. // "parameters": {
  36292. // "project": {
  36293. // "description": "Project ID for this request.",
  36294. // "location": "path",
  36295. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36296. // "required": true,
  36297. // "type": "string"
  36298. // },
  36299. // "requestId": {
  36300. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36301. // "location": "query",
  36302. // "type": "string"
  36303. // }
  36304. // },
  36305. // "path": "{project}/global/backendBuckets",
  36306. // "request": {
  36307. // "$ref": "BackendBucket"
  36308. // },
  36309. // "response": {
  36310. // "$ref": "Operation"
  36311. // },
  36312. // "scopes": [
  36313. // "https://www.googleapis.com/auth/cloud-platform",
  36314. // "https://www.googleapis.com/auth/compute"
  36315. // ]
  36316. // }
  36317. }
  36318. // method id "compute.backendBuckets.list":
  36319. type BackendBucketsListCall struct {
  36320. s *Service
  36321. project string
  36322. urlParams_ gensupport.URLParams
  36323. ifNoneMatch_ string
  36324. ctx_ context.Context
  36325. header_ http.Header
  36326. }
  36327. // List: Retrieves the list of BackendBucket resources available to the
  36328. // specified project.
  36329. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  36330. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36331. c.project = project
  36332. return c
  36333. }
  36334. // Filter sets the optional parameter "filter": A filter expression that
  36335. // filters resources listed in the response. The expression must specify
  36336. // the field name, a comparison operator, and the value that you want to
  36337. // use for filtering. The value must be a string, a number, or a
  36338. // boolean. The comparison operator must be either =, !=, >, or <.
  36339. //
  36340. // For example, if you are filtering Compute Engine instances, you can
  36341. // exclude instances named example-instance by specifying name !=
  36342. // example-instance.
  36343. //
  36344. // You can also filter nested fields. For example, you could specify
  36345. // scheduling.automaticRestart = false to include instances only if they
  36346. // are not scheduled for automatic restarts. You can use filtering on
  36347. // nested fields to filter based on resource labels.
  36348. //
  36349. // To filter on multiple expressions, provide each separate expression
  36350. // within parentheses. For example, (scheduling.automaticRestart = true)
  36351. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  36352. // AND expression. However, you can include AND and OR expressions
  36353. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  36354. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  36355. // true).
  36356. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  36357. c.urlParams_.Set("filter", filter)
  36358. return c
  36359. }
  36360. // MaxResults sets the optional parameter "maxResults": The maximum
  36361. // number of results per page that should be returned. If the number of
  36362. // available results is larger than maxResults, Compute Engine returns a
  36363. // nextPageToken that can be used to get the next page of results in
  36364. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  36365. // (Default: 500)
  36366. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  36367. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36368. return c
  36369. }
  36370. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36371. // a certain order. By default, results are returned in alphanumerical
  36372. // order based on the resource name.
  36373. //
  36374. // You can also sort results in descending order based on the creation
  36375. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36376. // based on the creationTimestamp field in reverse chronological order
  36377. // (newest result first). Use this to sort resources like operations so
  36378. // that the newest operation is returned first.
  36379. //
  36380. // Currently, only sorting by name or creationTimestamp desc is
  36381. // supported.
  36382. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  36383. c.urlParams_.Set("orderBy", orderBy)
  36384. return c
  36385. }
  36386. // PageToken sets the optional parameter "pageToken": Specifies a page
  36387. // token to use. Set pageToken to the nextPageToken returned by a
  36388. // previous list request to get the next page of results.
  36389. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  36390. c.urlParams_.Set("pageToken", pageToken)
  36391. return c
  36392. }
  36393. // Fields allows partial responses to be retrieved. See
  36394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36395. // for more information.
  36396. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  36397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36398. return c
  36399. }
  36400. // IfNoneMatch sets the optional parameter which makes the operation
  36401. // fail if the object's ETag matches the given value. This is useful for
  36402. // getting updates only after the object has changed since the last
  36403. // request. Use googleapi.IsNotModified to check whether the response
  36404. // error from Do is the result of In-None-Match.
  36405. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  36406. c.ifNoneMatch_ = entityTag
  36407. return c
  36408. }
  36409. // Context sets the context to be used in this call's Do method. Any
  36410. // pending HTTP request will be aborted if the provided context is
  36411. // canceled.
  36412. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  36413. c.ctx_ = ctx
  36414. return c
  36415. }
  36416. // Header returns an http.Header that can be modified by the caller to
  36417. // add HTTP headers to the request.
  36418. func (c *BackendBucketsListCall) Header() http.Header {
  36419. if c.header_ == nil {
  36420. c.header_ = make(http.Header)
  36421. }
  36422. return c.header_
  36423. }
  36424. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  36425. reqHeaders := make(http.Header)
  36426. for k, v := range c.header_ {
  36427. reqHeaders[k] = v
  36428. }
  36429. reqHeaders.Set("User-Agent", c.s.userAgent())
  36430. if c.ifNoneMatch_ != "" {
  36431. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36432. }
  36433. var body io.Reader = nil
  36434. c.urlParams_.Set("alt", alt)
  36435. c.urlParams_.Set("prettyPrint", "false")
  36436. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  36437. urls += "?" + c.urlParams_.Encode()
  36438. req, err := http.NewRequest("GET", urls, body)
  36439. if err != nil {
  36440. return nil, err
  36441. }
  36442. req.Header = reqHeaders
  36443. googleapi.Expand(req.URL, map[string]string{
  36444. "project": c.project,
  36445. })
  36446. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36447. }
  36448. // Do executes the "compute.backendBuckets.list" call.
  36449. // Exactly one of *BackendBucketList or error will be non-nil. Any
  36450. // non-2xx status code is an error. Response headers are in either
  36451. // *BackendBucketList.ServerResponse.Header or (if a response was
  36452. // returned at all) in error.(*googleapi.Error).Header. Use
  36453. // googleapi.IsNotModified to check whether the returned error was
  36454. // because http.StatusNotModified was returned.
  36455. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  36456. gensupport.SetOptions(c.urlParams_, opts...)
  36457. res, err := c.doRequest("json")
  36458. if res != nil && res.StatusCode == http.StatusNotModified {
  36459. if res.Body != nil {
  36460. res.Body.Close()
  36461. }
  36462. return nil, &googleapi.Error{
  36463. Code: res.StatusCode,
  36464. Header: res.Header,
  36465. }
  36466. }
  36467. if err != nil {
  36468. return nil, err
  36469. }
  36470. defer googleapi.CloseBody(res)
  36471. if err := googleapi.CheckResponse(res); err != nil {
  36472. return nil, err
  36473. }
  36474. ret := &BackendBucketList{
  36475. ServerResponse: googleapi.ServerResponse{
  36476. Header: res.Header,
  36477. HTTPStatusCode: res.StatusCode,
  36478. },
  36479. }
  36480. target := &ret
  36481. if err := gensupport.DecodeResponse(target, res); err != nil {
  36482. return nil, err
  36483. }
  36484. return ret, nil
  36485. // {
  36486. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  36487. // "httpMethod": "GET",
  36488. // "id": "compute.backendBuckets.list",
  36489. // "parameterOrder": [
  36490. // "project"
  36491. // ],
  36492. // "parameters": {
  36493. // "filter": {
  36494. // "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).",
  36495. // "location": "query",
  36496. // "type": "string"
  36497. // },
  36498. // "maxResults": {
  36499. // "default": "500",
  36500. // "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)",
  36501. // "format": "uint32",
  36502. // "location": "query",
  36503. // "minimum": "0",
  36504. // "type": "integer"
  36505. // },
  36506. // "orderBy": {
  36507. // "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.",
  36508. // "location": "query",
  36509. // "type": "string"
  36510. // },
  36511. // "pageToken": {
  36512. // "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.",
  36513. // "location": "query",
  36514. // "type": "string"
  36515. // },
  36516. // "project": {
  36517. // "description": "Project ID for this request.",
  36518. // "location": "path",
  36519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36520. // "required": true,
  36521. // "type": "string"
  36522. // }
  36523. // },
  36524. // "path": "{project}/global/backendBuckets",
  36525. // "response": {
  36526. // "$ref": "BackendBucketList"
  36527. // },
  36528. // "scopes": [
  36529. // "https://www.googleapis.com/auth/cloud-platform",
  36530. // "https://www.googleapis.com/auth/compute",
  36531. // "https://www.googleapis.com/auth/compute.readonly"
  36532. // ]
  36533. // }
  36534. }
  36535. // Pages invokes f for each page of results.
  36536. // A non-nil error returned from f will halt the iteration.
  36537. // The provided context supersedes any context provided to the Context method.
  36538. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  36539. c.ctx_ = ctx
  36540. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36541. for {
  36542. x, err := c.Do()
  36543. if err != nil {
  36544. return err
  36545. }
  36546. if err := f(x); err != nil {
  36547. return err
  36548. }
  36549. if x.NextPageToken == "" {
  36550. return nil
  36551. }
  36552. c.PageToken(x.NextPageToken)
  36553. }
  36554. }
  36555. // method id "compute.backendBuckets.patch":
  36556. type BackendBucketsPatchCall struct {
  36557. s *Service
  36558. project string
  36559. backendBucket string
  36560. backendbucket *BackendBucket
  36561. urlParams_ gensupport.URLParams
  36562. ctx_ context.Context
  36563. header_ http.Header
  36564. }
  36565. // Patch: Updates the specified BackendBucket resource with the data
  36566. // included in the request. This method supports PATCH semantics and
  36567. // uses the JSON merge patch format and processing rules.
  36568. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  36569. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36570. c.project = project
  36571. c.backendBucket = backendBucket
  36572. c.backendbucket = backendbucket
  36573. return c
  36574. }
  36575. // RequestId sets the optional parameter "requestId": An optional
  36576. // request ID to identify requests. Specify a unique request ID so that
  36577. // if you must retry your request, the server will know to ignore the
  36578. // request if it has already been completed.
  36579. //
  36580. // For example, consider a situation where you make an initial request
  36581. // and the request times out. If you make the request again with the
  36582. // same request ID, the server can check if original operation with the
  36583. // same request ID was received, and if so, will ignore the second
  36584. // request. This prevents clients from accidentally creating duplicate
  36585. // commitments.
  36586. //
  36587. // The request ID must be a valid UUID with the exception that zero UUID
  36588. // is not supported (00000000-0000-0000-0000-000000000000).
  36589. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  36590. c.urlParams_.Set("requestId", requestId)
  36591. return c
  36592. }
  36593. // Fields allows partial responses to be retrieved. See
  36594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36595. // for more information.
  36596. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  36597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36598. return c
  36599. }
  36600. // Context sets the context to be used in this call's Do method. Any
  36601. // pending HTTP request will be aborted if the provided context is
  36602. // canceled.
  36603. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  36604. c.ctx_ = ctx
  36605. return c
  36606. }
  36607. // Header returns an http.Header that can be modified by the caller to
  36608. // add HTTP headers to the request.
  36609. func (c *BackendBucketsPatchCall) Header() http.Header {
  36610. if c.header_ == nil {
  36611. c.header_ = make(http.Header)
  36612. }
  36613. return c.header_
  36614. }
  36615. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  36616. reqHeaders := make(http.Header)
  36617. for k, v := range c.header_ {
  36618. reqHeaders[k] = v
  36619. }
  36620. reqHeaders.Set("User-Agent", c.s.userAgent())
  36621. var body io.Reader = nil
  36622. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  36623. if err != nil {
  36624. return nil, err
  36625. }
  36626. reqHeaders.Set("Content-Type", "application/json")
  36627. c.urlParams_.Set("alt", alt)
  36628. c.urlParams_.Set("prettyPrint", "false")
  36629. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  36630. urls += "?" + c.urlParams_.Encode()
  36631. req, err := http.NewRequest("PATCH", urls, body)
  36632. if err != nil {
  36633. return nil, err
  36634. }
  36635. req.Header = reqHeaders
  36636. googleapi.Expand(req.URL, map[string]string{
  36637. "project": c.project,
  36638. "backendBucket": c.backendBucket,
  36639. })
  36640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36641. }
  36642. // Do executes the "compute.backendBuckets.patch" call.
  36643. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36644. // status code is an error. Response headers are in either
  36645. // *Operation.ServerResponse.Header or (if a response was returned at
  36646. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36647. // to check whether the returned error was because
  36648. // http.StatusNotModified was returned.
  36649. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36650. gensupport.SetOptions(c.urlParams_, opts...)
  36651. res, err := c.doRequest("json")
  36652. if res != nil && res.StatusCode == http.StatusNotModified {
  36653. if res.Body != nil {
  36654. res.Body.Close()
  36655. }
  36656. return nil, &googleapi.Error{
  36657. Code: res.StatusCode,
  36658. Header: res.Header,
  36659. }
  36660. }
  36661. if err != nil {
  36662. return nil, err
  36663. }
  36664. defer googleapi.CloseBody(res)
  36665. if err := googleapi.CheckResponse(res); err != nil {
  36666. return nil, err
  36667. }
  36668. ret := &Operation{
  36669. ServerResponse: googleapi.ServerResponse{
  36670. Header: res.Header,
  36671. HTTPStatusCode: res.StatusCode,
  36672. },
  36673. }
  36674. target := &ret
  36675. if err := gensupport.DecodeResponse(target, res); err != nil {
  36676. return nil, err
  36677. }
  36678. return ret, nil
  36679. // {
  36680. // "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.",
  36681. // "httpMethod": "PATCH",
  36682. // "id": "compute.backendBuckets.patch",
  36683. // "parameterOrder": [
  36684. // "project",
  36685. // "backendBucket"
  36686. // ],
  36687. // "parameters": {
  36688. // "backendBucket": {
  36689. // "description": "Name of the BackendBucket resource to patch.",
  36690. // "location": "path",
  36691. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36692. // "required": true,
  36693. // "type": "string"
  36694. // },
  36695. // "project": {
  36696. // "description": "Project ID for this request.",
  36697. // "location": "path",
  36698. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36699. // "required": true,
  36700. // "type": "string"
  36701. // },
  36702. // "requestId": {
  36703. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36704. // "location": "query",
  36705. // "type": "string"
  36706. // }
  36707. // },
  36708. // "path": "{project}/global/backendBuckets/{backendBucket}",
  36709. // "request": {
  36710. // "$ref": "BackendBucket"
  36711. // },
  36712. // "response": {
  36713. // "$ref": "Operation"
  36714. // },
  36715. // "scopes": [
  36716. // "https://www.googleapis.com/auth/cloud-platform",
  36717. // "https://www.googleapis.com/auth/compute"
  36718. // ]
  36719. // }
  36720. }
  36721. // method id "compute.backendBuckets.update":
  36722. type BackendBucketsUpdateCall struct {
  36723. s *Service
  36724. project string
  36725. backendBucket string
  36726. backendbucket *BackendBucket
  36727. urlParams_ gensupport.URLParams
  36728. ctx_ context.Context
  36729. header_ http.Header
  36730. }
  36731. // Update: Updates the specified BackendBucket resource with the data
  36732. // included in the request.
  36733. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  36734. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36735. c.project = project
  36736. c.backendBucket = backendBucket
  36737. c.backendbucket = backendbucket
  36738. return c
  36739. }
  36740. // RequestId sets the optional parameter "requestId": An optional
  36741. // request ID to identify requests. Specify a unique request ID so that
  36742. // if you must retry your request, the server will know to ignore the
  36743. // request if it has already been completed.
  36744. //
  36745. // For example, consider a situation where you make an initial request
  36746. // and the request times out. If you make the request again with the
  36747. // same request ID, the server can check if original operation with the
  36748. // same request ID was received, and if so, will ignore the second
  36749. // request. This prevents clients from accidentally creating duplicate
  36750. // commitments.
  36751. //
  36752. // The request ID must be a valid UUID with the exception that zero UUID
  36753. // is not supported (00000000-0000-0000-0000-000000000000).
  36754. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  36755. c.urlParams_.Set("requestId", requestId)
  36756. return c
  36757. }
  36758. // Fields allows partial responses to be retrieved. See
  36759. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36760. // for more information.
  36761. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  36762. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36763. return c
  36764. }
  36765. // Context sets the context to be used in this call's Do method. Any
  36766. // pending HTTP request will be aborted if the provided context is
  36767. // canceled.
  36768. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  36769. c.ctx_ = ctx
  36770. return c
  36771. }
  36772. // Header returns an http.Header that can be modified by the caller to
  36773. // add HTTP headers to the request.
  36774. func (c *BackendBucketsUpdateCall) Header() http.Header {
  36775. if c.header_ == nil {
  36776. c.header_ = make(http.Header)
  36777. }
  36778. return c.header_
  36779. }
  36780. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  36781. reqHeaders := make(http.Header)
  36782. for k, v := range c.header_ {
  36783. reqHeaders[k] = v
  36784. }
  36785. reqHeaders.Set("User-Agent", c.s.userAgent())
  36786. var body io.Reader = nil
  36787. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  36788. if err != nil {
  36789. return nil, err
  36790. }
  36791. reqHeaders.Set("Content-Type", "application/json")
  36792. c.urlParams_.Set("alt", alt)
  36793. c.urlParams_.Set("prettyPrint", "false")
  36794. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  36795. urls += "?" + c.urlParams_.Encode()
  36796. req, err := http.NewRequest("PUT", urls, body)
  36797. if err != nil {
  36798. return nil, err
  36799. }
  36800. req.Header = reqHeaders
  36801. googleapi.Expand(req.URL, map[string]string{
  36802. "project": c.project,
  36803. "backendBucket": c.backendBucket,
  36804. })
  36805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36806. }
  36807. // Do executes the "compute.backendBuckets.update" call.
  36808. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36809. // status code is an error. Response headers are in either
  36810. // *Operation.ServerResponse.Header or (if a response was returned at
  36811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36812. // to check whether the returned error was because
  36813. // http.StatusNotModified was returned.
  36814. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36815. gensupport.SetOptions(c.urlParams_, opts...)
  36816. res, err := c.doRequest("json")
  36817. if res != nil && res.StatusCode == http.StatusNotModified {
  36818. if res.Body != nil {
  36819. res.Body.Close()
  36820. }
  36821. return nil, &googleapi.Error{
  36822. Code: res.StatusCode,
  36823. Header: res.Header,
  36824. }
  36825. }
  36826. if err != nil {
  36827. return nil, err
  36828. }
  36829. defer googleapi.CloseBody(res)
  36830. if err := googleapi.CheckResponse(res); err != nil {
  36831. return nil, err
  36832. }
  36833. ret := &Operation{
  36834. ServerResponse: googleapi.ServerResponse{
  36835. Header: res.Header,
  36836. HTTPStatusCode: res.StatusCode,
  36837. },
  36838. }
  36839. target := &ret
  36840. if err := gensupport.DecodeResponse(target, res); err != nil {
  36841. return nil, err
  36842. }
  36843. return ret, nil
  36844. // {
  36845. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  36846. // "httpMethod": "PUT",
  36847. // "id": "compute.backendBuckets.update",
  36848. // "parameterOrder": [
  36849. // "project",
  36850. // "backendBucket"
  36851. // ],
  36852. // "parameters": {
  36853. // "backendBucket": {
  36854. // "description": "Name of the BackendBucket resource to update.",
  36855. // "location": "path",
  36856. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36857. // "required": true,
  36858. // "type": "string"
  36859. // },
  36860. // "project": {
  36861. // "description": "Project ID for this request.",
  36862. // "location": "path",
  36863. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36864. // "required": true,
  36865. // "type": "string"
  36866. // },
  36867. // "requestId": {
  36868. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36869. // "location": "query",
  36870. // "type": "string"
  36871. // }
  36872. // },
  36873. // "path": "{project}/global/backendBuckets/{backendBucket}",
  36874. // "request": {
  36875. // "$ref": "BackendBucket"
  36876. // },
  36877. // "response": {
  36878. // "$ref": "Operation"
  36879. // },
  36880. // "scopes": [
  36881. // "https://www.googleapis.com/auth/cloud-platform",
  36882. // "https://www.googleapis.com/auth/compute"
  36883. // ]
  36884. // }
  36885. }
  36886. // method id "compute.backendServices.addSignedUrlKey":
  36887. type BackendServicesAddSignedUrlKeyCall struct {
  36888. s *Service
  36889. project string
  36890. backendService string
  36891. signedurlkey *SignedUrlKey
  36892. urlParams_ gensupport.URLParams
  36893. ctx_ context.Context
  36894. header_ http.Header
  36895. }
  36896. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  36897. // for this backend service.
  36898. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  36899. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36900. c.project = project
  36901. c.backendService = backendService
  36902. c.signedurlkey = signedurlkey
  36903. return c
  36904. }
  36905. // RequestId sets the optional parameter "requestId": An optional
  36906. // request ID to identify requests. Specify a unique request ID so that
  36907. // if you must retry your request, the server will know to ignore the
  36908. // request if it has already been completed.
  36909. //
  36910. // For example, consider a situation where you make an initial request
  36911. // and the request times out. If you make the request again with the
  36912. // same request ID, the server can check if original operation with the
  36913. // same request ID was received, and if so, will ignore the second
  36914. // request. This prevents clients from accidentally creating duplicate
  36915. // commitments.
  36916. //
  36917. // The request ID must be a valid UUID with the exception that zero UUID
  36918. // is not supported (00000000-0000-0000-0000-000000000000).
  36919. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  36920. c.urlParams_.Set("requestId", requestId)
  36921. return c
  36922. }
  36923. // Fields allows partial responses to be retrieved. See
  36924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36925. // for more information.
  36926. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  36927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36928. return c
  36929. }
  36930. // Context sets the context to be used in this call's Do method. Any
  36931. // pending HTTP request will be aborted if the provided context is
  36932. // canceled.
  36933. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  36934. c.ctx_ = ctx
  36935. return c
  36936. }
  36937. // Header returns an http.Header that can be modified by the caller to
  36938. // add HTTP headers to the request.
  36939. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  36940. if c.header_ == nil {
  36941. c.header_ = make(http.Header)
  36942. }
  36943. return c.header_
  36944. }
  36945. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  36946. reqHeaders := make(http.Header)
  36947. for k, v := range c.header_ {
  36948. reqHeaders[k] = v
  36949. }
  36950. reqHeaders.Set("User-Agent", c.s.userAgent())
  36951. var body io.Reader = nil
  36952. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  36953. if err != nil {
  36954. return nil, err
  36955. }
  36956. reqHeaders.Set("Content-Type", "application/json")
  36957. c.urlParams_.Set("alt", alt)
  36958. c.urlParams_.Set("prettyPrint", "false")
  36959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  36960. urls += "?" + c.urlParams_.Encode()
  36961. req, err := http.NewRequest("POST", urls, body)
  36962. if err != nil {
  36963. return nil, err
  36964. }
  36965. req.Header = reqHeaders
  36966. googleapi.Expand(req.URL, map[string]string{
  36967. "project": c.project,
  36968. "backendService": c.backendService,
  36969. })
  36970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36971. }
  36972. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  36973. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36974. // status code is an error. Response headers are in either
  36975. // *Operation.ServerResponse.Header or (if a response was returned at
  36976. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36977. // to check whether the returned error was because
  36978. // http.StatusNotModified was returned.
  36979. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36980. gensupport.SetOptions(c.urlParams_, opts...)
  36981. res, err := c.doRequest("json")
  36982. if res != nil && res.StatusCode == http.StatusNotModified {
  36983. if res.Body != nil {
  36984. res.Body.Close()
  36985. }
  36986. return nil, &googleapi.Error{
  36987. Code: res.StatusCode,
  36988. Header: res.Header,
  36989. }
  36990. }
  36991. if err != nil {
  36992. return nil, err
  36993. }
  36994. defer googleapi.CloseBody(res)
  36995. if err := googleapi.CheckResponse(res); err != nil {
  36996. return nil, err
  36997. }
  36998. ret := &Operation{
  36999. ServerResponse: googleapi.ServerResponse{
  37000. Header: res.Header,
  37001. HTTPStatusCode: res.StatusCode,
  37002. },
  37003. }
  37004. target := &ret
  37005. if err := gensupport.DecodeResponse(target, res); err != nil {
  37006. return nil, err
  37007. }
  37008. return ret, nil
  37009. // {
  37010. // "description": "Adds a key for validating requests with signed URLs for this backend service.",
  37011. // "httpMethod": "POST",
  37012. // "id": "compute.backendServices.addSignedUrlKey",
  37013. // "parameterOrder": [
  37014. // "project",
  37015. // "backendService"
  37016. // ],
  37017. // "parameters": {
  37018. // "backendService": {
  37019. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  37020. // "location": "path",
  37021. // "required": true,
  37022. // "type": "string"
  37023. // },
  37024. // "project": {
  37025. // "description": "Project ID for this request.",
  37026. // "location": "path",
  37027. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37028. // "required": true,
  37029. // "type": "string"
  37030. // },
  37031. // "requestId": {
  37032. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37033. // "location": "query",
  37034. // "type": "string"
  37035. // }
  37036. // },
  37037. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  37038. // "request": {
  37039. // "$ref": "SignedUrlKey"
  37040. // },
  37041. // "response": {
  37042. // "$ref": "Operation"
  37043. // },
  37044. // "scopes": [
  37045. // "https://www.googleapis.com/auth/cloud-platform",
  37046. // "https://www.googleapis.com/auth/compute"
  37047. // ]
  37048. // }
  37049. }
  37050. // method id "compute.backendServices.aggregatedList":
  37051. type BackendServicesAggregatedListCall struct {
  37052. s *Service
  37053. project string
  37054. urlParams_ gensupport.URLParams
  37055. ifNoneMatch_ string
  37056. ctx_ context.Context
  37057. header_ http.Header
  37058. }
  37059. // AggregatedList: Retrieves the list of all BackendService resources,
  37060. // regional and global, available to the specified project.
  37061. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  37062. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37063. c.project = project
  37064. return c
  37065. }
  37066. // Filter sets the optional parameter "filter": A filter expression that
  37067. // filters resources listed in the response. The expression must specify
  37068. // the field name, a comparison operator, and the value that you want to
  37069. // use for filtering. The value must be a string, a number, or a
  37070. // boolean. The comparison operator must be either =, !=, >, or <.
  37071. //
  37072. // For example, if you are filtering Compute Engine instances, you can
  37073. // exclude instances named example-instance by specifying name !=
  37074. // example-instance.
  37075. //
  37076. // You can also filter nested fields. For example, you could specify
  37077. // scheduling.automaticRestart = false to include instances only if they
  37078. // are not scheduled for automatic restarts. You can use filtering on
  37079. // nested fields to filter based on resource labels.
  37080. //
  37081. // To filter on multiple expressions, provide each separate expression
  37082. // within parentheses. For example, (scheduling.automaticRestart = true)
  37083. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37084. // AND expression. However, you can include AND and OR expressions
  37085. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37086. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37087. // true).
  37088. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  37089. c.urlParams_.Set("filter", filter)
  37090. return c
  37091. }
  37092. // MaxResults sets the optional parameter "maxResults": The maximum
  37093. // number of results per page that should be returned. If the number of
  37094. // available results is larger than maxResults, Compute Engine returns a
  37095. // nextPageToken that can be used to get the next page of results in
  37096. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37097. // (Default: 500)
  37098. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  37099. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37100. return c
  37101. }
  37102. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37103. // a certain order. By default, results are returned in alphanumerical
  37104. // order based on the resource name.
  37105. //
  37106. // You can also sort results in descending order based on the creation
  37107. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37108. // based on the creationTimestamp field in reverse chronological order
  37109. // (newest result first). Use this to sort resources like operations so
  37110. // that the newest operation is returned first.
  37111. //
  37112. // Currently, only sorting by name or creationTimestamp desc is
  37113. // supported.
  37114. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  37115. c.urlParams_.Set("orderBy", orderBy)
  37116. return c
  37117. }
  37118. // PageToken sets the optional parameter "pageToken": Specifies a page
  37119. // token to use. Set pageToken to the nextPageToken returned by a
  37120. // previous list request to get the next page of results.
  37121. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  37122. c.urlParams_.Set("pageToken", pageToken)
  37123. return c
  37124. }
  37125. // Fields allows partial responses to be retrieved. See
  37126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37127. // for more information.
  37128. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  37129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37130. return c
  37131. }
  37132. // IfNoneMatch sets the optional parameter which makes the operation
  37133. // fail if the object's ETag matches the given value. This is useful for
  37134. // getting updates only after the object has changed since the last
  37135. // request. Use googleapi.IsNotModified to check whether the response
  37136. // error from Do is the result of In-None-Match.
  37137. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  37138. c.ifNoneMatch_ = entityTag
  37139. return c
  37140. }
  37141. // Context sets the context to be used in this call's Do method. Any
  37142. // pending HTTP request will be aborted if the provided context is
  37143. // canceled.
  37144. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  37145. c.ctx_ = ctx
  37146. return c
  37147. }
  37148. // Header returns an http.Header that can be modified by the caller to
  37149. // add HTTP headers to the request.
  37150. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  37151. if c.header_ == nil {
  37152. c.header_ = make(http.Header)
  37153. }
  37154. return c.header_
  37155. }
  37156. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  37157. reqHeaders := make(http.Header)
  37158. for k, v := range c.header_ {
  37159. reqHeaders[k] = v
  37160. }
  37161. reqHeaders.Set("User-Agent", c.s.userAgent())
  37162. if c.ifNoneMatch_ != "" {
  37163. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37164. }
  37165. var body io.Reader = nil
  37166. c.urlParams_.Set("alt", alt)
  37167. c.urlParams_.Set("prettyPrint", "false")
  37168. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  37169. urls += "?" + c.urlParams_.Encode()
  37170. req, err := http.NewRequest("GET", urls, body)
  37171. if err != nil {
  37172. return nil, err
  37173. }
  37174. req.Header = reqHeaders
  37175. googleapi.Expand(req.URL, map[string]string{
  37176. "project": c.project,
  37177. })
  37178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37179. }
  37180. // Do executes the "compute.backendServices.aggregatedList" call.
  37181. // Exactly one of *BackendServiceAggregatedList or error will be
  37182. // non-nil. Any non-2xx status code is an error. Response headers are in
  37183. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  37184. // response was returned at all) in error.(*googleapi.Error).Header. Use
  37185. // googleapi.IsNotModified to check whether the returned error was
  37186. // because http.StatusNotModified was returned.
  37187. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  37188. gensupport.SetOptions(c.urlParams_, opts...)
  37189. res, err := c.doRequest("json")
  37190. if res != nil && res.StatusCode == http.StatusNotModified {
  37191. if res.Body != nil {
  37192. res.Body.Close()
  37193. }
  37194. return nil, &googleapi.Error{
  37195. Code: res.StatusCode,
  37196. Header: res.Header,
  37197. }
  37198. }
  37199. if err != nil {
  37200. return nil, err
  37201. }
  37202. defer googleapi.CloseBody(res)
  37203. if err := googleapi.CheckResponse(res); err != nil {
  37204. return nil, err
  37205. }
  37206. ret := &BackendServiceAggregatedList{
  37207. ServerResponse: googleapi.ServerResponse{
  37208. Header: res.Header,
  37209. HTTPStatusCode: res.StatusCode,
  37210. },
  37211. }
  37212. target := &ret
  37213. if err := gensupport.DecodeResponse(target, res); err != nil {
  37214. return nil, err
  37215. }
  37216. return ret, nil
  37217. // {
  37218. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  37219. // "httpMethod": "GET",
  37220. // "id": "compute.backendServices.aggregatedList",
  37221. // "parameterOrder": [
  37222. // "project"
  37223. // ],
  37224. // "parameters": {
  37225. // "filter": {
  37226. // "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).",
  37227. // "location": "query",
  37228. // "type": "string"
  37229. // },
  37230. // "maxResults": {
  37231. // "default": "500",
  37232. // "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)",
  37233. // "format": "uint32",
  37234. // "location": "query",
  37235. // "minimum": "0",
  37236. // "type": "integer"
  37237. // },
  37238. // "orderBy": {
  37239. // "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.",
  37240. // "location": "query",
  37241. // "type": "string"
  37242. // },
  37243. // "pageToken": {
  37244. // "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.",
  37245. // "location": "query",
  37246. // "type": "string"
  37247. // },
  37248. // "project": {
  37249. // "description": "Name of the project scoping this request.",
  37250. // "location": "path",
  37251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37252. // "required": true,
  37253. // "type": "string"
  37254. // }
  37255. // },
  37256. // "path": "{project}/aggregated/backendServices",
  37257. // "response": {
  37258. // "$ref": "BackendServiceAggregatedList"
  37259. // },
  37260. // "scopes": [
  37261. // "https://www.googleapis.com/auth/cloud-platform",
  37262. // "https://www.googleapis.com/auth/compute",
  37263. // "https://www.googleapis.com/auth/compute.readonly"
  37264. // ]
  37265. // }
  37266. }
  37267. // Pages invokes f for each page of results.
  37268. // A non-nil error returned from f will halt the iteration.
  37269. // The provided context supersedes any context provided to the Context method.
  37270. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  37271. c.ctx_ = ctx
  37272. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37273. for {
  37274. x, err := c.Do()
  37275. if err != nil {
  37276. return err
  37277. }
  37278. if err := f(x); err != nil {
  37279. return err
  37280. }
  37281. if x.NextPageToken == "" {
  37282. return nil
  37283. }
  37284. c.PageToken(x.NextPageToken)
  37285. }
  37286. }
  37287. // method id "compute.backendServices.delete":
  37288. type BackendServicesDeleteCall struct {
  37289. s *Service
  37290. project string
  37291. backendService string
  37292. urlParams_ gensupport.URLParams
  37293. ctx_ context.Context
  37294. header_ http.Header
  37295. }
  37296. // Delete: Deletes the specified BackendService resource.
  37297. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  37298. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  37299. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37300. c.project = project
  37301. c.backendService = backendService
  37302. return c
  37303. }
  37304. // RequestId sets the optional parameter "requestId": An optional
  37305. // request ID to identify requests. Specify a unique request ID so that
  37306. // if you must retry your request, the server will know to ignore the
  37307. // request if it has already been completed.
  37308. //
  37309. // For example, consider a situation where you make an initial request
  37310. // and the request times out. If you make the request again with the
  37311. // same request ID, the server can check if original operation with the
  37312. // same request ID was received, and if so, will ignore the second
  37313. // request. This prevents clients from accidentally creating duplicate
  37314. // commitments.
  37315. //
  37316. // The request ID must be a valid UUID with the exception that zero UUID
  37317. // is not supported (00000000-0000-0000-0000-000000000000).
  37318. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  37319. c.urlParams_.Set("requestId", requestId)
  37320. return c
  37321. }
  37322. // Fields allows partial responses to be retrieved. See
  37323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37324. // for more information.
  37325. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  37326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37327. return c
  37328. }
  37329. // Context sets the context to be used in this call's Do method. Any
  37330. // pending HTTP request will be aborted if the provided context is
  37331. // canceled.
  37332. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  37333. c.ctx_ = ctx
  37334. return c
  37335. }
  37336. // Header returns an http.Header that can be modified by the caller to
  37337. // add HTTP headers to the request.
  37338. func (c *BackendServicesDeleteCall) Header() http.Header {
  37339. if c.header_ == nil {
  37340. c.header_ = make(http.Header)
  37341. }
  37342. return c.header_
  37343. }
  37344. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  37345. reqHeaders := make(http.Header)
  37346. for k, v := range c.header_ {
  37347. reqHeaders[k] = v
  37348. }
  37349. reqHeaders.Set("User-Agent", c.s.userAgent())
  37350. var body io.Reader = nil
  37351. c.urlParams_.Set("alt", alt)
  37352. c.urlParams_.Set("prettyPrint", "false")
  37353. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  37354. urls += "?" + c.urlParams_.Encode()
  37355. req, err := http.NewRequest("DELETE", urls, body)
  37356. if err != nil {
  37357. return nil, err
  37358. }
  37359. req.Header = reqHeaders
  37360. googleapi.Expand(req.URL, map[string]string{
  37361. "project": c.project,
  37362. "backendService": c.backendService,
  37363. })
  37364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37365. }
  37366. // Do executes the "compute.backendServices.delete" call.
  37367. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37368. // status code is an error. Response headers are in either
  37369. // *Operation.ServerResponse.Header or (if a response was returned at
  37370. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37371. // to check whether the returned error was because
  37372. // http.StatusNotModified was returned.
  37373. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37374. gensupport.SetOptions(c.urlParams_, opts...)
  37375. res, err := c.doRequest("json")
  37376. if res != nil && res.StatusCode == http.StatusNotModified {
  37377. if res.Body != nil {
  37378. res.Body.Close()
  37379. }
  37380. return nil, &googleapi.Error{
  37381. Code: res.StatusCode,
  37382. Header: res.Header,
  37383. }
  37384. }
  37385. if err != nil {
  37386. return nil, err
  37387. }
  37388. defer googleapi.CloseBody(res)
  37389. if err := googleapi.CheckResponse(res); err != nil {
  37390. return nil, err
  37391. }
  37392. ret := &Operation{
  37393. ServerResponse: googleapi.ServerResponse{
  37394. Header: res.Header,
  37395. HTTPStatusCode: res.StatusCode,
  37396. },
  37397. }
  37398. target := &ret
  37399. if err := gensupport.DecodeResponse(target, res); err != nil {
  37400. return nil, err
  37401. }
  37402. return ret, nil
  37403. // {
  37404. // "description": "Deletes the specified BackendService resource.",
  37405. // "httpMethod": "DELETE",
  37406. // "id": "compute.backendServices.delete",
  37407. // "parameterOrder": [
  37408. // "project",
  37409. // "backendService"
  37410. // ],
  37411. // "parameters": {
  37412. // "backendService": {
  37413. // "description": "Name of the BackendService resource to delete.",
  37414. // "location": "path",
  37415. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37416. // "required": true,
  37417. // "type": "string"
  37418. // },
  37419. // "project": {
  37420. // "description": "Project ID for this request.",
  37421. // "location": "path",
  37422. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37423. // "required": true,
  37424. // "type": "string"
  37425. // },
  37426. // "requestId": {
  37427. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37428. // "location": "query",
  37429. // "type": "string"
  37430. // }
  37431. // },
  37432. // "path": "{project}/global/backendServices/{backendService}",
  37433. // "response": {
  37434. // "$ref": "Operation"
  37435. // },
  37436. // "scopes": [
  37437. // "https://www.googleapis.com/auth/cloud-platform",
  37438. // "https://www.googleapis.com/auth/compute"
  37439. // ]
  37440. // }
  37441. }
  37442. // method id "compute.backendServices.deleteSignedUrlKey":
  37443. type BackendServicesDeleteSignedUrlKeyCall struct {
  37444. s *Service
  37445. project string
  37446. backendService string
  37447. urlParams_ gensupport.URLParams
  37448. ctx_ context.Context
  37449. header_ http.Header
  37450. }
  37451. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  37452. // URLs for this backend service.
  37453. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  37454. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37455. c.project = project
  37456. c.backendService = backendService
  37457. c.urlParams_.Set("keyName", keyName)
  37458. return c
  37459. }
  37460. // RequestId sets the optional parameter "requestId": An optional
  37461. // request ID to identify requests. Specify a unique request ID so that
  37462. // if you must retry your request, the server will know to ignore the
  37463. // request if it has already been completed.
  37464. //
  37465. // For example, consider a situation where you make an initial request
  37466. // and the request times out. If you make the request again with the
  37467. // same request ID, the server can check if original operation with the
  37468. // same request ID was received, and if so, will ignore the second
  37469. // request. This prevents clients from accidentally creating duplicate
  37470. // commitments.
  37471. //
  37472. // The request ID must be a valid UUID with the exception that zero UUID
  37473. // is not supported (00000000-0000-0000-0000-000000000000).
  37474. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  37475. c.urlParams_.Set("requestId", requestId)
  37476. return c
  37477. }
  37478. // Fields allows partial responses to be retrieved. See
  37479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37480. // for more information.
  37481. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  37482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37483. return c
  37484. }
  37485. // Context sets the context to be used in this call's Do method. Any
  37486. // pending HTTP request will be aborted if the provided context is
  37487. // canceled.
  37488. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  37489. c.ctx_ = ctx
  37490. return c
  37491. }
  37492. // Header returns an http.Header that can be modified by the caller to
  37493. // add HTTP headers to the request.
  37494. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  37495. if c.header_ == nil {
  37496. c.header_ = make(http.Header)
  37497. }
  37498. return c.header_
  37499. }
  37500. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  37501. reqHeaders := make(http.Header)
  37502. for k, v := range c.header_ {
  37503. reqHeaders[k] = v
  37504. }
  37505. reqHeaders.Set("User-Agent", c.s.userAgent())
  37506. var body io.Reader = nil
  37507. c.urlParams_.Set("alt", alt)
  37508. c.urlParams_.Set("prettyPrint", "false")
  37509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  37510. urls += "?" + c.urlParams_.Encode()
  37511. req, err := http.NewRequest("POST", urls, body)
  37512. if err != nil {
  37513. return nil, err
  37514. }
  37515. req.Header = reqHeaders
  37516. googleapi.Expand(req.URL, map[string]string{
  37517. "project": c.project,
  37518. "backendService": c.backendService,
  37519. })
  37520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37521. }
  37522. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  37523. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37524. // status code is an error. Response headers are in either
  37525. // *Operation.ServerResponse.Header or (if a response was returned at
  37526. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37527. // to check whether the returned error was because
  37528. // http.StatusNotModified was returned.
  37529. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37530. gensupport.SetOptions(c.urlParams_, opts...)
  37531. res, err := c.doRequest("json")
  37532. if res != nil && res.StatusCode == http.StatusNotModified {
  37533. if res.Body != nil {
  37534. res.Body.Close()
  37535. }
  37536. return nil, &googleapi.Error{
  37537. Code: res.StatusCode,
  37538. Header: res.Header,
  37539. }
  37540. }
  37541. if err != nil {
  37542. return nil, err
  37543. }
  37544. defer googleapi.CloseBody(res)
  37545. if err := googleapi.CheckResponse(res); err != nil {
  37546. return nil, err
  37547. }
  37548. ret := &Operation{
  37549. ServerResponse: googleapi.ServerResponse{
  37550. Header: res.Header,
  37551. HTTPStatusCode: res.StatusCode,
  37552. },
  37553. }
  37554. target := &ret
  37555. if err := gensupport.DecodeResponse(target, res); err != nil {
  37556. return nil, err
  37557. }
  37558. return ret, nil
  37559. // {
  37560. // "description": "Deletes a key for validating requests with signed URLs for this backend service.",
  37561. // "httpMethod": "POST",
  37562. // "id": "compute.backendServices.deleteSignedUrlKey",
  37563. // "parameterOrder": [
  37564. // "project",
  37565. // "backendService",
  37566. // "keyName"
  37567. // ],
  37568. // "parameters": {
  37569. // "backendService": {
  37570. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  37571. // "location": "path",
  37572. // "required": true,
  37573. // "type": "string"
  37574. // },
  37575. // "keyName": {
  37576. // "description": "The name of the Signed URL Key to delete.",
  37577. // "location": "query",
  37578. // "required": true,
  37579. // "type": "string"
  37580. // },
  37581. // "project": {
  37582. // "description": "Project ID for this request.",
  37583. // "location": "path",
  37584. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37585. // "required": true,
  37586. // "type": "string"
  37587. // },
  37588. // "requestId": {
  37589. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37590. // "location": "query",
  37591. // "type": "string"
  37592. // }
  37593. // },
  37594. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  37595. // "response": {
  37596. // "$ref": "Operation"
  37597. // },
  37598. // "scopes": [
  37599. // "https://www.googleapis.com/auth/cloud-platform",
  37600. // "https://www.googleapis.com/auth/compute"
  37601. // ]
  37602. // }
  37603. }
  37604. // method id "compute.backendServices.get":
  37605. type BackendServicesGetCall struct {
  37606. s *Service
  37607. project string
  37608. backendService string
  37609. urlParams_ gensupport.URLParams
  37610. ifNoneMatch_ string
  37611. ctx_ context.Context
  37612. header_ http.Header
  37613. }
  37614. // Get: Returns the specified BackendService resource. Gets a list of
  37615. // available backend services.
  37616. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  37617. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  37618. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37619. c.project = project
  37620. c.backendService = backendService
  37621. return c
  37622. }
  37623. // Fields allows partial responses to be retrieved. See
  37624. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37625. // for more information.
  37626. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  37627. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37628. return c
  37629. }
  37630. // IfNoneMatch sets the optional parameter which makes the operation
  37631. // fail if the object's ETag matches the given value. This is useful for
  37632. // getting updates only after the object has changed since the last
  37633. // request. Use googleapi.IsNotModified to check whether the response
  37634. // error from Do is the result of In-None-Match.
  37635. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  37636. c.ifNoneMatch_ = entityTag
  37637. return c
  37638. }
  37639. // Context sets the context to be used in this call's Do method. Any
  37640. // pending HTTP request will be aborted if the provided context is
  37641. // canceled.
  37642. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  37643. c.ctx_ = ctx
  37644. return c
  37645. }
  37646. // Header returns an http.Header that can be modified by the caller to
  37647. // add HTTP headers to the request.
  37648. func (c *BackendServicesGetCall) Header() http.Header {
  37649. if c.header_ == nil {
  37650. c.header_ = make(http.Header)
  37651. }
  37652. return c.header_
  37653. }
  37654. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  37655. reqHeaders := make(http.Header)
  37656. for k, v := range c.header_ {
  37657. reqHeaders[k] = v
  37658. }
  37659. reqHeaders.Set("User-Agent", c.s.userAgent())
  37660. if c.ifNoneMatch_ != "" {
  37661. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37662. }
  37663. var body io.Reader = nil
  37664. c.urlParams_.Set("alt", alt)
  37665. c.urlParams_.Set("prettyPrint", "false")
  37666. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  37667. urls += "?" + c.urlParams_.Encode()
  37668. req, err := http.NewRequest("GET", urls, body)
  37669. if err != nil {
  37670. return nil, err
  37671. }
  37672. req.Header = reqHeaders
  37673. googleapi.Expand(req.URL, map[string]string{
  37674. "project": c.project,
  37675. "backendService": c.backendService,
  37676. })
  37677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37678. }
  37679. // Do executes the "compute.backendServices.get" call.
  37680. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  37681. // status code is an error. Response headers are in either
  37682. // *BackendService.ServerResponse.Header or (if a response was returned
  37683. // at all) in error.(*googleapi.Error).Header. Use
  37684. // googleapi.IsNotModified to check whether the returned error was
  37685. // because http.StatusNotModified was returned.
  37686. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  37687. gensupport.SetOptions(c.urlParams_, opts...)
  37688. res, err := c.doRequest("json")
  37689. if res != nil && res.StatusCode == http.StatusNotModified {
  37690. if res.Body != nil {
  37691. res.Body.Close()
  37692. }
  37693. return nil, &googleapi.Error{
  37694. Code: res.StatusCode,
  37695. Header: res.Header,
  37696. }
  37697. }
  37698. if err != nil {
  37699. return nil, err
  37700. }
  37701. defer googleapi.CloseBody(res)
  37702. if err := googleapi.CheckResponse(res); err != nil {
  37703. return nil, err
  37704. }
  37705. ret := &BackendService{
  37706. ServerResponse: googleapi.ServerResponse{
  37707. Header: res.Header,
  37708. HTTPStatusCode: res.StatusCode,
  37709. },
  37710. }
  37711. target := &ret
  37712. if err := gensupport.DecodeResponse(target, res); err != nil {
  37713. return nil, err
  37714. }
  37715. return ret, nil
  37716. // {
  37717. // "description": "Returns the specified BackendService resource. Gets a list of available backend services.",
  37718. // "httpMethod": "GET",
  37719. // "id": "compute.backendServices.get",
  37720. // "parameterOrder": [
  37721. // "project",
  37722. // "backendService"
  37723. // ],
  37724. // "parameters": {
  37725. // "backendService": {
  37726. // "description": "Name of the BackendService resource to return.",
  37727. // "location": "path",
  37728. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37729. // "required": true,
  37730. // "type": "string"
  37731. // },
  37732. // "project": {
  37733. // "description": "Project ID for this request.",
  37734. // "location": "path",
  37735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37736. // "required": true,
  37737. // "type": "string"
  37738. // }
  37739. // },
  37740. // "path": "{project}/global/backendServices/{backendService}",
  37741. // "response": {
  37742. // "$ref": "BackendService"
  37743. // },
  37744. // "scopes": [
  37745. // "https://www.googleapis.com/auth/cloud-platform",
  37746. // "https://www.googleapis.com/auth/compute",
  37747. // "https://www.googleapis.com/auth/compute.readonly"
  37748. // ]
  37749. // }
  37750. }
  37751. // method id "compute.backendServices.getHealth":
  37752. type BackendServicesGetHealthCall struct {
  37753. s *Service
  37754. project string
  37755. backendService string
  37756. resourcegroupreference *ResourceGroupReference
  37757. urlParams_ gensupport.URLParams
  37758. ctx_ context.Context
  37759. header_ http.Header
  37760. }
  37761. // GetHealth: Gets the most recent health check results for this
  37762. // BackendService.
  37763. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  37764. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  37765. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37766. c.project = project
  37767. c.backendService = backendService
  37768. c.resourcegroupreference = resourcegroupreference
  37769. return c
  37770. }
  37771. // Fields allows partial responses to be retrieved. See
  37772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37773. // for more information.
  37774. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  37775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37776. return c
  37777. }
  37778. // Context sets the context to be used in this call's Do method. Any
  37779. // pending HTTP request will be aborted if the provided context is
  37780. // canceled.
  37781. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  37782. c.ctx_ = ctx
  37783. return c
  37784. }
  37785. // Header returns an http.Header that can be modified by the caller to
  37786. // add HTTP headers to the request.
  37787. func (c *BackendServicesGetHealthCall) Header() http.Header {
  37788. if c.header_ == nil {
  37789. c.header_ = make(http.Header)
  37790. }
  37791. return c.header_
  37792. }
  37793. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  37794. reqHeaders := make(http.Header)
  37795. for k, v := range c.header_ {
  37796. reqHeaders[k] = v
  37797. }
  37798. reqHeaders.Set("User-Agent", c.s.userAgent())
  37799. var body io.Reader = nil
  37800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  37801. if err != nil {
  37802. return nil, err
  37803. }
  37804. reqHeaders.Set("Content-Type", "application/json")
  37805. c.urlParams_.Set("alt", alt)
  37806. c.urlParams_.Set("prettyPrint", "false")
  37807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  37808. urls += "?" + c.urlParams_.Encode()
  37809. req, err := http.NewRequest("POST", urls, body)
  37810. if err != nil {
  37811. return nil, err
  37812. }
  37813. req.Header = reqHeaders
  37814. googleapi.Expand(req.URL, map[string]string{
  37815. "project": c.project,
  37816. "backendService": c.backendService,
  37817. })
  37818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37819. }
  37820. // Do executes the "compute.backendServices.getHealth" call.
  37821. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  37822. // Any non-2xx status code is an error. Response headers are in either
  37823. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  37824. // was returned at all) in error.(*googleapi.Error).Header. Use
  37825. // googleapi.IsNotModified to check whether the returned error was
  37826. // because http.StatusNotModified was returned.
  37827. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  37828. gensupport.SetOptions(c.urlParams_, opts...)
  37829. res, err := c.doRequest("json")
  37830. if res != nil && res.StatusCode == http.StatusNotModified {
  37831. if res.Body != nil {
  37832. res.Body.Close()
  37833. }
  37834. return nil, &googleapi.Error{
  37835. Code: res.StatusCode,
  37836. Header: res.Header,
  37837. }
  37838. }
  37839. if err != nil {
  37840. return nil, err
  37841. }
  37842. defer googleapi.CloseBody(res)
  37843. if err := googleapi.CheckResponse(res); err != nil {
  37844. return nil, err
  37845. }
  37846. ret := &BackendServiceGroupHealth{
  37847. ServerResponse: googleapi.ServerResponse{
  37848. Header: res.Header,
  37849. HTTPStatusCode: res.StatusCode,
  37850. },
  37851. }
  37852. target := &ret
  37853. if err := gensupport.DecodeResponse(target, res); err != nil {
  37854. return nil, err
  37855. }
  37856. return ret, nil
  37857. // {
  37858. // "description": "Gets the most recent health check results for this BackendService.",
  37859. // "httpMethod": "POST",
  37860. // "id": "compute.backendServices.getHealth",
  37861. // "parameterOrder": [
  37862. // "project",
  37863. // "backendService"
  37864. // ],
  37865. // "parameters": {
  37866. // "backendService": {
  37867. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  37868. // "location": "path",
  37869. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37870. // "required": true,
  37871. // "type": "string"
  37872. // },
  37873. // "project": {
  37874. // "location": "path",
  37875. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37876. // "required": true,
  37877. // "type": "string"
  37878. // }
  37879. // },
  37880. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  37881. // "request": {
  37882. // "$ref": "ResourceGroupReference"
  37883. // },
  37884. // "response": {
  37885. // "$ref": "BackendServiceGroupHealth"
  37886. // },
  37887. // "scopes": [
  37888. // "https://www.googleapis.com/auth/cloud-platform",
  37889. // "https://www.googleapis.com/auth/compute",
  37890. // "https://www.googleapis.com/auth/compute.readonly"
  37891. // ]
  37892. // }
  37893. }
  37894. // method id "compute.backendServices.insert":
  37895. type BackendServicesInsertCall struct {
  37896. s *Service
  37897. project string
  37898. backendservice *BackendService
  37899. urlParams_ gensupport.URLParams
  37900. ctx_ context.Context
  37901. header_ http.Header
  37902. }
  37903. // Insert: Creates a BackendService resource in the specified project
  37904. // using the data included in the request. There are several
  37905. // restrictions and guidelines to keep in mind when creating a backend
  37906. // service. Read Restrictions and Guidelines for more information.
  37907. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  37908. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  37909. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37910. c.project = project
  37911. c.backendservice = backendservice
  37912. return c
  37913. }
  37914. // RequestId sets the optional parameter "requestId": An optional
  37915. // request ID to identify requests. Specify a unique request ID so that
  37916. // if you must retry your request, the server will know to ignore the
  37917. // request if it has already been completed.
  37918. //
  37919. // For example, consider a situation where you make an initial request
  37920. // and the request times out. If you make the request again with the
  37921. // same request ID, the server can check if original operation with the
  37922. // same request ID was received, and if so, will ignore the second
  37923. // request. This prevents clients from accidentally creating duplicate
  37924. // commitments.
  37925. //
  37926. // The request ID must be a valid UUID with the exception that zero UUID
  37927. // is not supported (00000000-0000-0000-0000-000000000000).
  37928. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  37929. c.urlParams_.Set("requestId", requestId)
  37930. return c
  37931. }
  37932. // Fields allows partial responses to be retrieved. See
  37933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37934. // for more information.
  37935. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  37936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37937. return c
  37938. }
  37939. // Context sets the context to be used in this call's Do method. Any
  37940. // pending HTTP request will be aborted if the provided context is
  37941. // canceled.
  37942. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  37943. c.ctx_ = ctx
  37944. return c
  37945. }
  37946. // Header returns an http.Header that can be modified by the caller to
  37947. // add HTTP headers to the request.
  37948. func (c *BackendServicesInsertCall) Header() http.Header {
  37949. if c.header_ == nil {
  37950. c.header_ = make(http.Header)
  37951. }
  37952. return c.header_
  37953. }
  37954. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  37955. reqHeaders := make(http.Header)
  37956. for k, v := range c.header_ {
  37957. reqHeaders[k] = v
  37958. }
  37959. reqHeaders.Set("User-Agent", c.s.userAgent())
  37960. var body io.Reader = nil
  37961. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  37962. if err != nil {
  37963. return nil, err
  37964. }
  37965. reqHeaders.Set("Content-Type", "application/json")
  37966. c.urlParams_.Set("alt", alt)
  37967. c.urlParams_.Set("prettyPrint", "false")
  37968. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  37969. urls += "?" + c.urlParams_.Encode()
  37970. req, err := http.NewRequest("POST", urls, body)
  37971. if err != nil {
  37972. return nil, err
  37973. }
  37974. req.Header = reqHeaders
  37975. googleapi.Expand(req.URL, map[string]string{
  37976. "project": c.project,
  37977. })
  37978. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37979. }
  37980. // Do executes the "compute.backendServices.insert" call.
  37981. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37982. // status code is an error. Response headers are in either
  37983. // *Operation.ServerResponse.Header or (if a response was returned at
  37984. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37985. // to check whether the returned error was because
  37986. // http.StatusNotModified was returned.
  37987. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37988. gensupport.SetOptions(c.urlParams_, opts...)
  37989. res, err := c.doRequest("json")
  37990. if res != nil && res.StatusCode == http.StatusNotModified {
  37991. if res.Body != nil {
  37992. res.Body.Close()
  37993. }
  37994. return nil, &googleapi.Error{
  37995. Code: res.StatusCode,
  37996. Header: res.Header,
  37997. }
  37998. }
  37999. if err != nil {
  38000. return nil, err
  38001. }
  38002. defer googleapi.CloseBody(res)
  38003. if err := googleapi.CheckResponse(res); err != nil {
  38004. return nil, err
  38005. }
  38006. ret := &Operation{
  38007. ServerResponse: googleapi.ServerResponse{
  38008. Header: res.Header,
  38009. HTTPStatusCode: res.StatusCode,
  38010. },
  38011. }
  38012. target := &ret
  38013. if err := gensupport.DecodeResponse(target, res); err != nil {
  38014. return nil, err
  38015. }
  38016. return ret, nil
  38017. // {
  38018. // "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.",
  38019. // "httpMethod": "POST",
  38020. // "id": "compute.backendServices.insert",
  38021. // "parameterOrder": [
  38022. // "project"
  38023. // ],
  38024. // "parameters": {
  38025. // "project": {
  38026. // "description": "Project ID for this request.",
  38027. // "location": "path",
  38028. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38029. // "required": true,
  38030. // "type": "string"
  38031. // },
  38032. // "requestId": {
  38033. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38034. // "location": "query",
  38035. // "type": "string"
  38036. // }
  38037. // },
  38038. // "path": "{project}/global/backendServices",
  38039. // "request": {
  38040. // "$ref": "BackendService"
  38041. // },
  38042. // "response": {
  38043. // "$ref": "Operation"
  38044. // },
  38045. // "scopes": [
  38046. // "https://www.googleapis.com/auth/cloud-platform",
  38047. // "https://www.googleapis.com/auth/compute"
  38048. // ]
  38049. // }
  38050. }
  38051. // method id "compute.backendServices.list":
  38052. type BackendServicesListCall struct {
  38053. s *Service
  38054. project string
  38055. urlParams_ gensupport.URLParams
  38056. ifNoneMatch_ string
  38057. ctx_ context.Context
  38058. header_ http.Header
  38059. }
  38060. // List: Retrieves the list of BackendService resources available to the
  38061. // specified project.
  38062. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  38063. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  38064. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38065. c.project = project
  38066. return c
  38067. }
  38068. // Filter sets the optional parameter "filter": A filter expression that
  38069. // filters resources listed in the response. The expression must specify
  38070. // the field name, a comparison operator, and the value that you want to
  38071. // use for filtering. The value must be a string, a number, or a
  38072. // boolean. The comparison operator must be either =, !=, >, or <.
  38073. //
  38074. // For example, if you are filtering Compute Engine instances, you can
  38075. // exclude instances named example-instance by specifying name !=
  38076. // example-instance.
  38077. //
  38078. // You can also filter nested fields. For example, you could specify
  38079. // scheduling.automaticRestart = false to include instances only if they
  38080. // are not scheduled for automatic restarts. You can use filtering on
  38081. // nested fields to filter based on resource labels.
  38082. //
  38083. // To filter on multiple expressions, provide each separate expression
  38084. // within parentheses. For example, (scheduling.automaticRestart = true)
  38085. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38086. // AND expression. However, you can include AND and OR expressions
  38087. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38088. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38089. // true).
  38090. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  38091. c.urlParams_.Set("filter", filter)
  38092. return c
  38093. }
  38094. // MaxResults sets the optional parameter "maxResults": The maximum
  38095. // number of results per page that should be returned. If the number of
  38096. // available results is larger than maxResults, Compute Engine returns a
  38097. // nextPageToken that can be used to get the next page of results in
  38098. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38099. // (Default: 500)
  38100. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  38101. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38102. return c
  38103. }
  38104. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38105. // a certain order. By default, results are returned in alphanumerical
  38106. // order based on the resource name.
  38107. //
  38108. // You can also sort results in descending order based on the creation
  38109. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38110. // based on the creationTimestamp field in reverse chronological order
  38111. // (newest result first). Use this to sort resources like operations so
  38112. // that the newest operation is returned first.
  38113. //
  38114. // Currently, only sorting by name or creationTimestamp desc is
  38115. // supported.
  38116. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  38117. c.urlParams_.Set("orderBy", orderBy)
  38118. return c
  38119. }
  38120. // PageToken sets the optional parameter "pageToken": Specifies a page
  38121. // token to use. Set pageToken to the nextPageToken returned by a
  38122. // previous list request to get the next page of results.
  38123. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  38124. c.urlParams_.Set("pageToken", pageToken)
  38125. return c
  38126. }
  38127. // Fields allows partial responses to be retrieved. See
  38128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38129. // for more information.
  38130. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  38131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38132. return c
  38133. }
  38134. // IfNoneMatch sets the optional parameter which makes the operation
  38135. // fail if the object's ETag matches the given value. This is useful for
  38136. // getting updates only after the object has changed since the last
  38137. // request. Use googleapi.IsNotModified to check whether the response
  38138. // error from Do is the result of In-None-Match.
  38139. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  38140. c.ifNoneMatch_ = entityTag
  38141. return c
  38142. }
  38143. // Context sets the context to be used in this call's Do method. Any
  38144. // pending HTTP request will be aborted if the provided context is
  38145. // canceled.
  38146. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  38147. c.ctx_ = ctx
  38148. return c
  38149. }
  38150. // Header returns an http.Header that can be modified by the caller to
  38151. // add HTTP headers to the request.
  38152. func (c *BackendServicesListCall) Header() http.Header {
  38153. if c.header_ == nil {
  38154. c.header_ = make(http.Header)
  38155. }
  38156. return c.header_
  38157. }
  38158. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  38159. reqHeaders := make(http.Header)
  38160. for k, v := range c.header_ {
  38161. reqHeaders[k] = v
  38162. }
  38163. reqHeaders.Set("User-Agent", c.s.userAgent())
  38164. if c.ifNoneMatch_ != "" {
  38165. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38166. }
  38167. var body io.Reader = nil
  38168. c.urlParams_.Set("alt", alt)
  38169. c.urlParams_.Set("prettyPrint", "false")
  38170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  38171. urls += "?" + c.urlParams_.Encode()
  38172. req, err := http.NewRequest("GET", urls, body)
  38173. if err != nil {
  38174. return nil, err
  38175. }
  38176. req.Header = reqHeaders
  38177. googleapi.Expand(req.URL, map[string]string{
  38178. "project": c.project,
  38179. })
  38180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38181. }
  38182. // Do executes the "compute.backendServices.list" call.
  38183. // Exactly one of *BackendServiceList or error will be non-nil. Any
  38184. // non-2xx status code is an error. Response headers are in either
  38185. // *BackendServiceList.ServerResponse.Header or (if a response was
  38186. // returned at all) in error.(*googleapi.Error).Header. Use
  38187. // googleapi.IsNotModified to check whether the returned error was
  38188. // because http.StatusNotModified was returned.
  38189. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  38190. gensupport.SetOptions(c.urlParams_, opts...)
  38191. res, err := c.doRequest("json")
  38192. if res != nil && res.StatusCode == http.StatusNotModified {
  38193. if res.Body != nil {
  38194. res.Body.Close()
  38195. }
  38196. return nil, &googleapi.Error{
  38197. Code: res.StatusCode,
  38198. Header: res.Header,
  38199. }
  38200. }
  38201. if err != nil {
  38202. return nil, err
  38203. }
  38204. defer googleapi.CloseBody(res)
  38205. if err := googleapi.CheckResponse(res); err != nil {
  38206. return nil, err
  38207. }
  38208. ret := &BackendServiceList{
  38209. ServerResponse: googleapi.ServerResponse{
  38210. Header: res.Header,
  38211. HTTPStatusCode: res.StatusCode,
  38212. },
  38213. }
  38214. target := &ret
  38215. if err := gensupport.DecodeResponse(target, res); err != nil {
  38216. return nil, err
  38217. }
  38218. return ret, nil
  38219. // {
  38220. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  38221. // "httpMethod": "GET",
  38222. // "id": "compute.backendServices.list",
  38223. // "parameterOrder": [
  38224. // "project"
  38225. // ],
  38226. // "parameters": {
  38227. // "filter": {
  38228. // "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).",
  38229. // "location": "query",
  38230. // "type": "string"
  38231. // },
  38232. // "maxResults": {
  38233. // "default": "500",
  38234. // "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)",
  38235. // "format": "uint32",
  38236. // "location": "query",
  38237. // "minimum": "0",
  38238. // "type": "integer"
  38239. // },
  38240. // "orderBy": {
  38241. // "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.",
  38242. // "location": "query",
  38243. // "type": "string"
  38244. // },
  38245. // "pageToken": {
  38246. // "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.",
  38247. // "location": "query",
  38248. // "type": "string"
  38249. // },
  38250. // "project": {
  38251. // "description": "Project ID for this request.",
  38252. // "location": "path",
  38253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38254. // "required": true,
  38255. // "type": "string"
  38256. // }
  38257. // },
  38258. // "path": "{project}/global/backendServices",
  38259. // "response": {
  38260. // "$ref": "BackendServiceList"
  38261. // },
  38262. // "scopes": [
  38263. // "https://www.googleapis.com/auth/cloud-platform",
  38264. // "https://www.googleapis.com/auth/compute",
  38265. // "https://www.googleapis.com/auth/compute.readonly"
  38266. // ]
  38267. // }
  38268. }
  38269. // Pages invokes f for each page of results.
  38270. // A non-nil error returned from f will halt the iteration.
  38271. // The provided context supersedes any context provided to the Context method.
  38272. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  38273. c.ctx_ = ctx
  38274. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38275. for {
  38276. x, err := c.Do()
  38277. if err != nil {
  38278. return err
  38279. }
  38280. if err := f(x); err != nil {
  38281. return err
  38282. }
  38283. if x.NextPageToken == "" {
  38284. return nil
  38285. }
  38286. c.PageToken(x.NextPageToken)
  38287. }
  38288. }
  38289. // method id "compute.backendServices.patch":
  38290. type BackendServicesPatchCall struct {
  38291. s *Service
  38292. project string
  38293. backendService string
  38294. backendservice *BackendService
  38295. urlParams_ gensupport.URLParams
  38296. ctx_ context.Context
  38297. header_ http.Header
  38298. }
  38299. // Patch: Patches the specified BackendService resource with the data
  38300. // included in the request. There are several restrictions and
  38301. // guidelines to keep in mind when updating a backend service. Read
  38302. // Restrictions and Guidelines for more information. This method
  38303. // supports PATCH semantics and uses the JSON merge patch format and
  38304. // processing rules.
  38305. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  38306. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  38307. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38308. c.project = project
  38309. c.backendService = backendService
  38310. c.backendservice = backendservice
  38311. return c
  38312. }
  38313. // RequestId sets the optional parameter "requestId": An optional
  38314. // request ID to identify requests. Specify a unique request ID so that
  38315. // if you must retry your request, the server will know to ignore the
  38316. // request if it has already been completed.
  38317. //
  38318. // For example, consider a situation where you make an initial request
  38319. // and the request times out. If you make the request again with the
  38320. // same request ID, the server can check if original operation with the
  38321. // same request ID was received, and if so, will ignore the second
  38322. // request. This prevents clients from accidentally creating duplicate
  38323. // commitments.
  38324. //
  38325. // The request ID must be a valid UUID with the exception that zero UUID
  38326. // is not supported (00000000-0000-0000-0000-000000000000).
  38327. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  38328. c.urlParams_.Set("requestId", requestId)
  38329. return c
  38330. }
  38331. // Fields allows partial responses to be retrieved. See
  38332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38333. // for more information.
  38334. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  38335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38336. return c
  38337. }
  38338. // Context sets the context to be used in this call's Do method. Any
  38339. // pending HTTP request will be aborted if the provided context is
  38340. // canceled.
  38341. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  38342. c.ctx_ = ctx
  38343. return c
  38344. }
  38345. // Header returns an http.Header that can be modified by the caller to
  38346. // add HTTP headers to the request.
  38347. func (c *BackendServicesPatchCall) Header() http.Header {
  38348. if c.header_ == nil {
  38349. c.header_ = make(http.Header)
  38350. }
  38351. return c.header_
  38352. }
  38353. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  38354. reqHeaders := make(http.Header)
  38355. for k, v := range c.header_ {
  38356. reqHeaders[k] = v
  38357. }
  38358. reqHeaders.Set("User-Agent", c.s.userAgent())
  38359. var body io.Reader = nil
  38360. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  38361. if err != nil {
  38362. return nil, err
  38363. }
  38364. reqHeaders.Set("Content-Type", "application/json")
  38365. c.urlParams_.Set("alt", alt)
  38366. c.urlParams_.Set("prettyPrint", "false")
  38367. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  38368. urls += "?" + c.urlParams_.Encode()
  38369. req, err := http.NewRequest("PATCH", urls, body)
  38370. if err != nil {
  38371. return nil, err
  38372. }
  38373. req.Header = reqHeaders
  38374. googleapi.Expand(req.URL, map[string]string{
  38375. "project": c.project,
  38376. "backendService": c.backendService,
  38377. })
  38378. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38379. }
  38380. // Do executes the "compute.backendServices.patch" call.
  38381. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38382. // status code is an error. Response headers are in either
  38383. // *Operation.ServerResponse.Header or (if a response was returned at
  38384. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38385. // to check whether the returned error was because
  38386. // http.StatusNotModified was returned.
  38387. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38388. gensupport.SetOptions(c.urlParams_, opts...)
  38389. res, err := c.doRequest("json")
  38390. if res != nil && res.StatusCode == http.StatusNotModified {
  38391. if res.Body != nil {
  38392. res.Body.Close()
  38393. }
  38394. return nil, &googleapi.Error{
  38395. Code: res.StatusCode,
  38396. Header: res.Header,
  38397. }
  38398. }
  38399. if err != nil {
  38400. return nil, err
  38401. }
  38402. defer googleapi.CloseBody(res)
  38403. if err := googleapi.CheckResponse(res); err != nil {
  38404. return nil, err
  38405. }
  38406. ret := &Operation{
  38407. ServerResponse: googleapi.ServerResponse{
  38408. Header: res.Header,
  38409. HTTPStatusCode: res.StatusCode,
  38410. },
  38411. }
  38412. target := &ret
  38413. if err := gensupport.DecodeResponse(target, res); err != nil {
  38414. return nil, err
  38415. }
  38416. return ret, nil
  38417. // {
  38418. // "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.",
  38419. // "httpMethod": "PATCH",
  38420. // "id": "compute.backendServices.patch",
  38421. // "parameterOrder": [
  38422. // "project",
  38423. // "backendService"
  38424. // ],
  38425. // "parameters": {
  38426. // "backendService": {
  38427. // "description": "Name of the BackendService resource to patch.",
  38428. // "location": "path",
  38429. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38430. // "required": true,
  38431. // "type": "string"
  38432. // },
  38433. // "project": {
  38434. // "description": "Project ID for this request.",
  38435. // "location": "path",
  38436. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38437. // "required": true,
  38438. // "type": "string"
  38439. // },
  38440. // "requestId": {
  38441. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38442. // "location": "query",
  38443. // "type": "string"
  38444. // }
  38445. // },
  38446. // "path": "{project}/global/backendServices/{backendService}",
  38447. // "request": {
  38448. // "$ref": "BackendService"
  38449. // },
  38450. // "response": {
  38451. // "$ref": "Operation"
  38452. // },
  38453. // "scopes": [
  38454. // "https://www.googleapis.com/auth/cloud-platform",
  38455. // "https://www.googleapis.com/auth/compute"
  38456. // ]
  38457. // }
  38458. }
  38459. // method id "compute.backendServices.setSecurityPolicy":
  38460. type BackendServicesSetSecurityPolicyCall struct {
  38461. s *Service
  38462. project string
  38463. backendService string
  38464. securitypolicyreference *SecurityPolicyReference
  38465. urlParams_ gensupport.URLParams
  38466. ctx_ context.Context
  38467. header_ http.Header
  38468. }
  38469. // SetSecurityPolicy: Sets the security policy for the specified backend
  38470. // service.
  38471. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  38472. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38473. c.project = project
  38474. c.backendService = backendService
  38475. c.securitypolicyreference = securitypolicyreference
  38476. return c
  38477. }
  38478. // RequestId sets the optional parameter "requestId": An optional
  38479. // request ID to identify requests. Specify a unique request ID so that
  38480. // if you must retry your request, the server will know to ignore the
  38481. // request if it has already been completed.
  38482. //
  38483. // For example, consider a situation where you make an initial request
  38484. // and the request times out. If you make the request again with the
  38485. // same request ID, the server can check if original operation with the
  38486. // same request ID was received, and if so, will ignore the second
  38487. // request. This prevents clients from accidentally creating duplicate
  38488. // commitments.
  38489. //
  38490. // The request ID must be a valid UUID with the exception that zero UUID
  38491. // is not supported (00000000-0000-0000-0000-000000000000).
  38492. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  38493. c.urlParams_.Set("requestId", requestId)
  38494. return c
  38495. }
  38496. // Fields allows partial responses to be retrieved. See
  38497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38498. // for more information.
  38499. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  38500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38501. return c
  38502. }
  38503. // Context sets the context to be used in this call's Do method. Any
  38504. // pending HTTP request will be aborted if the provided context is
  38505. // canceled.
  38506. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  38507. c.ctx_ = ctx
  38508. return c
  38509. }
  38510. // Header returns an http.Header that can be modified by the caller to
  38511. // add HTTP headers to the request.
  38512. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  38513. if c.header_ == nil {
  38514. c.header_ = make(http.Header)
  38515. }
  38516. return c.header_
  38517. }
  38518. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  38519. reqHeaders := make(http.Header)
  38520. for k, v := range c.header_ {
  38521. reqHeaders[k] = v
  38522. }
  38523. reqHeaders.Set("User-Agent", c.s.userAgent())
  38524. var body io.Reader = nil
  38525. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  38526. if err != nil {
  38527. return nil, err
  38528. }
  38529. reqHeaders.Set("Content-Type", "application/json")
  38530. c.urlParams_.Set("alt", alt)
  38531. c.urlParams_.Set("prettyPrint", "false")
  38532. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  38533. urls += "?" + c.urlParams_.Encode()
  38534. req, err := http.NewRequest("POST", urls, body)
  38535. if err != nil {
  38536. return nil, err
  38537. }
  38538. req.Header = reqHeaders
  38539. googleapi.Expand(req.URL, map[string]string{
  38540. "project": c.project,
  38541. "backendService": c.backendService,
  38542. })
  38543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38544. }
  38545. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  38546. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38547. // status code is an error. Response headers are in either
  38548. // *Operation.ServerResponse.Header or (if a response was returned at
  38549. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38550. // to check whether the returned error was because
  38551. // http.StatusNotModified was returned.
  38552. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38553. gensupport.SetOptions(c.urlParams_, opts...)
  38554. res, err := c.doRequest("json")
  38555. if res != nil && res.StatusCode == http.StatusNotModified {
  38556. if res.Body != nil {
  38557. res.Body.Close()
  38558. }
  38559. return nil, &googleapi.Error{
  38560. Code: res.StatusCode,
  38561. Header: res.Header,
  38562. }
  38563. }
  38564. if err != nil {
  38565. return nil, err
  38566. }
  38567. defer googleapi.CloseBody(res)
  38568. if err := googleapi.CheckResponse(res); err != nil {
  38569. return nil, err
  38570. }
  38571. ret := &Operation{
  38572. ServerResponse: googleapi.ServerResponse{
  38573. Header: res.Header,
  38574. HTTPStatusCode: res.StatusCode,
  38575. },
  38576. }
  38577. target := &ret
  38578. if err := gensupport.DecodeResponse(target, res); err != nil {
  38579. return nil, err
  38580. }
  38581. return ret, nil
  38582. // {
  38583. // "description": "Sets the security policy for the specified backend service.",
  38584. // "httpMethod": "POST",
  38585. // "id": "compute.backendServices.setSecurityPolicy",
  38586. // "parameterOrder": [
  38587. // "project",
  38588. // "backendService"
  38589. // ],
  38590. // "parameters": {
  38591. // "backendService": {
  38592. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  38593. // "location": "path",
  38594. // "required": true,
  38595. // "type": "string"
  38596. // },
  38597. // "project": {
  38598. // "description": "Project ID for this request.",
  38599. // "location": "path",
  38600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38601. // "required": true,
  38602. // "type": "string"
  38603. // },
  38604. // "requestId": {
  38605. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38606. // "location": "query",
  38607. // "type": "string"
  38608. // }
  38609. // },
  38610. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  38611. // "request": {
  38612. // "$ref": "SecurityPolicyReference"
  38613. // },
  38614. // "response": {
  38615. // "$ref": "Operation"
  38616. // },
  38617. // "scopes": [
  38618. // "https://www.googleapis.com/auth/cloud-platform",
  38619. // "https://www.googleapis.com/auth/compute"
  38620. // ]
  38621. // }
  38622. }
  38623. // method id "compute.backendServices.testIamPermissions":
  38624. type BackendServicesTestIamPermissionsCall struct {
  38625. s *Service
  38626. project string
  38627. resource string
  38628. testpermissionsrequest *TestPermissionsRequest
  38629. urlParams_ gensupport.URLParams
  38630. ctx_ context.Context
  38631. header_ http.Header
  38632. }
  38633. // TestIamPermissions: Returns permissions that a caller has on the
  38634. // specified resource.
  38635. func (r *BackendServicesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendServicesTestIamPermissionsCall {
  38636. c := &BackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38637. c.project = project
  38638. c.resource = resource
  38639. c.testpermissionsrequest = testpermissionsrequest
  38640. return c
  38641. }
  38642. // Fields allows partial responses to be retrieved. See
  38643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38644. // for more information.
  38645. func (c *BackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendServicesTestIamPermissionsCall {
  38646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38647. return c
  38648. }
  38649. // Context sets the context to be used in this call's Do method. Any
  38650. // pending HTTP request will be aborted if the provided context is
  38651. // canceled.
  38652. func (c *BackendServicesTestIamPermissionsCall) Context(ctx context.Context) *BackendServicesTestIamPermissionsCall {
  38653. c.ctx_ = ctx
  38654. return c
  38655. }
  38656. // Header returns an http.Header that can be modified by the caller to
  38657. // add HTTP headers to the request.
  38658. func (c *BackendServicesTestIamPermissionsCall) Header() http.Header {
  38659. if c.header_ == nil {
  38660. c.header_ = make(http.Header)
  38661. }
  38662. return c.header_
  38663. }
  38664. func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  38665. reqHeaders := make(http.Header)
  38666. for k, v := range c.header_ {
  38667. reqHeaders[k] = v
  38668. }
  38669. reqHeaders.Set("User-Agent", c.s.userAgent())
  38670. var body io.Reader = nil
  38671. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  38672. if err != nil {
  38673. return nil, err
  38674. }
  38675. reqHeaders.Set("Content-Type", "application/json")
  38676. c.urlParams_.Set("alt", alt)
  38677. c.urlParams_.Set("prettyPrint", "false")
  38678. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{resource}/testIamPermissions")
  38679. urls += "?" + c.urlParams_.Encode()
  38680. req, err := http.NewRequest("POST", urls, body)
  38681. if err != nil {
  38682. return nil, err
  38683. }
  38684. req.Header = reqHeaders
  38685. googleapi.Expand(req.URL, map[string]string{
  38686. "project": c.project,
  38687. "resource": c.resource,
  38688. })
  38689. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38690. }
  38691. // Do executes the "compute.backendServices.testIamPermissions" call.
  38692. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  38693. // non-2xx status code is an error. Response headers are in either
  38694. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  38695. // returned at all) in error.(*googleapi.Error).Header. Use
  38696. // googleapi.IsNotModified to check whether the returned error was
  38697. // because http.StatusNotModified was returned.
  38698. func (c *BackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  38699. gensupport.SetOptions(c.urlParams_, opts...)
  38700. res, err := c.doRequest("json")
  38701. if res != nil && res.StatusCode == http.StatusNotModified {
  38702. if res.Body != nil {
  38703. res.Body.Close()
  38704. }
  38705. return nil, &googleapi.Error{
  38706. Code: res.StatusCode,
  38707. Header: res.Header,
  38708. }
  38709. }
  38710. if err != nil {
  38711. return nil, err
  38712. }
  38713. defer googleapi.CloseBody(res)
  38714. if err := googleapi.CheckResponse(res); err != nil {
  38715. return nil, err
  38716. }
  38717. ret := &TestPermissionsResponse{
  38718. ServerResponse: googleapi.ServerResponse{
  38719. Header: res.Header,
  38720. HTTPStatusCode: res.StatusCode,
  38721. },
  38722. }
  38723. target := &ret
  38724. if err := gensupport.DecodeResponse(target, res); err != nil {
  38725. return nil, err
  38726. }
  38727. return ret, nil
  38728. // {
  38729. // "description": "Returns permissions that a caller has on the specified resource.",
  38730. // "httpMethod": "POST",
  38731. // "id": "compute.backendServices.testIamPermissions",
  38732. // "parameterOrder": [
  38733. // "project",
  38734. // "resource"
  38735. // ],
  38736. // "parameters": {
  38737. // "project": {
  38738. // "description": "Project ID for this request.",
  38739. // "location": "path",
  38740. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38741. // "required": true,
  38742. // "type": "string"
  38743. // },
  38744. // "resource": {
  38745. // "description": "Name or id of the resource for this request.",
  38746. // "location": "path",
  38747. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38748. // "required": true,
  38749. // "type": "string"
  38750. // }
  38751. // },
  38752. // "path": "{project}/global/backendServices/{resource}/testIamPermissions",
  38753. // "request": {
  38754. // "$ref": "TestPermissionsRequest"
  38755. // },
  38756. // "response": {
  38757. // "$ref": "TestPermissionsResponse"
  38758. // },
  38759. // "scopes": [
  38760. // "https://www.googleapis.com/auth/cloud-platform",
  38761. // "https://www.googleapis.com/auth/compute",
  38762. // "https://www.googleapis.com/auth/compute.readonly"
  38763. // ]
  38764. // }
  38765. }
  38766. // method id "compute.backendServices.update":
  38767. type BackendServicesUpdateCall struct {
  38768. s *Service
  38769. project string
  38770. backendService string
  38771. backendservice *BackendService
  38772. urlParams_ gensupport.URLParams
  38773. ctx_ context.Context
  38774. header_ http.Header
  38775. }
  38776. // Update: Updates the specified BackendService resource with the data
  38777. // included in the request. There are several restrictions and
  38778. // guidelines to keep in mind when updating a backend service. Read
  38779. // Restrictions and Guidelines for more information.
  38780. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  38781. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  38782. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38783. c.project = project
  38784. c.backendService = backendService
  38785. c.backendservice = backendservice
  38786. return c
  38787. }
  38788. // RequestId sets the optional parameter "requestId": An optional
  38789. // request ID to identify requests. Specify a unique request ID so that
  38790. // if you must retry your request, the server will know to ignore the
  38791. // request if it has already been completed.
  38792. //
  38793. // For example, consider a situation where you make an initial request
  38794. // and the request times out. If you make the request again with the
  38795. // same request ID, the server can check if original operation with the
  38796. // same request ID was received, and if so, will ignore the second
  38797. // request. This prevents clients from accidentally creating duplicate
  38798. // commitments.
  38799. //
  38800. // The request ID must be a valid UUID with the exception that zero UUID
  38801. // is not supported (00000000-0000-0000-0000-000000000000).
  38802. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  38803. c.urlParams_.Set("requestId", requestId)
  38804. return c
  38805. }
  38806. // Fields allows partial responses to be retrieved. See
  38807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38808. // for more information.
  38809. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  38810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38811. return c
  38812. }
  38813. // Context sets the context to be used in this call's Do method. Any
  38814. // pending HTTP request will be aborted if the provided context is
  38815. // canceled.
  38816. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  38817. c.ctx_ = ctx
  38818. return c
  38819. }
  38820. // Header returns an http.Header that can be modified by the caller to
  38821. // add HTTP headers to the request.
  38822. func (c *BackendServicesUpdateCall) Header() http.Header {
  38823. if c.header_ == nil {
  38824. c.header_ = make(http.Header)
  38825. }
  38826. return c.header_
  38827. }
  38828. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  38829. reqHeaders := make(http.Header)
  38830. for k, v := range c.header_ {
  38831. reqHeaders[k] = v
  38832. }
  38833. reqHeaders.Set("User-Agent", c.s.userAgent())
  38834. var body io.Reader = nil
  38835. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  38836. if err != nil {
  38837. return nil, err
  38838. }
  38839. reqHeaders.Set("Content-Type", "application/json")
  38840. c.urlParams_.Set("alt", alt)
  38841. c.urlParams_.Set("prettyPrint", "false")
  38842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  38843. urls += "?" + c.urlParams_.Encode()
  38844. req, err := http.NewRequest("PUT", urls, body)
  38845. if err != nil {
  38846. return nil, err
  38847. }
  38848. req.Header = reqHeaders
  38849. googleapi.Expand(req.URL, map[string]string{
  38850. "project": c.project,
  38851. "backendService": c.backendService,
  38852. })
  38853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38854. }
  38855. // Do executes the "compute.backendServices.update" call.
  38856. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38857. // status code is an error. Response headers are in either
  38858. // *Operation.ServerResponse.Header or (if a response was returned at
  38859. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38860. // to check whether the returned error was because
  38861. // http.StatusNotModified was returned.
  38862. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38863. gensupport.SetOptions(c.urlParams_, opts...)
  38864. res, err := c.doRequest("json")
  38865. if res != nil && res.StatusCode == http.StatusNotModified {
  38866. if res.Body != nil {
  38867. res.Body.Close()
  38868. }
  38869. return nil, &googleapi.Error{
  38870. Code: res.StatusCode,
  38871. Header: res.Header,
  38872. }
  38873. }
  38874. if err != nil {
  38875. return nil, err
  38876. }
  38877. defer googleapi.CloseBody(res)
  38878. if err := googleapi.CheckResponse(res); err != nil {
  38879. return nil, err
  38880. }
  38881. ret := &Operation{
  38882. ServerResponse: googleapi.ServerResponse{
  38883. Header: res.Header,
  38884. HTTPStatusCode: res.StatusCode,
  38885. },
  38886. }
  38887. target := &ret
  38888. if err := gensupport.DecodeResponse(target, res); err != nil {
  38889. return nil, err
  38890. }
  38891. return ret, nil
  38892. // {
  38893. // "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.",
  38894. // "httpMethod": "PUT",
  38895. // "id": "compute.backendServices.update",
  38896. // "parameterOrder": [
  38897. // "project",
  38898. // "backendService"
  38899. // ],
  38900. // "parameters": {
  38901. // "backendService": {
  38902. // "description": "Name of the BackendService resource to update.",
  38903. // "location": "path",
  38904. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38905. // "required": true,
  38906. // "type": "string"
  38907. // },
  38908. // "project": {
  38909. // "description": "Project ID for this request.",
  38910. // "location": "path",
  38911. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38912. // "required": true,
  38913. // "type": "string"
  38914. // },
  38915. // "requestId": {
  38916. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38917. // "location": "query",
  38918. // "type": "string"
  38919. // }
  38920. // },
  38921. // "path": "{project}/global/backendServices/{backendService}",
  38922. // "request": {
  38923. // "$ref": "BackendService"
  38924. // },
  38925. // "response": {
  38926. // "$ref": "Operation"
  38927. // },
  38928. // "scopes": [
  38929. // "https://www.googleapis.com/auth/cloud-platform",
  38930. // "https://www.googleapis.com/auth/compute"
  38931. // ]
  38932. // }
  38933. }
  38934. // method id "compute.diskTypes.aggregatedList":
  38935. type DiskTypesAggregatedListCall struct {
  38936. s *Service
  38937. project string
  38938. urlParams_ gensupport.URLParams
  38939. ifNoneMatch_ string
  38940. ctx_ context.Context
  38941. header_ http.Header
  38942. }
  38943. // AggregatedList: Retrieves an aggregated list of disk types.
  38944. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  38945. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  38946. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38947. c.project = project
  38948. return c
  38949. }
  38950. // Filter sets the optional parameter "filter": A filter expression that
  38951. // filters resources listed in the response. The expression must specify
  38952. // the field name, a comparison operator, and the value that you want to
  38953. // use for filtering. The value must be a string, a number, or a
  38954. // boolean. The comparison operator must be either =, !=, >, or <.
  38955. //
  38956. // For example, if you are filtering Compute Engine instances, you can
  38957. // exclude instances named example-instance by specifying name !=
  38958. // example-instance.
  38959. //
  38960. // You can also filter nested fields. For example, you could specify
  38961. // scheduling.automaticRestart = false to include instances only if they
  38962. // are not scheduled for automatic restarts. You can use filtering on
  38963. // nested fields to filter based on resource labels.
  38964. //
  38965. // To filter on multiple expressions, provide each separate expression
  38966. // within parentheses. For example, (scheduling.automaticRestart = true)
  38967. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38968. // AND expression. However, you can include AND and OR expressions
  38969. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38970. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38971. // true).
  38972. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  38973. c.urlParams_.Set("filter", filter)
  38974. return c
  38975. }
  38976. // MaxResults sets the optional parameter "maxResults": The maximum
  38977. // number of results per page that should be returned. If the number of
  38978. // available results is larger than maxResults, Compute Engine returns a
  38979. // nextPageToken that can be used to get the next page of results in
  38980. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38981. // (Default: 500)
  38982. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  38983. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38984. return c
  38985. }
  38986. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38987. // a certain order. By default, results are returned in alphanumerical
  38988. // order based on the resource name.
  38989. //
  38990. // You can also sort results in descending order based on the creation
  38991. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38992. // based on the creationTimestamp field in reverse chronological order
  38993. // (newest result first). Use this to sort resources like operations so
  38994. // that the newest operation is returned first.
  38995. //
  38996. // Currently, only sorting by name or creationTimestamp desc is
  38997. // supported.
  38998. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  38999. c.urlParams_.Set("orderBy", orderBy)
  39000. return c
  39001. }
  39002. // PageToken sets the optional parameter "pageToken": Specifies a page
  39003. // token to use. Set pageToken to the nextPageToken returned by a
  39004. // previous list request to get the next page of results.
  39005. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  39006. c.urlParams_.Set("pageToken", pageToken)
  39007. return c
  39008. }
  39009. // Fields allows partial responses to be retrieved. See
  39010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39011. // for more information.
  39012. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  39013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39014. return c
  39015. }
  39016. // IfNoneMatch sets the optional parameter which makes the operation
  39017. // fail if the object's ETag matches the given value. This is useful for
  39018. // getting updates only after the object has changed since the last
  39019. // request. Use googleapi.IsNotModified to check whether the response
  39020. // error from Do is the result of In-None-Match.
  39021. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  39022. c.ifNoneMatch_ = entityTag
  39023. return c
  39024. }
  39025. // Context sets the context to be used in this call's Do method. Any
  39026. // pending HTTP request will be aborted if the provided context is
  39027. // canceled.
  39028. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  39029. c.ctx_ = ctx
  39030. return c
  39031. }
  39032. // Header returns an http.Header that can be modified by the caller to
  39033. // add HTTP headers to the request.
  39034. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  39035. if c.header_ == nil {
  39036. c.header_ = make(http.Header)
  39037. }
  39038. return c.header_
  39039. }
  39040. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  39041. reqHeaders := make(http.Header)
  39042. for k, v := range c.header_ {
  39043. reqHeaders[k] = v
  39044. }
  39045. reqHeaders.Set("User-Agent", c.s.userAgent())
  39046. if c.ifNoneMatch_ != "" {
  39047. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39048. }
  39049. var body io.Reader = nil
  39050. c.urlParams_.Set("alt", alt)
  39051. c.urlParams_.Set("prettyPrint", "false")
  39052. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  39053. urls += "?" + c.urlParams_.Encode()
  39054. req, err := http.NewRequest("GET", urls, body)
  39055. if err != nil {
  39056. return nil, err
  39057. }
  39058. req.Header = reqHeaders
  39059. googleapi.Expand(req.URL, map[string]string{
  39060. "project": c.project,
  39061. })
  39062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39063. }
  39064. // Do executes the "compute.diskTypes.aggregatedList" call.
  39065. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  39066. // non-2xx status code is an error. Response headers are in either
  39067. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  39068. // returned at all) in error.(*googleapi.Error).Header. Use
  39069. // googleapi.IsNotModified to check whether the returned error was
  39070. // because http.StatusNotModified was returned.
  39071. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  39072. gensupport.SetOptions(c.urlParams_, opts...)
  39073. res, err := c.doRequest("json")
  39074. if res != nil && res.StatusCode == http.StatusNotModified {
  39075. if res.Body != nil {
  39076. res.Body.Close()
  39077. }
  39078. return nil, &googleapi.Error{
  39079. Code: res.StatusCode,
  39080. Header: res.Header,
  39081. }
  39082. }
  39083. if err != nil {
  39084. return nil, err
  39085. }
  39086. defer googleapi.CloseBody(res)
  39087. if err := googleapi.CheckResponse(res); err != nil {
  39088. return nil, err
  39089. }
  39090. ret := &DiskTypeAggregatedList{
  39091. ServerResponse: googleapi.ServerResponse{
  39092. Header: res.Header,
  39093. HTTPStatusCode: res.StatusCode,
  39094. },
  39095. }
  39096. target := &ret
  39097. if err := gensupport.DecodeResponse(target, res); err != nil {
  39098. return nil, err
  39099. }
  39100. return ret, nil
  39101. // {
  39102. // "description": "Retrieves an aggregated list of disk types.",
  39103. // "httpMethod": "GET",
  39104. // "id": "compute.diskTypes.aggregatedList",
  39105. // "parameterOrder": [
  39106. // "project"
  39107. // ],
  39108. // "parameters": {
  39109. // "filter": {
  39110. // "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).",
  39111. // "location": "query",
  39112. // "type": "string"
  39113. // },
  39114. // "maxResults": {
  39115. // "default": "500",
  39116. // "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)",
  39117. // "format": "uint32",
  39118. // "location": "query",
  39119. // "minimum": "0",
  39120. // "type": "integer"
  39121. // },
  39122. // "orderBy": {
  39123. // "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.",
  39124. // "location": "query",
  39125. // "type": "string"
  39126. // },
  39127. // "pageToken": {
  39128. // "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.",
  39129. // "location": "query",
  39130. // "type": "string"
  39131. // },
  39132. // "project": {
  39133. // "description": "Project ID for this request.",
  39134. // "location": "path",
  39135. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39136. // "required": true,
  39137. // "type": "string"
  39138. // }
  39139. // },
  39140. // "path": "{project}/aggregated/diskTypes",
  39141. // "response": {
  39142. // "$ref": "DiskTypeAggregatedList"
  39143. // },
  39144. // "scopes": [
  39145. // "https://www.googleapis.com/auth/cloud-platform",
  39146. // "https://www.googleapis.com/auth/compute",
  39147. // "https://www.googleapis.com/auth/compute.readonly"
  39148. // ]
  39149. // }
  39150. }
  39151. // Pages invokes f for each page of results.
  39152. // A non-nil error returned from f will halt the iteration.
  39153. // The provided context supersedes any context provided to the Context method.
  39154. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  39155. c.ctx_ = ctx
  39156. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39157. for {
  39158. x, err := c.Do()
  39159. if err != nil {
  39160. return err
  39161. }
  39162. if err := f(x); err != nil {
  39163. return err
  39164. }
  39165. if x.NextPageToken == "" {
  39166. return nil
  39167. }
  39168. c.PageToken(x.NextPageToken)
  39169. }
  39170. }
  39171. // method id "compute.diskTypes.get":
  39172. type DiskTypesGetCall struct {
  39173. s *Service
  39174. project string
  39175. zone string
  39176. diskType string
  39177. urlParams_ gensupport.URLParams
  39178. ifNoneMatch_ string
  39179. ctx_ context.Context
  39180. header_ http.Header
  39181. }
  39182. // Get: Returns the specified disk type. Gets a list of available disk
  39183. // types by making a list() request.
  39184. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  39185. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  39186. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39187. c.project = project
  39188. c.zone = zone
  39189. c.diskType = diskType
  39190. return c
  39191. }
  39192. // Fields allows partial responses to be retrieved. See
  39193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39194. // for more information.
  39195. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  39196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39197. return c
  39198. }
  39199. // IfNoneMatch sets the optional parameter which makes the operation
  39200. // fail if the object's ETag matches the given value. This is useful for
  39201. // getting updates only after the object has changed since the last
  39202. // request. Use googleapi.IsNotModified to check whether the response
  39203. // error from Do is the result of In-None-Match.
  39204. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  39205. c.ifNoneMatch_ = entityTag
  39206. return c
  39207. }
  39208. // Context sets the context to be used in this call's Do method. Any
  39209. // pending HTTP request will be aborted if the provided context is
  39210. // canceled.
  39211. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  39212. c.ctx_ = ctx
  39213. return c
  39214. }
  39215. // Header returns an http.Header that can be modified by the caller to
  39216. // add HTTP headers to the request.
  39217. func (c *DiskTypesGetCall) Header() http.Header {
  39218. if c.header_ == nil {
  39219. c.header_ = make(http.Header)
  39220. }
  39221. return c.header_
  39222. }
  39223. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  39224. reqHeaders := make(http.Header)
  39225. for k, v := range c.header_ {
  39226. reqHeaders[k] = v
  39227. }
  39228. reqHeaders.Set("User-Agent", c.s.userAgent())
  39229. if c.ifNoneMatch_ != "" {
  39230. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39231. }
  39232. var body io.Reader = nil
  39233. c.urlParams_.Set("alt", alt)
  39234. c.urlParams_.Set("prettyPrint", "false")
  39235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  39236. urls += "?" + c.urlParams_.Encode()
  39237. req, err := http.NewRequest("GET", urls, body)
  39238. if err != nil {
  39239. return nil, err
  39240. }
  39241. req.Header = reqHeaders
  39242. googleapi.Expand(req.URL, map[string]string{
  39243. "project": c.project,
  39244. "zone": c.zone,
  39245. "diskType": c.diskType,
  39246. })
  39247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39248. }
  39249. // Do executes the "compute.diskTypes.get" call.
  39250. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  39251. // code is an error. Response headers are in either
  39252. // *DiskType.ServerResponse.Header or (if a response was returned at
  39253. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39254. // to check whether the returned error was because
  39255. // http.StatusNotModified was returned.
  39256. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  39257. gensupport.SetOptions(c.urlParams_, opts...)
  39258. res, err := c.doRequest("json")
  39259. if res != nil && res.StatusCode == http.StatusNotModified {
  39260. if res.Body != nil {
  39261. res.Body.Close()
  39262. }
  39263. return nil, &googleapi.Error{
  39264. Code: res.StatusCode,
  39265. Header: res.Header,
  39266. }
  39267. }
  39268. if err != nil {
  39269. return nil, err
  39270. }
  39271. defer googleapi.CloseBody(res)
  39272. if err := googleapi.CheckResponse(res); err != nil {
  39273. return nil, err
  39274. }
  39275. ret := &DiskType{
  39276. ServerResponse: googleapi.ServerResponse{
  39277. Header: res.Header,
  39278. HTTPStatusCode: res.StatusCode,
  39279. },
  39280. }
  39281. target := &ret
  39282. if err := gensupport.DecodeResponse(target, res); err != nil {
  39283. return nil, err
  39284. }
  39285. return ret, nil
  39286. // {
  39287. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  39288. // "httpMethod": "GET",
  39289. // "id": "compute.diskTypes.get",
  39290. // "parameterOrder": [
  39291. // "project",
  39292. // "zone",
  39293. // "diskType"
  39294. // ],
  39295. // "parameters": {
  39296. // "diskType": {
  39297. // "description": "Name of the disk type to return.",
  39298. // "location": "path",
  39299. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39300. // "required": true,
  39301. // "type": "string"
  39302. // },
  39303. // "project": {
  39304. // "description": "Project ID for this request.",
  39305. // "location": "path",
  39306. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39307. // "required": true,
  39308. // "type": "string"
  39309. // },
  39310. // "zone": {
  39311. // "description": "The name of the zone for this request.",
  39312. // "location": "path",
  39313. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39314. // "required": true,
  39315. // "type": "string"
  39316. // }
  39317. // },
  39318. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  39319. // "response": {
  39320. // "$ref": "DiskType"
  39321. // },
  39322. // "scopes": [
  39323. // "https://www.googleapis.com/auth/cloud-platform",
  39324. // "https://www.googleapis.com/auth/compute",
  39325. // "https://www.googleapis.com/auth/compute.readonly"
  39326. // ]
  39327. // }
  39328. }
  39329. // method id "compute.diskTypes.list":
  39330. type DiskTypesListCall struct {
  39331. s *Service
  39332. project string
  39333. zone string
  39334. urlParams_ gensupport.URLParams
  39335. ifNoneMatch_ string
  39336. ctx_ context.Context
  39337. header_ http.Header
  39338. }
  39339. // List: Retrieves a list of disk types available to the specified
  39340. // project.
  39341. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  39342. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  39343. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39344. c.project = project
  39345. c.zone = zone
  39346. return c
  39347. }
  39348. // Filter sets the optional parameter "filter": A filter expression that
  39349. // filters resources listed in the response. The expression must specify
  39350. // the field name, a comparison operator, and the value that you want to
  39351. // use for filtering. The value must be a string, a number, or a
  39352. // boolean. The comparison operator must be either =, !=, >, or <.
  39353. //
  39354. // For example, if you are filtering Compute Engine instances, you can
  39355. // exclude instances named example-instance by specifying name !=
  39356. // example-instance.
  39357. //
  39358. // You can also filter nested fields. For example, you could specify
  39359. // scheduling.automaticRestart = false to include instances only if they
  39360. // are not scheduled for automatic restarts. You can use filtering on
  39361. // nested fields to filter based on resource labels.
  39362. //
  39363. // To filter on multiple expressions, provide each separate expression
  39364. // within parentheses. For example, (scheduling.automaticRestart = true)
  39365. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39366. // AND expression. However, you can include AND and OR expressions
  39367. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39368. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39369. // true).
  39370. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  39371. c.urlParams_.Set("filter", filter)
  39372. return c
  39373. }
  39374. // MaxResults sets the optional parameter "maxResults": The maximum
  39375. // number of results per page that should be returned. If the number of
  39376. // available results is larger than maxResults, Compute Engine returns a
  39377. // nextPageToken that can be used to get the next page of results in
  39378. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39379. // (Default: 500)
  39380. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  39381. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39382. return c
  39383. }
  39384. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39385. // a certain order. By default, results are returned in alphanumerical
  39386. // order based on the resource name.
  39387. //
  39388. // You can also sort results in descending order based on the creation
  39389. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39390. // based on the creationTimestamp field in reverse chronological order
  39391. // (newest result first). Use this to sort resources like operations so
  39392. // that the newest operation is returned first.
  39393. //
  39394. // Currently, only sorting by name or creationTimestamp desc is
  39395. // supported.
  39396. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  39397. c.urlParams_.Set("orderBy", orderBy)
  39398. return c
  39399. }
  39400. // PageToken sets the optional parameter "pageToken": Specifies a page
  39401. // token to use. Set pageToken to the nextPageToken returned by a
  39402. // previous list request to get the next page of results.
  39403. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  39404. c.urlParams_.Set("pageToken", pageToken)
  39405. return c
  39406. }
  39407. // Fields allows partial responses to be retrieved. See
  39408. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39409. // for more information.
  39410. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  39411. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39412. return c
  39413. }
  39414. // IfNoneMatch sets the optional parameter which makes the operation
  39415. // fail if the object's ETag matches the given value. This is useful for
  39416. // getting updates only after the object has changed since the last
  39417. // request. Use googleapi.IsNotModified to check whether the response
  39418. // error from Do is the result of In-None-Match.
  39419. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  39420. c.ifNoneMatch_ = entityTag
  39421. return c
  39422. }
  39423. // Context sets the context to be used in this call's Do method. Any
  39424. // pending HTTP request will be aborted if the provided context is
  39425. // canceled.
  39426. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  39427. c.ctx_ = ctx
  39428. return c
  39429. }
  39430. // Header returns an http.Header that can be modified by the caller to
  39431. // add HTTP headers to the request.
  39432. func (c *DiskTypesListCall) Header() http.Header {
  39433. if c.header_ == nil {
  39434. c.header_ = make(http.Header)
  39435. }
  39436. return c.header_
  39437. }
  39438. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  39439. reqHeaders := make(http.Header)
  39440. for k, v := range c.header_ {
  39441. reqHeaders[k] = v
  39442. }
  39443. reqHeaders.Set("User-Agent", c.s.userAgent())
  39444. if c.ifNoneMatch_ != "" {
  39445. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39446. }
  39447. var body io.Reader = nil
  39448. c.urlParams_.Set("alt", alt)
  39449. c.urlParams_.Set("prettyPrint", "false")
  39450. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  39451. urls += "?" + c.urlParams_.Encode()
  39452. req, err := http.NewRequest("GET", urls, body)
  39453. if err != nil {
  39454. return nil, err
  39455. }
  39456. req.Header = reqHeaders
  39457. googleapi.Expand(req.URL, map[string]string{
  39458. "project": c.project,
  39459. "zone": c.zone,
  39460. })
  39461. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39462. }
  39463. // Do executes the "compute.diskTypes.list" call.
  39464. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  39465. // status code is an error. Response headers are in either
  39466. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  39467. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39468. // to check whether the returned error was because
  39469. // http.StatusNotModified was returned.
  39470. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  39471. gensupport.SetOptions(c.urlParams_, opts...)
  39472. res, err := c.doRequest("json")
  39473. if res != nil && res.StatusCode == http.StatusNotModified {
  39474. if res.Body != nil {
  39475. res.Body.Close()
  39476. }
  39477. return nil, &googleapi.Error{
  39478. Code: res.StatusCode,
  39479. Header: res.Header,
  39480. }
  39481. }
  39482. if err != nil {
  39483. return nil, err
  39484. }
  39485. defer googleapi.CloseBody(res)
  39486. if err := googleapi.CheckResponse(res); err != nil {
  39487. return nil, err
  39488. }
  39489. ret := &DiskTypeList{
  39490. ServerResponse: googleapi.ServerResponse{
  39491. Header: res.Header,
  39492. HTTPStatusCode: res.StatusCode,
  39493. },
  39494. }
  39495. target := &ret
  39496. if err := gensupport.DecodeResponse(target, res); err != nil {
  39497. return nil, err
  39498. }
  39499. return ret, nil
  39500. // {
  39501. // "description": "Retrieves a list of disk types available to the specified project.",
  39502. // "httpMethod": "GET",
  39503. // "id": "compute.diskTypes.list",
  39504. // "parameterOrder": [
  39505. // "project",
  39506. // "zone"
  39507. // ],
  39508. // "parameters": {
  39509. // "filter": {
  39510. // "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).",
  39511. // "location": "query",
  39512. // "type": "string"
  39513. // },
  39514. // "maxResults": {
  39515. // "default": "500",
  39516. // "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)",
  39517. // "format": "uint32",
  39518. // "location": "query",
  39519. // "minimum": "0",
  39520. // "type": "integer"
  39521. // },
  39522. // "orderBy": {
  39523. // "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.",
  39524. // "location": "query",
  39525. // "type": "string"
  39526. // },
  39527. // "pageToken": {
  39528. // "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.",
  39529. // "location": "query",
  39530. // "type": "string"
  39531. // },
  39532. // "project": {
  39533. // "description": "Project ID for this request.",
  39534. // "location": "path",
  39535. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39536. // "required": true,
  39537. // "type": "string"
  39538. // },
  39539. // "zone": {
  39540. // "description": "The name of the zone for this request.",
  39541. // "location": "path",
  39542. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39543. // "required": true,
  39544. // "type": "string"
  39545. // }
  39546. // },
  39547. // "path": "{project}/zones/{zone}/diskTypes",
  39548. // "response": {
  39549. // "$ref": "DiskTypeList"
  39550. // },
  39551. // "scopes": [
  39552. // "https://www.googleapis.com/auth/cloud-platform",
  39553. // "https://www.googleapis.com/auth/compute",
  39554. // "https://www.googleapis.com/auth/compute.readonly"
  39555. // ]
  39556. // }
  39557. }
  39558. // Pages invokes f for each page of results.
  39559. // A non-nil error returned from f will halt the iteration.
  39560. // The provided context supersedes any context provided to the Context method.
  39561. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  39562. c.ctx_ = ctx
  39563. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39564. for {
  39565. x, err := c.Do()
  39566. if err != nil {
  39567. return err
  39568. }
  39569. if err := f(x); err != nil {
  39570. return err
  39571. }
  39572. if x.NextPageToken == "" {
  39573. return nil
  39574. }
  39575. c.PageToken(x.NextPageToken)
  39576. }
  39577. }
  39578. // method id "compute.disks.addResourcePolicies":
  39579. type DisksAddResourcePoliciesCall struct {
  39580. s *Service
  39581. project string
  39582. zone string
  39583. disk string
  39584. disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest
  39585. urlParams_ gensupport.URLParams
  39586. ctx_ context.Context
  39587. header_ http.Header
  39588. }
  39589. // AddResourcePolicies: Adds existing resource policies to a disk. You
  39590. // can only add one policy which will be applied to this disk for
  39591. // scheduling snapshot creation.
  39592. func (r *DisksService) AddResourcePolicies(project string, zone string, disk string, disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest) *DisksAddResourcePoliciesCall {
  39593. c := &DisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39594. c.project = project
  39595. c.zone = zone
  39596. c.disk = disk
  39597. c.disksaddresourcepoliciesrequest = disksaddresourcepoliciesrequest
  39598. return c
  39599. }
  39600. // RequestId sets the optional parameter "requestId": An optional
  39601. // request ID to identify requests. Specify a unique request ID so that
  39602. // if you must retry your request, the server will know to ignore the
  39603. // request if it has already been completed.
  39604. //
  39605. // For example, consider a situation where you make an initial request
  39606. // and the request times out. If you make the request again with the
  39607. // same request ID, the server can check if original operation with the
  39608. // same request ID was received, and if so, will ignore the second
  39609. // request. This prevents clients from accidentally creating duplicate
  39610. // commitments.
  39611. //
  39612. // The request ID must be a valid UUID with the exception that zero UUID
  39613. // is not supported (00000000-0000-0000-0000-000000000000).
  39614. func (c *DisksAddResourcePoliciesCall) RequestId(requestId string) *DisksAddResourcePoliciesCall {
  39615. c.urlParams_.Set("requestId", requestId)
  39616. return c
  39617. }
  39618. // Fields allows partial responses to be retrieved. See
  39619. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39620. // for more information.
  39621. func (c *DisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksAddResourcePoliciesCall {
  39622. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39623. return c
  39624. }
  39625. // Context sets the context to be used in this call's Do method. Any
  39626. // pending HTTP request will be aborted if the provided context is
  39627. // canceled.
  39628. func (c *DisksAddResourcePoliciesCall) Context(ctx context.Context) *DisksAddResourcePoliciesCall {
  39629. c.ctx_ = ctx
  39630. return c
  39631. }
  39632. // Header returns an http.Header that can be modified by the caller to
  39633. // add HTTP headers to the request.
  39634. func (c *DisksAddResourcePoliciesCall) Header() http.Header {
  39635. if c.header_ == nil {
  39636. c.header_ = make(http.Header)
  39637. }
  39638. return c.header_
  39639. }
  39640. func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  39641. reqHeaders := make(http.Header)
  39642. for k, v := range c.header_ {
  39643. reqHeaders[k] = v
  39644. }
  39645. reqHeaders.Set("User-Agent", c.s.userAgent())
  39646. var body io.Reader = nil
  39647. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest)
  39648. if err != nil {
  39649. return nil, err
  39650. }
  39651. reqHeaders.Set("Content-Type", "application/json")
  39652. c.urlParams_.Set("alt", alt)
  39653. c.urlParams_.Set("prettyPrint", "false")
  39654. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/addResourcePolicies")
  39655. urls += "?" + c.urlParams_.Encode()
  39656. req, err := http.NewRequest("POST", urls, body)
  39657. if err != nil {
  39658. return nil, err
  39659. }
  39660. req.Header = reqHeaders
  39661. googleapi.Expand(req.URL, map[string]string{
  39662. "project": c.project,
  39663. "zone": c.zone,
  39664. "disk": c.disk,
  39665. })
  39666. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39667. }
  39668. // Do executes the "compute.disks.addResourcePolicies" call.
  39669. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39670. // status code is an error. Response headers are in either
  39671. // *Operation.ServerResponse.Header or (if a response was returned at
  39672. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39673. // to check whether the returned error was because
  39674. // http.StatusNotModified was returned.
  39675. func (c *DisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39676. gensupport.SetOptions(c.urlParams_, opts...)
  39677. res, err := c.doRequest("json")
  39678. if res != nil && res.StatusCode == http.StatusNotModified {
  39679. if res.Body != nil {
  39680. res.Body.Close()
  39681. }
  39682. return nil, &googleapi.Error{
  39683. Code: res.StatusCode,
  39684. Header: res.Header,
  39685. }
  39686. }
  39687. if err != nil {
  39688. return nil, err
  39689. }
  39690. defer googleapi.CloseBody(res)
  39691. if err := googleapi.CheckResponse(res); err != nil {
  39692. return nil, err
  39693. }
  39694. ret := &Operation{
  39695. ServerResponse: googleapi.ServerResponse{
  39696. Header: res.Header,
  39697. HTTPStatusCode: res.StatusCode,
  39698. },
  39699. }
  39700. target := &ret
  39701. if err := gensupport.DecodeResponse(target, res); err != nil {
  39702. return nil, err
  39703. }
  39704. return ret, nil
  39705. // {
  39706. // "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.",
  39707. // "httpMethod": "POST",
  39708. // "id": "compute.disks.addResourcePolicies",
  39709. // "parameterOrder": [
  39710. // "project",
  39711. // "zone",
  39712. // "disk"
  39713. // ],
  39714. // "parameters": {
  39715. // "disk": {
  39716. // "description": "The disk name for this request.",
  39717. // "location": "path",
  39718. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39719. // "required": true,
  39720. // "type": "string"
  39721. // },
  39722. // "project": {
  39723. // "description": "Project ID for this request.",
  39724. // "location": "path",
  39725. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39726. // "required": true,
  39727. // "type": "string"
  39728. // },
  39729. // "requestId": {
  39730. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39731. // "location": "query",
  39732. // "type": "string"
  39733. // },
  39734. // "zone": {
  39735. // "description": "The name of the zone for this request.",
  39736. // "location": "path",
  39737. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39738. // "required": true,
  39739. // "type": "string"
  39740. // }
  39741. // },
  39742. // "path": "{project}/zones/{zone}/disks/{disk}/addResourcePolicies",
  39743. // "request": {
  39744. // "$ref": "DisksAddResourcePoliciesRequest"
  39745. // },
  39746. // "response": {
  39747. // "$ref": "Operation"
  39748. // },
  39749. // "scopes": [
  39750. // "https://www.googleapis.com/auth/cloud-platform",
  39751. // "https://www.googleapis.com/auth/compute"
  39752. // ]
  39753. // }
  39754. }
  39755. // method id "compute.disks.aggregatedList":
  39756. type DisksAggregatedListCall struct {
  39757. s *Service
  39758. project string
  39759. urlParams_ gensupport.URLParams
  39760. ifNoneMatch_ string
  39761. ctx_ context.Context
  39762. header_ http.Header
  39763. }
  39764. // AggregatedList: Retrieves an aggregated list of persistent disks.
  39765. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  39766. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  39767. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39768. c.project = project
  39769. return c
  39770. }
  39771. // Filter sets the optional parameter "filter": A filter expression that
  39772. // filters resources listed in the response. The expression must specify
  39773. // the field name, a comparison operator, and the value that you want to
  39774. // use for filtering. The value must be a string, a number, or a
  39775. // boolean. The comparison operator must be either =, !=, >, or <.
  39776. //
  39777. // For example, if you are filtering Compute Engine instances, you can
  39778. // exclude instances named example-instance by specifying name !=
  39779. // example-instance.
  39780. //
  39781. // You can also filter nested fields. For example, you could specify
  39782. // scheduling.automaticRestart = false to include instances only if they
  39783. // are not scheduled for automatic restarts. You can use filtering on
  39784. // nested fields to filter based on resource labels.
  39785. //
  39786. // To filter on multiple expressions, provide each separate expression
  39787. // within parentheses. For example, (scheduling.automaticRestart = true)
  39788. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39789. // AND expression. However, you can include AND and OR expressions
  39790. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39791. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39792. // true).
  39793. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  39794. c.urlParams_.Set("filter", filter)
  39795. return c
  39796. }
  39797. // MaxResults sets the optional parameter "maxResults": The maximum
  39798. // number of results per page that should be returned. If the number of
  39799. // available results is larger than maxResults, Compute Engine returns a
  39800. // nextPageToken that can be used to get the next page of results in
  39801. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39802. // (Default: 500)
  39803. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  39804. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39805. return c
  39806. }
  39807. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39808. // a certain order. By default, results are returned in alphanumerical
  39809. // order based on the resource name.
  39810. //
  39811. // You can also sort results in descending order based on the creation
  39812. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39813. // based on the creationTimestamp field in reverse chronological order
  39814. // (newest result first). Use this to sort resources like operations so
  39815. // that the newest operation is returned first.
  39816. //
  39817. // Currently, only sorting by name or creationTimestamp desc is
  39818. // supported.
  39819. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  39820. c.urlParams_.Set("orderBy", orderBy)
  39821. return c
  39822. }
  39823. // PageToken sets the optional parameter "pageToken": Specifies a page
  39824. // token to use. Set pageToken to the nextPageToken returned by a
  39825. // previous list request to get the next page of results.
  39826. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  39827. c.urlParams_.Set("pageToken", pageToken)
  39828. return c
  39829. }
  39830. // Fields allows partial responses to be retrieved. See
  39831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39832. // for more information.
  39833. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  39834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39835. return c
  39836. }
  39837. // IfNoneMatch sets the optional parameter which makes the operation
  39838. // fail if the object's ETag matches the given value. This is useful for
  39839. // getting updates only after the object has changed since the last
  39840. // request. Use googleapi.IsNotModified to check whether the response
  39841. // error from Do is the result of In-None-Match.
  39842. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  39843. c.ifNoneMatch_ = entityTag
  39844. return c
  39845. }
  39846. // Context sets the context to be used in this call's Do method. Any
  39847. // pending HTTP request will be aborted if the provided context is
  39848. // canceled.
  39849. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  39850. c.ctx_ = ctx
  39851. return c
  39852. }
  39853. // Header returns an http.Header that can be modified by the caller to
  39854. // add HTTP headers to the request.
  39855. func (c *DisksAggregatedListCall) Header() http.Header {
  39856. if c.header_ == nil {
  39857. c.header_ = make(http.Header)
  39858. }
  39859. return c.header_
  39860. }
  39861. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  39862. reqHeaders := make(http.Header)
  39863. for k, v := range c.header_ {
  39864. reqHeaders[k] = v
  39865. }
  39866. reqHeaders.Set("User-Agent", c.s.userAgent())
  39867. if c.ifNoneMatch_ != "" {
  39868. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39869. }
  39870. var body io.Reader = nil
  39871. c.urlParams_.Set("alt", alt)
  39872. c.urlParams_.Set("prettyPrint", "false")
  39873. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  39874. urls += "?" + c.urlParams_.Encode()
  39875. req, err := http.NewRequest("GET", urls, body)
  39876. if err != nil {
  39877. return nil, err
  39878. }
  39879. req.Header = reqHeaders
  39880. googleapi.Expand(req.URL, map[string]string{
  39881. "project": c.project,
  39882. })
  39883. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39884. }
  39885. // Do executes the "compute.disks.aggregatedList" call.
  39886. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  39887. // non-2xx status code is an error. Response headers are in either
  39888. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  39889. // returned at all) in error.(*googleapi.Error).Header. Use
  39890. // googleapi.IsNotModified to check whether the returned error was
  39891. // because http.StatusNotModified was returned.
  39892. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  39893. gensupport.SetOptions(c.urlParams_, opts...)
  39894. res, err := c.doRequest("json")
  39895. if res != nil && res.StatusCode == http.StatusNotModified {
  39896. if res.Body != nil {
  39897. res.Body.Close()
  39898. }
  39899. return nil, &googleapi.Error{
  39900. Code: res.StatusCode,
  39901. Header: res.Header,
  39902. }
  39903. }
  39904. if err != nil {
  39905. return nil, err
  39906. }
  39907. defer googleapi.CloseBody(res)
  39908. if err := googleapi.CheckResponse(res); err != nil {
  39909. return nil, err
  39910. }
  39911. ret := &DiskAggregatedList{
  39912. ServerResponse: googleapi.ServerResponse{
  39913. Header: res.Header,
  39914. HTTPStatusCode: res.StatusCode,
  39915. },
  39916. }
  39917. target := &ret
  39918. if err := gensupport.DecodeResponse(target, res); err != nil {
  39919. return nil, err
  39920. }
  39921. return ret, nil
  39922. // {
  39923. // "description": "Retrieves an aggregated list of persistent disks.",
  39924. // "httpMethod": "GET",
  39925. // "id": "compute.disks.aggregatedList",
  39926. // "parameterOrder": [
  39927. // "project"
  39928. // ],
  39929. // "parameters": {
  39930. // "filter": {
  39931. // "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).",
  39932. // "location": "query",
  39933. // "type": "string"
  39934. // },
  39935. // "maxResults": {
  39936. // "default": "500",
  39937. // "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)",
  39938. // "format": "uint32",
  39939. // "location": "query",
  39940. // "minimum": "0",
  39941. // "type": "integer"
  39942. // },
  39943. // "orderBy": {
  39944. // "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.",
  39945. // "location": "query",
  39946. // "type": "string"
  39947. // },
  39948. // "pageToken": {
  39949. // "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.",
  39950. // "location": "query",
  39951. // "type": "string"
  39952. // },
  39953. // "project": {
  39954. // "description": "Project ID for this request.",
  39955. // "location": "path",
  39956. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39957. // "required": true,
  39958. // "type": "string"
  39959. // }
  39960. // },
  39961. // "path": "{project}/aggregated/disks",
  39962. // "response": {
  39963. // "$ref": "DiskAggregatedList"
  39964. // },
  39965. // "scopes": [
  39966. // "https://www.googleapis.com/auth/cloud-platform",
  39967. // "https://www.googleapis.com/auth/compute",
  39968. // "https://www.googleapis.com/auth/compute.readonly"
  39969. // ]
  39970. // }
  39971. }
  39972. // Pages invokes f for each page of results.
  39973. // A non-nil error returned from f will halt the iteration.
  39974. // The provided context supersedes any context provided to the Context method.
  39975. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  39976. c.ctx_ = ctx
  39977. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39978. for {
  39979. x, err := c.Do()
  39980. if err != nil {
  39981. return err
  39982. }
  39983. if err := f(x); err != nil {
  39984. return err
  39985. }
  39986. if x.NextPageToken == "" {
  39987. return nil
  39988. }
  39989. c.PageToken(x.NextPageToken)
  39990. }
  39991. }
  39992. // method id "compute.disks.createSnapshot":
  39993. type DisksCreateSnapshotCall struct {
  39994. s *Service
  39995. project string
  39996. zone string
  39997. disk string
  39998. snapshot *Snapshot
  39999. urlParams_ gensupport.URLParams
  40000. ctx_ context.Context
  40001. header_ http.Header
  40002. }
  40003. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  40004. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  40005. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  40006. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40007. c.project = project
  40008. c.zone = zone
  40009. c.disk = disk
  40010. c.snapshot = snapshot
  40011. return c
  40012. }
  40013. // GuestFlush sets the optional parameter "guestFlush":
  40014. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  40015. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  40016. return c
  40017. }
  40018. // RequestId sets the optional parameter "requestId": An optional
  40019. // request ID to identify requests. Specify a unique request ID so that
  40020. // if you must retry your request, the server will know to ignore the
  40021. // request if it has already been completed.
  40022. //
  40023. // For example, consider a situation where you make an initial request
  40024. // and the request times out. If you make the request again with the
  40025. // same request ID, the server can check if original operation with the
  40026. // same request ID was received, and if so, will ignore the second
  40027. // request. This prevents clients from accidentally creating duplicate
  40028. // commitments.
  40029. //
  40030. // The request ID must be a valid UUID with the exception that zero UUID
  40031. // is not supported (00000000-0000-0000-0000-000000000000).
  40032. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  40033. c.urlParams_.Set("requestId", requestId)
  40034. return c
  40035. }
  40036. // Fields allows partial responses to be retrieved. See
  40037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40038. // for more information.
  40039. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  40040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40041. return c
  40042. }
  40043. // Context sets the context to be used in this call's Do method. Any
  40044. // pending HTTP request will be aborted if the provided context is
  40045. // canceled.
  40046. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  40047. c.ctx_ = ctx
  40048. return c
  40049. }
  40050. // Header returns an http.Header that can be modified by the caller to
  40051. // add HTTP headers to the request.
  40052. func (c *DisksCreateSnapshotCall) Header() http.Header {
  40053. if c.header_ == nil {
  40054. c.header_ = make(http.Header)
  40055. }
  40056. return c.header_
  40057. }
  40058. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  40059. reqHeaders := make(http.Header)
  40060. for k, v := range c.header_ {
  40061. reqHeaders[k] = v
  40062. }
  40063. reqHeaders.Set("User-Agent", c.s.userAgent())
  40064. var body io.Reader = nil
  40065. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  40066. if err != nil {
  40067. return nil, err
  40068. }
  40069. reqHeaders.Set("Content-Type", "application/json")
  40070. c.urlParams_.Set("alt", alt)
  40071. c.urlParams_.Set("prettyPrint", "false")
  40072. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  40073. urls += "?" + c.urlParams_.Encode()
  40074. req, err := http.NewRequest("POST", urls, body)
  40075. if err != nil {
  40076. return nil, err
  40077. }
  40078. req.Header = reqHeaders
  40079. googleapi.Expand(req.URL, map[string]string{
  40080. "project": c.project,
  40081. "zone": c.zone,
  40082. "disk": c.disk,
  40083. })
  40084. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40085. }
  40086. // Do executes the "compute.disks.createSnapshot" call.
  40087. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40088. // status code is an error. Response headers are in either
  40089. // *Operation.ServerResponse.Header or (if a response was returned at
  40090. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40091. // to check whether the returned error was because
  40092. // http.StatusNotModified was returned.
  40093. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40094. gensupport.SetOptions(c.urlParams_, opts...)
  40095. res, err := c.doRequest("json")
  40096. if res != nil && res.StatusCode == http.StatusNotModified {
  40097. if res.Body != nil {
  40098. res.Body.Close()
  40099. }
  40100. return nil, &googleapi.Error{
  40101. Code: res.StatusCode,
  40102. Header: res.Header,
  40103. }
  40104. }
  40105. if err != nil {
  40106. return nil, err
  40107. }
  40108. defer googleapi.CloseBody(res)
  40109. if err := googleapi.CheckResponse(res); err != nil {
  40110. return nil, err
  40111. }
  40112. ret := &Operation{
  40113. ServerResponse: googleapi.ServerResponse{
  40114. Header: res.Header,
  40115. HTTPStatusCode: res.StatusCode,
  40116. },
  40117. }
  40118. target := &ret
  40119. if err := gensupport.DecodeResponse(target, res); err != nil {
  40120. return nil, err
  40121. }
  40122. return ret, nil
  40123. // {
  40124. // "description": "Creates a snapshot of a specified persistent disk.",
  40125. // "httpMethod": "POST",
  40126. // "id": "compute.disks.createSnapshot",
  40127. // "parameterOrder": [
  40128. // "project",
  40129. // "zone",
  40130. // "disk"
  40131. // ],
  40132. // "parameters": {
  40133. // "disk": {
  40134. // "description": "Name of the persistent disk to snapshot.",
  40135. // "location": "path",
  40136. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40137. // "required": true,
  40138. // "type": "string"
  40139. // },
  40140. // "guestFlush": {
  40141. // "location": "query",
  40142. // "type": "boolean"
  40143. // },
  40144. // "project": {
  40145. // "description": "Project ID for this request.",
  40146. // "location": "path",
  40147. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40148. // "required": true,
  40149. // "type": "string"
  40150. // },
  40151. // "requestId": {
  40152. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40153. // "location": "query",
  40154. // "type": "string"
  40155. // },
  40156. // "zone": {
  40157. // "description": "The name of the zone for this request.",
  40158. // "location": "path",
  40159. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40160. // "required": true,
  40161. // "type": "string"
  40162. // }
  40163. // },
  40164. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  40165. // "request": {
  40166. // "$ref": "Snapshot"
  40167. // },
  40168. // "response": {
  40169. // "$ref": "Operation"
  40170. // },
  40171. // "scopes": [
  40172. // "https://www.googleapis.com/auth/cloud-platform",
  40173. // "https://www.googleapis.com/auth/compute"
  40174. // ]
  40175. // }
  40176. }
  40177. // method id "compute.disks.delete":
  40178. type DisksDeleteCall struct {
  40179. s *Service
  40180. project string
  40181. zone string
  40182. disk string
  40183. urlParams_ gensupport.URLParams
  40184. ctx_ context.Context
  40185. header_ http.Header
  40186. }
  40187. // Delete: Deletes the specified persistent disk. Deleting a disk
  40188. // removes its data permanently and is irreversible. However, deleting a
  40189. // disk does not delete any snapshots previously made from the disk. You
  40190. // must separately delete snapshots.
  40191. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  40192. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  40193. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40194. c.project = project
  40195. c.zone = zone
  40196. c.disk = disk
  40197. return c
  40198. }
  40199. // RequestId sets the optional parameter "requestId": An optional
  40200. // request ID to identify requests. Specify a unique request ID so that
  40201. // if you must retry your request, the server will know to ignore the
  40202. // request if it has already been completed.
  40203. //
  40204. // For example, consider a situation where you make an initial request
  40205. // and the request times out. If you make the request again with the
  40206. // same request ID, the server can check if original operation with the
  40207. // same request ID was received, and if so, will ignore the second
  40208. // request. This prevents clients from accidentally creating duplicate
  40209. // commitments.
  40210. //
  40211. // The request ID must be a valid UUID with the exception that zero UUID
  40212. // is not supported (00000000-0000-0000-0000-000000000000).
  40213. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  40214. c.urlParams_.Set("requestId", requestId)
  40215. return c
  40216. }
  40217. // Fields allows partial responses to be retrieved. See
  40218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40219. // for more information.
  40220. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  40221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40222. return c
  40223. }
  40224. // Context sets the context to be used in this call's Do method. Any
  40225. // pending HTTP request will be aborted if the provided context is
  40226. // canceled.
  40227. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  40228. c.ctx_ = ctx
  40229. return c
  40230. }
  40231. // Header returns an http.Header that can be modified by the caller to
  40232. // add HTTP headers to the request.
  40233. func (c *DisksDeleteCall) Header() http.Header {
  40234. if c.header_ == nil {
  40235. c.header_ = make(http.Header)
  40236. }
  40237. return c.header_
  40238. }
  40239. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  40240. reqHeaders := make(http.Header)
  40241. for k, v := range c.header_ {
  40242. reqHeaders[k] = v
  40243. }
  40244. reqHeaders.Set("User-Agent", c.s.userAgent())
  40245. var body io.Reader = nil
  40246. c.urlParams_.Set("alt", alt)
  40247. c.urlParams_.Set("prettyPrint", "false")
  40248. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  40249. urls += "?" + c.urlParams_.Encode()
  40250. req, err := http.NewRequest("DELETE", urls, body)
  40251. if err != nil {
  40252. return nil, err
  40253. }
  40254. req.Header = reqHeaders
  40255. googleapi.Expand(req.URL, map[string]string{
  40256. "project": c.project,
  40257. "zone": c.zone,
  40258. "disk": c.disk,
  40259. })
  40260. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40261. }
  40262. // Do executes the "compute.disks.delete" call.
  40263. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40264. // status code is an error. Response headers are in either
  40265. // *Operation.ServerResponse.Header or (if a response was returned at
  40266. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40267. // to check whether the returned error was because
  40268. // http.StatusNotModified was returned.
  40269. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40270. gensupport.SetOptions(c.urlParams_, opts...)
  40271. res, err := c.doRequest("json")
  40272. if res != nil && res.StatusCode == http.StatusNotModified {
  40273. if res.Body != nil {
  40274. res.Body.Close()
  40275. }
  40276. return nil, &googleapi.Error{
  40277. Code: res.StatusCode,
  40278. Header: res.Header,
  40279. }
  40280. }
  40281. if err != nil {
  40282. return nil, err
  40283. }
  40284. defer googleapi.CloseBody(res)
  40285. if err := googleapi.CheckResponse(res); err != nil {
  40286. return nil, err
  40287. }
  40288. ret := &Operation{
  40289. ServerResponse: googleapi.ServerResponse{
  40290. Header: res.Header,
  40291. HTTPStatusCode: res.StatusCode,
  40292. },
  40293. }
  40294. target := &ret
  40295. if err := gensupport.DecodeResponse(target, res); err != nil {
  40296. return nil, err
  40297. }
  40298. return ret, nil
  40299. // {
  40300. // "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.",
  40301. // "httpMethod": "DELETE",
  40302. // "id": "compute.disks.delete",
  40303. // "parameterOrder": [
  40304. // "project",
  40305. // "zone",
  40306. // "disk"
  40307. // ],
  40308. // "parameters": {
  40309. // "disk": {
  40310. // "description": "Name of the persistent disk to delete.",
  40311. // "location": "path",
  40312. // "required": true,
  40313. // "type": "string"
  40314. // },
  40315. // "project": {
  40316. // "description": "Project ID for this request.",
  40317. // "location": "path",
  40318. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40319. // "required": true,
  40320. // "type": "string"
  40321. // },
  40322. // "requestId": {
  40323. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40324. // "location": "query",
  40325. // "type": "string"
  40326. // },
  40327. // "zone": {
  40328. // "description": "The name of the zone for this request.",
  40329. // "location": "path",
  40330. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40331. // "required": true,
  40332. // "type": "string"
  40333. // }
  40334. // },
  40335. // "path": "{project}/zones/{zone}/disks/{disk}",
  40336. // "response": {
  40337. // "$ref": "Operation"
  40338. // },
  40339. // "scopes": [
  40340. // "https://www.googleapis.com/auth/cloud-platform",
  40341. // "https://www.googleapis.com/auth/compute"
  40342. // ]
  40343. // }
  40344. }
  40345. // method id "compute.disks.get":
  40346. type DisksGetCall struct {
  40347. s *Service
  40348. project string
  40349. zone string
  40350. disk string
  40351. urlParams_ gensupport.URLParams
  40352. ifNoneMatch_ string
  40353. ctx_ context.Context
  40354. header_ http.Header
  40355. }
  40356. // Get: Returns a specified persistent disk. Gets a list of available
  40357. // persistent disks by making a list() request.
  40358. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  40359. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  40360. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40361. c.project = project
  40362. c.zone = zone
  40363. c.disk = disk
  40364. return c
  40365. }
  40366. // Fields allows partial responses to be retrieved. See
  40367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40368. // for more information.
  40369. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  40370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40371. return c
  40372. }
  40373. // IfNoneMatch sets the optional parameter which makes the operation
  40374. // fail if the object's ETag matches the given value. This is useful for
  40375. // getting updates only after the object has changed since the last
  40376. // request. Use googleapi.IsNotModified to check whether the response
  40377. // error from Do is the result of In-None-Match.
  40378. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  40379. c.ifNoneMatch_ = entityTag
  40380. return c
  40381. }
  40382. // Context sets the context to be used in this call's Do method. Any
  40383. // pending HTTP request will be aborted if the provided context is
  40384. // canceled.
  40385. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  40386. c.ctx_ = ctx
  40387. return c
  40388. }
  40389. // Header returns an http.Header that can be modified by the caller to
  40390. // add HTTP headers to the request.
  40391. func (c *DisksGetCall) Header() http.Header {
  40392. if c.header_ == nil {
  40393. c.header_ = make(http.Header)
  40394. }
  40395. return c.header_
  40396. }
  40397. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  40398. reqHeaders := make(http.Header)
  40399. for k, v := range c.header_ {
  40400. reqHeaders[k] = v
  40401. }
  40402. reqHeaders.Set("User-Agent", c.s.userAgent())
  40403. if c.ifNoneMatch_ != "" {
  40404. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40405. }
  40406. var body io.Reader = nil
  40407. c.urlParams_.Set("alt", alt)
  40408. c.urlParams_.Set("prettyPrint", "false")
  40409. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  40410. urls += "?" + c.urlParams_.Encode()
  40411. req, err := http.NewRequest("GET", urls, body)
  40412. if err != nil {
  40413. return nil, err
  40414. }
  40415. req.Header = reqHeaders
  40416. googleapi.Expand(req.URL, map[string]string{
  40417. "project": c.project,
  40418. "zone": c.zone,
  40419. "disk": c.disk,
  40420. })
  40421. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40422. }
  40423. // Do executes the "compute.disks.get" call.
  40424. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  40425. // code is an error. Response headers are in either
  40426. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  40427. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40428. // whether the returned error was because http.StatusNotModified was
  40429. // returned.
  40430. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  40431. gensupport.SetOptions(c.urlParams_, opts...)
  40432. res, err := c.doRequest("json")
  40433. if res != nil && res.StatusCode == http.StatusNotModified {
  40434. if res.Body != nil {
  40435. res.Body.Close()
  40436. }
  40437. return nil, &googleapi.Error{
  40438. Code: res.StatusCode,
  40439. Header: res.Header,
  40440. }
  40441. }
  40442. if err != nil {
  40443. return nil, err
  40444. }
  40445. defer googleapi.CloseBody(res)
  40446. if err := googleapi.CheckResponse(res); err != nil {
  40447. return nil, err
  40448. }
  40449. ret := &Disk{
  40450. ServerResponse: googleapi.ServerResponse{
  40451. Header: res.Header,
  40452. HTTPStatusCode: res.StatusCode,
  40453. },
  40454. }
  40455. target := &ret
  40456. if err := gensupport.DecodeResponse(target, res); err != nil {
  40457. return nil, err
  40458. }
  40459. return ret, nil
  40460. // {
  40461. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  40462. // "httpMethod": "GET",
  40463. // "id": "compute.disks.get",
  40464. // "parameterOrder": [
  40465. // "project",
  40466. // "zone",
  40467. // "disk"
  40468. // ],
  40469. // "parameters": {
  40470. // "disk": {
  40471. // "description": "Name of the persistent disk to return.",
  40472. // "location": "path",
  40473. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40474. // "required": true,
  40475. // "type": "string"
  40476. // },
  40477. // "project": {
  40478. // "description": "Project ID for this request.",
  40479. // "location": "path",
  40480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40481. // "required": true,
  40482. // "type": "string"
  40483. // },
  40484. // "zone": {
  40485. // "description": "The name of the zone for this request.",
  40486. // "location": "path",
  40487. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40488. // "required": true,
  40489. // "type": "string"
  40490. // }
  40491. // },
  40492. // "path": "{project}/zones/{zone}/disks/{disk}",
  40493. // "response": {
  40494. // "$ref": "Disk"
  40495. // },
  40496. // "scopes": [
  40497. // "https://www.googleapis.com/auth/cloud-platform",
  40498. // "https://www.googleapis.com/auth/compute",
  40499. // "https://www.googleapis.com/auth/compute.readonly"
  40500. // ]
  40501. // }
  40502. }
  40503. // method id "compute.disks.getIamPolicy":
  40504. type DisksGetIamPolicyCall struct {
  40505. s *Service
  40506. project string
  40507. zone string
  40508. resource string
  40509. urlParams_ gensupport.URLParams
  40510. ifNoneMatch_ string
  40511. ctx_ context.Context
  40512. header_ http.Header
  40513. }
  40514. // GetIamPolicy: Gets the access control policy for a resource. May be
  40515. // empty if no such policy or resource exists.
  40516. func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
  40517. c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40518. c.project = project
  40519. c.zone = zone
  40520. c.resource = resource
  40521. return c
  40522. }
  40523. // Fields allows partial responses to be retrieved. See
  40524. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40525. // for more information.
  40526. func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
  40527. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40528. return c
  40529. }
  40530. // IfNoneMatch sets the optional parameter which makes the operation
  40531. // fail if the object's ETag matches the given value. This is useful for
  40532. // getting updates only after the object has changed since the last
  40533. // request. Use googleapi.IsNotModified to check whether the response
  40534. // error from Do is the result of In-None-Match.
  40535. func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
  40536. c.ifNoneMatch_ = entityTag
  40537. return c
  40538. }
  40539. // Context sets the context to be used in this call's Do method. Any
  40540. // pending HTTP request will be aborted if the provided context is
  40541. // canceled.
  40542. func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
  40543. c.ctx_ = ctx
  40544. return c
  40545. }
  40546. // Header returns an http.Header that can be modified by the caller to
  40547. // add HTTP headers to the request.
  40548. func (c *DisksGetIamPolicyCall) Header() http.Header {
  40549. if c.header_ == nil {
  40550. c.header_ = make(http.Header)
  40551. }
  40552. return c.header_
  40553. }
  40554. func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  40555. reqHeaders := make(http.Header)
  40556. for k, v := range c.header_ {
  40557. reqHeaders[k] = v
  40558. }
  40559. reqHeaders.Set("User-Agent", c.s.userAgent())
  40560. if c.ifNoneMatch_ != "" {
  40561. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40562. }
  40563. var body io.Reader = nil
  40564. c.urlParams_.Set("alt", alt)
  40565. c.urlParams_.Set("prettyPrint", "false")
  40566. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/getIamPolicy")
  40567. urls += "?" + c.urlParams_.Encode()
  40568. req, err := http.NewRequest("GET", urls, body)
  40569. if err != nil {
  40570. return nil, err
  40571. }
  40572. req.Header = reqHeaders
  40573. googleapi.Expand(req.URL, map[string]string{
  40574. "project": c.project,
  40575. "zone": c.zone,
  40576. "resource": c.resource,
  40577. })
  40578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40579. }
  40580. // Do executes the "compute.disks.getIamPolicy" call.
  40581. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  40582. // code is an error. Response headers are in either
  40583. // *Policy.ServerResponse.Header or (if a response was returned at all)
  40584. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40585. // check whether the returned error was because http.StatusNotModified
  40586. // was returned.
  40587. func (c *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  40588. gensupport.SetOptions(c.urlParams_, opts...)
  40589. res, err := c.doRequest("json")
  40590. if res != nil && res.StatusCode == http.StatusNotModified {
  40591. if res.Body != nil {
  40592. res.Body.Close()
  40593. }
  40594. return nil, &googleapi.Error{
  40595. Code: res.StatusCode,
  40596. Header: res.Header,
  40597. }
  40598. }
  40599. if err != nil {
  40600. return nil, err
  40601. }
  40602. defer googleapi.CloseBody(res)
  40603. if err := googleapi.CheckResponse(res); err != nil {
  40604. return nil, err
  40605. }
  40606. ret := &Policy{
  40607. ServerResponse: googleapi.ServerResponse{
  40608. Header: res.Header,
  40609. HTTPStatusCode: res.StatusCode,
  40610. },
  40611. }
  40612. target := &ret
  40613. if err := gensupport.DecodeResponse(target, res); err != nil {
  40614. return nil, err
  40615. }
  40616. return ret, nil
  40617. // {
  40618. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  40619. // "httpMethod": "GET",
  40620. // "id": "compute.disks.getIamPolicy",
  40621. // "parameterOrder": [
  40622. // "project",
  40623. // "zone",
  40624. // "resource"
  40625. // ],
  40626. // "parameters": {
  40627. // "project": {
  40628. // "description": "Project ID for this request.",
  40629. // "location": "path",
  40630. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40631. // "required": true,
  40632. // "type": "string"
  40633. // },
  40634. // "resource": {
  40635. // "description": "Name or id of the resource for this request.",
  40636. // "location": "path",
  40637. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40638. // "required": true,
  40639. // "type": "string"
  40640. // },
  40641. // "zone": {
  40642. // "description": "The name of the zone for this request.",
  40643. // "location": "path",
  40644. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40645. // "required": true,
  40646. // "type": "string"
  40647. // }
  40648. // },
  40649. // "path": "{project}/zones/{zone}/disks/{resource}/getIamPolicy",
  40650. // "response": {
  40651. // "$ref": "Policy"
  40652. // },
  40653. // "scopes": [
  40654. // "https://www.googleapis.com/auth/cloud-platform",
  40655. // "https://www.googleapis.com/auth/compute",
  40656. // "https://www.googleapis.com/auth/compute.readonly"
  40657. // ]
  40658. // }
  40659. }
  40660. // method id "compute.disks.insert":
  40661. type DisksInsertCall struct {
  40662. s *Service
  40663. project string
  40664. zone string
  40665. disk *Disk
  40666. urlParams_ gensupport.URLParams
  40667. ctx_ context.Context
  40668. header_ http.Header
  40669. }
  40670. // Insert: Creates a persistent disk in the specified project using the
  40671. // data in the request. You can create a disk with a sourceImage, a
  40672. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  40673. // properties. You can also create a disk that is larger than the
  40674. // default size by specifying the sizeGb property.
  40675. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  40676. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  40677. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40678. c.project = project
  40679. c.zone = zone
  40680. c.disk = disk
  40681. return c
  40682. }
  40683. // RequestId sets the optional parameter "requestId": An optional
  40684. // request ID to identify requests. Specify a unique request ID so that
  40685. // if you must retry your request, the server will know to ignore the
  40686. // request if it has already been completed.
  40687. //
  40688. // For example, consider a situation where you make an initial request
  40689. // and the request times out. If you make the request again with the
  40690. // same request ID, the server can check if original operation with the
  40691. // same request ID was received, and if so, will ignore the second
  40692. // request. This prevents clients from accidentally creating duplicate
  40693. // commitments.
  40694. //
  40695. // The request ID must be a valid UUID with the exception that zero UUID
  40696. // is not supported (00000000-0000-0000-0000-000000000000).
  40697. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  40698. c.urlParams_.Set("requestId", requestId)
  40699. return c
  40700. }
  40701. // SourceImage sets the optional parameter "sourceImage": Source image
  40702. // to restore onto a disk.
  40703. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  40704. c.urlParams_.Set("sourceImage", sourceImage)
  40705. return c
  40706. }
  40707. // Fields allows partial responses to be retrieved. See
  40708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40709. // for more information.
  40710. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  40711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40712. return c
  40713. }
  40714. // Context sets the context to be used in this call's Do method. Any
  40715. // pending HTTP request will be aborted if the provided context is
  40716. // canceled.
  40717. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  40718. c.ctx_ = ctx
  40719. return c
  40720. }
  40721. // Header returns an http.Header that can be modified by the caller to
  40722. // add HTTP headers to the request.
  40723. func (c *DisksInsertCall) Header() http.Header {
  40724. if c.header_ == nil {
  40725. c.header_ = make(http.Header)
  40726. }
  40727. return c.header_
  40728. }
  40729. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  40730. reqHeaders := make(http.Header)
  40731. for k, v := range c.header_ {
  40732. reqHeaders[k] = v
  40733. }
  40734. reqHeaders.Set("User-Agent", c.s.userAgent())
  40735. var body io.Reader = nil
  40736. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  40737. if err != nil {
  40738. return nil, err
  40739. }
  40740. reqHeaders.Set("Content-Type", "application/json")
  40741. c.urlParams_.Set("alt", alt)
  40742. c.urlParams_.Set("prettyPrint", "false")
  40743. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  40744. urls += "?" + c.urlParams_.Encode()
  40745. req, err := http.NewRequest("POST", urls, body)
  40746. if err != nil {
  40747. return nil, err
  40748. }
  40749. req.Header = reqHeaders
  40750. googleapi.Expand(req.URL, map[string]string{
  40751. "project": c.project,
  40752. "zone": c.zone,
  40753. })
  40754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40755. }
  40756. // Do executes the "compute.disks.insert" call.
  40757. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40758. // status code is an error. Response headers are in either
  40759. // *Operation.ServerResponse.Header or (if a response was returned at
  40760. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40761. // to check whether the returned error was because
  40762. // http.StatusNotModified was returned.
  40763. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40764. gensupport.SetOptions(c.urlParams_, opts...)
  40765. res, err := c.doRequest("json")
  40766. if res != nil && res.StatusCode == http.StatusNotModified {
  40767. if res.Body != nil {
  40768. res.Body.Close()
  40769. }
  40770. return nil, &googleapi.Error{
  40771. Code: res.StatusCode,
  40772. Header: res.Header,
  40773. }
  40774. }
  40775. if err != nil {
  40776. return nil, err
  40777. }
  40778. defer googleapi.CloseBody(res)
  40779. if err := googleapi.CheckResponse(res); err != nil {
  40780. return nil, err
  40781. }
  40782. ret := &Operation{
  40783. ServerResponse: googleapi.ServerResponse{
  40784. Header: res.Header,
  40785. HTTPStatusCode: res.StatusCode,
  40786. },
  40787. }
  40788. target := &ret
  40789. if err := gensupport.DecodeResponse(target, res); err != nil {
  40790. return nil, err
  40791. }
  40792. return ret, nil
  40793. // {
  40794. // "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.",
  40795. // "httpMethod": "POST",
  40796. // "id": "compute.disks.insert",
  40797. // "parameterOrder": [
  40798. // "project",
  40799. // "zone"
  40800. // ],
  40801. // "parameters": {
  40802. // "project": {
  40803. // "description": "Project ID for this request.",
  40804. // "location": "path",
  40805. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40806. // "required": true,
  40807. // "type": "string"
  40808. // },
  40809. // "requestId": {
  40810. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40811. // "location": "query",
  40812. // "type": "string"
  40813. // },
  40814. // "sourceImage": {
  40815. // "description": "Optional. Source image to restore onto a disk.",
  40816. // "location": "query",
  40817. // "type": "string"
  40818. // },
  40819. // "zone": {
  40820. // "description": "The name of the zone for this request.",
  40821. // "location": "path",
  40822. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40823. // "required": true,
  40824. // "type": "string"
  40825. // }
  40826. // },
  40827. // "path": "{project}/zones/{zone}/disks",
  40828. // "request": {
  40829. // "$ref": "Disk"
  40830. // },
  40831. // "response": {
  40832. // "$ref": "Operation"
  40833. // },
  40834. // "scopes": [
  40835. // "https://www.googleapis.com/auth/cloud-platform",
  40836. // "https://www.googleapis.com/auth/compute"
  40837. // ]
  40838. // }
  40839. }
  40840. // method id "compute.disks.list":
  40841. type DisksListCall struct {
  40842. s *Service
  40843. project string
  40844. zone string
  40845. urlParams_ gensupport.URLParams
  40846. ifNoneMatch_ string
  40847. ctx_ context.Context
  40848. header_ http.Header
  40849. }
  40850. // List: Retrieves a list of persistent disks contained within the
  40851. // specified zone.
  40852. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  40853. func (r *DisksService) List(project string, zone string) *DisksListCall {
  40854. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40855. c.project = project
  40856. c.zone = zone
  40857. return c
  40858. }
  40859. // Filter sets the optional parameter "filter": A filter expression that
  40860. // filters resources listed in the response. The expression must specify
  40861. // the field name, a comparison operator, and the value that you want to
  40862. // use for filtering. The value must be a string, a number, or a
  40863. // boolean. The comparison operator must be either =, !=, >, or <.
  40864. //
  40865. // For example, if you are filtering Compute Engine instances, you can
  40866. // exclude instances named example-instance by specifying name !=
  40867. // example-instance.
  40868. //
  40869. // You can also filter nested fields. For example, you could specify
  40870. // scheduling.automaticRestart = false to include instances only if they
  40871. // are not scheduled for automatic restarts. You can use filtering on
  40872. // nested fields to filter based on resource labels.
  40873. //
  40874. // To filter on multiple expressions, provide each separate expression
  40875. // within parentheses. For example, (scheduling.automaticRestart = true)
  40876. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40877. // AND expression. However, you can include AND and OR expressions
  40878. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40879. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40880. // true).
  40881. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  40882. c.urlParams_.Set("filter", filter)
  40883. return c
  40884. }
  40885. // MaxResults sets the optional parameter "maxResults": The maximum
  40886. // number of results per page that should be returned. If the number of
  40887. // available results is larger than maxResults, Compute Engine returns a
  40888. // nextPageToken that can be used to get the next page of results in
  40889. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40890. // (Default: 500)
  40891. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  40892. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40893. return c
  40894. }
  40895. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40896. // a certain order. By default, results are returned in alphanumerical
  40897. // order based on the resource name.
  40898. //
  40899. // You can also sort results in descending order based on the creation
  40900. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40901. // based on the creationTimestamp field in reverse chronological order
  40902. // (newest result first). Use this to sort resources like operations so
  40903. // that the newest operation is returned first.
  40904. //
  40905. // Currently, only sorting by name or creationTimestamp desc is
  40906. // supported.
  40907. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  40908. c.urlParams_.Set("orderBy", orderBy)
  40909. return c
  40910. }
  40911. // PageToken sets the optional parameter "pageToken": Specifies a page
  40912. // token to use. Set pageToken to the nextPageToken returned by a
  40913. // previous list request to get the next page of results.
  40914. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  40915. c.urlParams_.Set("pageToken", pageToken)
  40916. return c
  40917. }
  40918. // Fields allows partial responses to be retrieved. See
  40919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40920. // for more information.
  40921. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  40922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40923. return c
  40924. }
  40925. // IfNoneMatch sets the optional parameter which makes the operation
  40926. // fail if the object's ETag matches the given value. This is useful for
  40927. // getting updates only after the object has changed since the last
  40928. // request. Use googleapi.IsNotModified to check whether the response
  40929. // error from Do is the result of In-None-Match.
  40930. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  40931. c.ifNoneMatch_ = entityTag
  40932. return c
  40933. }
  40934. // Context sets the context to be used in this call's Do method. Any
  40935. // pending HTTP request will be aborted if the provided context is
  40936. // canceled.
  40937. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  40938. c.ctx_ = ctx
  40939. return c
  40940. }
  40941. // Header returns an http.Header that can be modified by the caller to
  40942. // add HTTP headers to the request.
  40943. func (c *DisksListCall) Header() http.Header {
  40944. if c.header_ == nil {
  40945. c.header_ = make(http.Header)
  40946. }
  40947. return c.header_
  40948. }
  40949. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  40950. reqHeaders := make(http.Header)
  40951. for k, v := range c.header_ {
  40952. reqHeaders[k] = v
  40953. }
  40954. reqHeaders.Set("User-Agent", c.s.userAgent())
  40955. if c.ifNoneMatch_ != "" {
  40956. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40957. }
  40958. var body io.Reader = nil
  40959. c.urlParams_.Set("alt", alt)
  40960. c.urlParams_.Set("prettyPrint", "false")
  40961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  40962. urls += "?" + c.urlParams_.Encode()
  40963. req, err := http.NewRequest("GET", urls, body)
  40964. if err != nil {
  40965. return nil, err
  40966. }
  40967. req.Header = reqHeaders
  40968. googleapi.Expand(req.URL, map[string]string{
  40969. "project": c.project,
  40970. "zone": c.zone,
  40971. })
  40972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40973. }
  40974. // Do executes the "compute.disks.list" call.
  40975. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  40976. // code is an error. Response headers are in either
  40977. // *DiskList.ServerResponse.Header or (if a response was returned at
  40978. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40979. // to check whether the returned error was because
  40980. // http.StatusNotModified was returned.
  40981. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  40982. gensupport.SetOptions(c.urlParams_, opts...)
  40983. res, err := c.doRequest("json")
  40984. if res != nil && res.StatusCode == http.StatusNotModified {
  40985. if res.Body != nil {
  40986. res.Body.Close()
  40987. }
  40988. return nil, &googleapi.Error{
  40989. Code: res.StatusCode,
  40990. Header: res.Header,
  40991. }
  40992. }
  40993. if err != nil {
  40994. return nil, err
  40995. }
  40996. defer googleapi.CloseBody(res)
  40997. if err := googleapi.CheckResponse(res); err != nil {
  40998. return nil, err
  40999. }
  41000. ret := &DiskList{
  41001. ServerResponse: googleapi.ServerResponse{
  41002. Header: res.Header,
  41003. HTTPStatusCode: res.StatusCode,
  41004. },
  41005. }
  41006. target := &ret
  41007. if err := gensupport.DecodeResponse(target, res); err != nil {
  41008. return nil, err
  41009. }
  41010. return ret, nil
  41011. // {
  41012. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  41013. // "httpMethod": "GET",
  41014. // "id": "compute.disks.list",
  41015. // "parameterOrder": [
  41016. // "project",
  41017. // "zone"
  41018. // ],
  41019. // "parameters": {
  41020. // "filter": {
  41021. // "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).",
  41022. // "location": "query",
  41023. // "type": "string"
  41024. // },
  41025. // "maxResults": {
  41026. // "default": "500",
  41027. // "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)",
  41028. // "format": "uint32",
  41029. // "location": "query",
  41030. // "minimum": "0",
  41031. // "type": "integer"
  41032. // },
  41033. // "orderBy": {
  41034. // "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.",
  41035. // "location": "query",
  41036. // "type": "string"
  41037. // },
  41038. // "pageToken": {
  41039. // "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.",
  41040. // "location": "query",
  41041. // "type": "string"
  41042. // },
  41043. // "project": {
  41044. // "description": "Project ID for this request.",
  41045. // "location": "path",
  41046. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41047. // "required": true,
  41048. // "type": "string"
  41049. // },
  41050. // "zone": {
  41051. // "description": "The name of the zone for this request.",
  41052. // "location": "path",
  41053. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41054. // "required": true,
  41055. // "type": "string"
  41056. // }
  41057. // },
  41058. // "path": "{project}/zones/{zone}/disks",
  41059. // "response": {
  41060. // "$ref": "DiskList"
  41061. // },
  41062. // "scopes": [
  41063. // "https://www.googleapis.com/auth/cloud-platform",
  41064. // "https://www.googleapis.com/auth/compute",
  41065. // "https://www.googleapis.com/auth/compute.readonly"
  41066. // ]
  41067. // }
  41068. }
  41069. // Pages invokes f for each page of results.
  41070. // A non-nil error returned from f will halt the iteration.
  41071. // The provided context supersedes any context provided to the Context method.
  41072. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  41073. c.ctx_ = ctx
  41074. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41075. for {
  41076. x, err := c.Do()
  41077. if err != nil {
  41078. return err
  41079. }
  41080. if err := f(x); err != nil {
  41081. return err
  41082. }
  41083. if x.NextPageToken == "" {
  41084. return nil
  41085. }
  41086. c.PageToken(x.NextPageToken)
  41087. }
  41088. }
  41089. // method id "compute.disks.removeResourcePolicies":
  41090. type DisksRemoveResourcePoliciesCall struct {
  41091. s *Service
  41092. project string
  41093. zone string
  41094. disk string
  41095. disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest
  41096. urlParams_ gensupport.URLParams
  41097. ctx_ context.Context
  41098. header_ http.Header
  41099. }
  41100. // RemoveResourcePolicies: Removes resource policies from a disk.
  41101. func (r *DisksService) RemoveResourcePolicies(project string, zone string, disk string, disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest) *DisksRemoveResourcePoliciesCall {
  41102. c := &DisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41103. c.project = project
  41104. c.zone = zone
  41105. c.disk = disk
  41106. c.disksremoveresourcepoliciesrequest = disksremoveresourcepoliciesrequest
  41107. return c
  41108. }
  41109. // RequestId sets the optional parameter "requestId": An optional
  41110. // request ID to identify requests. Specify a unique request ID so that
  41111. // if you must retry your request, the server will know to ignore the
  41112. // request if it has already been completed.
  41113. //
  41114. // For example, consider a situation where you make an initial request
  41115. // and the request times out. If you make the request again with the
  41116. // same request ID, the server can check if original operation with the
  41117. // same request ID was received, and if so, will ignore the second
  41118. // request. This prevents clients from accidentally creating duplicate
  41119. // commitments.
  41120. //
  41121. // The request ID must be a valid UUID with the exception that zero UUID
  41122. // is not supported (00000000-0000-0000-0000-000000000000).
  41123. func (c *DisksRemoveResourcePoliciesCall) RequestId(requestId string) *DisksRemoveResourcePoliciesCall {
  41124. c.urlParams_.Set("requestId", requestId)
  41125. return c
  41126. }
  41127. // Fields allows partial responses to be retrieved. See
  41128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41129. // for more information.
  41130. func (c *DisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksRemoveResourcePoliciesCall {
  41131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41132. return c
  41133. }
  41134. // Context sets the context to be used in this call's Do method. Any
  41135. // pending HTTP request will be aborted if the provided context is
  41136. // canceled.
  41137. func (c *DisksRemoveResourcePoliciesCall) Context(ctx context.Context) *DisksRemoveResourcePoliciesCall {
  41138. c.ctx_ = ctx
  41139. return c
  41140. }
  41141. // Header returns an http.Header that can be modified by the caller to
  41142. // add HTTP headers to the request.
  41143. func (c *DisksRemoveResourcePoliciesCall) Header() http.Header {
  41144. if c.header_ == nil {
  41145. c.header_ = make(http.Header)
  41146. }
  41147. return c.header_
  41148. }
  41149. func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  41150. reqHeaders := make(http.Header)
  41151. for k, v := range c.header_ {
  41152. reqHeaders[k] = v
  41153. }
  41154. reqHeaders.Set("User-Agent", c.s.userAgent())
  41155. var body io.Reader = nil
  41156. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest)
  41157. if err != nil {
  41158. return nil, err
  41159. }
  41160. reqHeaders.Set("Content-Type", "application/json")
  41161. c.urlParams_.Set("alt", alt)
  41162. c.urlParams_.Set("prettyPrint", "false")
  41163. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies")
  41164. urls += "?" + c.urlParams_.Encode()
  41165. req, err := http.NewRequest("POST", urls, body)
  41166. if err != nil {
  41167. return nil, err
  41168. }
  41169. req.Header = reqHeaders
  41170. googleapi.Expand(req.URL, map[string]string{
  41171. "project": c.project,
  41172. "zone": c.zone,
  41173. "disk": c.disk,
  41174. })
  41175. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41176. }
  41177. // Do executes the "compute.disks.removeResourcePolicies" call.
  41178. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41179. // status code is an error. Response headers are in either
  41180. // *Operation.ServerResponse.Header or (if a response was returned at
  41181. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41182. // to check whether the returned error was because
  41183. // http.StatusNotModified was returned.
  41184. func (c *DisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41185. gensupport.SetOptions(c.urlParams_, opts...)
  41186. res, err := c.doRequest("json")
  41187. if res != nil && res.StatusCode == http.StatusNotModified {
  41188. if res.Body != nil {
  41189. res.Body.Close()
  41190. }
  41191. return nil, &googleapi.Error{
  41192. Code: res.StatusCode,
  41193. Header: res.Header,
  41194. }
  41195. }
  41196. if err != nil {
  41197. return nil, err
  41198. }
  41199. defer googleapi.CloseBody(res)
  41200. if err := googleapi.CheckResponse(res); err != nil {
  41201. return nil, err
  41202. }
  41203. ret := &Operation{
  41204. ServerResponse: googleapi.ServerResponse{
  41205. Header: res.Header,
  41206. HTTPStatusCode: res.StatusCode,
  41207. },
  41208. }
  41209. target := &ret
  41210. if err := gensupport.DecodeResponse(target, res); err != nil {
  41211. return nil, err
  41212. }
  41213. return ret, nil
  41214. // {
  41215. // "description": "Removes resource policies from a disk.",
  41216. // "httpMethod": "POST",
  41217. // "id": "compute.disks.removeResourcePolicies",
  41218. // "parameterOrder": [
  41219. // "project",
  41220. // "zone",
  41221. // "disk"
  41222. // ],
  41223. // "parameters": {
  41224. // "disk": {
  41225. // "description": "The disk name for this request.",
  41226. // "location": "path",
  41227. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41228. // "required": true,
  41229. // "type": "string"
  41230. // },
  41231. // "project": {
  41232. // "description": "Project ID for this request.",
  41233. // "location": "path",
  41234. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41235. // "required": true,
  41236. // "type": "string"
  41237. // },
  41238. // "requestId": {
  41239. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41240. // "location": "query",
  41241. // "type": "string"
  41242. // },
  41243. // "zone": {
  41244. // "description": "The name of the zone for this request.",
  41245. // "location": "path",
  41246. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41247. // "required": true,
  41248. // "type": "string"
  41249. // }
  41250. // },
  41251. // "path": "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies",
  41252. // "request": {
  41253. // "$ref": "DisksRemoveResourcePoliciesRequest"
  41254. // },
  41255. // "response": {
  41256. // "$ref": "Operation"
  41257. // },
  41258. // "scopes": [
  41259. // "https://www.googleapis.com/auth/cloud-platform",
  41260. // "https://www.googleapis.com/auth/compute"
  41261. // ]
  41262. // }
  41263. }
  41264. // method id "compute.disks.resize":
  41265. type DisksResizeCall struct {
  41266. s *Service
  41267. project string
  41268. zone string
  41269. disk string
  41270. disksresizerequest *DisksResizeRequest
  41271. urlParams_ gensupport.URLParams
  41272. ctx_ context.Context
  41273. header_ http.Header
  41274. }
  41275. // Resize: Resizes the specified persistent disk. You can only increase
  41276. // the size of the disk.
  41277. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  41278. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41279. c.project = project
  41280. c.zone = zone
  41281. c.disk = disk
  41282. c.disksresizerequest = disksresizerequest
  41283. return c
  41284. }
  41285. // RequestId sets the optional parameter "requestId": An optional
  41286. // request ID to identify requests. Specify a unique request ID so that
  41287. // if you must retry your request, the server will know to ignore the
  41288. // request if it has already been completed.
  41289. //
  41290. // For example, consider a situation where you make an initial request
  41291. // and the request times out. If you make the request again with the
  41292. // same request ID, the server can check if original operation with the
  41293. // same request ID was received, and if so, will ignore the second
  41294. // request. This prevents clients from accidentally creating duplicate
  41295. // commitments.
  41296. //
  41297. // The request ID must be a valid UUID with the exception that zero UUID
  41298. // is not supported (00000000-0000-0000-0000-000000000000).
  41299. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  41300. c.urlParams_.Set("requestId", requestId)
  41301. return c
  41302. }
  41303. // Fields allows partial responses to be retrieved. See
  41304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41305. // for more information.
  41306. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  41307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41308. return c
  41309. }
  41310. // Context sets the context to be used in this call's Do method. Any
  41311. // pending HTTP request will be aborted if the provided context is
  41312. // canceled.
  41313. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  41314. c.ctx_ = ctx
  41315. return c
  41316. }
  41317. // Header returns an http.Header that can be modified by the caller to
  41318. // add HTTP headers to the request.
  41319. func (c *DisksResizeCall) Header() http.Header {
  41320. if c.header_ == nil {
  41321. c.header_ = make(http.Header)
  41322. }
  41323. return c.header_
  41324. }
  41325. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  41326. reqHeaders := make(http.Header)
  41327. for k, v := range c.header_ {
  41328. reqHeaders[k] = v
  41329. }
  41330. reqHeaders.Set("User-Agent", c.s.userAgent())
  41331. var body io.Reader = nil
  41332. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  41333. if err != nil {
  41334. return nil, err
  41335. }
  41336. reqHeaders.Set("Content-Type", "application/json")
  41337. c.urlParams_.Set("alt", alt)
  41338. c.urlParams_.Set("prettyPrint", "false")
  41339. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  41340. urls += "?" + c.urlParams_.Encode()
  41341. req, err := http.NewRequest("POST", urls, body)
  41342. if err != nil {
  41343. return nil, err
  41344. }
  41345. req.Header = reqHeaders
  41346. googleapi.Expand(req.URL, map[string]string{
  41347. "project": c.project,
  41348. "zone": c.zone,
  41349. "disk": c.disk,
  41350. })
  41351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41352. }
  41353. // Do executes the "compute.disks.resize" call.
  41354. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41355. // status code is an error. Response headers are in either
  41356. // *Operation.ServerResponse.Header or (if a response was returned at
  41357. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41358. // to check whether the returned error was because
  41359. // http.StatusNotModified was returned.
  41360. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41361. gensupport.SetOptions(c.urlParams_, opts...)
  41362. res, err := c.doRequest("json")
  41363. if res != nil && res.StatusCode == http.StatusNotModified {
  41364. if res.Body != nil {
  41365. res.Body.Close()
  41366. }
  41367. return nil, &googleapi.Error{
  41368. Code: res.StatusCode,
  41369. Header: res.Header,
  41370. }
  41371. }
  41372. if err != nil {
  41373. return nil, err
  41374. }
  41375. defer googleapi.CloseBody(res)
  41376. if err := googleapi.CheckResponse(res); err != nil {
  41377. return nil, err
  41378. }
  41379. ret := &Operation{
  41380. ServerResponse: googleapi.ServerResponse{
  41381. Header: res.Header,
  41382. HTTPStatusCode: res.StatusCode,
  41383. },
  41384. }
  41385. target := &ret
  41386. if err := gensupport.DecodeResponse(target, res); err != nil {
  41387. return nil, err
  41388. }
  41389. return ret, nil
  41390. // {
  41391. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  41392. // "httpMethod": "POST",
  41393. // "id": "compute.disks.resize",
  41394. // "parameterOrder": [
  41395. // "project",
  41396. // "zone",
  41397. // "disk"
  41398. // ],
  41399. // "parameters": {
  41400. // "disk": {
  41401. // "description": "The name of the persistent disk.",
  41402. // "location": "path",
  41403. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41404. // "required": true,
  41405. // "type": "string"
  41406. // },
  41407. // "project": {
  41408. // "description": "Project ID for this request.",
  41409. // "location": "path",
  41410. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41411. // "required": true,
  41412. // "type": "string"
  41413. // },
  41414. // "requestId": {
  41415. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41416. // "location": "query",
  41417. // "type": "string"
  41418. // },
  41419. // "zone": {
  41420. // "description": "The name of the zone for this request.",
  41421. // "location": "path",
  41422. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41423. // "required": true,
  41424. // "type": "string"
  41425. // }
  41426. // },
  41427. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  41428. // "request": {
  41429. // "$ref": "DisksResizeRequest"
  41430. // },
  41431. // "response": {
  41432. // "$ref": "Operation"
  41433. // },
  41434. // "scopes": [
  41435. // "https://www.googleapis.com/auth/cloud-platform",
  41436. // "https://www.googleapis.com/auth/compute"
  41437. // ]
  41438. // }
  41439. }
  41440. // method id "compute.disks.setIamPolicy":
  41441. type DisksSetIamPolicyCall struct {
  41442. s *Service
  41443. project string
  41444. zone string
  41445. resource string
  41446. zonesetpolicyrequest *ZoneSetPolicyRequest
  41447. urlParams_ gensupport.URLParams
  41448. ctx_ context.Context
  41449. header_ http.Header
  41450. }
  41451. // SetIamPolicy: Sets the access control policy on the specified
  41452. // resource. Replaces any existing policy.
  41453. func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
  41454. c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41455. c.project = project
  41456. c.zone = zone
  41457. c.resource = resource
  41458. c.zonesetpolicyrequest = zonesetpolicyrequest
  41459. return c
  41460. }
  41461. // Fields allows partial responses to be retrieved. See
  41462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41463. // for more information.
  41464. func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
  41465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41466. return c
  41467. }
  41468. // Context sets the context to be used in this call's Do method. Any
  41469. // pending HTTP request will be aborted if the provided context is
  41470. // canceled.
  41471. func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
  41472. c.ctx_ = ctx
  41473. return c
  41474. }
  41475. // Header returns an http.Header that can be modified by the caller to
  41476. // add HTTP headers to the request.
  41477. func (c *DisksSetIamPolicyCall) Header() http.Header {
  41478. if c.header_ == nil {
  41479. c.header_ = make(http.Header)
  41480. }
  41481. return c.header_
  41482. }
  41483. func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  41484. reqHeaders := make(http.Header)
  41485. for k, v := range c.header_ {
  41486. reqHeaders[k] = v
  41487. }
  41488. reqHeaders.Set("User-Agent", c.s.userAgent())
  41489. var body io.Reader = nil
  41490. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  41491. if err != nil {
  41492. return nil, err
  41493. }
  41494. reqHeaders.Set("Content-Type", "application/json")
  41495. c.urlParams_.Set("alt", alt)
  41496. c.urlParams_.Set("prettyPrint", "false")
  41497. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setIamPolicy")
  41498. urls += "?" + c.urlParams_.Encode()
  41499. req, err := http.NewRequest("POST", urls, body)
  41500. if err != nil {
  41501. return nil, err
  41502. }
  41503. req.Header = reqHeaders
  41504. googleapi.Expand(req.URL, map[string]string{
  41505. "project": c.project,
  41506. "zone": c.zone,
  41507. "resource": c.resource,
  41508. })
  41509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41510. }
  41511. // Do executes the "compute.disks.setIamPolicy" call.
  41512. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  41513. // code is an error. Response headers are in either
  41514. // *Policy.ServerResponse.Header or (if a response was returned at all)
  41515. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  41516. // check whether the returned error was because http.StatusNotModified
  41517. // was returned.
  41518. func (c *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  41519. gensupport.SetOptions(c.urlParams_, opts...)
  41520. res, err := c.doRequest("json")
  41521. if res != nil && res.StatusCode == http.StatusNotModified {
  41522. if res.Body != nil {
  41523. res.Body.Close()
  41524. }
  41525. return nil, &googleapi.Error{
  41526. Code: res.StatusCode,
  41527. Header: res.Header,
  41528. }
  41529. }
  41530. if err != nil {
  41531. return nil, err
  41532. }
  41533. defer googleapi.CloseBody(res)
  41534. if err := googleapi.CheckResponse(res); err != nil {
  41535. return nil, err
  41536. }
  41537. ret := &Policy{
  41538. ServerResponse: googleapi.ServerResponse{
  41539. Header: res.Header,
  41540. HTTPStatusCode: res.StatusCode,
  41541. },
  41542. }
  41543. target := &ret
  41544. if err := gensupport.DecodeResponse(target, res); err != nil {
  41545. return nil, err
  41546. }
  41547. return ret, nil
  41548. // {
  41549. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  41550. // "httpMethod": "POST",
  41551. // "id": "compute.disks.setIamPolicy",
  41552. // "parameterOrder": [
  41553. // "project",
  41554. // "zone",
  41555. // "resource"
  41556. // ],
  41557. // "parameters": {
  41558. // "project": {
  41559. // "description": "Project ID for this request.",
  41560. // "location": "path",
  41561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41562. // "required": true,
  41563. // "type": "string"
  41564. // },
  41565. // "resource": {
  41566. // "description": "Name or id of the resource for this request.",
  41567. // "location": "path",
  41568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41569. // "required": true,
  41570. // "type": "string"
  41571. // },
  41572. // "zone": {
  41573. // "description": "The name of the zone for this request.",
  41574. // "location": "path",
  41575. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41576. // "required": true,
  41577. // "type": "string"
  41578. // }
  41579. // },
  41580. // "path": "{project}/zones/{zone}/disks/{resource}/setIamPolicy",
  41581. // "request": {
  41582. // "$ref": "ZoneSetPolicyRequest"
  41583. // },
  41584. // "response": {
  41585. // "$ref": "Policy"
  41586. // },
  41587. // "scopes": [
  41588. // "https://www.googleapis.com/auth/cloud-platform",
  41589. // "https://www.googleapis.com/auth/compute"
  41590. // ]
  41591. // }
  41592. }
  41593. // method id "compute.disks.setLabels":
  41594. type DisksSetLabelsCall struct {
  41595. s *Service
  41596. project string
  41597. zone string
  41598. resource string
  41599. zonesetlabelsrequest *ZoneSetLabelsRequest
  41600. urlParams_ gensupport.URLParams
  41601. ctx_ context.Context
  41602. header_ http.Header
  41603. }
  41604. // SetLabels: Sets the labels on a disk. To learn more about labels,
  41605. // read the Labeling Resources documentation.
  41606. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  41607. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41608. c.project = project
  41609. c.zone = zone
  41610. c.resource = resource
  41611. c.zonesetlabelsrequest = zonesetlabelsrequest
  41612. return c
  41613. }
  41614. // RequestId sets the optional parameter "requestId": An optional
  41615. // request ID to identify requests. Specify a unique request ID so that
  41616. // if you must retry your request, the server will know to ignore the
  41617. // request if it has already been completed.
  41618. //
  41619. // For example, consider a situation where you make an initial request
  41620. // and the request times out. If you make the request again with the
  41621. // same request ID, the server can check if original operation with the
  41622. // same request ID was received, and if so, will ignore the second
  41623. // request. This prevents clients from accidentally creating duplicate
  41624. // commitments.
  41625. //
  41626. // The request ID must be a valid UUID with the exception that zero UUID
  41627. // is not supported (00000000-0000-0000-0000-000000000000).
  41628. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  41629. c.urlParams_.Set("requestId", requestId)
  41630. return c
  41631. }
  41632. // Fields allows partial responses to be retrieved. See
  41633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41634. // for more information.
  41635. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  41636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41637. return c
  41638. }
  41639. // Context sets the context to be used in this call's Do method. Any
  41640. // pending HTTP request will be aborted if the provided context is
  41641. // canceled.
  41642. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  41643. c.ctx_ = ctx
  41644. return c
  41645. }
  41646. // Header returns an http.Header that can be modified by the caller to
  41647. // add HTTP headers to the request.
  41648. func (c *DisksSetLabelsCall) Header() http.Header {
  41649. if c.header_ == nil {
  41650. c.header_ = make(http.Header)
  41651. }
  41652. return c.header_
  41653. }
  41654. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  41655. reqHeaders := make(http.Header)
  41656. for k, v := range c.header_ {
  41657. reqHeaders[k] = v
  41658. }
  41659. reqHeaders.Set("User-Agent", c.s.userAgent())
  41660. var body io.Reader = nil
  41661. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  41662. if err != nil {
  41663. return nil, err
  41664. }
  41665. reqHeaders.Set("Content-Type", "application/json")
  41666. c.urlParams_.Set("alt", alt)
  41667. c.urlParams_.Set("prettyPrint", "false")
  41668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  41669. urls += "?" + c.urlParams_.Encode()
  41670. req, err := http.NewRequest("POST", urls, body)
  41671. if err != nil {
  41672. return nil, err
  41673. }
  41674. req.Header = reqHeaders
  41675. googleapi.Expand(req.URL, map[string]string{
  41676. "project": c.project,
  41677. "zone": c.zone,
  41678. "resource": c.resource,
  41679. })
  41680. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41681. }
  41682. // Do executes the "compute.disks.setLabels" call.
  41683. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41684. // status code is an error. Response headers are in either
  41685. // *Operation.ServerResponse.Header or (if a response was returned at
  41686. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41687. // to check whether the returned error was because
  41688. // http.StatusNotModified was returned.
  41689. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41690. gensupport.SetOptions(c.urlParams_, opts...)
  41691. res, err := c.doRequest("json")
  41692. if res != nil && res.StatusCode == http.StatusNotModified {
  41693. if res.Body != nil {
  41694. res.Body.Close()
  41695. }
  41696. return nil, &googleapi.Error{
  41697. Code: res.StatusCode,
  41698. Header: res.Header,
  41699. }
  41700. }
  41701. if err != nil {
  41702. return nil, err
  41703. }
  41704. defer googleapi.CloseBody(res)
  41705. if err := googleapi.CheckResponse(res); err != nil {
  41706. return nil, err
  41707. }
  41708. ret := &Operation{
  41709. ServerResponse: googleapi.ServerResponse{
  41710. Header: res.Header,
  41711. HTTPStatusCode: res.StatusCode,
  41712. },
  41713. }
  41714. target := &ret
  41715. if err := gensupport.DecodeResponse(target, res); err != nil {
  41716. return nil, err
  41717. }
  41718. return ret, nil
  41719. // {
  41720. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  41721. // "httpMethod": "POST",
  41722. // "id": "compute.disks.setLabels",
  41723. // "parameterOrder": [
  41724. // "project",
  41725. // "zone",
  41726. // "resource"
  41727. // ],
  41728. // "parameters": {
  41729. // "project": {
  41730. // "description": "Project ID for this request.",
  41731. // "location": "path",
  41732. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41733. // "required": true,
  41734. // "type": "string"
  41735. // },
  41736. // "requestId": {
  41737. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41738. // "location": "query",
  41739. // "type": "string"
  41740. // },
  41741. // "resource": {
  41742. // "description": "Name or id of the resource for this request.",
  41743. // "location": "path",
  41744. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41745. // "required": true,
  41746. // "type": "string"
  41747. // },
  41748. // "zone": {
  41749. // "description": "The name of the zone for this request.",
  41750. // "location": "path",
  41751. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41752. // "required": true,
  41753. // "type": "string"
  41754. // }
  41755. // },
  41756. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  41757. // "request": {
  41758. // "$ref": "ZoneSetLabelsRequest"
  41759. // },
  41760. // "response": {
  41761. // "$ref": "Operation"
  41762. // },
  41763. // "scopes": [
  41764. // "https://www.googleapis.com/auth/cloud-platform",
  41765. // "https://www.googleapis.com/auth/compute"
  41766. // ]
  41767. // }
  41768. }
  41769. // method id "compute.disks.testIamPermissions":
  41770. type DisksTestIamPermissionsCall struct {
  41771. s *Service
  41772. project string
  41773. zone string
  41774. resource string
  41775. testpermissionsrequest *TestPermissionsRequest
  41776. urlParams_ gensupport.URLParams
  41777. ctx_ context.Context
  41778. header_ http.Header
  41779. }
  41780. // TestIamPermissions: Returns permissions that a caller has on the
  41781. // specified resource.
  41782. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  41783. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41784. c.project = project
  41785. c.zone = zone
  41786. c.resource = resource
  41787. c.testpermissionsrequest = testpermissionsrequest
  41788. return c
  41789. }
  41790. // Fields allows partial responses to be retrieved. See
  41791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41792. // for more information.
  41793. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  41794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41795. return c
  41796. }
  41797. // Context sets the context to be used in this call's Do method. Any
  41798. // pending HTTP request will be aborted if the provided context is
  41799. // canceled.
  41800. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  41801. c.ctx_ = ctx
  41802. return c
  41803. }
  41804. // Header returns an http.Header that can be modified by the caller to
  41805. // add HTTP headers to the request.
  41806. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  41807. if c.header_ == nil {
  41808. c.header_ = make(http.Header)
  41809. }
  41810. return c.header_
  41811. }
  41812. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  41813. reqHeaders := make(http.Header)
  41814. for k, v := range c.header_ {
  41815. reqHeaders[k] = v
  41816. }
  41817. reqHeaders.Set("User-Agent", c.s.userAgent())
  41818. var body io.Reader = nil
  41819. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  41820. if err != nil {
  41821. return nil, err
  41822. }
  41823. reqHeaders.Set("Content-Type", "application/json")
  41824. c.urlParams_.Set("alt", alt)
  41825. c.urlParams_.Set("prettyPrint", "false")
  41826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  41827. urls += "?" + c.urlParams_.Encode()
  41828. req, err := http.NewRequest("POST", urls, body)
  41829. if err != nil {
  41830. return nil, err
  41831. }
  41832. req.Header = reqHeaders
  41833. googleapi.Expand(req.URL, map[string]string{
  41834. "project": c.project,
  41835. "zone": c.zone,
  41836. "resource": c.resource,
  41837. })
  41838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41839. }
  41840. // Do executes the "compute.disks.testIamPermissions" call.
  41841. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  41842. // non-2xx status code is an error. Response headers are in either
  41843. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  41844. // returned at all) in error.(*googleapi.Error).Header. Use
  41845. // googleapi.IsNotModified to check whether the returned error was
  41846. // because http.StatusNotModified was returned.
  41847. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  41848. gensupport.SetOptions(c.urlParams_, opts...)
  41849. res, err := c.doRequest("json")
  41850. if res != nil && res.StatusCode == http.StatusNotModified {
  41851. if res.Body != nil {
  41852. res.Body.Close()
  41853. }
  41854. return nil, &googleapi.Error{
  41855. Code: res.StatusCode,
  41856. Header: res.Header,
  41857. }
  41858. }
  41859. if err != nil {
  41860. return nil, err
  41861. }
  41862. defer googleapi.CloseBody(res)
  41863. if err := googleapi.CheckResponse(res); err != nil {
  41864. return nil, err
  41865. }
  41866. ret := &TestPermissionsResponse{
  41867. ServerResponse: googleapi.ServerResponse{
  41868. Header: res.Header,
  41869. HTTPStatusCode: res.StatusCode,
  41870. },
  41871. }
  41872. target := &ret
  41873. if err := gensupport.DecodeResponse(target, res); err != nil {
  41874. return nil, err
  41875. }
  41876. return ret, nil
  41877. // {
  41878. // "description": "Returns permissions that a caller has on the specified resource.",
  41879. // "httpMethod": "POST",
  41880. // "id": "compute.disks.testIamPermissions",
  41881. // "parameterOrder": [
  41882. // "project",
  41883. // "zone",
  41884. // "resource"
  41885. // ],
  41886. // "parameters": {
  41887. // "project": {
  41888. // "description": "Project ID for this request.",
  41889. // "location": "path",
  41890. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41891. // "required": true,
  41892. // "type": "string"
  41893. // },
  41894. // "resource": {
  41895. // "description": "Name or id of the resource for this request.",
  41896. // "location": "path",
  41897. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41898. // "required": true,
  41899. // "type": "string"
  41900. // },
  41901. // "zone": {
  41902. // "description": "The name of the zone for this request.",
  41903. // "location": "path",
  41904. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41905. // "required": true,
  41906. // "type": "string"
  41907. // }
  41908. // },
  41909. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  41910. // "request": {
  41911. // "$ref": "TestPermissionsRequest"
  41912. // },
  41913. // "response": {
  41914. // "$ref": "TestPermissionsResponse"
  41915. // },
  41916. // "scopes": [
  41917. // "https://www.googleapis.com/auth/cloud-platform",
  41918. // "https://www.googleapis.com/auth/compute",
  41919. // "https://www.googleapis.com/auth/compute.readonly"
  41920. // ]
  41921. // }
  41922. }
  41923. // method id "compute.externalVpnGateways.delete":
  41924. type ExternalVpnGatewaysDeleteCall struct {
  41925. s *Service
  41926. project string
  41927. externalVpnGateway string
  41928. urlParams_ gensupport.URLParams
  41929. ctx_ context.Context
  41930. header_ http.Header
  41931. }
  41932. // Delete: Deletes the specified externalVpnGateway.
  41933. func (r *ExternalVpnGatewaysService) Delete(project string, externalVpnGateway string) *ExternalVpnGatewaysDeleteCall {
  41934. c := &ExternalVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41935. c.project = project
  41936. c.externalVpnGateway = externalVpnGateway
  41937. return c
  41938. }
  41939. // RequestId sets the optional parameter "requestId": An optional
  41940. // request ID to identify requests. Specify a unique request ID so that
  41941. // if you must retry your request, the server will know to ignore the
  41942. // request if it has already been completed.
  41943. //
  41944. // For example, consider a situation where you make an initial request
  41945. // and the request times out. If you make the request again with the
  41946. // same request ID, the server can check if original operation with the
  41947. // same request ID was received, and if so, will ignore the second
  41948. // request. This prevents clients from accidentally creating duplicate
  41949. // commitments.
  41950. //
  41951. // The request ID must be a valid UUID with the exception that zero UUID
  41952. // is not supported (00000000-0000-0000-0000-000000000000).
  41953. func (c *ExternalVpnGatewaysDeleteCall) RequestId(requestId string) *ExternalVpnGatewaysDeleteCall {
  41954. c.urlParams_.Set("requestId", requestId)
  41955. return c
  41956. }
  41957. // Fields allows partial responses to be retrieved. See
  41958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41959. // for more information.
  41960. func (c *ExternalVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysDeleteCall {
  41961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41962. return c
  41963. }
  41964. // Context sets the context to be used in this call's Do method. Any
  41965. // pending HTTP request will be aborted if the provided context is
  41966. // canceled.
  41967. func (c *ExternalVpnGatewaysDeleteCall) Context(ctx context.Context) *ExternalVpnGatewaysDeleteCall {
  41968. c.ctx_ = ctx
  41969. return c
  41970. }
  41971. // Header returns an http.Header that can be modified by the caller to
  41972. // add HTTP headers to the request.
  41973. func (c *ExternalVpnGatewaysDeleteCall) Header() http.Header {
  41974. if c.header_ == nil {
  41975. c.header_ = make(http.Header)
  41976. }
  41977. return c.header_
  41978. }
  41979. func (c *ExternalVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  41980. reqHeaders := make(http.Header)
  41981. for k, v := range c.header_ {
  41982. reqHeaders[k] = v
  41983. }
  41984. reqHeaders.Set("User-Agent", c.s.userAgent())
  41985. var body io.Reader = nil
  41986. c.urlParams_.Set("alt", alt)
  41987. c.urlParams_.Set("prettyPrint", "false")
  41988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{externalVpnGateway}")
  41989. urls += "?" + c.urlParams_.Encode()
  41990. req, err := http.NewRequest("DELETE", urls, body)
  41991. if err != nil {
  41992. return nil, err
  41993. }
  41994. req.Header = reqHeaders
  41995. googleapi.Expand(req.URL, map[string]string{
  41996. "project": c.project,
  41997. "externalVpnGateway": c.externalVpnGateway,
  41998. })
  41999. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42000. }
  42001. // Do executes the "compute.externalVpnGateways.delete" call.
  42002. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42003. // status code is an error. Response headers are in either
  42004. // *Operation.ServerResponse.Header or (if a response was returned at
  42005. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42006. // to check whether the returned error was because
  42007. // http.StatusNotModified was returned.
  42008. func (c *ExternalVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42009. gensupport.SetOptions(c.urlParams_, opts...)
  42010. res, err := c.doRequest("json")
  42011. if res != nil && res.StatusCode == http.StatusNotModified {
  42012. if res.Body != nil {
  42013. res.Body.Close()
  42014. }
  42015. return nil, &googleapi.Error{
  42016. Code: res.StatusCode,
  42017. Header: res.Header,
  42018. }
  42019. }
  42020. if err != nil {
  42021. return nil, err
  42022. }
  42023. defer googleapi.CloseBody(res)
  42024. if err := googleapi.CheckResponse(res); err != nil {
  42025. return nil, err
  42026. }
  42027. ret := &Operation{
  42028. ServerResponse: googleapi.ServerResponse{
  42029. Header: res.Header,
  42030. HTTPStatusCode: res.StatusCode,
  42031. },
  42032. }
  42033. target := &ret
  42034. if err := gensupport.DecodeResponse(target, res); err != nil {
  42035. return nil, err
  42036. }
  42037. return ret, nil
  42038. // {
  42039. // "description": "Deletes the specified externalVpnGateway.",
  42040. // "httpMethod": "DELETE",
  42041. // "id": "compute.externalVpnGateways.delete",
  42042. // "parameterOrder": [
  42043. // "project",
  42044. // "externalVpnGateway"
  42045. // ],
  42046. // "parameters": {
  42047. // "externalVpnGateway": {
  42048. // "description": "Name of the externalVpnGateways to delete.",
  42049. // "location": "path",
  42050. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42051. // "required": true,
  42052. // "type": "string"
  42053. // },
  42054. // "project": {
  42055. // "description": "Project ID for this request.",
  42056. // "location": "path",
  42057. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42058. // "required": true,
  42059. // "type": "string"
  42060. // },
  42061. // "requestId": {
  42062. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42063. // "location": "query",
  42064. // "type": "string"
  42065. // }
  42066. // },
  42067. // "path": "{project}/global/externalVpnGateways/{externalVpnGateway}",
  42068. // "response": {
  42069. // "$ref": "Operation"
  42070. // },
  42071. // "scopes": [
  42072. // "https://www.googleapis.com/auth/cloud-platform",
  42073. // "https://www.googleapis.com/auth/compute"
  42074. // ]
  42075. // }
  42076. }
  42077. // method id "compute.externalVpnGateways.get":
  42078. type ExternalVpnGatewaysGetCall struct {
  42079. s *Service
  42080. project string
  42081. externalVpnGateway string
  42082. urlParams_ gensupport.URLParams
  42083. ifNoneMatch_ string
  42084. ctx_ context.Context
  42085. header_ http.Header
  42086. }
  42087. // Get: Returns the specified externalVpnGateway. Get a list of
  42088. // available externalVpnGateways by making a list() request.
  42089. func (r *ExternalVpnGatewaysService) Get(project string, externalVpnGateway string) *ExternalVpnGatewaysGetCall {
  42090. c := &ExternalVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42091. c.project = project
  42092. c.externalVpnGateway = externalVpnGateway
  42093. return c
  42094. }
  42095. // Fields allows partial responses to be retrieved. See
  42096. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42097. // for more information.
  42098. func (c *ExternalVpnGatewaysGetCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysGetCall {
  42099. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42100. return c
  42101. }
  42102. // IfNoneMatch sets the optional parameter which makes the operation
  42103. // fail if the object's ETag matches the given value. This is useful for
  42104. // getting updates only after the object has changed since the last
  42105. // request. Use googleapi.IsNotModified to check whether the response
  42106. // error from Do is the result of In-None-Match.
  42107. func (c *ExternalVpnGatewaysGetCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysGetCall {
  42108. c.ifNoneMatch_ = entityTag
  42109. return c
  42110. }
  42111. // Context sets the context to be used in this call's Do method. Any
  42112. // pending HTTP request will be aborted if the provided context is
  42113. // canceled.
  42114. func (c *ExternalVpnGatewaysGetCall) Context(ctx context.Context) *ExternalVpnGatewaysGetCall {
  42115. c.ctx_ = ctx
  42116. return c
  42117. }
  42118. // Header returns an http.Header that can be modified by the caller to
  42119. // add HTTP headers to the request.
  42120. func (c *ExternalVpnGatewaysGetCall) Header() http.Header {
  42121. if c.header_ == nil {
  42122. c.header_ = make(http.Header)
  42123. }
  42124. return c.header_
  42125. }
  42126. func (c *ExternalVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  42127. reqHeaders := make(http.Header)
  42128. for k, v := range c.header_ {
  42129. reqHeaders[k] = v
  42130. }
  42131. reqHeaders.Set("User-Agent", c.s.userAgent())
  42132. if c.ifNoneMatch_ != "" {
  42133. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42134. }
  42135. var body io.Reader = nil
  42136. c.urlParams_.Set("alt", alt)
  42137. c.urlParams_.Set("prettyPrint", "false")
  42138. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{externalVpnGateway}")
  42139. urls += "?" + c.urlParams_.Encode()
  42140. req, err := http.NewRequest("GET", urls, body)
  42141. if err != nil {
  42142. return nil, err
  42143. }
  42144. req.Header = reqHeaders
  42145. googleapi.Expand(req.URL, map[string]string{
  42146. "project": c.project,
  42147. "externalVpnGateway": c.externalVpnGateway,
  42148. })
  42149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42150. }
  42151. // Do executes the "compute.externalVpnGateways.get" call.
  42152. // Exactly one of *ExternalVpnGateway or error will be non-nil. Any
  42153. // non-2xx status code is an error. Response headers are in either
  42154. // *ExternalVpnGateway.ServerResponse.Header or (if a response was
  42155. // returned at all) in error.(*googleapi.Error).Header. Use
  42156. // googleapi.IsNotModified to check whether the returned error was
  42157. // because http.StatusNotModified was returned.
  42158. func (c *ExternalVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGateway, error) {
  42159. gensupport.SetOptions(c.urlParams_, opts...)
  42160. res, err := c.doRequest("json")
  42161. if res != nil && res.StatusCode == http.StatusNotModified {
  42162. if res.Body != nil {
  42163. res.Body.Close()
  42164. }
  42165. return nil, &googleapi.Error{
  42166. Code: res.StatusCode,
  42167. Header: res.Header,
  42168. }
  42169. }
  42170. if err != nil {
  42171. return nil, err
  42172. }
  42173. defer googleapi.CloseBody(res)
  42174. if err := googleapi.CheckResponse(res); err != nil {
  42175. return nil, err
  42176. }
  42177. ret := &ExternalVpnGateway{
  42178. ServerResponse: googleapi.ServerResponse{
  42179. Header: res.Header,
  42180. HTTPStatusCode: res.StatusCode,
  42181. },
  42182. }
  42183. target := &ret
  42184. if err := gensupport.DecodeResponse(target, res); err != nil {
  42185. return nil, err
  42186. }
  42187. return ret, nil
  42188. // {
  42189. // "description": "Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request.",
  42190. // "httpMethod": "GET",
  42191. // "id": "compute.externalVpnGateways.get",
  42192. // "parameterOrder": [
  42193. // "project",
  42194. // "externalVpnGateway"
  42195. // ],
  42196. // "parameters": {
  42197. // "externalVpnGateway": {
  42198. // "description": "Name of the externalVpnGateway to return.",
  42199. // "location": "path",
  42200. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42201. // "required": true,
  42202. // "type": "string"
  42203. // },
  42204. // "project": {
  42205. // "description": "Project ID for this request.",
  42206. // "location": "path",
  42207. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42208. // "required": true,
  42209. // "type": "string"
  42210. // }
  42211. // },
  42212. // "path": "{project}/global/externalVpnGateways/{externalVpnGateway}",
  42213. // "response": {
  42214. // "$ref": "ExternalVpnGateway"
  42215. // },
  42216. // "scopes": [
  42217. // "https://www.googleapis.com/auth/cloud-platform",
  42218. // "https://www.googleapis.com/auth/compute",
  42219. // "https://www.googleapis.com/auth/compute.readonly"
  42220. // ]
  42221. // }
  42222. }
  42223. // method id "compute.externalVpnGateways.insert":
  42224. type ExternalVpnGatewaysInsertCall struct {
  42225. s *Service
  42226. project string
  42227. externalvpngateway *ExternalVpnGateway
  42228. urlParams_ gensupport.URLParams
  42229. ctx_ context.Context
  42230. header_ http.Header
  42231. }
  42232. // Insert: Creates a ExternalVpnGateway in the specified project using
  42233. // the data included in the request.
  42234. func (r *ExternalVpnGatewaysService) Insert(project string, externalvpngateway *ExternalVpnGateway) *ExternalVpnGatewaysInsertCall {
  42235. c := &ExternalVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42236. c.project = project
  42237. c.externalvpngateway = externalvpngateway
  42238. return c
  42239. }
  42240. // RequestId sets the optional parameter "requestId": An optional
  42241. // request ID to identify requests. Specify a unique request ID so that
  42242. // if you must retry your request, the server will know to ignore the
  42243. // request if it has already been completed.
  42244. //
  42245. // For example, consider a situation where you make an initial request
  42246. // and the request times out. If you make the request again with the
  42247. // same request ID, the server can check if original operation with the
  42248. // same request ID was received, and if so, will ignore the second
  42249. // request. This prevents clients from accidentally creating duplicate
  42250. // commitments.
  42251. //
  42252. // The request ID must be a valid UUID with the exception that zero UUID
  42253. // is not supported (00000000-0000-0000-0000-000000000000).
  42254. func (c *ExternalVpnGatewaysInsertCall) RequestId(requestId string) *ExternalVpnGatewaysInsertCall {
  42255. c.urlParams_.Set("requestId", requestId)
  42256. return c
  42257. }
  42258. // Fields allows partial responses to be retrieved. See
  42259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42260. // for more information.
  42261. func (c *ExternalVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysInsertCall {
  42262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42263. return c
  42264. }
  42265. // Context sets the context to be used in this call's Do method. Any
  42266. // pending HTTP request will be aborted if the provided context is
  42267. // canceled.
  42268. func (c *ExternalVpnGatewaysInsertCall) Context(ctx context.Context) *ExternalVpnGatewaysInsertCall {
  42269. c.ctx_ = ctx
  42270. return c
  42271. }
  42272. // Header returns an http.Header that can be modified by the caller to
  42273. // add HTTP headers to the request.
  42274. func (c *ExternalVpnGatewaysInsertCall) Header() http.Header {
  42275. if c.header_ == nil {
  42276. c.header_ = make(http.Header)
  42277. }
  42278. return c.header_
  42279. }
  42280. func (c *ExternalVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  42281. reqHeaders := make(http.Header)
  42282. for k, v := range c.header_ {
  42283. reqHeaders[k] = v
  42284. }
  42285. reqHeaders.Set("User-Agent", c.s.userAgent())
  42286. var body io.Reader = nil
  42287. body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalvpngateway)
  42288. if err != nil {
  42289. return nil, err
  42290. }
  42291. reqHeaders.Set("Content-Type", "application/json")
  42292. c.urlParams_.Set("alt", alt)
  42293. c.urlParams_.Set("prettyPrint", "false")
  42294. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways")
  42295. urls += "?" + c.urlParams_.Encode()
  42296. req, err := http.NewRequest("POST", urls, body)
  42297. if err != nil {
  42298. return nil, err
  42299. }
  42300. req.Header = reqHeaders
  42301. googleapi.Expand(req.URL, map[string]string{
  42302. "project": c.project,
  42303. })
  42304. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42305. }
  42306. // Do executes the "compute.externalVpnGateways.insert" call.
  42307. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42308. // status code is an error. Response headers are in either
  42309. // *Operation.ServerResponse.Header or (if a response was returned at
  42310. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42311. // to check whether the returned error was because
  42312. // http.StatusNotModified was returned.
  42313. func (c *ExternalVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42314. gensupport.SetOptions(c.urlParams_, opts...)
  42315. res, err := c.doRequest("json")
  42316. if res != nil && res.StatusCode == http.StatusNotModified {
  42317. if res.Body != nil {
  42318. res.Body.Close()
  42319. }
  42320. return nil, &googleapi.Error{
  42321. Code: res.StatusCode,
  42322. Header: res.Header,
  42323. }
  42324. }
  42325. if err != nil {
  42326. return nil, err
  42327. }
  42328. defer googleapi.CloseBody(res)
  42329. if err := googleapi.CheckResponse(res); err != nil {
  42330. return nil, err
  42331. }
  42332. ret := &Operation{
  42333. ServerResponse: googleapi.ServerResponse{
  42334. Header: res.Header,
  42335. HTTPStatusCode: res.StatusCode,
  42336. },
  42337. }
  42338. target := &ret
  42339. if err := gensupport.DecodeResponse(target, res); err != nil {
  42340. return nil, err
  42341. }
  42342. return ret, nil
  42343. // {
  42344. // "description": "Creates a ExternalVpnGateway in the specified project using the data included in the request.",
  42345. // "httpMethod": "POST",
  42346. // "id": "compute.externalVpnGateways.insert",
  42347. // "parameterOrder": [
  42348. // "project"
  42349. // ],
  42350. // "parameters": {
  42351. // "project": {
  42352. // "description": "Project ID for this request.",
  42353. // "location": "path",
  42354. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42355. // "required": true,
  42356. // "type": "string"
  42357. // },
  42358. // "requestId": {
  42359. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42360. // "location": "query",
  42361. // "type": "string"
  42362. // }
  42363. // },
  42364. // "path": "{project}/global/externalVpnGateways",
  42365. // "request": {
  42366. // "$ref": "ExternalVpnGateway"
  42367. // },
  42368. // "response": {
  42369. // "$ref": "Operation"
  42370. // },
  42371. // "scopes": [
  42372. // "https://www.googleapis.com/auth/cloud-platform",
  42373. // "https://www.googleapis.com/auth/compute"
  42374. // ]
  42375. // }
  42376. }
  42377. // method id "compute.externalVpnGateways.list":
  42378. type ExternalVpnGatewaysListCall struct {
  42379. s *Service
  42380. project string
  42381. urlParams_ gensupport.URLParams
  42382. ifNoneMatch_ string
  42383. ctx_ context.Context
  42384. header_ http.Header
  42385. }
  42386. // List: Retrieves the list of ExternalVpnGateway available to the
  42387. // specified project.
  42388. func (r *ExternalVpnGatewaysService) List(project string) *ExternalVpnGatewaysListCall {
  42389. c := &ExternalVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42390. c.project = project
  42391. return c
  42392. }
  42393. // Filter sets the optional parameter "filter": A filter expression that
  42394. // filters resources listed in the response. The expression must specify
  42395. // the field name, a comparison operator, and the value that you want to
  42396. // use for filtering. The value must be a string, a number, or a
  42397. // boolean. The comparison operator must be either =, !=, >, or <.
  42398. //
  42399. // For example, if you are filtering Compute Engine instances, you can
  42400. // exclude instances named example-instance by specifying name !=
  42401. // example-instance.
  42402. //
  42403. // You can also filter nested fields. For example, you could specify
  42404. // scheduling.automaticRestart = false to include instances only if they
  42405. // are not scheduled for automatic restarts. You can use filtering on
  42406. // nested fields to filter based on resource labels.
  42407. //
  42408. // To filter on multiple expressions, provide each separate expression
  42409. // within parentheses. For example, (scheduling.automaticRestart = true)
  42410. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42411. // AND expression. However, you can include AND and OR expressions
  42412. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42413. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42414. // true).
  42415. func (c *ExternalVpnGatewaysListCall) Filter(filter string) *ExternalVpnGatewaysListCall {
  42416. c.urlParams_.Set("filter", filter)
  42417. return c
  42418. }
  42419. // MaxResults sets the optional parameter "maxResults": The maximum
  42420. // number of results per page that should be returned. If the number of
  42421. // available results is larger than maxResults, Compute Engine returns a
  42422. // nextPageToken that can be used to get the next page of results in
  42423. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42424. // (Default: 500)
  42425. func (c *ExternalVpnGatewaysListCall) MaxResults(maxResults int64) *ExternalVpnGatewaysListCall {
  42426. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42427. return c
  42428. }
  42429. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42430. // a certain order. By default, results are returned in alphanumerical
  42431. // order based on the resource name.
  42432. //
  42433. // You can also sort results in descending order based on the creation
  42434. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42435. // based on the creationTimestamp field in reverse chronological order
  42436. // (newest result first). Use this to sort resources like operations so
  42437. // that the newest operation is returned first.
  42438. //
  42439. // Currently, only sorting by name or creationTimestamp desc is
  42440. // supported.
  42441. func (c *ExternalVpnGatewaysListCall) OrderBy(orderBy string) *ExternalVpnGatewaysListCall {
  42442. c.urlParams_.Set("orderBy", orderBy)
  42443. return c
  42444. }
  42445. // PageToken sets the optional parameter "pageToken": Specifies a page
  42446. // token to use. Set pageToken to the nextPageToken returned by a
  42447. // previous list request to get the next page of results.
  42448. func (c *ExternalVpnGatewaysListCall) PageToken(pageToken string) *ExternalVpnGatewaysListCall {
  42449. c.urlParams_.Set("pageToken", pageToken)
  42450. return c
  42451. }
  42452. // Fields allows partial responses to be retrieved. See
  42453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42454. // for more information.
  42455. func (c *ExternalVpnGatewaysListCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysListCall {
  42456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42457. return c
  42458. }
  42459. // IfNoneMatch sets the optional parameter which makes the operation
  42460. // fail if the object's ETag matches the given value. This is useful for
  42461. // getting updates only after the object has changed since the last
  42462. // request. Use googleapi.IsNotModified to check whether the response
  42463. // error from Do is the result of In-None-Match.
  42464. func (c *ExternalVpnGatewaysListCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysListCall {
  42465. c.ifNoneMatch_ = entityTag
  42466. return c
  42467. }
  42468. // Context sets the context to be used in this call's Do method. Any
  42469. // pending HTTP request will be aborted if the provided context is
  42470. // canceled.
  42471. func (c *ExternalVpnGatewaysListCall) Context(ctx context.Context) *ExternalVpnGatewaysListCall {
  42472. c.ctx_ = ctx
  42473. return c
  42474. }
  42475. // Header returns an http.Header that can be modified by the caller to
  42476. // add HTTP headers to the request.
  42477. func (c *ExternalVpnGatewaysListCall) Header() http.Header {
  42478. if c.header_ == nil {
  42479. c.header_ = make(http.Header)
  42480. }
  42481. return c.header_
  42482. }
  42483. func (c *ExternalVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  42484. reqHeaders := make(http.Header)
  42485. for k, v := range c.header_ {
  42486. reqHeaders[k] = v
  42487. }
  42488. reqHeaders.Set("User-Agent", c.s.userAgent())
  42489. if c.ifNoneMatch_ != "" {
  42490. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42491. }
  42492. var body io.Reader = nil
  42493. c.urlParams_.Set("alt", alt)
  42494. c.urlParams_.Set("prettyPrint", "false")
  42495. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways")
  42496. urls += "?" + c.urlParams_.Encode()
  42497. req, err := http.NewRequest("GET", urls, body)
  42498. if err != nil {
  42499. return nil, err
  42500. }
  42501. req.Header = reqHeaders
  42502. googleapi.Expand(req.URL, map[string]string{
  42503. "project": c.project,
  42504. })
  42505. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42506. }
  42507. // Do executes the "compute.externalVpnGateways.list" call.
  42508. // Exactly one of *ExternalVpnGatewayList or error will be non-nil. Any
  42509. // non-2xx status code is an error. Response headers are in either
  42510. // *ExternalVpnGatewayList.ServerResponse.Header or (if a response was
  42511. // returned at all) in error.(*googleapi.Error).Header. Use
  42512. // googleapi.IsNotModified to check whether the returned error was
  42513. // because http.StatusNotModified was returned.
  42514. func (c *ExternalVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGatewayList, error) {
  42515. gensupport.SetOptions(c.urlParams_, opts...)
  42516. res, err := c.doRequest("json")
  42517. if res != nil && res.StatusCode == http.StatusNotModified {
  42518. if res.Body != nil {
  42519. res.Body.Close()
  42520. }
  42521. return nil, &googleapi.Error{
  42522. Code: res.StatusCode,
  42523. Header: res.Header,
  42524. }
  42525. }
  42526. if err != nil {
  42527. return nil, err
  42528. }
  42529. defer googleapi.CloseBody(res)
  42530. if err := googleapi.CheckResponse(res); err != nil {
  42531. return nil, err
  42532. }
  42533. ret := &ExternalVpnGatewayList{
  42534. ServerResponse: googleapi.ServerResponse{
  42535. Header: res.Header,
  42536. HTTPStatusCode: res.StatusCode,
  42537. },
  42538. }
  42539. target := &ret
  42540. if err := gensupport.DecodeResponse(target, res); err != nil {
  42541. return nil, err
  42542. }
  42543. return ret, nil
  42544. // {
  42545. // "description": "Retrieves the list of ExternalVpnGateway available to the specified project.",
  42546. // "httpMethod": "GET",
  42547. // "id": "compute.externalVpnGateways.list",
  42548. // "parameterOrder": [
  42549. // "project"
  42550. // ],
  42551. // "parameters": {
  42552. // "filter": {
  42553. // "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).",
  42554. // "location": "query",
  42555. // "type": "string"
  42556. // },
  42557. // "maxResults": {
  42558. // "default": "500",
  42559. // "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)",
  42560. // "format": "uint32",
  42561. // "location": "query",
  42562. // "minimum": "0",
  42563. // "type": "integer"
  42564. // },
  42565. // "orderBy": {
  42566. // "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.",
  42567. // "location": "query",
  42568. // "type": "string"
  42569. // },
  42570. // "pageToken": {
  42571. // "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.",
  42572. // "location": "query",
  42573. // "type": "string"
  42574. // },
  42575. // "project": {
  42576. // "description": "Project ID for this request.",
  42577. // "location": "path",
  42578. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42579. // "required": true,
  42580. // "type": "string"
  42581. // }
  42582. // },
  42583. // "path": "{project}/global/externalVpnGateways",
  42584. // "response": {
  42585. // "$ref": "ExternalVpnGatewayList"
  42586. // },
  42587. // "scopes": [
  42588. // "https://www.googleapis.com/auth/cloud-platform",
  42589. // "https://www.googleapis.com/auth/compute",
  42590. // "https://www.googleapis.com/auth/compute.readonly"
  42591. // ]
  42592. // }
  42593. }
  42594. // Pages invokes f for each page of results.
  42595. // A non-nil error returned from f will halt the iteration.
  42596. // The provided context supersedes any context provided to the Context method.
  42597. func (c *ExternalVpnGatewaysListCall) Pages(ctx context.Context, f func(*ExternalVpnGatewayList) error) error {
  42598. c.ctx_ = ctx
  42599. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42600. for {
  42601. x, err := c.Do()
  42602. if err != nil {
  42603. return err
  42604. }
  42605. if err := f(x); err != nil {
  42606. return err
  42607. }
  42608. if x.NextPageToken == "" {
  42609. return nil
  42610. }
  42611. c.PageToken(x.NextPageToken)
  42612. }
  42613. }
  42614. // method id "compute.externalVpnGateways.setLabels":
  42615. type ExternalVpnGatewaysSetLabelsCall struct {
  42616. s *Service
  42617. project string
  42618. resource string
  42619. globalsetlabelsrequest *GlobalSetLabelsRequest
  42620. urlParams_ gensupport.URLParams
  42621. ctx_ context.Context
  42622. header_ http.Header
  42623. }
  42624. // SetLabels: Sets the labels on an ExternalVpnGateway. To learn more
  42625. // about labels, read the Labeling Resources documentation.
  42626. func (r *ExternalVpnGatewaysService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ExternalVpnGatewaysSetLabelsCall {
  42627. c := &ExternalVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42628. c.project = project
  42629. c.resource = resource
  42630. c.globalsetlabelsrequest = globalsetlabelsrequest
  42631. return c
  42632. }
  42633. // Fields allows partial responses to be retrieved. See
  42634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42635. // for more information.
  42636. func (c *ExternalVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysSetLabelsCall {
  42637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42638. return c
  42639. }
  42640. // Context sets the context to be used in this call's Do method. Any
  42641. // pending HTTP request will be aborted if the provided context is
  42642. // canceled.
  42643. func (c *ExternalVpnGatewaysSetLabelsCall) Context(ctx context.Context) *ExternalVpnGatewaysSetLabelsCall {
  42644. c.ctx_ = ctx
  42645. return c
  42646. }
  42647. // Header returns an http.Header that can be modified by the caller to
  42648. // add HTTP headers to the request.
  42649. func (c *ExternalVpnGatewaysSetLabelsCall) Header() http.Header {
  42650. if c.header_ == nil {
  42651. c.header_ = make(http.Header)
  42652. }
  42653. return c.header_
  42654. }
  42655. func (c *ExternalVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  42656. reqHeaders := make(http.Header)
  42657. for k, v := range c.header_ {
  42658. reqHeaders[k] = v
  42659. }
  42660. reqHeaders.Set("User-Agent", c.s.userAgent())
  42661. var body io.Reader = nil
  42662. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  42663. if err != nil {
  42664. return nil, err
  42665. }
  42666. reqHeaders.Set("Content-Type", "application/json")
  42667. c.urlParams_.Set("alt", alt)
  42668. c.urlParams_.Set("prettyPrint", "false")
  42669. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{resource}/setLabels")
  42670. urls += "?" + c.urlParams_.Encode()
  42671. req, err := http.NewRequest("POST", urls, body)
  42672. if err != nil {
  42673. return nil, err
  42674. }
  42675. req.Header = reqHeaders
  42676. googleapi.Expand(req.URL, map[string]string{
  42677. "project": c.project,
  42678. "resource": c.resource,
  42679. })
  42680. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42681. }
  42682. // Do executes the "compute.externalVpnGateways.setLabels" call.
  42683. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42684. // status code is an error. Response headers are in either
  42685. // *Operation.ServerResponse.Header or (if a response was returned at
  42686. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42687. // to check whether the returned error was because
  42688. // http.StatusNotModified was returned.
  42689. func (c *ExternalVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42690. gensupport.SetOptions(c.urlParams_, opts...)
  42691. res, err := c.doRequest("json")
  42692. if res != nil && res.StatusCode == http.StatusNotModified {
  42693. if res.Body != nil {
  42694. res.Body.Close()
  42695. }
  42696. return nil, &googleapi.Error{
  42697. Code: res.StatusCode,
  42698. Header: res.Header,
  42699. }
  42700. }
  42701. if err != nil {
  42702. return nil, err
  42703. }
  42704. defer googleapi.CloseBody(res)
  42705. if err := googleapi.CheckResponse(res); err != nil {
  42706. return nil, err
  42707. }
  42708. ret := &Operation{
  42709. ServerResponse: googleapi.ServerResponse{
  42710. Header: res.Header,
  42711. HTTPStatusCode: res.StatusCode,
  42712. },
  42713. }
  42714. target := &ret
  42715. if err := gensupport.DecodeResponse(target, res); err != nil {
  42716. return nil, err
  42717. }
  42718. return ret, nil
  42719. // {
  42720. // "description": "Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  42721. // "httpMethod": "POST",
  42722. // "id": "compute.externalVpnGateways.setLabels",
  42723. // "parameterOrder": [
  42724. // "project",
  42725. // "resource"
  42726. // ],
  42727. // "parameters": {
  42728. // "project": {
  42729. // "description": "Project ID for this request.",
  42730. // "location": "path",
  42731. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42732. // "required": true,
  42733. // "type": "string"
  42734. // },
  42735. // "resource": {
  42736. // "description": "Name or id of the resource for this request.",
  42737. // "location": "path",
  42738. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42739. // "required": true,
  42740. // "type": "string"
  42741. // }
  42742. // },
  42743. // "path": "{project}/global/externalVpnGateways/{resource}/setLabels",
  42744. // "request": {
  42745. // "$ref": "GlobalSetLabelsRequest"
  42746. // },
  42747. // "response": {
  42748. // "$ref": "Operation"
  42749. // },
  42750. // "scopes": [
  42751. // "https://www.googleapis.com/auth/cloud-platform",
  42752. // "https://www.googleapis.com/auth/compute"
  42753. // ]
  42754. // }
  42755. }
  42756. // method id "compute.externalVpnGateways.testIamPermissions":
  42757. type ExternalVpnGatewaysTestIamPermissionsCall struct {
  42758. s *Service
  42759. project string
  42760. resource string
  42761. testpermissionsrequest *TestPermissionsRequest
  42762. urlParams_ gensupport.URLParams
  42763. ctx_ context.Context
  42764. header_ http.Header
  42765. }
  42766. // TestIamPermissions: Returns permissions that a caller has on the
  42767. // specified resource.
  42768. func (r *ExternalVpnGatewaysService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ExternalVpnGatewaysTestIamPermissionsCall {
  42769. c := &ExternalVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42770. c.project = project
  42771. c.resource = resource
  42772. c.testpermissionsrequest = testpermissionsrequest
  42773. return c
  42774. }
  42775. // Fields allows partial responses to be retrieved. See
  42776. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42777. // for more information.
  42778. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysTestIamPermissionsCall {
  42779. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42780. return c
  42781. }
  42782. // Context sets the context to be used in this call's Do method. Any
  42783. // pending HTTP request will be aborted if the provided context is
  42784. // canceled.
  42785. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *ExternalVpnGatewaysTestIamPermissionsCall {
  42786. c.ctx_ = ctx
  42787. return c
  42788. }
  42789. // Header returns an http.Header that can be modified by the caller to
  42790. // add HTTP headers to the request.
  42791. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  42792. if c.header_ == nil {
  42793. c.header_ = make(http.Header)
  42794. }
  42795. return c.header_
  42796. }
  42797. func (c *ExternalVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  42798. reqHeaders := make(http.Header)
  42799. for k, v := range c.header_ {
  42800. reqHeaders[k] = v
  42801. }
  42802. reqHeaders.Set("User-Agent", c.s.userAgent())
  42803. var body io.Reader = nil
  42804. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  42805. if err != nil {
  42806. return nil, err
  42807. }
  42808. reqHeaders.Set("Content-Type", "application/json")
  42809. c.urlParams_.Set("alt", alt)
  42810. c.urlParams_.Set("prettyPrint", "false")
  42811. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{resource}/testIamPermissions")
  42812. urls += "?" + c.urlParams_.Encode()
  42813. req, err := http.NewRequest("POST", urls, body)
  42814. if err != nil {
  42815. return nil, err
  42816. }
  42817. req.Header = reqHeaders
  42818. googleapi.Expand(req.URL, map[string]string{
  42819. "project": c.project,
  42820. "resource": c.resource,
  42821. })
  42822. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42823. }
  42824. // Do executes the "compute.externalVpnGateways.testIamPermissions" call.
  42825. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  42826. // non-2xx status code is an error. Response headers are in either
  42827. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  42828. // returned at all) in error.(*googleapi.Error).Header. Use
  42829. // googleapi.IsNotModified to check whether the returned error was
  42830. // because http.StatusNotModified was returned.
  42831. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  42832. gensupport.SetOptions(c.urlParams_, opts...)
  42833. res, err := c.doRequest("json")
  42834. if res != nil && res.StatusCode == http.StatusNotModified {
  42835. if res.Body != nil {
  42836. res.Body.Close()
  42837. }
  42838. return nil, &googleapi.Error{
  42839. Code: res.StatusCode,
  42840. Header: res.Header,
  42841. }
  42842. }
  42843. if err != nil {
  42844. return nil, err
  42845. }
  42846. defer googleapi.CloseBody(res)
  42847. if err := googleapi.CheckResponse(res); err != nil {
  42848. return nil, err
  42849. }
  42850. ret := &TestPermissionsResponse{
  42851. ServerResponse: googleapi.ServerResponse{
  42852. Header: res.Header,
  42853. HTTPStatusCode: res.StatusCode,
  42854. },
  42855. }
  42856. target := &ret
  42857. if err := gensupport.DecodeResponse(target, res); err != nil {
  42858. return nil, err
  42859. }
  42860. return ret, nil
  42861. // {
  42862. // "description": "Returns permissions that a caller has on the specified resource.",
  42863. // "httpMethod": "POST",
  42864. // "id": "compute.externalVpnGateways.testIamPermissions",
  42865. // "parameterOrder": [
  42866. // "project",
  42867. // "resource"
  42868. // ],
  42869. // "parameters": {
  42870. // "project": {
  42871. // "description": "Project ID for this request.",
  42872. // "location": "path",
  42873. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42874. // "required": true,
  42875. // "type": "string"
  42876. // },
  42877. // "resource": {
  42878. // "description": "Name or id of the resource for this request.",
  42879. // "location": "path",
  42880. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42881. // "required": true,
  42882. // "type": "string"
  42883. // }
  42884. // },
  42885. // "path": "{project}/global/externalVpnGateways/{resource}/testIamPermissions",
  42886. // "request": {
  42887. // "$ref": "TestPermissionsRequest"
  42888. // },
  42889. // "response": {
  42890. // "$ref": "TestPermissionsResponse"
  42891. // },
  42892. // "scopes": [
  42893. // "https://www.googleapis.com/auth/cloud-platform",
  42894. // "https://www.googleapis.com/auth/compute",
  42895. // "https://www.googleapis.com/auth/compute.readonly"
  42896. // ]
  42897. // }
  42898. }
  42899. // method id "compute.firewalls.delete":
  42900. type FirewallsDeleteCall struct {
  42901. s *Service
  42902. project string
  42903. firewall string
  42904. urlParams_ gensupport.URLParams
  42905. ctx_ context.Context
  42906. header_ http.Header
  42907. }
  42908. // Delete: Deletes the specified firewall.
  42909. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  42910. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  42911. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42912. c.project = project
  42913. c.firewall = firewall
  42914. return c
  42915. }
  42916. // RequestId sets the optional parameter "requestId": An optional
  42917. // request ID to identify requests. Specify a unique request ID so that
  42918. // if you must retry your request, the server will know to ignore the
  42919. // request if it has already been completed.
  42920. //
  42921. // For example, consider a situation where you make an initial request
  42922. // and the request times out. If you make the request again with the
  42923. // same request ID, the server can check if original operation with the
  42924. // same request ID was received, and if so, will ignore the second
  42925. // request. This prevents clients from accidentally creating duplicate
  42926. // commitments.
  42927. //
  42928. // The request ID must be a valid UUID with the exception that zero UUID
  42929. // is not supported (00000000-0000-0000-0000-000000000000).
  42930. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  42931. c.urlParams_.Set("requestId", requestId)
  42932. return c
  42933. }
  42934. // Fields allows partial responses to be retrieved. See
  42935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42936. // for more information.
  42937. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  42938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42939. return c
  42940. }
  42941. // Context sets the context to be used in this call's Do method. Any
  42942. // pending HTTP request will be aborted if the provided context is
  42943. // canceled.
  42944. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  42945. c.ctx_ = ctx
  42946. return c
  42947. }
  42948. // Header returns an http.Header that can be modified by the caller to
  42949. // add HTTP headers to the request.
  42950. func (c *FirewallsDeleteCall) Header() http.Header {
  42951. if c.header_ == nil {
  42952. c.header_ = make(http.Header)
  42953. }
  42954. return c.header_
  42955. }
  42956. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  42957. reqHeaders := make(http.Header)
  42958. for k, v := range c.header_ {
  42959. reqHeaders[k] = v
  42960. }
  42961. reqHeaders.Set("User-Agent", c.s.userAgent())
  42962. var body io.Reader = nil
  42963. c.urlParams_.Set("alt", alt)
  42964. c.urlParams_.Set("prettyPrint", "false")
  42965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  42966. urls += "?" + c.urlParams_.Encode()
  42967. req, err := http.NewRequest("DELETE", urls, body)
  42968. if err != nil {
  42969. return nil, err
  42970. }
  42971. req.Header = reqHeaders
  42972. googleapi.Expand(req.URL, map[string]string{
  42973. "project": c.project,
  42974. "firewall": c.firewall,
  42975. })
  42976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42977. }
  42978. // Do executes the "compute.firewalls.delete" call.
  42979. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42980. // status code is an error. Response headers are in either
  42981. // *Operation.ServerResponse.Header or (if a response was returned at
  42982. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42983. // to check whether the returned error was because
  42984. // http.StatusNotModified was returned.
  42985. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42986. gensupport.SetOptions(c.urlParams_, opts...)
  42987. res, err := c.doRequest("json")
  42988. if res != nil && res.StatusCode == http.StatusNotModified {
  42989. if res.Body != nil {
  42990. res.Body.Close()
  42991. }
  42992. return nil, &googleapi.Error{
  42993. Code: res.StatusCode,
  42994. Header: res.Header,
  42995. }
  42996. }
  42997. if err != nil {
  42998. return nil, err
  42999. }
  43000. defer googleapi.CloseBody(res)
  43001. if err := googleapi.CheckResponse(res); err != nil {
  43002. return nil, err
  43003. }
  43004. ret := &Operation{
  43005. ServerResponse: googleapi.ServerResponse{
  43006. Header: res.Header,
  43007. HTTPStatusCode: res.StatusCode,
  43008. },
  43009. }
  43010. target := &ret
  43011. if err := gensupport.DecodeResponse(target, res); err != nil {
  43012. return nil, err
  43013. }
  43014. return ret, nil
  43015. // {
  43016. // "description": "Deletes the specified firewall.",
  43017. // "httpMethod": "DELETE",
  43018. // "id": "compute.firewalls.delete",
  43019. // "parameterOrder": [
  43020. // "project",
  43021. // "firewall"
  43022. // ],
  43023. // "parameters": {
  43024. // "firewall": {
  43025. // "description": "Name of the firewall rule to delete.",
  43026. // "location": "path",
  43027. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43028. // "required": true,
  43029. // "type": "string"
  43030. // },
  43031. // "project": {
  43032. // "description": "Project ID for this request.",
  43033. // "location": "path",
  43034. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43035. // "required": true,
  43036. // "type": "string"
  43037. // },
  43038. // "requestId": {
  43039. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43040. // "location": "query",
  43041. // "type": "string"
  43042. // }
  43043. // },
  43044. // "path": "{project}/global/firewalls/{firewall}",
  43045. // "response": {
  43046. // "$ref": "Operation"
  43047. // },
  43048. // "scopes": [
  43049. // "https://www.googleapis.com/auth/cloud-platform",
  43050. // "https://www.googleapis.com/auth/compute"
  43051. // ]
  43052. // }
  43053. }
  43054. // method id "compute.firewalls.get":
  43055. type FirewallsGetCall struct {
  43056. s *Service
  43057. project string
  43058. firewall string
  43059. urlParams_ gensupport.URLParams
  43060. ifNoneMatch_ string
  43061. ctx_ context.Context
  43062. header_ http.Header
  43063. }
  43064. // Get: Returns the specified firewall.
  43065. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  43066. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  43067. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43068. c.project = project
  43069. c.firewall = firewall
  43070. return c
  43071. }
  43072. // Fields allows partial responses to be retrieved. See
  43073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43074. // for more information.
  43075. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  43076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43077. return c
  43078. }
  43079. // IfNoneMatch sets the optional parameter which makes the operation
  43080. // fail if the object's ETag matches the given value. This is useful for
  43081. // getting updates only after the object has changed since the last
  43082. // request. Use googleapi.IsNotModified to check whether the response
  43083. // error from Do is the result of In-None-Match.
  43084. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  43085. c.ifNoneMatch_ = entityTag
  43086. return c
  43087. }
  43088. // Context sets the context to be used in this call's Do method. Any
  43089. // pending HTTP request will be aborted if the provided context is
  43090. // canceled.
  43091. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  43092. c.ctx_ = ctx
  43093. return c
  43094. }
  43095. // Header returns an http.Header that can be modified by the caller to
  43096. // add HTTP headers to the request.
  43097. func (c *FirewallsGetCall) Header() http.Header {
  43098. if c.header_ == nil {
  43099. c.header_ = make(http.Header)
  43100. }
  43101. return c.header_
  43102. }
  43103. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  43104. reqHeaders := make(http.Header)
  43105. for k, v := range c.header_ {
  43106. reqHeaders[k] = v
  43107. }
  43108. reqHeaders.Set("User-Agent", c.s.userAgent())
  43109. if c.ifNoneMatch_ != "" {
  43110. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43111. }
  43112. var body io.Reader = nil
  43113. c.urlParams_.Set("alt", alt)
  43114. c.urlParams_.Set("prettyPrint", "false")
  43115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  43116. urls += "?" + c.urlParams_.Encode()
  43117. req, err := http.NewRequest("GET", urls, body)
  43118. if err != nil {
  43119. return nil, err
  43120. }
  43121. req.Header = reqHeaders
  43122. googleapi.Expand(req.URL, map[string]string{
  43123. "project": c.project,
  43124. "firewall": c.firewall,
  43125. })
  43126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43127. }
  43128. // Do executes the "compute.firewalls.get" call.
  43129. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  43130. // code is an error. Response headers are in either
  43131. // *Firewall.ServerResponse.Header or (if a response was returned at
  43132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43133. // to check whether the returned error was because
  43134. // http.StatusNotModified was returned.
  43135. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  43136. gensupport.SetOptions(c.urlParams_, opts...)
  43137. res, err := c.doRequest("json")
  43138. if res != nil && res.StatusCode == http.StatusNotModified {
  43139. if res.Body != nil {
  43140. res.Body.Close()
  43141. }
  43142. return nil, &googleapi.Error{
  43143. Code: res.StatusCode,
  43144. Header: res.Header,
  43145. }
  43146. }
  43147. if err != nil {
  43148. return nil, err
  43149. }
  43150. defer googleapi.CloseBody(res)
  43151. if err := googleapi.CheckResponse(res); err != nil {
  43152. return nil, err
  43153. }
  43154. ret := &Firewall{
  43155. ServerResponse: googleapi.ServerResponse{
  43156. Header: res.Header,
  43157. HTTPStatusCode: res.StatusCode,
  43158. },
  43159. }
  43160. target := &ret
  43161. if err := gensupport.DecodeResponse(target, res); err != nil {
  43162. return nil, err
  43163. }
  43164. return ret, nil
  43165. // {
  43166. // "description": "Returns the specified firewall.",
  43167. // "httpMethod": "GET",
  43168. // "id": "compute.firewalls.get",
  43169. // "parameterOrder": [
  43170. // "project",
  43171. // "firewall"
  43172. // ],
  43173. // "parameters": {
  43174. // "firewall": {
  43175. // "description": "Name of the firewall rule to return.",
  43176. // "location": "path",
  43177. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43178. // "required": true,
  43179. // "type": "string"
  43180. // },
  43181. // "project": {
  43182. // "description": "Project ID for this request.",
  43183. // "location": "path",
  43184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43185. // "required": true,
  43186. // "type": "string"
  43187. // }
  43188. // },
  43189. // "path": "{project}/global/firewalls/{firewall}",
  43190. // "response": {
  43191. // "$ref": "Firewall"
  43192. // },
  43193. // "scopes": [
  43194. // "https://www.googleapis.com/auth/cloud-platform",
  43195. // "https://www.googleapis.com/auth/compute",
  43196. // "https://www.googleapis.com/auth/compute.readonly"
  43197. // ]
  43198. // }
  43199. }
  43200. // method id "compute.firewalls.insert":
  43201. type FirewallsInsertCall struct {
  43202. s *Service
  43203. project string
  43204. firewall *Firewall
  43205. urlParams_ gensupport.URLParams
  43206. ctx_ context.Context
  43207. header_ http.Header
  43208. }
  43209. // Insert: Creates a firewall rule in the specified project using the
  43210. // data included in the request.
  43211. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  43212. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  43213. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43214. c.project = project
  43215. c.firewall = firewall
  43216. return c
  43217. }
  43218. // RequestId sets the optional parameter "requestId": An optional
  43219. // request ID to identify requests. Specify a unique request ID so that
  43220. // if you must retry your request, the server will know to ignore the
  43221. // request if it has already been completed.
  43222. //
  43223. // For example, consider a situation where you make an initial request
  43224. // and the request times out. If you make the request again with the
  43225. // same request ID, the server can check if original operation with the
  43226. // same request ID was received, and if so, will ignore the second
  43227. // request. This prevents clients from accidentally creating duplicate
  43228. // commitments.
  43229. //
  43230. // The request ID must be a valid UUID with the exception that zero UUID
  43231. // is not supported (00000000-0000-0000-0000-000000000000).
  43232. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  43233. c.urlParams_.Set("requestId", requestId)
  43234. return c
  43235. }
  43236. // Fields allows partial responses to be retrieved. See
  43237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43238. // for more information.
  43239. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  43240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43241. return c
  43242. }
  43243. // Context sets the context to be used in this call's Do method. Any
  43244. // pending HTTP request will be aborted if the provided context is
  43245. // canceled.
  43246. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  43247. c.ctx_ = ctx
  43248. return c
  43249. }
  43250. // Header returns an http.Header that can be modified by the caller to
  43251. // add HTTP headers to the request.
  43252. func (c *FirewallsInsertCall) Header() http.Header {
  43253. if c.header_ == nil {
  43254. c.header_ = make(http.Header)
  43255. }
  43256. return c.header_
  43257. }
  43258. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  43259. reqHeaders := make(http.Header)
  43260. for k, v := range c.header_ {
  43261. reqHeaders[k] = v
  43262. }
  43263. reqHeaders.Set("User-Agent", c.s.userAgent())
  43264. var body io.Reader = nil
  43265. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  43266. if err != nil {
  43267. return nil, err
  43268. }
  43269. reqHeaders.Set("Content-Type", "application/json")
  43270. c.urlParams_.Set("alt", alt)
  43271. c.urlParams_.Set("prettyPrint", "false")
  43272. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  43273. urls += "?" + c.urlParams_.Encode()
  43274. req, err := http.NewRequest("POST", urls, body)
  43275. if err != nil {
  43276. return nil, err
  43277. }
  43278. req.Header = reqHeaders
  43279. googleapi.Expand(req.URL, map[string]string{
  43280. "project": c.project,
  43281. })
  43282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43283. }
  43284. // Do executes the "compute.firewalls.insert" call.
  43285. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43286. // status code is an error. Response headers are in either
  43287. // *Operation.ServerResponse.Header or (if a response was returned at
  43288. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43289. // to check whether the returned error was because
  43290. // http.StatusNotModified was returned.
  43291. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43292. gensupport.SetOptions(c.urlParams_, opts...)
  43293. res, err := c.doRequest("json")
  43294. if res != nil && res.StatusCode == http.StatusNotModified {
  43295. if res.Body != nil {
  43296. res.Body.Close()
  43297. }
  43298. return nil, &googleapi.Error{
  43299. Code: res.StatusCode,
  43300. Header: res.Header,
  43301. }
  43302. }
  43303. if err != nil {
  43304. return nil, err
  43305. }
  43306. defer googleapi.CloseBody(res)
  43307. if err := googleapi.CheckResponse(res); err != nil {
  43308. return nil, err
  43309. }
  43310. ret := &Operation{
  43311. ServerResponse: googleapi.ServerResponse{
  43312. Header: res.Header,
  43313. HTTPStatusCode: res.StatusCode,
  43314. },
  43315. }
  43316. target := &ret
  43317. if err := gensupport.DecodeResponse(target, res); err != nil {
  43318. return nil, err
  43319. }
  43320. return ret, nil
  43321. // {
  43322. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  43323. // "httpMethod": "POST",
  43324. // "id": "compute.firewalls.insert",
  43325. // "parameterOrder": [
  43326. // "project"
  43327. // ],
  43328. // "parameters": {
  43329. // "project": {
  43330. // "description": "Project ID for this request.",
  43331. // "location": "path",
  43332. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43333. // "required": true,
  43334. // "type": "string"
  43335. // },
  43336. // "requestId": {
  43337. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43338. // "location": "query",
  43339. // "type": "string"
  43340. // }
  43341. // },
  43342. // "path": "{project}/global/firewalls",
  43343. // "request": {
  43344. // "$ref": "Firewall"
  43345. // },
  43346. // "response": {
  43347. // "$ref": "Operation"
  43348. // },
  43349. // "scopes": [
  43350. // "https://www.googleapis.com/auth/cloud-platform",
  43351. // "https://www.googleapis.com/auth/compute"
  43352. // ]
  43353. // }
  43354. }
  43355. // method id "compute.firewalls.list":
  43356. type FirewallsListCall struct {
  43357. s *Service
  43358. project string
  43359. urlParams_ gensupport.URLParams
  43360. ifNoneMatch_ string
  43361. ctx_ context.Context
  43362. header_ http.Header
  43363. }
  43364. // List: Retrieves the list of firewall rules available to the specified
  43365. // project.
  43366. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  43367. func (r *FirewallsService) List(project string) *FirewallsListCall {
  43368. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43369. c.project = project
  43370. return c
  43371. }
  43372. // Filter sets the optional parameter "filter": A filter expression that
  43373. // filters resources listed in the response. The expression must specify
  43374. // the field name, a comparison operator, and the value that you want to
  43375. // use for filtering. The value must be a string, a number, or a
  43376. // boolean. The comparison operator must be either =, !=, >, or <.
  43377. //
  43378. // For example, if you are filtering Compute Engine instances, you can
  43379. // exclude instances named example-instance by specifying name !=
  43380. // example-instance.
  43381. //
  43382. // You can also filter nested fields. For example, you could specify
  43383. // scheduling.automaticRestart = false to include instances only if they
  43384. // are not scheduled for automatic restarts. You can use filtering on
  43385. // nested fields to filter based on resource labels.
  43386. //
  43387. // To filter on multiple expressions, provide each separate expression
  43388. // within parentheses. For example, (scheduling.automaticRestart = true)
  43389. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43390. // AND expression. However, you can include AND and OR expressions
  43391. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43392. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43393. // true).
  43394. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  43395. c.urlParams_.Set("filter", filter)
  43396. return c
  43397. }
  43398. // MaxResults sets the optional parameter "maxResults": The maximum
  43399. // number of results per page that should be returned. If the number of
  43400. // available results is larger than maxResults, Compute Engine returns a
  43401. // nextPageToken that can be used to get the next page of results in
  43402. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43403. // (Default: 500)
  43404. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  43405. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43406. return c
  43407. }
  43408. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43409. // a certain order. By default, results are returned in alphanumerical
  43410. // order based on the resource name.
  43411. //
  43412. // You can also sort results in descending order based on the creation
  43413. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43414. // based on the creationTimestamp field in reverse chronological order
  43415. // (newest result first). Use this to sort resources like operations so
  43416. // that the newest operation is returned first.
  43417. //
  43418. // Currently, only sorting by name or creationTimestamp desc is
  43419. // supported.
  43420. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  43421. c.urlParams_.Set("orderBy", orderBy)
  43422. return c
  43423. }
  43424. // PageToken sets the optional parameter "pageToken": Specifies a page
  43425. // token to use. Set pageToken to the nextPageToken returned by a
  43426. // previous list request to get the next page of results.
  43427. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  43428. c.urlParams_.Set("pageToken", pageToken)
  43429. return c
  43430. }
  43431. // Fields allows partial responses to be retrieved. See
  43432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43433. // for more information.
  43434. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  43435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43436. return c
  43437. }
  43438. // IfNoneMatch sets the optional parameter which makes the operation
  43439. // fail if the object's ETag matches the given value. This is useful for
  43440. // getting updates only after the object has changed since the last
  43441. // request. Use googleapi.IsNotModified to check whether the response
  43442. // error from Do is the result of In-None-Match.
  43443. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  43444. c.ifNoneMatch_ = entityTag
  43445. return c
  43446. }
  43447. // Context sets the context to be used in this call's Do method. Any
  43448. // pending HTTP request will be aborted if the provided context is
  43449. // canceled.
  43450. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  43451. c.ctx_ = ctx
  43452. return c
  43453. }
  43454. // Header returns an http.Header that can be modified by the caller to
  43455. // add HTTP headers to the request.
  43456. func (c *FirewallsListCall) Header() http.Header {
  43457. if c.header_ == nil {
  43458. c.header_ = make(http.Header)
  43459. }
  43460. return c.header_
  43461. }
  43462. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  43463. reqHeaders := make(http.Header)
  43464. for k, v := range c.header_ {
  43465. reqHeaders[k] = v
  43466. }
  43467. reqHeaders.Set("User-Agent", c.s.userAgent())
  43468. if c.ifNoneMatch_ != "" {
  43469. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43470. }
  43471. var body io.Reader = nil
  43472. c.urlParams_.Set("alt", alt)
  43473. c.urlParams_.Set("prettyPrint", "false")
  43474. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  43475. urls += "?" + c.urlParams_.Encode()
  43476. req, err := http.NewRequest("GET", urls, body)
  43477. if err != nil {
  43478. return nil, err
  43479. }
  43480. req.Header = reqHeaders
  43481. googleapi.Expand(req.URL, map[string]string{
  43482. "project": c.project,
  43483. })
  43484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43485. }
  43486. // Do executes the "compute.firewalls.list" call.
  43487. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  43488. // status code is an error. Response headers are in either
  43489. // *FirewallList.ServerResponse.Header or (if a response was returned at
  43490. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43491. // to check whether the returned error was because
  43492. // http.StatusNotModified was returned.
  43493. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  43494. gensupport.SetOptions(c.urlParams_, opts...)
  43495. res, err := c.doRequest("json")
  43496. if res != nil && res.StatusCode == http.StatusNotModified {
  43497. if res.Body != nil {
  43498. res.Body.Close()
  43499. }
  43500. return nil, &googleapi.Error{
  43501. Code: res.StatusCode,
  43502. Header: res.Header,
  43503. }
  43504. }
  43505. if err != nil {
  43506. return nil, err
  43507. }
  43508. defer googleapi.CloseBody(res)
  43509. if err := googleapi.CheckResponse(res); err != nil {
  43510. return nil, err
  43511. }
  43512. ret := &FirewallList{
  43513. ServerResponse: googleapi.ServerResponse{
  43514. Header: res.Header,
  43515. HTTPStatusCode: res.StatusCode,
  43516. },
  43517. }
  43518. target := &ret
  43519. if err := gensupport.DecodeResponse(target, res); err != nil {
  43520. return nil, err
  43521. }
  43522. return ret, nil
  43523. // {
  43524. // "description": "Retrieves the list of firewall rules available to the specified project.",
  43525. // "httpMethod": "GET",
  43526. // "id": "compute.firewalls.list",
  43527. // "parameterOrder": [
  43528. // "project"
  43529. // ],
  43530. // "parameters": {
  43531. // "filter": {
  43532. // "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).",
  43533. // "location": "query",
  43534. // "type": "string"
  43535. // },
  43536. // "maxResults": {
  43537. // "default": "500",
  43538. // "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)",
  43539. // "format": "uint32",
  43540. // "location": "query",
  43541. // "minimum": "0",
  43542. // "type": "integer"
  43543. // },
  43544. // "orderBy": {
  43545. // "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.",
  43546. // "location": "query",
  43547. // "type": "string"
  43548. // },
  43549. // "pageToken": {
  43550. // "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.",
  43551. // "location": "query",
  43552. // "type": "string"
  43553. // },
  43554. // "project": {
  43555. // "description": "Project ID for this request.",
  43556. // "location": "path",
  43557. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43558. // "required": true,
  43559. // "type": "string"
  43560. // }
  43561. // },
  43562. // "path": "{project}/global/firewalls",
  43563. // "response": {
  43564. // "$ref": "FirewallList"
  43565. // },
  43566. // "scopes": [
  43567. // "https://www.googleapis.com/auth/cloud-platform",
  43568. // "https://www.googleapis.com/auth/compute",
  43569. // "https://www.googleapis.com/auth/compute.readonly"
  43570. // ]
  43571. // }
  43572. }
  43573. // Pages invokes f for each page of results.
  43574. // A non-nil error returned from f will halt the iteration.
  43575. // The provided context supersedes any context provided to the Context method.
  43576. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  43577. c.ctx_ = ctx
  43578. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43579. for {
  43580. x, err := c.Do()
  43581. if err != nil {
  43582. return err
  43583. }
  43584. if err := f(x); err != nil {
  43585. return err
  43586. }
  43587. if x.NextPageToken == "" {
  43588. return nil
  43589. }
  43590. c.PageToken(x.NextPageToken)
  43591. }
  43592. }
  43593. // method id "compute.firewalls.patch":
  43594. type FirewallsPatchCall struct {
  43595. s *Service
  43596. project string
  43597. firewall string
  43598. firewall2 *Firewall
  43599. urlParams_ gensupport.URLParams
  43600. ctx_ context.Context
  43601. header_ http.Header
  43602. }
  43603. // Patch: Updates the specified firewall rule with the data included in
  43604. // the request. This method supports PATCH semantics and uses the JSON
  43605. // merge patch format and processing rules.
  43606. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  43607. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  43608. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43609. c.project = project
  43610. c.firewall = firewall
  43611. c.firewall2 = firewall2
  43612. return c
  43613. }
  43614. // RequestId sets the optional parameter "requestId": An optional
  43615. // request ID to identify requests. Specify a unique request ID so that
  43616. // if you must retry your request, the server will know to ignore the
  43617. // request if it has already been completed.
  43618. //
  43619. // For example, consider a situation where you make an initial request
  43620. // and the request times out. If you make the request again with the
  43621. // same request ID, the server can check if original operation with the
  43622. // same request ID was received, and if so, will ignore the second
  43623. // request. This prevents clients from accidentally creating duplicate
  43624. // commitments.
  43625. //
  43626. // The request ID must be a valid UUID with the exception that zero UUID
  43627. // is not supported (00000000-0000-0000-0000-000000000000).
  43628. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  43629. c.urlParams_.Set("requestId", requestId)
  43630. return c
  43631. }
  43632. // Fields allows partial responses to be retrieved. See
  43633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43634. // for more information.
  43635. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  43636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43637. return c
  43638. }
  43639. // Context sets the context to be used in this call's Do method. Any
  43640. // pending HTTP request will be aborted if the provided context is
  43641. // canceled.
  43642. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  43643. c.ctx_ = ctx
  43644. return c
  43645. }
  43646. // Header returns an http.Header that can be modified by the caller to
  43647. // add HTTP headers to the request.
  43648. func (c *FirewallsPatchCall) Header() http.Header {
  43649. if c.header_ == nil {
  43650. c.header_ = make(http.Header)
  43651. }
  43652. return c.header_
  43653. }
  43654. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  43655. reqHeaders := make(http.Header)
  43656. for k, v := range c.header_ {
  43657. reqHeaders[k] = v
  43658. }
  43659. reqHeaders.Set("User-Agent", c.s.userAgent())
  43660. var body io.Reader = nil
  43661. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  43662. if err != nil {
  43663. return nil, err
  43664. }
  43665. reqHeaders.Set("Content-Type", "application/json")
  43666. c.urlParams_.Set("alt", alt)
  43667. c.urlParams_.Set("prettyPrint", "false")
  43668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  43669. urls += "?" + c.urlParams_.Encode()
  43670. req, err := http.NewRequest("PATCH", urls, body)
  43671. if err != nil {
  43672. return nil, err
  43673. }
  43674. req.Header = reqHeaders
  43675. googleapi.Expand(req.URL, map[string]string{
  43676. "project": c.project,
  43677. "firewall": c.firewall,
  43678. })
  43679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43680. }
  43681. // Do executes the "compute.firewalls.patch" call.
  43682. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43683. // status code is an error. Response headers are in either
  43684. // *Operation.ServerResponse.Header or (if a response was returned at
  43685. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43686. // to check whether the returned error was because
  43687. // http.StatusNotModified was returned.
  43688. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43689. gensupport.SetOptions(c.urlParams_, opts...)
  43690. res, err := c.doRequest("json")
  43691. if res != nil && res.StatusCode == http.StatusNotModified {
  43692. if res.Body != nil {
  43693. res.Body.Close()
  43694. }
  43695. return nil, &googleapi.Error{
  43696. Code: res.StatusCode,
  43697. Header: res.Header,
  43698. }
  43699. }
  43700. if err != nil {
  43701. return nil, err
  43702. }
  43703. defer googleapi.CloseBody(res)
  43704. if err := googleapi.CheckResponse(res); err != nil {
  43705. return nil, err
  43706. }
  43707. ret := &Operation{
  43708. ServerResponse: googleapi.ServerResponse{
  43709. Header: res.Header,
  43710. HTTPStatusCode: res.StatusCode,
  43711. },
  43712. }
  43713. target := &ret
  43714. if err := gensupport.DecodeResponse(target, res); err != nil {
  43715. return nil, err
  43716. }
  43717. return ret, nil
  43718. // {
  43719. // "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.",
  43720. // "httpMethod": "PATCH",
  43721. // "id": "compute.firewalls.patch",
  43722. // "parameterOrder": [
  43723. // "project",
  43724. // "firewall"
  43725. // ],
  43726. // "parameters": {
  43727. // "firewall": {
  43728. // "description": "Name of the firewall rule to patch.",
  43729. // "location": "path",
  43730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43731. // "required": true,
  43732. // "type": "string"
  43733. // },
  43734. // "project": {
  43735. // "description": "Project ID for this request.",
  43736. // "location": "path",
  43737. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43738. // "required": true,
  43739. // "type": "string"
  43740. // },
  43741. // "requestId": {
  43742. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43743. // "location": "query",
  43744. // "type": "string"
  43745. // }
  43746. // },
  43747. // "path": "{project}/global/firewalls/{firewall}",
  43748. // "request": {
  43749. // "$ref": "Firewall"
  43750. // },
  43751. // "response": {
  43752. // "$ref": "Operation"
  43753. // },
  43754. // "scopes": [
  43755. // "https://www.googleapis.com/auth/cloud-platform",
  43756. // "https://www.googleapis.com/auth/compute"
  43757. // ]
  43758. // }
  43759. }
  43760. // method id "compute.firewalls.testIamPermissions":
  43761. type FirewallsTestIamPermissionsCall struct {
  43762. s *Service
  43763. project string
  43764. resource string
  43765. testpermissionsrequest *TestPermissionsRequest
  43766. urlParams_ gensupport.URLParams
  43767. ctx_ context.Context
  43768. header_ http.Header
  43769. }
  43770. // TestIamPermissions: Returns permissions that a caller has on the
  43771. // specified resource.
  43772. func (r *FirewallsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *FirewallsTestIamPermissionsCall {
  43773. c := &FirewallsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43774. c.project = project
  43775. c.resource = resource
  43776. c.testpermissionsrequest = testpermissionsrequest
  43777. return c
  43778. }
  43779. // Fields allows partial responses to be retrieved. See
  43780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43781. // for more information.
  43782. func (c *FirewallsTestIamPermissionsCall) Fields(s ...googleapi.Field) *FirewallsTestIamPermissionsCall {
  43783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43784. return c
  43785. }
  43786. // Context sets the context to be used in this call's Do method. Any
  43787. // pending HTTP request will be aborted if the provided context is
  43788. // canceled.
  43789. func (c *FirewallsTestIamPermissionsCall) Context(ctx context.Context) *FirewallsTestIamPermissionsCall {
  43790. c.ctx_ = ctx
  43791. return c
  43792. }
  43793. // Header returns an http.Header that can be modified by the caller to
  43794. // add HTTP headers to the request.
  43795. func (c *FirewallsTestIamPermissionsCall) Header() http.Header {
  43796. if c.header_ == nil {
  43797. c.header_ = make(http.Header)
  43798. }
  43799. return c.header_
  43800. }
  43801. func (c *FirewallsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  43802. reqHeaders := make(http.Header)
  43803. for k, v := range c.header_ {
  43804. reqHeaders[k] = v
  43805. }
  43806. reqHeaders.Set("User-Agent", c.s.userAgent())
  43807. var body io.Reader = nil
  43808. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  43809. if err != nil {
  43810. return nil, err
  43811. }
  43812. reqHeaders.Set("Content-Type", "application/json")
  43813. c.urlParams_.Set("alt", alt)
  43814. c.urlParams_.Set("prettyPrint", "false")
  43815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{resource}/testIamPermissions")
  43816. urls += "?" + c.urlParams_.Encode()
  43817. req, err := http.NewRequest("POST", urls, body)
  43818. if err != nil {
  43819. return nil, err
  43820. }
  43821. req.Header = reqHeaders
  43822. googleapi.Expand(req.URL, map[string]string{
  43823. "project": c.project,
  43824. "resource": c.resource,
  43825. })
  43826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43827. }
  43828. // Do executes the "compute.firewalls.testIamPermissions" call.
  43829. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  43830. // non-2xx status code is an error. Response headers are in either
  43831. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  43832. // returned at all) in error.(*googleapi.Error).Header. Use
  43833. // googleapi.IsNotModified to check whether the returned error was
  43834. // because http.StatusNotModified was returned.
  43835. func (c *FirewallsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  43836. gensupport.SetOptions(c.urlParams_, opts...)
  43837. res, err := c.doRequest("json")
  43838. if res != nil && res.StatusCode == http.StatusNotModified {
  43839. if res.Body != nil {
  43840. res.Body.Close()
  43841. }
  43842. return nil, &googleapi.Error{
  43843. Code: res.StatusCode,
  43844. Header: res.Header,
  43845. }
  43846. }
  43847. if err != nil {
  43848. return nil, err
  43849. }
  43850. defer googleapi.CloseBody(res)
  43851. if err := googleapi.CheckResponse(res); err != nil {
  43852. return nil, err
  43853. }
  43854. ret := &TestPermissionsResponse{
  43855. ServerResponse: googleapi.ServerResponse{
  43856. Header: res.Header,
  43857. HTTPStatusCode: res.StatusCode,
  43858. },
  43859. }
  43860. target := &ret
  43861. if err := gensupport.DecodeResponse(target, res); err != nil {
  43862. return nil, err
  43863. }
  43864. return ret, nil
  43865. // {
  43866. // "description": "Returns permissions that a caller has on the specified resource.",
  43867. // "httpMethod": "POST",
  43868. // "id": "compute.firewalls.testIamPermissions",
  43869. // "parameterOrder": [
  43870. // "project",
  43871. // "resource"
  43872. // ],
  43873. // "parameters": {
  43874. // "project": {
  43875. // "description": "Project ID for this request.",
  43876. // "location": "path",
  43877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43878. // "required": true,
  43879. // "type": "string"
  43880. // },
  43881. // "resource": {
  43882. // "description": "Name or id of the resource for this request.",
  43883. // "location": "path",
  43884. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43885. // "required": true,
  43886. // "type": "string"
  43887. // }
  43888. // },
  43889. // "path": "{project}/global/firewalls/{resource}/testIamPermissions",
  43890. // "request": {
  43891. // "$ref": "TestPermissionsRequest"
  43892. // },
  43893. // "response": {
  43894. // "$ref": "TestPermissionsResponse"
  43895. // },
  43896. // "scopes": [
  43897. // "https://www.googleapis.com/auth/cloud-platform",
  43898. // "https://www.googleapis.com/auth/compute",
  43899. // "https://www.googleapis.com/auth/compute.readonly"
  43900. // ]
  43901. // }
  43902. }
  43903. // method id "compute.firewalls.update":
  43904. type FirewallsUpdateCall struct {
  43905. s *Service
  43906. project string
  43907. firewall string
  43908. firewall2 *Firewall
  43909. urlParams_ gensupport.URLParams
  43910. ctx_ context.Context
  43911. header_ http.Header
  43912. }
  43913. // Update: Updates the specified firewall rule with the data included in
  43914. // the request. The PUT method can only update the following fields of
  43915. // firewall rule: allowed, description, sourceRanges, sourceTags,
  43916. // targetTags.
  43917. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  43918. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  43919. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43920. c.project = project
  43921. c.firewall = firewall
  43922. c.firewall2 = firewall2
  43923. return c
  43924. }
  43925. // RequestId sets the optional parameter "requestId": An optional
  43926. // request ID to identify requests. Specify a unique request ID so that
  43927. // if you must retry your request, the server will know to ignore the
  43928. // request if it has already been completed.
  43929. //
  43930. // For example, consider a situation where you make an initial request
  43931. // and the request times out. If you make the request again with the
  43932. // same request ID, the server can check if original operation with the
  43933. // same request ID was received, and if so, will ignore the second
  43934. // request. This prevents clients from accidentally creating duplicate
  43935. // commitments.
  43936. //
  43937. // The request ID must be a valid UUID with the exception that zero UUID
  43938. // is not supported (00000000-0000-0000-0000-000000000000).
  43939. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  43940. c.urlParams_.Set("requestId", requestId)
  43941. return c
  43942. }
  43943. // Fields allows partial responses to be retrieved. See
  43944. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43945. // for more information.
  43946. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  43947. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43948. return c
  43949. }
  43950. // Context sets the context to be used in this call's Do method. Any
  43951. // pending HTTP request will be aborted if the provided context is
  43952. // canceled.
  43953. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  43954. c.ctx_ = ctx
  43955. return c
  43956. }
  43957. // Header returns an http.Header that can be modified by the caller to
  43958. // add HTTP headers to the request.
  43959. func (c *FirewallsUpdateCall) Header() http.Header {
  43960. if c.header_ == nil {
  43961. c.header_ = make(http.Header)
  43962. }
  43963. return c.header_
  43964. }
  43965. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  43966. reqHeaders := make(http.Header)
  43967. for k, v := range c.header_ {
  43968. reqHeaders[k] = v
  43969. }
  43970. reqHeaders.Set("User-Agent", c.s.userAgent())
  43971. var body io.Reader = nil
  43972. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  43973. if err != nil {
  43974. return nil, err
  43975. }
  43976. reqHeaders.Set("Content-Type", "application/json")
  43977. c.urlParams_.Set("alt", alt)
  43978. c.urlParams_.Set("prettyPrint", "false")
  43979. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  43980. urls += "?" + c.urlParams_.Encode()
  43981. req, err := http.NewRequest("PUT", urls, body)
  43982. if err != nil {
  43983. return nil, err
  43984. }
  43985. req.Header = reqHeaders
  43986. googleapi.Expand(req.URL, map[string]string{
  43987. "project": c.project,
  43988. "firewall": c.firewall,
  43989. })
  43990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43991. }
  43992. // Do executes the "compute.firewalls.update" call.
  43993. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43994. // status code is an error. Response headers are in either
  43995. // *Operation.ServerResponse.Header or (if a response was returned at
  43996. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43997. // to check whether the returned error was because
  43998. // http.StatusNotModified was returned.
  43999. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44000. gensupport.SetOptions(c.urlParams_, opts...)
  44001. res, err := c.doRequest("json")
  44002. if res != nil && res.StatusCode == http.StatusNotModified {
  44003. if res.Body != nil {
  44004. res.Body.Close()
  44005. }
  44006. return nil, &googleapi.Error{
  44007. Code: res.StatusCode,
  44008. Header: res.Header,
  44009. }
  44010. }
  44011. if err != nil {
  44012. return nil, err
  44013. }
  44014. defer googleapi.CloseBody(res)
  44015. if err := googleapi.CheckResponse(res); err != nil {
  44016. return nil, err
  44017. }
  44018. ret := &Operation{
  44019. ServerResponse: googleapi.ServerResponse{
  44020. Header: res.Header,
  44021. HTTPStatusCode: res.StatusCode,
  44022. },
  44023. }
  44024. target := &ret
  44025. if err := gensupport.DecodeResponse(target, res); err != nil {
  44026. return nil, err
  44027. }
  44028. return ret, nil
  44029. // {
  44030. // "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.",
  44031. // "httpMethod": "PUT",
  44032. // "id": "compute.firewalls.update",
  44033. // "parameterOrder": [
  44034. // "project",
  44035. // "firewall"
  44036. // ],
  44037. // "parameters": {
  44038. // "firewall": {
  44039. // "description": "Name of the firewall rule to update.",
  44040. // "location": "path",
  44041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44042. // "required": true,
  44043. // "type": "string"
  44044. // },
  44045. // "project": {
  44046. // "description": "Project ID for this request.",
  44047. // "location": "path",
  44048. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44049. // "required": true,
  44050. // "type": "string"
  44051. // },
  44052. // "requestId": {
  44053. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44054. // "location": "query",
  44055. // "type": "string"
  44056. // }
  44057. // },
  44058. // "path": "{project}/global/firewalls/{firewall}",
  44059. // "request": {
  44060. // "$ref": "Firewall"
  44061. // },
  44062. // "response": {
  44063. // "$ref": "Operation"
  44064. // },
  44065. // "scopes": [
  44066. // "https://www.googleapis.com/auth/cloud-platform",
  44067. // "https://www.googleapis.com/auth/compute"
  44068. // ]
  44069. // }
  44070. }
  44071. // method id "compute.forwardingRules.aggregatedList":
  44072. type ForwardingRulesAggregatedListCall struct {
  44073. s *Service
  44074. project string
  44075. urlParams_ gensupport.URLParams
  44076. ifNoneMatch_ string
  44077. ctx_ context.Context
  44078. header_ http.Header
  44079. }
  44080. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  44081. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  44082. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  44083. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44084. c.project = project
  44085. return c
  44086. }
  44087. // Filter sets the optional parameter "filter": A filter expression that
  44088. // filters resources listed in the response. The expression must specify
  44089. // the field name, a comparison operator, and the value that you want to
  44090. // use for filtering. The value must be a string, a number, or a
  44091. // boolean. The comparison operator must be either =, !=, >, or <.
  44092. //
  44093. // For example, if you are filtering Compute Engine instances, you can
  44094. // exclude instances named example-instance by specifying name !=
  44095. // example-instance.
  44096. //
  44097. // You can also filter nested fields. For example, you could specify
  44098. // scheduling.automaticRestart = false to include instances only if they
  44099. // are not scheduled for automatic restarts. You can use filtering on
  44100. // nested fields to filter based on resource labels.
  44101. //
  44102. // To filter on multiple expressions, provide each separate expression
  44103. // within parentheses. For example, (scheduling.automaticRestart = true)
  44104. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44105. // AND expression. However, you can include AND and OR expressions
  44106. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44107. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44108. // true).
  44109. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  44110. c.urlParams_.Set("filter", filter)
  44111. return c
  44112. }
  44113. // MaxResults sets the optional parameter "maxResults": The maximum
  44114. // number of results per page that should be returned. If the number of
  44115. // available results is larger than maxResults, Compute Engine returns a
  44116. // nextPageToken that can be used to get the next page of results in
  44117. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44118. // (Default: 500)
  44119. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  44120. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44121. return c
  44122. }
  44123. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44124. // a certain order. By default, results are returned in alphanumerical
  44125. // order based on the resource name.
  44126. //
  44127. // You can also sort results in descending order based on the creation
  44128. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44129. // based on the creationTimestamp field in reverse chronological order
  44130. // (newest result first). Use this to sort resources like operations so
  44131. // that the newest operation is returned first.
  44132. //
  44133. // Currently, only sorting by name or creationTimestamp desc is
  44134. // supported.
  44135. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  44136. c.urlParams_.Set("orderBy", orderBy)
  44137. return c
  44138. }
  44139. // PageToken sets the optional parameter "pageToken": Specifies a page
  44140. // token to use. Set pageToken to the nextPageToken returned by a
  44141. // previous list request to get the next page of results.
  44142. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  44143. c.urlParams_.Set("pageToken", pageToken)
  44144. return c
  44145. }
  44146. // Fields allows partial responses to be retrieved. See
  44147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44148. // for more information.
  44149. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  44150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44151. return c
  44152. }
  44153. // IfNoneMatch sets the optional parameter which makes the operation
  44154. // fail if the object's ETag matches the given value. This is useful for
  44155. // getting updates only after the object has changed since the last
  44156. // request. Use googleapi.IsNotModified to check whether the response
  44157. // error from Do is the result of In-None-Match.
  44158. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  44159. c.ifNoneMatch_ = entityTag
  44160. return c
  44161. }
  44162. // Context sets the context to be used in this call's Do method. Any
  44163. // pending HTTP request will be aborted if the provided context is
  44164. // canceled.
  44165. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  44166. c.ctx_ = ctx
  44167. return c
  44168. }
  44169. // Header returns an http.Header that can be modified by the caller to
  44170. // add HTTP headers to the request.
  44171. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  44172. if c.header_ == nil {
  44173. c.header_ = make(http.Header)
  44174. }
  44175. return c.header_
  44176. }
  44177. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  44178. reqHeaders := make(http.Header)
  44179. for k, v := range c.header_ {
  44180. reqHeaders[k] = v
  44181. }
  44182. reqHeaders.Set("User-Agent", c.s.userAgent())
  44183. if c.ifNoneMatch_ != "" {
  44184. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44185. }
  44186. var body io.Reader = nil
  44187. c.urlParams_.Set("alt", alt)
  44188. c.urlParams_.Set("prettyPrint", "false")
  44189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  44190. urls += "?" + c.urlParams_.Encode()
  44191. req, err := http.NewRequest("GET", urls, body)
  44192. if err != nil {
  44193. return nil, err
  44194. }
  44195. req.Header = reqHeaders
  44196. googleapi.Expand(req.URL, map[string]string{
  44197. "project": c.project,
  44198. })
  44199. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44200. }
  44201. // Do executes the "compute.forwardingRules.aggregatedList" call.
  44202. // Exactly one of *ForwardingRuleAggregatedList or error will be
  44203. // non-nil. Any non-2xx status code is an error. Response headers are in
  44204. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  44205. // response was returned at all) in error.(*googleapi.Error).Header. Use
  44206. // googleapi.IsNotModified to check whether the returned error was
  44207. // because http.StatusNotModified was returned.
  44208. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  44209. gensupport.SetOptions(c.urlParams_, opts...)
  44210. res, err := c.doRequest("json")
  44211. if res != nil && res.StatusCode == http.StatusNotModified {
  44212. if res.Body != nil {
  44213. res.Body.Close()
  44214. }
  44215. return nil, &googleapi.Error{
  44216. Code: res.StatusCode,
  44217. Header: res.Header,
  44218. }
  44219. }
  44220. if err != nil {
  44221. return nil, err
  44222. }
  44223. defer googleapi.CloseBody(res)
  44224. if err := googleapi.CheckResponse(res); err != nil {
  44225. return nil, err
  44226. }
  44227. ret := &ForwardingRuleAggregatedList{
  44228. ServerResponse: googleapi.ServerResponse{
  44229. Header: res.Header,
  44230. HTTPStatusCode: res.StatusCode,
  44231. },
  44232. }
  44233. target := &ret
  44234. if err := gensupport.DecodeResponse(target, res); err != nil {
  44235. return nil, err
  44236. }
  44237. return ret, nil
  44238. // {
  44239. // "description": "Retrieves an aggregated list of forwarding rules.",
  44240. // "httpMethod": "GET",
  44241. // "id": "compute.forwardingRules.aggregatedList",
  44242. // "parameterOrder": [
  44243. // "project"
  44244. // ],
  44245. // "parameters": {
  44246. // "filter": {
  44247. // "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).",
  44248. // "location": "query",
  44249. // "type": "string"
  44250. // },
  44251. // "maxResults": {
  44252. // "default": "500",
  44253. // "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)",
  44254. // "format": "uint32",
  44255. // "location": "query",
  44256. // "minimum": "0",
  44257. // "type": "integer"
  44258. // },
  44259. // "orderBy": {
  44260. // "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.",
  44261. // "location": "query",
  44262. // "type": "string"
  44263. // },
  44264. // "pageToken": {
  44265. // "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.",
  44266. // "location": "query",
  44267. // "type": "string"
  44268. // },
  44269. // "project": {
  44270. // "description": "Project ID for this request.",
  44271. // "location": "path",
  44272. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44273. // "required": true,
  44274. // "type": "string"
  44275. // }
  44276. // },
  44277. // "path": "{project}/aggregated/forwardingRules",
  44278. // "response": {
  44279. // "$ref": "ForwardingRuleAggregatedList"
  44280. // },
  44281. // "scopes": [
  44282. // "https://www.googleapis.com/auth/cloud-platform",
  44283. // "https://www.googleapis.com/auth/compute",
  44284. // "https://www.googleapis.com/auth/compute.readonly"
  44285. // ]
  44286. // }
  44287. }
  44288. // Pages invokes f for each page of results.
  44289. // A non-nil error returned from f will halt the iteration.
  44290. // The provided context supersedes any context provided to the Context method.
  44291. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  44292. c.ctx_ = ctx
  44293. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44294. for {
  44295. x, err := c.Do()
  44296. if err != nil {
  44297. return err
  44298. }
  44299. if err := f(x); err != nil {
  44300. return err
  44301. }
  44302. if x.NextPageToken == "" {
  44303. return nil
  44304. }
  44305. c.PageToken(x.NextPageToken)
  44306. }
  44307. }
  44308. // method id "compute.forwardingRules.delete":
  44309. type ForwardingRulesDeleteCall struct {
  44310. s *Service
  44311. project string
  44312. region string
  44313. forwardingRule string
  44314. urlParams_ gensupport.URLParams
  44315. ctx_ context.Context
  44316. header_ http.Header
  44317. }
  44318. // Delete: Deletes the specified ForwardingRule resource.
  44319. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  44320. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  44321. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44322. c.project = project
  44323. c.region = region
  44324. c.forwardingRule = forwardingRule
  44325. return c
  44326. }
  44327. // RequestId sets the optional parameter "requestId": An optional
  44328. // request ID to identify requests. Specify a unique request ID so that
  44329. // if you must retry your request, the server will know to ignore the
  44330. // request if it has already been completed.
  44331. //
  44332. // For example, consider a situation where you make an initial request
  44333. // and the request times out. If you make the request again with the
  44334. // same request ID, the server can check if original operation with the
  44335. // same request ID was received, and if so, will ignore the second
  44336. // request. This prevents clients from accidentally creating duplicate
  44337. // commitments.
  44338. //
  44339. // The request ID must be a valid UUID with the exception that zero UUID
  44340. // is not supported (00000000-0000-0000-0000-000000000000).
  44341. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  44342. c.urlParams_.Set("requestId", requestId)
  44343. return c
  44344. }
  44345. // Fields allows partial responses to be retrieved. See
  44346. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44347. // for more information.
  44348. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  44349. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44350. return c
  44351. }
  44352. // Context sets the context to be used in this call's Do method. Any
  44353. // pending HTTP request will be aborted if the provided context is
  44354. // canceled.
  44355. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  44356. c.ctx_ = ctx
  44357. return c
  44358. }
  44359. // Header returns an http.Header that can be modified by the caller to
  44360. // add HTTP headers to the request.
  44361. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  44362. if c.header_ == nil {
  44363. c.header_ = make(http.Header)
  44364. }
  44365. return c.header_
  44366. }
  44367. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  44368. reqHeaders := make(http.Header)
  44369. for k, v := range c.header_ {
  44370. reqHeaders[k] = v
  44371. }
  44372. reqHeaders.Set("User-Agent", c.s.userAgent())
  44373. var body io.Reader = nil
  44374. c.urlParams_.Set("alt", alt)
  44375. c.urlParams_.Set("prettyPrint", "false")
  44376. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  44377. urls += "?" + c.urlParams_.Encode()
  44378. req, err := http.NewRequest("DELETE", urls, body)
  44379. if err != nil {
  44380. return nil, err
  44381. }
  44382. req.Header = reqHeaders
  44383. googleapi.Expand(req.URL, map[string]string{
  44384. "project": c.project,
  44385. "region": c.region,
  44386. "forwardingRule": c.forwardingRule,
  44387. })
  44388. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44389. }
  44390. // Do executes the "compute.forwardingRules.delete" call.
  44391. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44392. // status code is an error. Response headers are in either
  44393. // *Operation.ServerResponse.Header or (if a response was returned at
  44394. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44395. // to check whether the returned error was because
  44396. // http.StatusNotModified was returned.
  44397. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44398. gensupport.SetOptions(c.urlParams_, opts...)
  44399. res, err := c.doRequest("json")
  44400. if res != nil && res.StatusCode == http.StatusNotModified {
  44401. if res.Body != nil {
  44402. res.Body.Close()
  44403. }
  44404. return nil, &googleapi.Error{
  44405. Code: res.StatusCode,
  44406. Header: res.Header,
  44407. }
  44408. }
  44409. if err != nil {
  44410. return nil, err
  44411. }
  44412. defer googleapi.CloseBody(res)
  44413. if err := googleapi.CheckResponse(res); err != nil {
  44414. return nil, err
  44415. }
  44416. ret := &Operation{
  44417. ServerResponse: googleapi.ServerResponse{
  44418. Header: res.Header,
  44419. HTTPStatusCode: res.StatusCode,
  44420. },
  44421. }
  44422. target := &ret
  44423. if err := gensupport.DecodeResponse(target, res); err != nil {
  44424. return nil, err
  44425. }
  44426. return ret, nil
  44427. // {
  44428. // "description": "Deletes the specified ForwardingRule resource.",
  44429. // "httpMethod": "DELETE",
  44430. // "id": "compute.forwardingRules.delete",
  44431. // "parameterOrder": [
  44432. // "project",
  44433. // "region",
  44434. // "forwardingRule"
  44435. // ],
  44436. // "parameters": {
  44437. // "forwardingRule": {
  44438. // "description": "Name of the ForwardingRule resource to delete.",
  44439. // "location": "path",
  44440. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44441. // "required": true,
  44442. // "type": "string"
  44443. // },
  44444. // "project": {
  44445. // "description": "Project ID for this request.",
  44446. // "location": "path",
  44447. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44448. // "required": true,
  44449. // "type": "string"
  44450. // },
  44451. // "region": {
  44452. // "description": "Name of the region scoping this request.",
  44453. // "location": "path",
  44454. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44455. // "required": true,
  44456. // "type": "string"
  44457. // },
  44458. // "requestId": {
  44459. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44460. // "location": "query",
  44461. // "type": "string"
  44462. // }
  44463. // },
  44464. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  44465. // "response": {
  44466. // "$ref": "Operation"
  44467. // },
  44468. // "scopes": [
  44469. // "https://www.googleapis.com/auth/cloud-platform",
  44470. // "https://www.googleapis.com/auth/compute"
  44471. // ]
  44472. // }
  44473. }
  44474. // method id "compute.forwardingRules.get":
  44475. type ForwardingRulesGetCall struct {
  44476. s *Service
  44477. project string
  44478. region string
  44479. forwardingRule string
  44480. urlParams_ gensupport.URLParams
  44481. ifNoneMatch_ string
  44482. ctx_ context.Context
  44483. header_ http.Header
  44484. }
  44485. // Get: Returns the specified ForwardingRule resource.
  44486. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  44487. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  44488. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44489. c.project = project
  44490. c.region = region
  44491. c.forwardingRule = forwardingRule
  44492. return c
  44493. }
  44494. // Fields allows partial responses to be retrieved. See
  44495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44496. // for more information.
  44497. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  44498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44499. return c
  44500. }
  44501. // IfNoneMatch sets the optional parameter which makes the operation
  44502. // fail if the object's ETag matches the given value. This is useful for
  44503. // getting updates only after the object has changed since the last
  44504. // request. Use googleapi.IsNotModified to check whether the response
  44505. // error from Do is the result of In-None-Match.
  44506. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  44507. c.ifNoneMatch_ = entityTag
  44508. return c
  44509. }
  44510. // Context sets the context to be used in this call's Do method. Any
  44511. // pending HTTP request will be aborted if the provided context is
  44512. // canceled.
  44513. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  44514. c.ctx_ = ctx
  44515. return c
  44516. }
  44517. // Header returns an http.Header that can be modified by the caller to
  44518. // add HTTP headers to the request.
  44519. func (c *ForwardingRulesGetCall) Header() http.Header {
  44520. if c.header_ == nil {
  44521. c.header_ = make(http.Header)
  44522. }
  44523. return c.header_
  44524. }
  44525. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  44526. reqHeaders := make(http.Header)
  44527. for k, v := range c.header_ {
  44528. reqHeaders[k] = v
  44529. }
  44530. reqHeaders.Set("User-Agent", c.s.userAgent())
  44531. if c.ifNoneMatch_ != "" {
  44532. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44533. }
  44534. var body io.Reader = nil
  44535. c.urlParams_.Set("alt", alt)
  44536. c.urlParams_.Set("prettyPrint", "false")
  44537. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  44538. urls += "?" + c.urlParams_.Encode()
  44539. req, err := http.NewRequest("GET", urls, body)
  44540. if err != nil {
  44541. return nil, err
  44542. }
  44543. req.Header = reqHeaders
  44544. googleapi.Expand(req.URL, map[string]string{
  44545. "project": c.project,
  44546. "region": c.region,
  44547. "forwardingRule": c.forwardingRule,
  44548. })
  44549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44550. }
  44551. // Do executes the "compute.forwardingRules.get" call.
  44552. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  44553. // status code is an error. Response headers are in either
  44554. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  44555. // at all) in error.(*googleapi.Error).Header. Use
  44556. // googleapi.IsNotModified to check whether the returned error was
  44557. // because http.StatusNotModified was returned.
  44558. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  44559. gensupport.SetOptions(c.urlParams_, opts...)
  44560. res, err := c.doRequest("json")
  44561. if res != nil && res.StatusCode == http.StatusNotModified {
  44562. if res.Body != nil {
  44563. res.Body.Close()
  44564. }
  44565. return nil, &googleapi.Error{
  44566. Code: res.StatusCode,
  44567. Header: res.Header,
  44568. }
  44569. }
  44570. if err != nil {
  44571. return nil, err
  44572. }
  44573. defer googleapi.CloseBody(res)
  44574. if err := googleapi.CheckResponse(res); err != nil {
  44575. return nil, err
  44576. }
  44577. ret := &ForwardingRule{
  44578. ServerResponse: googleapi.ServerResponse{
  44579. Header: res.Header,
  44580. HTTPStatusCode: res.StatusCode,
  44581. },
  44582. }
  44583. target := &ret
  44584. if err := gensupport.DecodeResponse(target, res); err != nil {
  44585. return nil, err
  44586. }
  44587. return ret, nil
  44588. // {
  44589. // "description": "Returns the specified ForwardingRule resource.",
  44590. // "httpMethod": "GET",
  44591. // "id": "compute.forwardingRules.get",
  44592. // "parameterOrder": [
  44593. // "project",
  44594. // "region",
  44595. // "forwardingRule"
  44596. // ],
  44597. // "parameters": {
  44598. // "forwardingRule": {
  44599. // "description": "Name of the ForwardingRule resource to return.",
  44600. // "location": "path",
  44601. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44602. // "required": true,
  44603. // "type": "string"
  44604. // },
  44605. // "project": {
  44606. // "description": "Project ID for this request.",
  44607. // "location": "path",
  44608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44609. // "required": true,
  44610. // "type": "string"
  44611. // },
  44612. // "region": {
  44613. // "description": "Name of the region scoping this request.",
  44614. // "location": "path",
  44615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44616. // "required": true,
  44617. // "type": "string"
  44618. // }
  44619. // },
  44620. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  44621. // "response": {
  44622. // "$ref": "ForwardingRule"
  44623. // },
  44624. // "scopes": [
  44625. // "https://www.googleapis.com/auth/cloud-platform",
  44626. // "https://www.googleapis.com/auth/compute",
  44627. // "https://www.googleapis.com/auth/compute.readonly"
  44628. // ]
  44629. // }
  44630. }
  44631. // method id "compute.forwardingRules.insert":
  44632. type ForwardingRulesInsertCall struct {
  44633. s *Service
  44634. project string
  44635. region string
  44636. forwardingrule *ForwardingRule
  44637. urlParams_ gensupport.URLParams
  44638. ctx_ context.Context
  44639. header_ http.Header
  44640. }
  44641. // Insert: Creates a ForwardingRule resource in the specified project
  44642. // and region using the data included in the request.
  44643. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  44644. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  44645. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44646. c.project = project
  44647. c.region = region
  44648. c.forwardingrule = forwardingrule
  44649. return c
  44650. }
  44651. // RequestId sets the optional parameter "requestId": An optional
  44652. // request ID to identify requests. Specify a unique request ID so that
  44653. // if you must retry your request, the server will know to ignore the
  44654. // request if it has already been completed.
  44655. //
  44656. // For example, consider a situation where you make an initial request
  44657. // and the request times out. If you make the request again with the
  44658. // same request ID, the server can check if original operation with the
  44659. // same request ID was received, and if so, will ignore the second
  44660. // request. This prevents clients from accidentally creating duplicate
  44661. // commitments.
  44662. //
  44663. // The request ID must be a valid UUID with the exception that zero UUID
  44664. // is not supported (00000000-0000-0000-0000-000000000000).
  44665. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  44666. c.urlParams_.Set("requestId", requestId)
  44667. return c
  44668. }
  44669. // Fields allows partial responses to be retrieved. See
  44670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44671. // for more information.
  44672. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  44673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44674. return c
  44675. }
  44676. // Context sets the context to be used in this call's Do method. Any
  44677. // pending HTTP request will be aborted if the provided context is
  44678. // canceled.
  44679. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  44680. c.ctx_ = ctx
  44681. return c
  44682. }
  44683. // Header returns an http.Header that can be modified by the caller to
  44684. // add HTTP headers to the request.
  44685. func (c *ForwardingRulesInsertCall) Header() http.Header {
  44686. if c.header_ == nil {
  44687. c.header_ = make(http.Header)
  44688. }
  44689. return c.header_
  44690. }
  44691. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  44692. reqHeaders := make(http.Header)
  44693. for k, v := range c.header_ {
  44694. reqHeaders[k] = v
  44695. }
  44696. reqHeaders.Set("User-Agent", c.s.userAgent())
  44697. var body io.Reader = nil
  44698. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  44699. if err != nil {
  44700. return nil, err
  44701. }
  44702. reqHeaders.Set("Content-Type", "application/json")
  44703. c.urlParams_.Set("alt", alt)
  44704. c.urlParams_.Set("prettyPrint", "false")
  44705. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  44706. urls += "?" + c.urlParams_.Encode()
  44707. req, err := http.NewRequest("POST", urls, body)
  44708. if err != nil {
  44709. return nil, err
  44710. }
  44711. req.Header = reqHeaders
  44712. googleapi.Expand(req.URL, map[string]string{
  44713. "project": c.project,
  44714. "region": c.region,
  44715. })
  44716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44717. }
  44718. // Do executes the "compute.forwardingRules.insert" call.
  44719. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44720. // status code is an error. Response headers are in either
  44721. // *Operation.ServerResponse.Header or (if a response was returned at
  44722. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44723. // to check whether the returned error was because
  44724. // http.StatusNotModified was returned.
  44725. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44726. gensupport.SetOptions(c.urlParams_, opts...)
  44727. res, err := c.doRequest("json")
  44728. if res != nil && res.StatusCode == http.StatusNotModified {
  44729. if res.Body != nil {
  44730. res.Body.Close()
  44731. }
  44732. return nil, &googleapi.Error{
  44733. Code: res.StatusCode,
  44734. Header: res.Header,
  44735. }
  44736. }
  44737. if err != nil {
  44738. return nil, err
  44739. }
  44740. defer googleapi.CloseBody(res)
  44741. if err := googleapi.CheckResponse(res); err != nil {
  44742. return nil, err
  44743. }
  44744. ret := &Operation{
  44745. ServerResponse: googleapi.ServerResponse{
  44746. Header: res.Header,
  44747. HTTPStatusCode: res.StatusCode,
  44748. },
  44749. }
  44750. target := &ret
  44751. if err := gensupport.DecodeResponse(target, res); err != nil {
  44752. return nil, err
  44753. }
  44754. return ret, nil
  44755. // {
  44756. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  44757. // "httpMethod": "POST",
  44758. // "id": "compute.forwardingRules.insert",
  44759. // "parameterOrder": [
  44760. // "project",
  44761. // "region"
  44762. // ],
  44763. // "parameters": {
  44764. // "project": {
  44765. // "description": "Project ID for this request.",
  44766. // "location": "path",
  44767. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44768. // "required": true,
  44769. // "type": "string"
  44770. // },
  44771. // "region": {
  44772. // "description": "Name of the region scoping this request.",
  44773. // "location": "path",
  44774. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44775. // "required": true,
  44776. // "type": "string"
  44777. // },
  44778. // "requestId": {
  44779. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44780. // "location": "query",
  44781. // "type": "string"
  44782. // }
  44783. // },
  44784. // "path": "{project}/regions/{region}/forwardingRules",
  44785. // "request": {
  44786. // "$ref": "ForwardingRule"
  44787. // },
  44788. // "response": {
  44789. // "$ref": "Operation"
  44790. // },
  44791. // "scopes": [
  44792. // "https://www.googleapis.com/auth/cloud-platform",
  44793. // "https://www.googleapis.com/auth/compute"
  44794. // ]
  44795. // }
  44796. }
  44797. // method id "compute.forwardingRules.list":
  44798. type ForwardingRulesListCall struct {
  44799. s *Service
  44800. project string
  44801. region string
  44802. urlParams_ gensupport.URLParams
  44803. ifNoneMatch_ string
  44804. ctx_ context.Context
  44805. header_ http.Header
  44806. }
  44807. // List: Retrieves a list of ForwardingRule resources available to the
  44808. // specified project and region.
  44809. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  44810. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  44811. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44812. c.project = project
  44813. c.region = region
  44814. return c
  44815. }
  44816. // Filter sets the optional parameter "filter": A filter expression that
  44817. // filters resources listed in the response. The expression must specify
  44818. // the field name, a comparison operator, and the value that you want to
  44819. // use for filtering. The value must be a string, a number, or a
  44820. // boolean. The comparison operator must be either =, !=, >, or <.
  44821. //
  44822. // For example, if you are filtering Compute Engine instances, you can
  44823. // exclude instances named example-instance by specifying name !=
  44824. // example-instance.
  44825. //
  44826. // You can also filter nested fields. For example, you could specify
  44827. // scheduling.automaticRestart = false to include instances only if they
  44828. // are not scheduled for automatic restarts. You can use filtering on
  44829. // nested fields to filter based on resource labels.
  44830. //
  44831. // To filter on multiple expressions, provide each separate expression
  44832. // within parentheses. For example, (scheduling.automaticRestart = true)
  44833. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44834. // AND expression. However, you can include AND and OR expressions
  44835. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44836. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44837. // true).
  44838. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  44839. c.urlParams_.Set("filter", filter)
  44840. return c
  44841. }
  44842. // MaxResults sets the optional parameter "maxResults": The maximum
  44843. // number of results per page that should be returned. If the number of
  44844. // available results is larger than maxResults, Compute Engine returns a
  44845. // nextPageToken that can be used to get the next page of results in
  44846. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44847. // (Default: 500)
  44848. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  44849. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44850. return c
  44851. }
  44852. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44853. // a certain order. By default, results are returned in alphanumerical
  44854. // order based on the resource name.
  44855. //
  44856. // You can also sort results in descending order based on the creation
  44857. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44858. // based on the creationTimestamp field in reverse chronological order
  44859. // (newest result first). Use this to sort resources like operations so
  44860. // that the newest operation is returned first.
  44861. //
  44862. // Currently, only sorting by name or creationTimestamp desc is
  44863. // supported.
  44864. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  44865. c.urlParams_.Set("orderBy", orderBy)
  44866. return c
  44867. }
  44868. // PageToken sets the optional parameter "pageToken": Specifies a page
  44869. // token to use. Set pageToken to the nextPageToken returned by a
  44870. // previous list request to get the next page of results.
  44871. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  44872. c.urlParams_.Set("pageToken", pageToken)
  44873. return c
  44874. }
  44875. // Fields allows partial responses to be retrieved. See
  44876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44877. // for more information.
  44878. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  44879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44880. return c
  44881. }
  44882. // IfNoneMatch sets the optional parameter which makes the operation
  44883. // fail if the object's ETag matches the given value. This is useful for
  44884. // getting updates only after the object has changed since the last
  44885. // request. Use googleapi.IsNotModified to check whether the response
  44886. // error from Do is the result of In-None-Match.
  44887. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  44888. c.ifNoneMatch_ = entityTag
  44889. return c
  44890. }
  44891. // Context sets the context to be used in this call's Do method. Any
  44892. // pending HTTP request will be aborted if the provided context is
  44893. // canceled.
  44894. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  44895. c.ctx_ = ctx
  44896. return c
  44897. }
  44898. // Header returns an http.Header that can be modified by the caller to
  44899. // add HTTP headers to the request.
  44900. func (c *ForwardingRulesListCall) Header() http.Header {
  44901. if c.header_ == nil {
  44902. c.header_ = make(http.Header)
  44903. }
  44904. return c.header_
  44905. }
  44906. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  44907. reqHeaders := make(http.Header)
  44908. for k, v := range c.header_ {
  44909. reqHeaders[k] = v
  44910. }
  44911. reqHeaders.Set("User-Agent", c.s.userAgent())
  44912. if c.ifNoneMatch_ != "" {
  44913. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44914. }
  44915. var body io.Reader = nil
  44916. c.urlParams_.Set("alt", alt)
  44917. c.urlParams_.Set("prettyPrint", "false")
  44918. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  44919. urls += "?" + c.urlParams_.Encode()
  44920. req, err := http.NewRequest("GET", urls, body)
  44921. if err != nil {
  44922. return nil, err
  44923. }
  44924. req.Header = reqHeaders
  44925. googleapi.Expand(req.URL, map[string]string{
  44926. "project": c.project,
  44927. "region": c.region,
  44928. })
  44929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44930. }
  44931. // Do executes the "compute.forwardingRules.list" call.
  44932. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  44933. // non-2xx status code is an error. Response headers are in either
  44934. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  44935. // returned at all) in error.(*googleapi.Error).Header. Use
  44936. // googleapi.IsNotModified to check whether the returned error was
  44937. // because http.StatusNotModified was returned.
  44938. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  44939. gensupport.SetOptions(c.urlParams_, opts...)
  44940. res, err := c.doRequest("json")
  44941. if res != nil && res.StatusCode == http.StatusNotModified {
  44942. if res.Body != nil {
  44943. res.Body.Close()
  44944. }
  44945. return nil, &googleapi.Error{
  44946. Code: res.StatusCode,
  44947. Header: res.Header,
  44948. }
  44949. }
  44950. if err != nil {
  44951. return nil, err
  44952. }
  44953. defer googleapi.CloseBody(res)
  44954. if err := googleapi.CheckResponse(res); err != nil {
  44955. return nil, err
  44956. }
  44957. ret := &ForwardingRuleList{
  44958. ServerResponse: googleapi.ServerResponse{
  44959. Header: res.Header,
  44960. HTTPStatusCode: res.StatusCode,
  44961. },
  44962. }
  44963. target := &ret
  44964. if err := gensupport.DecodeResponse(target, res); err != nil {
  44965. return nil, err
  44966. }
  44967. return ret, nil
  44968. // {
  44969. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  44970. // "httpMethod": "GET",
  44971. // "id": "compute.forwardingRules.list",
  44972. // "parameterOrder": [
  44973. // "project",
  44974. // "region"
  44975. // ],
  44976. // "parameters": {
  44977. // "filter": {
  44978. // "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).",
  44979. // "location": "query",
  44980. // "type": "string"
  44981. // },
  44982. // "maxResults": {
  44983. // "default": "500",
  44984. // "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)",
  44985. // "format": "uint32",
  44986. // "location": "query",
  44987. // "minimum": "0",
  44988. // "type": "integer"
  44989. // },
  44990. // "orderBy": {
  44991. // "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.",
  44992. // "location": "query",
  44993. // "type": "string"
  44994. // },
  44995. // "pageToken": {
  44996. // "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.",
  44997. // "location": "query",
  44998. // "type": "string"
  44999. // },
  45000. // "project": {
  45001. // "description": "Project ID for this request.",
  45002. // "location": "path",
  45003. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45004. // "required": true,
  45005. // "type": "string"
  45006. // },
  45007. // "region": {
  45008. // "description": "Name of the region scoping this request.",
  45009. // "location": "path",
  45010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45011. // "required": true,
  45012. // "type": "string"
  45013. // }
  45014. // },
  45015. // "path": "{project}/regions/{region}/forwardingRules",
  45016. // "response": {
  45017. // "$ref": "ForwardingRuleList"
  45018. // },
  45019. // "scopes": [
  45020. // "https://www.googleapis.com/auth/cloud-platform",
  45021. // "https://www.googleapis.com/auth/compute",
  45022. // "https://www.googleapis.com/auth/compute.readonly"
  45023. // ]
  45024. // }
  45025. }
  45026. // Pages invokes f for each page of results.
  45027. // A non-nil error returned from f will halt the iteration.
  45028. // The provided context supersedes any context provided to the Context method.
  45029. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  45030. c.ctx_ = ctx
  45031. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45032. for {
  45033. x, err := c.Do()
  45034. if err != nil {
  45035. return err
  45036. }
  45037. if err := f(x); err != nil {
  45038. return err
  45039. }
  45040. if x.NextPageToken == "" {
  45041. return nil
  45042. }
  45043. c.PageToken(x.NextPageToken)
  45044. }
  45045. }
  45046. // method id "compute.forwardingRules.patch":
  45047. type ForwardingRulesPatchCall struct {
  45048. s *Service
  45049. project string
  45050. region string
  45051. forwardingRule string
  45052. forwardingrule *ForwardingRule
  45053. urlParams_ gensupport.URLParams
  45054. ctx_ context.Context
  45055. header_ http.Header
  45056. }
  45057. // Patch: Updates the specified forwarding rule with the data included
  45058. // in the request. This method supports PATCH semantics and uses the
  45059. // JSON merge patch format and processing rules. Currently, you can only
  45060. // patch the network_tier field.
  45061. func (r *ForwardingRulesService) Patch(project string, region string, forwardingRule string, forwardingrule *ForwardingRule) *ForwardingRulesPatchCall {
  45062. c := &ForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45063. c.project = project
  45064. c.region = region
  45065. c.forwardingRule = forwardingRule
  45066. c.forwardingrule = forwardingrule
  45067. return c
  45068. }
  45069. // RequestId sets the optional parameter "requestId": An optional
  45070. // request ID to identify requests. Specify a unique request ID so that
  45071. // if you must retry your request, the server will know to ignore the
  45072. // request if it has already been completed.
  45073. //
  45074. // For example, consider a situation where you make an initial request
  45075. // and the request times out. If you make the request again with the
  45076. // same request ID, the server can check if original operation with the
  45077. // same request ID was received, and if so, will ignore the second
  45078. // request. This prevents clients from accidentally creating duplicate
  45079. // commitments.
  45080. //
  45081. // The request ID must be a valid UUID with the exception that zero UUID
  45082. // is not supported (00000000-0000-0000-0000-000000000000).
  45083. func (c *ForwardingRulesPatchCall) RequestId(requestId string) *ForwardingRulesPatchCall {
  45084. c.urlParams_.Set("requestId", requestId)
  45085. return c
  45086. }
  45087. // Fields allows partial responses to be retrieved. See
  45088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45089. // for more information.
  45090. func (c *ForwardingRulesPatchCall) Fields(s ...googleapi.Field) *ForwardingRulesPatchCall {
  45091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45092. return c
  45093. }
  45094. // Context sets the context to be used in this call's Do method. Any
  45095. // pending HTTP request will be aborted if the provided context is
  45096. // canceled.
  45097. func (c *ForwardingRulesPatchCall) Context(ctx context.Context) *ForwardingRulesPatchCall {
  45098. c.ctx_ = ctx
  45099. return c
  45100. }
  45101. // Header returns an http.Header that can be modified by the caller to
  45102. // add HTTP headers to the request.
  45103. func (c *ForwardingRulesPatchCall) Header() http.Header {
  45104. if c.header_ == nil {
  45105. c.header_ = make(http.Header)
  45106. }
  45107. return c.header_
  45108. }
  45109. func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  45110. reqHeaders := make(http.Header)
  45111. for k, v := range c.header_ {
  45112. reqHeaders[k] = v
  45113. }
  45114. reqHeaders.Set("User-Agent", c.s.userAgent())
  45115. var body io.Reader = nil
  45116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  45117. if err != nil {
  45118. return nil, err
  45119. }
  45120. reqHeaders.Set("Content-Type", "application/json")
  45121. c.urlParams_.Set("alt", alt)
  45122. c.urlParams_.Set("prettyPrint", "false")
  45123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  45124. urls += "?" + c.urlParams_.Encode()
  45125. req, err := http.NewRequest("PATCH", urls, body)
  45126. if err != nil {
  45127. return nil, err
  45128. }
  45129. req.Header = reqHeaders
  45130. googleapi.Expand(req.URL, map[string]string{
  45131. "project": c.project,
  45132. "region": c.region,
  45133. "forwardingRule": c.forwardingRule,
  45134. })
  45135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45136. }
  45137. // Do executes the "compute.forwardingRules.patch" call.
  45138. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45139. // status code is an error. Response headers are in either
  45140. // *Operation.ServerResponse.Header or (if a response was returned at
  45141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45142. // to check whether the returned error was because
  45143. // http.StatusNotModified was returned.
  45144. func (c *ForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45145. gensupport.SetOptions(c.urlParams_, opts...)
  45146. res, err := c.doRequest("json")
  45147. if res != nil && res.StatusCode == http.StatusNotModified {
  45148. if res.Body != nil {
  45149. res.Body.Close()
  45150. }
  45151. return nil, &googleapi.Error{
  45152. Code: res.StatusCode,
  45153. Header: res.Header,
  45154. }
  45155. }
  45156. if err != nil {
  45157. return nil, err
  45158. }
  45159. defer googleapi.CloseBody(res)
  45160. if err := googleapi.CheckResponse(res); err != nil {
  45161. return nil, err
  45162. }
  45163. ret := &Operation{
  45164. ServerResponse: googleapi.ServerResponse{
  45165. Header: res.Header,
  45166. HTTPStatusCode: res.StatusCode,
  45167. },
  45168. }
  45169. target := &ret
  45170. if err := gensupport.DecodeResponse(target, res); err != nil {
  45171. return nil, err
  45172. }
  45173. return ret, nil
  45174. // {
  45175. // "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.",
  45176. // "httpMethod": "PATCH",
  45177. // "id": "compute.forwardingRules.patch",
  45178. // "parameterOrder": [
  45179. // "project",
  45180. // "region",
  45181. // "forwardingRule"
  45182. // ],
  45183. // "parameters": {
  45184. // "forwardingRule": {
  45185. // "description": "Name of the ForwardingRule resource to patch.",
  45186. // "location": "path",
  45187. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45188. // "required": true,
  45189. // "type": "string"
  45190. // },
  45191. // "project": {
  45192. // "description": "Project ID for this request.",
  45193. // "location": "path",
  45194. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45195. // "required": true,
  45196. // "type": "string"
  45197. // },
  45198. // "region": {
  45199. // "description": "Name of the region scoping this request.",
  45200. // "location": "path",
  45201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45202. // "required": true,
  45203. // "type": "string"
  45204. // },
  45205. // "requestId": {
  45206. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45207. // "location": "query",
  45208. // "type": "string"
  45209. // }
  45210. // },
  45211. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  45212. // "request": {
  45213. // "$ref": "ForwardingRule"
  45214. // },
  45215. // "response": {
  45216. // "$ref": "Operation"
  45217. // },
  45218. // "scopes": [
  45219. // "https://www.googleapis.com/auth/cloud-platform",
  45220. // "https://www.googleapis.com/auth/compute"
  45221. // ]
  45222. // }
  45223. }
  45224. // method id "compute.forwardingRules.setLabels":
  45225. type ForwardingRulesSetLabelsCall struct {
  45226. s *Service
  45227. project string
  45228. region string
  45229. resource string
  45230. regionsetlabelsrequest *RegionSetLabelsRequest
  45231. urlParams_ gensupport.URLParams
  45232. ctx_ context.Context
  45233. header_ http.Header
  45234. }
  45235. // SetLabels: Sets the labels on the specified resource. To learn more
  45236. // about labels, read the Labeling Resources documentation.
  45237. func (r *ForwardingRulesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *ForwardingRulesSetLabelsCall {
  45238. c := &ForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45239. c.project = project
  45240. c.region = region
  45241. c.resource = resource
  45242. c.regionsetlabelsrequest = regionsetlabelsrequest
  45243. return c
  45244. }
  45245. // RequestId sets the optional parameter "requestId": An optional
  45246. // request ID to identify requests. Specify a unique request ID so that
  45247. // if you must retry your request, the server will know to ignore the
  45248. // request if it has already been completed.
  45249. //
  45250. // For example, consider a situation where you make an initial request
  45251. // and the request times out. If you make the request again with the
  45252. // same request ID, the server can check if original operation with the
  45253. // same request ID was received, and if so, will ignore the second
  45254. // request. This prevents clients from accidentally creating duplicate
  45255. // commitments.
  45256. //
  45257. // The request ID must be a valid UUID with the exception that zero UUID
  45258. // is not supported (00000000-0000-0000-0000-000000000000).
  45259. func (c *ForwardingRulesSetLabelsCall) RequestId(requestId string) *ForwardingRulesSetLabelsCall {
  45260. c.urlParams_.Set("requestId", requestId)
  45261. return c
  45262. }
  45263. // Fields allows partial responses to be retrieved. See
  45264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45265. // for more information.
  45266. func (c *ForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *ForwardingRulesSetLabelsCall {
  45267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45268. return c
  45269. }
  45270. // Context sets the context to be used in this call's Do method. Any
  45271. // pending HTTP request will be aborted if the provided context is
  45272. // canceled.
  45273. func (c *ForwardingRulesSetLabelsCall) Context(ctx context.Context) *ForwardingRulesSetLabelsCall {
  45274. c.ctx_ = ctx
  45275. return c
  45276. }
  45277. // Header returns an http.Header that can be modified by the caller to
  45278. // add HTTP headers to the request.
  45279. func (c *ForwardingRulesSetLabelsCall) Header() http.Header {
  45280. if c.header_ == nil {
  45281. c.header_ = make(http.Header)
  45282. }
  45283. return c.header_
  45284. }
  45285. func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  45286. reqHeaders := make(http.Header)
  45287. for k, v := range c.header_ {
  45288. reqHeaders[k] = v
  45289. }
  45290. reqHeaders.Set("User-Agent", c.s.userAgent())
  45291. var body io.Reader = nil
  45292. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  45293. if err != nil {
  45294. return nil, err
  45295. }
  45296. reqHeaders.Set("Content-Type", "application/json")
  45297. c.urlParams_.Set("alt", alt)
  45298. c.urlParams_.Set("prettyPrint", "false")
  45299. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/setLabels")
  45300. urls += "?" + c.urlParams_.Encode()
  45301. req, err := http.NewRequest("POST", urls, body)
  45302. if err != nil {
  45303. return nil, err
  45304. }
  45305. req.Header = reqHeaders
  45306. googleapi.Expand(req.URL, map[string]string{
  45307. "project": c.project,
  45308. "region": c.region,
  45309. "resource": c.resource,
  45310. })
  45311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45312. }
  45313. // Do executes the "compute.forwardingRules.setLabels" call.
  45314. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45315. // status code is an error. Response headers are in either
  45316. // *Operation.ServerResponse.Header or (if a response was returned at
  45317. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45318. // to check whether the returned error was because
  45319. // http.StatusNotModified was returned.
  45320. func (c *ForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45321. gensupport.SetOptions(c.urlParams_, opts...)
  45322. res, err := c.doRequest("json")
  45323. if res != nil && res.StatusCode == http.StatusNotModified {
  45324. if res.Body != nil {
  45325. res.Body.Close()
  45326. }
  45327. return nil, &googleapi.Error{
  45328. Code: res.StatusCode,
  45329. Header: res.Header,
  45330. }
  45331. }
  45332. if err != nil {
  45333. return nil, err
  45334. }
  45335. defer googleapi.CloseBody(res)
  45336. if err := googleapi.CheckResponse(res); err != nil {
  45337. return nil, err
  45338. }
  45339. ret := &Operation{
  45340. ServerResponse: googleapi.ServerResponse{
  45341. Header: res.Header,
  45342. HTTPStatusCode: res.StatusCode,
  45343. },
  45344. }
  45345. target := &ret
  45346. if err := gensupport.DecodeResponse(target, res); err != nil {
  45347. return nil, err
  45348. }
  45349. return ret, nil
  45350. // {
  45351. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  45352. // "httpMethod": "POST",
  45353. // "id": "compute.forwardingRules.setLabels",
  45354. // "parameterOrder": [
  45355. // "project",
  45356. // "region",
  45357. // "resource"
  45358. // ],
  45359. // "parameters": {
  45360. // "project": {
  45361. // "description": "Project ID for this request.",
  45362. // "location": "path",
  45363. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45364. // "required": true,
  45365. // "type": "string"
  45366. // },
  45367. // "region": {
  45368. // "description": "The region for this request.",
  45369. // "location": "path",
  45370. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45371. // "required": true,
  45372. // "type": "string"
  45373. // },
  45374. // "requestId": {
  45375. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45376. // "location": "query",
  45377. // "type": "string"
  45378. // },
  45379. // "resource": {
  45380. // "description": "Name or id of the resource for this request.",
  45381. // "location": "path",
  45382. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45383. // "required": true,
  45384. // "type": "string"
  45385. // }
  45386. // },
  45387. // "path": "{project}/regions/{region}/forwardingRules/{resource}/setLabels",
  45388. // "request": {
  45389. // "$ref": "RegionSetLabelsRequest"
  45390. // },
  45391. // "response": {
  45392. // "$ref": "Operation"
  45393. // },
  45394. // "scopes": [
  45395. // "https://www.googleapis.com/auth/cloud-platform",
  45396. // "https://www.googleapis.com/auth/compute"
  45397. // ]
  45398. // }
  45399. }
  45400. // method id "compute.forwardingRules.setTarget":
  45401. type ForwardingRulesSetTargetCall struct {
  45402. s *Service
  45403. project string
  45404. region string
  45405. forwardingRule string
  45406. targetreference *TargetReference
  45407. urlParams_ gensupport.URLParams
  45408. ctx_ context.Context
  45409. header_ http.Header
  45410. }
  45411. // SetTarget: Changes target URL for forwarding rule. The new target
  45412. // should be of the same type as the old target.
  45413. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  45414. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  45415. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45416. c.project = project
  45417. c.region = region
  45418. c.forwardingRule = forwardingRule
  45419. c.targetreference = targetreference
  45420. return c
  45421. }
  45422. // RequestId sets the optional parameter "requestId": An optional
  45423. // request ID to identify requests. Specify a unique request ID so that
  45424. // if you must retry your request, the server will know to ignore the
  45425. // request if it has already been completed.
  45426. //
  45427. // For example, consider a situation where you make an initial request
  45428. // and the request times out. If you make the request again with the
  45429. // same request ID, the server can check if original operation with the
  45430. // same request ID was received, and if so, will ignore the second
  45431. // request. This prevents clients from accidentally creating duplicate
  45432. // commitments.
  45433. //
  45434. // The request ID must be a valid UUID with the exception that zero UUID
  45435. // is not supported (00000000-0000-0000-0000-000000000000).
  45436. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  45437. c.urlParams_.Set("requestId", requestId)
  45438. return c
  45439. }
  45440. // Fields allows partial responses to be retrieved. See
  45441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45442. // for more information.
  45443. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  45444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45445. return c
  45446. }
  45447. // Context sets the context to be used in this call's Do method. Any
  45448. // pending HTTP request will be aborted if the provided context is
  45449. // canceled.
  45450. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  45451. c.ctx_ = ctx
  45452. return c
  45453. }
  45454. // Header returns an http.Header that can be modified by the caller to
  45455. // add HTTP headers to the request.
  45456. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  45457. if c.header_ == nil {
  45458. c.header_ = make(http.Header)
  45459. }
  45460. return c.header_
  45461. }
  45462. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  45463. reqHeaders := make(http.Header)
  45464. for k, v := range c.header_ {
  45465. reqHeaders[k] = v
  45466. }
  45467. reqHeaders.Set("User-Agent", c.s.userAgent())
  45468. var body io.Reader = nil
  45469. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  45470. if err != nil {
  45471. return nil, err
  45472. }
  45473. reqHeaders.Set("Content-Type", "application/json")
  45474. c.urlParams_.Set("alt", alt)
  45475. c.urlParams_.Set("prettyPrint", "false")
  45476. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  45477. urls += "?" + c.urlParams_.Encode()
  45478. req, err := http.NewRequest("POST", urls, body)
  45479. if err != nil {
  45480. return nil, err
  45481. }
  45482. req.Header = reqHeaders
  45483. googleapi.Expand(req.URL, map[string]string{
  45484. "project": c.project,
  45485. "region": c.region,
  45486. "forwardingRule": c.forwardingRule,
  45487. })
  45488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45489. }
  45490. // Do executes the "compute.forwardingRules.setTarget" call.
  45491. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45492. // status code is an error. Response headers are in either
  45493. // *Operation.ServerResponse.Header or (if a response was returned at
  45494. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45495. // to check whether the returned error was because
  45496. // http.StatusNotModified was returned.
  45497. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45498. gensupport.SetOptions(c.urlParams_, opts...)
  45499. res, err := c.doRequest("json")
  45500. if res != nil && res.StatusCode == http.StatusNotModified {
  45501. if res.Body != nil {
  45502. res.Body.Close()
  45503. }
  45504. return nil, &googleapi.Error{
  45505. Code: res.StatusCode,
  45506. Header: res.Header,
  45507. }
  45508. }
  45509. if err != nil {
  45510. return nil, err
  45511. }
  45512. defer googleapi.CloseBody(res)
  45513. if err := googleapi.CheckResponse(res); err != nil {
  45514. return nil, err
  45515. }
  45516. ret := &Operation{
  45517. ServerResponse: googleapi.ServerResponse{
  45518. Header: res.Header,
  45519. HTTPStatusCode: res.StatusCode,
  45520. },
  45521. }
  45522. target := &ret
  45523. if err := gensupport.DecodeResponse(target, res); err != nil {
  45524. return nil, err
  45525. }
  45526. return ret, nil
  45527. // {
  45528. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  45529. // "httpMethod": "POST",
  45530. // "id": "compute.forwardingRules.setTarget",
  45531. // "parameterOrder": [
  45532. // "project",
  45533. // "region",
  45534. // "forwardingRule"
  45535. // ],
  45536. // "parameters": {
  45537. // "forwardingRule": {
  45538. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  45539. // "location": "path",
  45540. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45541. // "required": true,
  45542. // "type": "string"
  45543. // },
  45544. // "project": {
  45545. // "description": "Project ID for this request.",
  45546. // "location": "path",
  45547. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45548. // "required": true,
  45549. // "type": "string"
  45550. // },
  45551. // "region": {
  45552. // "description": "Name of the region scoping this request.",
  45553. // "location": "path",
  45554. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45555. // "required": true,
  45556. // "type": "string"
  45557. // },
  45558. // "requestId": {
  45559. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45560. // "location": "query",
  45561. // "type": "string"
  45562. // }
  45563. // },
  45564. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  45565. // "request": {
  45566. // "$ref": "TargetReference"
  45567. // },
  45568. // "response": {
  45569. // "$ref": "Operation"
  45570. // },
  45571. // "scopes": [
  45572. // "https://www.googleapis.com/auth/cloud-platform",
  45573. // "https://www.googleapis.com/auth/compute"
  45574. // ]
  45575. // }
  45576. }
  45577. // method id "compute.forwardingRules.testIamPermissions":
  45578. type ForwardingRulesTestIamPermissionsCall struct {
  45579. s *Service
  45580. project string
  45581. region string
  45582. resource string
  45583. testpermissionsrequest *TestPermissionsRequest
  45584. urlParams_ gensupport.URLParams
  45585. ctx_ context.Context
  45586. header_ http.Header
  45587. }
  45588. // TestIamPermissions: Returns permissions that a caller has on the
  45589. // specified resource.
  45590. func (r *ForwardingRulesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ForwardingRulesTestIamPermissionsCall {
  45591. c := &ForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45592. c.project = project
  45593. c.region = region
  45594. c.resource = resource
  45595. c.testpermissionsrequest = testpermissionsrequest
  45596. return c
  45597. }
  45598. // Fields allows partial responses to be retrieved. See
  45599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45600. // for more information.
  45601. func (c *ForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ForwardingRulesTestIamPermissionsCall {
  45602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45603. return c
  45604. }
  45605. // Context sets the context to be used in this call's Do method. Any
  45606. // pending HTTP request will be aborted if the provided context is
  45607. // canceled.
  45608. func (c *ForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *ForwardingRulesTestIamPermissionsCall {
  45609. c.ctx_ = ctx
  45610. return c
  45611. }
  45612. // Header returns an http.Header that can be modified by the caller to
  45613. // add HTTP headers to the request.
  45614. func (c *ForwardingRulesTestIamPermissionsCall) Header() http.Header {
  45615. if c.header_ == nil {
  45616. c.header_ = make(http.Header)
  45617. }
  45618. return c.header_
  45619. }
  45620. func (c *ForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  45621. reqHeaders := make(http.Header)
  45622. for k, v := range c.header_ {
  45623. reqHeaders[k] = v
  45624. }
  45625. reqHeaders.Set("User-Agent", c.s.userAgent())
  45626. var body io.Reader = nil
  45627. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  45628. if err != nil {
  45629. return nil, err
  45630. }
  45631. reqHeaders.Set("Content-Type", "application/json")
  45632. c.urlParams_.Set("alt", alt)
  45633. c.urlParams_.Set("prettyPrint", "false")
  45634. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions")
  45635. urls += "?" + c.urlParams_.Encode()
  45636. req, err := http.NewRequest("POST", urls, body)
  45637. if err != nil {
  45638. return nil, err
  45639. }
  45640. req.Header = reqHeaders
  45641. googleapi.Expand(req.URL, map[string]string{
  45642. "project": c.project,
  45643. "region": c.region,
  45644. "resource": c.resource,
  45645. })
  45646. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45647. }
  45648. // Do executes the "compute.forwardingRules.testIamPermissions" call.
  45649. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  45650. // non-2xx status code is an error. Response headers are in either
  45651. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  45652. // returned at all) in error.(*googleapi.Error).Header. Use
  45653. // googleapi.IsNotModified to check whether the returned error was
  45654. // because http.StatusNotModified was returned.
  45655. func (c *ForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  45656. gensupport.SetOptions(c.urlParams_, opts...)
  45657. res, err := c.doRequest("json")
  45658. if res != nil && res.StatusCode == http.StatusNotModified {
  45659. if res.Body != nil {
  45660. res.Body.Close()
  45661. }
  45662. return nil, &googleapi.Error{
  45663. Code: res.StatusCode,
  45664. Header: res.Header,
  45665. }
  45666. }
  45667. if err != nil {
  45668. return nil, err
  45669. }
  45670. defer googleapi.CloseBody(res)
  45671. if err := googleapi.CheckResponse(res); err != nil {
  45672. return nil, err
  45673. }
  45674. ret := &TestPermissionsResponse{
  45675. ServerResponse: googleapi.ServerResponse{
  45676. Header: res.Header,
  45677. HTTPStatusCode: res.StatusCode,
  45678. },
  45679. }
  45680. target := &ret
  45681. if err := gensupport.DecodeResponse(target, res); err != nil {
  45682. return nil, err
  45683. }
  45684. return ret, nil
  45685. // {
  45686. // "description": "Returns permissions that a caller has on the specified resource.",
  45687. // "httpMethod": "POST",
  45688. // "id": "compute.forwardingRules.testIamPermissions",
  45689. // "parameterOrder": [
  45690. // "project",
  45691. // "region",
  45692. // "resource"
  45693. // ],
  45694. // "parameters": {
  45695. // "project": {
  45696. // "description": "Project ID for this request.",
  45697. // "location": "path",
  45698. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45699. // "required": true,
  45700. // "type": "string"
  45701. // },
  45702. // "region": {
  45703. // "description": "The name of the region for this request.",
  45704. // "location": "path",
  45705. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45706. // "required": true,
  45707. // "type": "string"
  45708. // },
  45709. // "resource": {
  45710. // "description": "Name or id of the resource for this request.",
  45711. // "location": "path",
  45712. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45713. // "required": true,
  45714. // "type": "string"
  45715. // }
  45716. // },
  45717. // "path": "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions",
  45718. // "request": {
  45719. // "$ref": "TestPermissionsRequest"
  45720. // },
  45721. // "response": {
  45722. // "$ref": "TestPermissionsResponse"
  45723. // },
  45724. // "scopes": [
  45725. // "https://www.googleapis.com/auth/cloud-platform",
  45726. // "https://www.googleapis.com/auth/compute",
  45727. // "https://www.googleapis.com/auth/compute.readonly"
  45728. // ]
  45729. // }
  45730. }
  45731. // method id "compute.globalAddresses.delete":
  45732. type GlobalAddressesDeleteCall struct {
  45733. s *Service
  45734. project string
  45735. address string
  45736. urlParams_ gensupport.URLParams
  45737. ctx_ context.Context
  45738. header_ http.Header
  45739. }
  45740. // Delete: Deletes the specified address resource.
  45741. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  45742. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  45743. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45744. c.project = project
  45745. c.address = address
  45746. return c
  45747. }
  45748. // RequestId sets the optional parameter "requestId": An optional
  45749. // request ID to identify requests. Specify a unique request ID so that
  45750. // if you must retry your request, the server will know to ignore the
  45751. // request if it has already been completed.
  45752. //
  45753. // For example, consider a situation where you make an initial request
  45754. // and the request times out. If you make the request again with the
  45755. // same request ID, the server can check if original operation with the
  45756. // same request ID was received, and if so, will ignore the second
  45757. // request. This prevents clients from accidentally creating duplicate
  45758. // commitments.
  45759. //
  45760. // The request ID must be a valid UUID with the exception that zero UUID
  45761. // is not supported (00000000-0000-0000-0000-000000000000).
  45762. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  45763. c.urlParams_.Set("requestId", requestId)
  45764. return c
  45765. }
  45766. // Fields allows partial responses to be retrieved. See
  45767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45768. // for more information.
  45769. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  45770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45771. return c
  45772. }
  45773. // Context sets the context to be used in this call's Do method. Any
  45774. // pending HTTP request will be aborted if the provided context is
  45775. // canceled.
  45776. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  45777. c.ctx_ = ctx
  45778. return c
  45779. }
  45780. // Header returns an http.Header that can be modified by the caller to
  45781. // add HTTP headers to the request.
  45782. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  45783. if c.header_ == nil {
  45784. c.header_ = make(http.Header)
  45785. }
  45786. return c.header_
  45787. }
  45788. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  45789. reqHeaders := make(http.Header)
  45790. for k, v := range c.header_ {
  45791. reqHeaders[k] = v
  45792. }
  45793. reqHeaders.Set("User-Agent", c.s.userAgent())
  45794. var body io.Reader = nil
  45795. c.urlParams_.Set("alt", alt)
  45796. c.urlParams_.Set("prettyPrint", "false")
  45797. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  45798. urls += "?" + c.urlParams_.Encode()
  45799. req, err := http.NewRequest("DELETE", urls, body)
  45800. if err != nil {
  45801. return nil, err
  45802. }
  45803. req.Header = reqHeaders
  45804. googleapi.Expand(req.URL, map[string]string{
  45805. "project": c.project,
  45806. "address": c.address,
  45807. })
  45808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45809. }
  45810. // Do executes the "compute.globalAddresses.delete" call.
  45811. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45812. // status code is an error. Response headers are in either
  45813. // *Operation.ServerResponse.Header or (if a response was returned at
  45814. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45815. // to check whether the returned error was because
  45816. // http.StatusNotModified was returned.
  45817. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45818. gensupport.SetOptions(c.urlParams_, opts...)
  45819. res, err := c.doRequest("json")
  45820. if res != nil && res.StatusCode == http.StatusNotModified {
  45821. if res.Body != nil {
  45822. res.Body.Close()
  45823. }
  45824. return nil, &googleapi.Error{
  45825. Code: res.StatusCode,
  45826. Header: res.Header,
  45827. }
  45828. }
  45829. if err != nil {
  45830. return nil, err
  45831. }
  45832. defer googleapi.CloseBody(res)
  45833. if err := googleapi.CheckResponse(res); err != nil {
  45834. return nil, err
  45835. }
  45836. ret := &Operation{
  45837. ServerResponse: googleapi.ServerResponse{
  45838. Header: res.Header,
  45839. HTTPStatusCode: res.StatusCode,
  45840. },
  45841. }
  45842. target := &ret
  45843. if err := gensupport.DecodeResponse(target, res); err != nil {
  45844. return nil, err
  45845. }
  45846. return ret, nil
  45847. // {
  45848. // "description": "Deletes the specified address resource.",
  45849. // "httpMethod": "DELETE",
  45850. // "id": "compute.globalAddresses.delete",
  45851. // "parameterOrder": [
  45852. // "project",
  45853. // "address"
  45854. // ],
  45855. // "parameters": {
  45856. // "address": {
  45857. // "description": "Name of the address resource to delete.",
  45858. // "location": "path",
  45859. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45860. // "required": true,
  45861. // "type": "string"
  45862. // },
  45863. // "project": {
  45864. // "description": "Project ID for this request.",
  45865. // "location": "path",
  45866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45867. // "required": true,
  45868. // "type": "string"
  45869. // },
  45870. // "requestId": {
  45871. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45872. // "location": "query",
  45873. // "type": "string"
  45874. // }
  45875. // },
  45876. // "path": "{project}/global/addresses/{address}",
  45877. // "response": {
  45878. // "$ref": "Operation"
  45879. // },
  45880. // "scopes": [
  45881. // "https://www.googleapis.com/auth/cloud-platform",
  45882. // "https://www.googleapis.com/auth/compute"
  45883. // ]
  45884. // }
  45885. }
  45886. // method id "compute.globalAddresses.get":
  45887. type GlobalAddressesGetCall struct {
  45888. s *Service
  45889. project string
  45890. address string
  45891. urlParams_ gensupport.URLParams
  45892. ifNoneMatch_ string
  45893. ctx_ context.Context
  45894. header_ http.Header
  45895. }
  45896. // Get: Returns the specified address resource. Gets a list of available
  45897. // addresses by making a list() request.
  45898. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  45899. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  45900. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45901. c.project = project
  45902. c.address = address
  45903. return c
  45904. }
  45905. // Fields allows partial responses to be retrieved. See
  45906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45907. // for more information.
  45908. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  45909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45910. return c
  45911. }
  45912. // IfNoneMatch sets the optional parameter which makes the operation
  45913. // fail if the object's ETag matches the given value. This is useful for
  45914. // getting updates only after the object has changed since the last
  45915. // request. Use googleapi.IsNotModified to check whether the response
  45916. // error from Do is the result of In-None-Match.
  45917. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  45918. c.ifNoneMatch_ = entityTag
  45919. return c
  45920. }
  45921. // Context sets the context to be used in this call's Do method. Any
  45922. // pending HTTP request will be aborted if the provided context is
  45923. // canceled.
  45924. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  45925. c.ctx_ = ctx
  45926. return c
  45927. }
  45928. // Header returns an http.Header that can be modified by the caller to
  45929. // add HTTP headers to the request.
  45930. func (c *GlobalAddressesGetCall) Header() http.Header {
  45931. if c.header_ == nil {
  45932. c.header_ = make(http.Header)
  45933. }
  45934. return c.header_
  45935. }
  45936. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  45937. reqHeaders := make(http.Header)
  45938. for k, v := range c.header_ {
  45939. reqHeaders[k] = v
  45940. }
  45941. reqHeaders.Set("User-Agent", c.s.userAgent())
  45942. if c.ifNoneMatch_ != "" {
  45943. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45944. }
  45945. var body io.Reader = nil
  45946. c.urlParams_.Set("alt", alt)
  45947. c.urlParams_.Set("prettyPrint", "false")
  45948. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  45949. urls += "?" + c.urlParams_.Encode()
  45950. req, err := http.NewRequest("GET", urls, body)
  45951. if err != nil {
  45952. return nil, err
  45953. }
  45954. req.Header = reqHeaders
  45955. googleapi.Expand(req.URL, map[string]string{
  45956. "project": c.project,
  45957. "address": c.address,
  45958. })
  45959. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45960. }
  45961. // Do executes the "compute.globalAddresses.get" call.
  45962. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  45963. // code is an error. Response headers are in either
  45964. // *Address.ServerResponse.Header or (if a response was returned at all)
  45965. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  45966. // check whether the returned error was because http.StatusNotModified
  45967. // was returned.
  45968. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  45969. gensupport.SetOptions(c.urlParams_, opts...)
  45970. res, err := c.doRequest("json")
  45971. if res != nil && res.StatusCode == http.StatusNotModified {
  45972. if res.Body != nil {
  45973. res.Body.Close()
  45974. }
  45975. return nil, &googleapi.Error{
  45976. Code: res.StatusCode,
  45977. Header: res.Header,
  45978. }
  45979. }
  45980. if err != nil {
  45981. return nil, err
  45982. }
  45983. defer googleapi.CloseBody(res)
  45984. if err := googleapi.CheckResponse(res); err != nil {
  45985. return nil, err
  45986. }
  45987. ret := &Address{
  45988. ServerResponse: googleapi.ServerResponse{
  45989. Header: res.Header,
  45990. HTTPStatusCode: res.StatusCode,
  45991. },
  45992. }
  45993. target := &ret
  45994. if err := gensupport.DecodeResponse(target, res); err != nil {
  45995. return nil, err
  45996. }
  45997. return ret, nil
  45998. // {
  45999. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  46000. // "httpMethod": "GET",
  46001. // "id": "compute.globalAddresses.get",
  46002. // "parameterOrder": [
  46003. // "project",
  46004. // "address"
  46005. // ],
  46006. // "parameters": {
  46007. // "address": {
  46008. // "description": "Name of the address resource to return.",
  46009. // "location": "path",
  46010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46011. // "required": true,
  46012. // "type": "string"
  46013. // },
  46014. // "project": {
  46015. // "description": "Project ID for this request.",
  46016. // "location": "path",
  46017. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46018. // "required": true,
  46019. // "type": "string"
  46020. // }
  46021. // },
  46022. // "path": "{project}/global/addresses/{address}",
  46023. // "response": {
  46024. // "$ref": "Address"
  46025. // },
  46026. // "scopes": [
  46027. // "https://www.googleapis.com/auth/cloud-platform",
  46028. // "https://www.googleapis.com/auth/compute",
  46029. // "https://www.googleapis.com/auth/compute.readonly"
  46030. // ]
  46031. // }
  46032. }
  46033. // method id "compute.globalAddresses.insert":
  46034. type GlobalAddressesInsertCall struct {
  46035. s *Service
  46036. project string
  46037. address *Address
  46038. urlParams_ gensupport.URLParams
  46039. ctx_ context.Context
  46040. header_ http.Header
  46041. }
  46042. // Insert: Creates an address resource in the specified project using
  46043. // the data included in the request.
  46044. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  46045. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  46046. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46047. c.project = project
  46048. c.address = address
  46049. return c
  46050. }
  46051. // RequestId sets the optional parameter "requestId": An optional
  46052. // request ID to identify requests. Specify a unique request ID so that
  46053. // if you must retry your request, the server will know to ignore the
  46054. // request if it has already been completed.
  46055. //
  46056. // For example, consider a situation where you make an initial request
  46057. // and the request times out. If you make the request again with the
  46058. // same request ID, the server can check if original operation with the
  46059. // same request ID was received, and if so, will ignore the second
  46060. // request. This prevents clients from accidentally creating duplicate
  46061. // commitments.
  46062. //
  46063. // The request ID must be a valid UUID with the exception that zero UUID
  46064. // is not supported (00000000-0000-0000-0000-000000000000).
  46065. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  46066. c.urlParams_.Set("requestId", requestId)
  46067. return c
  46068. }
  46069. // Fields allows partial responses to be retrieved. See
  46070. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46071. // for more information.
  46072. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  46073. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46074. return c
  46075. }
  46076. // Context sets the context to be used in this call's Do method. Any
  46077. // pending HTTP request will be aborted if the provided context is
  46078. // canceled.
  46079. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  46080. c.ctx_ = ctx
  46081. return c
  46082. }
  46083. // Header returns an http.Header that can be modified by the caller to
  46084. // add HTTP headers to the request.
  46085. func (c *GlobalAddressesInsertCall) Header() http.Header {
  46086. if c.header_ == nil {
  46087. c.header_ = make(http.Header)
  46088. }
  46089. return c.header_
  46090. }
  46091. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  46092. reqHeaders := make(http.Header)
  46093. for k, v := range c.header_ {
  46094. reqHeaders[k] = v
  46095. }
  46096. reqHeaders.Set("User-Agent", c.s.userAgent())
  46097. var body io.Reader = nil
  46098. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  46099. if err != nil {
  46100. return nil, err
  46101. }
  46102. reqHeaders.Set("Content-Type", "application/json")
  46103. c.urlParams_.Set("alt", alt)
  46104. c.urlParams_.Set("prettyPrint", "false")
  46105. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  46106. urls += "?" + c.urlParams_.Encode()
  46107. req, err := http.NewRequest("POST", urls, body)
  46108. if err != nil {
  46109. return nil, err
  46110. }
  46111. req.Header = reqHeaders
  46112. googleapi.Expand(req.URL, map[string]string{
  46113. "project": c.project,
  46114. })
  46115. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46116. }
  46117. // Do executes the "compute.globalAddresses.insert" call.
  46118. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46119. // status code is an error. Response headers are in either
  46120. // *Operation.ServerResponse.Header or (if a response was returned at
  46121. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46122. // to check whether the returned error was because
  46123. // http.StatusNotModified was returned.
  46124. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46125. gensupport.SetOptions(c.urlParams_, opts...)
  46126. res, err := c.doRequest("json")
  46127. if res != nil && res.StatusCode == http.StatusNotModified {
  46128. if res.Body != nil {
  46129. res.Body.Close()
  46130. }
  46131. return nil, &googleapi.Error{
  46132. Code: res.StatusCode,
  46133. Header: res.Header,
  46134. }
  46135. }
  46136. if err != nil {
  46137. return nil, err
  46138. }
  46139. defer googleapi.CloseBody(res)
  46140. if err := googleapi.CheckResponse(res); err != nil {
  46141. return nil, err
  46142. }
  46143. ret := &Operation{
  46144. ServerResponse: googleapi.ServerResponse{
  46145. Header: res.Header,
  46146. HTTPStatusCode: res.StatusCode,
  46147. },
  46148. }
  46149. target := &ret
  46150. if err := gensupport.DecodeResponse(target, res); err != nil {
  46151. return nil, err
  46152. }
  46153. return ret, nil
  46154. // {
  46155. // "description": "Creates an address resource in the specified project using the data included in the request.",
  46156. // "httpMethod": "POST",
  46157. // "id": "compute.globalAddresses.insert",
  46158. // "parameterOrder": [
  46159. // "project"
  46160. // ],
  46161. // "parameters": {
  46162. // "project": {
  46163. // "description": "Project ID for this request.",
  46164. // "location": "path",
  46165. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46166. // "required": true,
  46167. // "type": "string"
  46168. // },
  46169. // "requestId": {
  46170. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46171. // "location": "query",
  46172. // "type": "string"
  46173. // }
  46174. // },
  46175. // "path": "{project}/global/addresses",
  46176. // "request": {
  46177. // "$ref": "Address"
  46178. // },
  46179. // "response": {
  46180. // "$ref": "Operation"
  46181. // },
  46182. // "scopes": [
  46183. // "https://www.googleapis.com/auth/cloud-platform",
  46184. // "https://www.googleapis.com/auth/compute"
  46185. // ]
  46186. // }
  46187. }
  46188. // method id "compute.globalAddresses.list":
  46189. type GlobalAddressesListCall struct {
  46190. s *Service
  46191. project string
  46192. urlParams_ gensupport.URLParams
  46193. ifNoneMatch_ string
  46194. ctx_ context.Context
  46195. header_ http.Header
  46196. }
  46197. // List: Retrieves a list of global addresses.
  46198. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  46199. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  46200. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46201. c.project = project
  46202. return c
  46203. }
  46204. // Filter sets the optional parameter "filter": A filter expression that
  46205. // filters resources listed in the response. The expression must specify
  46206. // the field name, a comparison operator, and the value that you want to
  46207. // use for filtering. The value must be a string, a number, or a
  46208. // boolean. The comparison operator must be either =, !=, >, or <.
  46209. //
  46210. // For example, if you are filtering Compute Engine instances, you can
  46211. // exclude instances named example-instance by specifying name !=
  46212. // example-instance.
  46213. //
  46214. // You can also filter nested fields. For example, you could specify
  46215. // scheduling.automaticRestart = false to include instances only if they
  46216. // are not scheduled for automatic restarts. You can use filtering on
  46217. // nested fields to filter based on resource labels.
  46218. //
  46219. // To filter on multiple expressions, provide each separate expression
  46220. // within parentheses. For example, (scheduling.automaticRestart = true)
  46221. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46222. // AND expression. However, you can include AND and OR expressions
  46223. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46224. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46225. // true).
  46226. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  46227. c.urlParams_.Set("filter", filter)
  46228. return c
  46229. }
  46230. // MaxResults sets the optional parameter "maxResults": The maximum
  46231. // number of results per page that should be returned. If the number of
  46232. // available results is larger than maxResults, Compute Engine returns a
  46233. // nextPageToken that can be used to get the next page of results in
  46234. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46235. // (Default: 500)
  46236. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  46237. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46238. return c
  46239. }
  46240. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46241. // a certain order. By default, results are returned in alphanumerical
  46242. // order based on the resource name.
  46243. //
  46244. // You can also sort results in descending order based on the creation
  46245. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46246. // based on the creationTimestamp field in reverse chronological order
  46247. // (newest result first). Use this to sort resources like operations so
  46248. // that the newest operation is returned first.
  46249. //
  46250. // Currently, only sorting by name or creationTimestamp desc is
  46251. // supported.
  46252. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  46253. c.urlParams_.Set("orderBy", orderBy)
  46254. return c
  46255. }
  46256. // PageToken sets the optional parameter "pageToken": Specifies a page
  46257. // token to use. Set pageToken to the nextPageToken returned by a
  46258. // previous list request to get the next page of results.
  46259. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  46260. c.urlParams_.Set("pageToken", pageToken)
  46261. return c
  46262. }
  46263. // Fields allows partial responses to be retrieved. See
  46264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46265. // for more information.
  46266. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  46267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46268. return c
  46269. }
  46270. // IfNoneMatch sets the optional parameter which makes the operation
  46271. // fail if the object's ETag matches the given value. This is useful for
  46272. // getting updates only after the object has changed since the last
  46273. // request. Use googleapi.IsNotModified to check whether the response
  46274. // error from Do is the result of In-None-Match.
  46275. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  46276. c.ifNoneMatch_ = entityTag
  46277. return c
  46278. }
  46279. // Context sets the context to be used in this call's Do method. Any
  46280. // pending HTTP request will be aborted if the provided context is
  46281. // canceled.
  46282. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  46283. c.ctx_ = ctx
  46284. return c
  46285. }
  46286. // Header returns an http.Header that can be modified by the caller to
  46287. // add HTTP headers to the request.
  46288. func (c *GlobalAddressesListCall) Header() http.Header {
  46289. if c.header_ == nil {
  46290. c.header_ = make(http.Header)
  46291. }
  46292. return c.header_
  46293. }
  46294. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  46295. reqHeaders := make(http.Header)
  46296. for k, v := range c.header_ {
  46297. reqHeaders[k] = v
  46298. }
  46299. reqHeaders.Set("User-Agent", c.s.userAgent())
  46300. if c.ifNoneMatch_ != "" {
  46301. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46302. }
  46303. var body io.Reader = nil
  46304. c.urlParams_.Set("alt", alt)
  46305. c.urlParams_.Set("prettyPrint", "false")
  46306. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  46307. urls += "?" + c.urlParams_.Encode()
  46308. req, err := http.NewRequest("GET", urls, body)
  46309. if err != nil {
  46310. return nil, err
  46311. }
  46312. req.Header = reqHeaders
  46313. googleapi.Expand(req.URL, map[string]string{
  46314. "project": c.project,
  46315. })
  46316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46317. }
  46318. // Do executes the "compute.globalAddresses.list" call.
  46319. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  46320. // status code is an error. Response headers are in either
  46321. // *AddressList.ServerResponse.Header or (if a response was returned at
  46322. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46323. // to check whether the returned error was because
  46324. // http.StatusNotModified was returned.
  46325. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  46326. gensupport.SetOptions(c.urlParams_, opts...)
  46327. res, err := c.doRequest("json")
  46328. if res != nil && res.StatusCode == http.StatusNotModified {
  46329. if res.Body != nil {
  46330. res.Body.Close()
  46331. }
  46332. return nil, &googleapi.Error{
  46333. Code: res.StatusCode,
  46334. Header: res.Header,
  46335. }
  46336. }
  46337. if err != nil {
  46338. return nil, err
  46339. }
  46340. defer googleapi.CloseBody(res)
  46341. if err := googleapi.CheckResponse(res); err != nil {
  46342. return nil, err
  46343. }
  46344. ret := &AddressList{
  46345. ServerResponse: googleapi.ServerResponse{
  46346. Header: res.Header,
  46347. HTTPStatusCode: res.StatusCode,
  46348. },
  46349. }
  46350. target := &ret
  46351. if err := gensupport.DecodeResponse(target, res); err != nil {
  46352. return nil, err
  46353. }
  46354. return ret, nil
  46355. // {
  46356. // "description": "Retrieves a list of global addresses.",
  46357. // "httpMethod": "GET",
  46358. // "id": "compute.globalAddresses.list",
  46359. // "parameterOrder": [
  46360. // "project"
  46361. // ],
  46362. // "parameters": {
  46363. // "filter": {
  46364. // "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).",
  46365. // "location": "query",
  46366. // "type": "string"
  46367. // },
  46368. // "maxResults": {
  46369. // "default": "500",
  46370. // "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)",
  46371. // "format": "uint32",
  46372. // "location": "query",
  46373. // "minimum": "0",
  46374. // "type": "integer"
  46375. // },
  46376. // "orderBy": {
  46377. // "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.",
  46378. // "location": "query",
  46379. // "type": "string"
  46380. // },
  46381. // "pageToken": {
  46382. // "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.",
  46383. // "location": "query",
  46384. // "type": "string"
  46385. // },
  46386. // "project": {
  46387. // "description": "Project ID for this request.",
  46388. // "location": "path",
  46389. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46390. // "required": true,
  46391. // "type": "string"
  46392. // }
  46393. // },
  46394. // "path": "{project}/global/addresses",
  46395. // "response": {
  46396. // "$ref": "AddressList"
  46397. // },
  46398. // "scopes": [
  46399. // "https://www.googleapis.com/auth/cloud-platform",
  46400. // "https://www.googleapis.com/auth/compute",
  46401. // "https://www.googleapis.com/auth/compute.readonly"
  46402. // ]
  46403. // }
  46404. }
  46405. // Pages invokes f for each page of results.
  46406. // A non-nil error returned from f will halt the iteration.
  46407. // The provided context supersedes any context provided to the Context method.
  46408. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  46409. c.ctx_ = ctx
  46410. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46411. for {
  46412. x, err := c.Do()
  46413. if err != nil {
  46414. return err
  46415. }
  46416. if err := f(x); err != nil {
  46417. return err
  46418. }
  46419. if x.NextPageToken == "" {
  46420. return nil
  46421. }
  46422. c.PageToken(x.NextPageToken)
  46423. }
  46424. }
  46425. // method id "compute.globalAddresses.setLabels":
  46426. type GlobalAddressesSetLabelsCall struct {
  46427. s *Service
  46428. project string
  46429. resource string
  46430. globalsetlabelsrequest *GlobalSetLabelsRequest
  46431. urlParams_ gensupport.URLParams
  46432. ctx_ context.Context
  46433. header_ http.Header
  46434. }
  46435. // SetLabels: Sets the labels on a GlobalAddress. To learn more about
  46436. // labels, read the Labeling Resources documentation.
  46437. func (r *GlobalAddressesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalAddressesSetLabelsCall {
  46438. c := &GlobalAddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46439. c.project = project
  46440. c.resource = resource
  46441. c.globalsetlabelsrequest = globalsetlabelsrequest
  46442. return c
  46443. }
  46444. // Fields allows partial responses to be retrieved. See
  46445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46446. // for more information.
  46447. func (c *GlobalAddressesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalAddressesSetLabelsCall {
  46448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46449. return c
  46450. }
  46451. // Context sets the context to be used in this call's Do method. Any
  46452. // pending HTTP request will be aborted if the provided context is
  46453. // canceled.
  46454. func (c *GlobalAddressesSetLabelsCall) Context(ctx context.Context) *GlobalAddressesSetLabelsCall {
  46455. c.ctx_ = ctx
  46456. return c
  46457. }
  46458. // Header returns an http.Header that can be modified by the caller to
  46459. // add HTTP headers to the request.
  46460. func (c *GlobalAddressesSetLabelsCall) Header() http.Header {
  46461. if c.header_ == nil {
  46462. c.header_ = make(http.Header)
  46463. }
  46464. return c.header_
  46465. }
  46466. func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  46467. reqHeaders := make(http.Header)
  46468. for k, v := range c.header_ {
  46469. reqHeaders[k] = v
  46470. }
  46471. reqHeaders.Set("User-Agent", c.s.userAgent())
  46472. var body io.Reader = nil
  46473. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  46474. if err != nil {
  46475. return nil, err
  46476. }
  46477. reqHeaders.Set("Content-Type", "application/json")
  46478. c.urlParams_.Set("alt", alt)
  46479. c.urlParams_.Set("prettyPrint", "false")
  46480. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/setLabels")
  46481. urls += "?" + c.urlParams_.Encode()
  46482. req, err := http.NewRequest("POST", urls, body)
  46483. if err != nil {
  46484. return nil, err
  46485. }
  46486. req.Header = reqHeaders
  46487. googleapi.Expand(req.URL, map[string]string{
  46488. "project": c.project,
  46489. "resource": c.resource,
  46490. })
  46491. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46492. }
  46493. // Do executes the "compute.globalAddresses.setLabels" call.
  46494. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46495. // status code is an error. Response headers are in either
  46496. // *Operation.ServerResponse.Header or (if a response was returned at
  46497. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46498. // to check whether the returned error was because
  46499. // http.StatusNotModified was returned.
  46500. func (c *GlobalAddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46501. gensupport.SetOptions(c.urlParams_, opts...)
  46502. res, err := c.doRequest("json")
  46503. if res != nil && res.StatusCode == http.StatusNotModified {
  46504. if res.Body != nil {
  46505. res.Body.Close()
  46506. }
  46507. return nil, &googleapi.Error{
  46508. Code: res.StatusCode,
  46509. Header: res.Header,
  46510. }
  46511. }
  46512. if err != nil {
  46513. return nil, err
  46514. }
  46515. defer googleapi.CloseBody(res)
  46516. if err := googleapi.CheckResponse(res); err != nil {
  46517. return nil, err
  46518. }
  46519. ret := &Operation{
  46520. ServerResponse: googleapi.ServerResponse{
  46521. Header: res.Header,
  46522. HTTPStatusCode: res.StatusCode,
  46523. },
  46524. }
  46525. target := &ret
  46526. if err := gensupport.DecodeResponse(target, res); err != nil {
  46527. return nil, err
  46528. }
  46529. return ret, nil
  46530. // {
  46531. // "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.",
  46532. // "httpMethod": "POST",
  46533. // "id": "compute.globalAddresses.setLabels",
  46534. // "parameterOrder": [
  46535. // "project",
  46536. // "resource"
  46537. // ],
  46538. // "parameters": {
  46539. // "project": {
  46540. // "description": "Project ID for this request.",
  46541. // "location": "path",
  46542. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46543. // "required": true,
  46544. // "type": "string"
  46545. // },
  46546. // "resource": {
  46547. // "description": "Name or id of the resource for this request.",
  46548. // "location": "path",
  46549. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46550. // "required": true,
  46551. // "type": "string"
  46552. // }
  46553. // },
  46554. // "path": "{project}/global/addresses/{resource}/setLabels",
  46555. // "request": {
  46556. // "$ref": "GlobalSetLabelsRequest"
  46557. // },
  46558. // "response": {
  46559. // "$ref": "Operation"
  46560. // },
  46561. // "scopes": [
  46562. // "https://www.googleapis.com/auth/cloud-platform",
  46563. // "https://www.googleapis.com/auth/compute"
  46564. // ]
  46565. // }
  46566. }
  46567. // method id "compute.globalAddresses.testIamPermissions":
  46568. type GlobalAddressesTestIamPermissionsCall struct {
  46569. s *Service
  46570. project string
  46571. resource string
  46572. testpermissionsrequest *TestPermissionsRequest
  46573. urlParams_ gensupport.URLParams
  46574. ctx_ context.Context
  46575. header_ http.Header
  46576. }
  46577. // TestIamPermissions: Returns permissions that a caller has on the
  46578. // specified resource.
  46579. func (r *GlobalAddressesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalAddressesTestIamPermissionsCall {
  46580. c := &GlobalAddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46581. c.project = project
  46582. c.resource = resource
  46583. c.testpermissionsrequest = testpermissionsrequest
  46584. return c
  46585. }
  46586. // Fields allows partial responses to be retrieved. See
  46587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46588. // for more information.
  46589. func (c *GlobalAddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalAddressesTestIamPermissionsCall {
  46590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46591. return c
  46592. }
  46593. // Context sets the context to be used in this call's Do method. Any
  46594. // pending HTTP request will be aborted if the provided context is
  46595. // canceled.
  46596. func (c *GlobalAddressesTestIamPermissionsCall) Context(ctx context.Context) *GlobalAddressesTestIamPermissionsCall {
  46597. c.ctx_ = ctx
  46598. return c
  46599. }
  46600. // Header returns an http.Header that can be modified by the caller to
  46601. // add HTTP headers to the request.
  46602. func (c *GlobalAddressesTestIamPermissionsCall) Header() http.Header {
  46603. if c.header_ == nil {
  46604. c.header_ = make(http.Header)
  46605. }
  46606. return c.header_
  46607. }
  46608. func (c *GlobalAddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  46609. reqHeaders := make(http.Header)
  46610. for k, v := range c.header_ {
  46611. reqHeaders[k] = v
  46612. }
  46613. reqHeaders.Set("User-Agent", c.s.userAgent())
  46614. var body io.Reader = nil
  46615. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  46616. if err != nil {
  46617. return nil, err
  46618. }
  46619. reqHeaders.Set("Content-Type", "application/json")
  46620. c.urlParams_.Set("alt", alt)
  46621. c.urlParams_.Set("prettyPrint", "false")
  46622. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/testIamPermissions")
  46623. urls += "?" + c.urlParams_.Encode()
  46624. req, err := http.NewRequest("POST", urls, body)
  46625. if err != nil {
  46626. return nil, err
  46627. }
  46628. req.Header = reqHeaders
  46629. googleapi.Expand(req.URL, map[string]string{
  46630. "project": c.project,
  46631. "resource": c.resource,
  46632. })
  46633. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46634. }
  46635. // Do executes the "compute.globalAddresses.testIamPermissions" call.
  46636. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  46637. // non-2xx status code is an error. Response headers are in either
  46638. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  46639. // returned at all) in error.(*googleapi.Error).Header. Use
  46640. // googleapi.IsNotModified to check whether the returned error was
  46641. // because http.StatusNotModified was returned.
  46642. func (c *GlobalAddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  46643. gensupport.SetOptions(c.urlParams_, opts...)
  46644. res, err := c.doRequest("json")
  46645. if res != nil && res.StatusCode == http.StatusNotModified {
  46646. if res.Body != nil {
  46647. res.Body.Close()
  46648. }
  46649. return nil, &googleapi.Error{
  46650. Code: res.StatusCode,
  46651. Header: res.Header,
  46652. }
  46653. }
  46654. if err != nil {
  46655. return nil, err
  46656. }
  46657. defer googleapi.CloseBody(res)
  46658. if err := googleapi.CheckResponse(res); err != nil {
  46659. return nil, err
  46660. }
  46661. ret := &TestPermissionsResponse{
  46662. ServerResponse: googleapi.ServerResponse{
  46663. Header: res.Header,
  46664. HTTPStatusCode: res.StatusCode,
  46665. },
  46666. }
  46667. target := &ret
  46668. if err := gensupport.DecodeResponse(target, res); err != nil {
  46669. return nil, err
  46670. }
  46671. return ret, nil
  46672. // {
  46673. // "description": "Returns permissions that a caller has on the specified resource.",
  46674. // "httpMethod": "POST",
  46675. // "id": "compute.globalAddresses.testIamPermissions",
  46676. // "parameterOrder": [
  46677. // "project",
  46678. // "resource"
  46679. // ],
  46680. // "parameters": {
  46681. // "project": {
  46682. // "description": "Project ID for this request.",
  46683. // "location": "path",
  46684. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46685. // "required": true,
  46686. // "type": "string"
  46687. // },
  46688. // "resource": {
  46689. // "description": "Name or id of the resource for this request.",
  46690. // "location": "path",
  46691. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46692. // "required": true,
  46693. // "type": "string"
  46694. // }
  46695. // },
  46696. // "path": "{project}/global/addresses/{resource}/testIamPermissions",
  46697. // "request": {
  46698. // "$ref": "TestPermissionsRequest"
  46699. // },
  46700. // "response": {
  46701. // "$ref": "TestPermissionsResponse"
  46702. // },
  46703. // "scopes": [
  46704. // "https://www.googleapis.com/auth/cloud-platform",
  46705. // "https://www.googleapis.com/auth/compute",
  46706. // "https://www.googleapis.com/auth/compute.readonly"
  46707. // ]
  46708. // }
  46709. }
  46710. // method id "compute.globalForwardingRules.delete":
  46711. type GlobalForwardingRulesDeleteCall struct {
  46712. s *Service
  46713. project string
  46714. forwardingRule string
  46715. urlParams_ gensupport.URLParams
  46716. ctx_ context.Context
  46717. header_ http.Header
  46718. }
  46719. // Delete: Deletes the specified GlobalForwardingRule resource.
  46720. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  46721. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  46722. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46723. c.project = project
  46724. c.forwardingRule = forwardingRule
  46725. return c
  46726. }
  46727. // RequestId sets the optional parameter "requestId": An optional
  46728. // request ID to identify requests. Specify a unique request ID so that
  46729. // if you must retry your request, the server will know to ignore the
  46730. // request if it has already been completed.
  46731. //
  46732. // For example, consider a situation where you make an initial request
  46733. // and the request times out. If you make the request again with the
  46734. // same request ID, the server can check if original operation with the
  46735. // same request ID was received, and if so, will ignore the second
  46736. // request. This prevents clients from accidentally creating duplicate
  46737. // commitments.
  46738. //
  46739. // The request ID must be a valid UUID with the exception that zero UUID
  46740. // is not supported (00000000-0000-0000-0000-000000000000).
  46741. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  46742. c.urlParams_.Set("requestId", requestId)
  46743. return c
  46744. }
  46745. // Fields allows partial responses to be retrieved. See
  46746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46747. // for more information.
  46748. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  46749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46750. return c
  46751. }
  46752. // Context sets the context to be used in this call's Do method. Any
  46753. // pending HTTP request will be aborted if the provided context is
  46754. // canceled.
  46755. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  46756. c.ctx_ = ctx
  46757. return c
  46758. }
  46759. // Header returns an http.Header that can be modified by the caller to
  46760. // add HTTP headers to the request.
  46761. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  46762. if c.header_ == nil {
  46763. c.header_ = make(http.Header)
  46764. }
  46765. return c.header_
  46766. }
  46767. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  46768. reqHeaders := make(http.Header)
  46769. for k, v := range c.header_ {
  46770. reqHeaders[k] = v
  46771. }
  46772. reqHeaders.Set("User-Agent", c.s.userAgent())
  46773. var body io.Reader = nil
  46774. c.urlParams_.Set("alt", alt)
  46775. c.urlParams_.Set("prettyPrint", "false")
  46776. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  46777. urls += "?" + c.urlParams_.Encode()
  46778. req, err := http.NewRequest("DELETE", urls, body)
  46779. if err != nil {
  46780. return nil, err
  46781. }
  46782. req.Header = reqHeaders
  46783. googleapi.Expand(req.URL, map[string]string{
  46784. "project": c.project,
  46785. "forwardingRule": c.forwardingRule,
  46786. })
  46787. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46788. }
  46789. // Do executes the "compute.globalForwardingRules.delete" call.
  46790. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46791. // status code is an error. Response headers are in either
  46792. // *Operation.ServerResponse.Header or (if a response was returned at
  46793. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46794. // to check whether the returned error was because
  46795. // http.StatusNotModified was returned.
  46796. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46797. gensupport.SetOptions(c.urlParams_, opts...)
  46798. res, err := c.doRequest("json")
  46799. if res != nil && res.StatusCode == http.StatusNotModified {
  46800. if res.Body != nil {
  46801. res.Body.Close()
  46802. }
  46803. return nil, &googleapi.Error{
  46804. Code: res.StatusCode,
  46805. Header: res.Header,
  46806. }
  46807. }
  46808. if err != nil {
  46809. return nil, err
  46810. }
  46811. defer googleapi.CloseBody(res)
  46812. if err := googleapi.CheckResponse(res); err != nil {
  46813. return nil, err
  46814. }
  46815. ret := &Operation{
  46816. ServerResponse: googleapi.ServerResponse{
  46817. Header: res.Header,
  46818. HTTPStatusCode: res.StatusCode,
  46819. },
  46820. }
  46821. target := &ret
  46822. if err := gensupport.DecodeResponse(target, res); err != nil {
  46823. return nil, err
  46824. }
  46825. return ret, nil
  46826. // {
  46827. // "description": "Deletes the specified GlobalForwardingRule resource.",
  46828. // "httpMethod": "DELETE",
  46829. // "id": "compute.globalForwardingRules.delete",
  46830. // "parameterOrder": [
  46831. // "project",
  46832. // "forwardingRule"
  46833. // ],
  46834. // "parameters": {
  46835. // "forwardingRule": {
  46836. // "description": "Name of the ForwardingRule resource to delete.",
  46837. // "location": "path",
  46838. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46839. // "required": true,
  46840. // "type": "string"
  46841. // },
  46842. // "project": {
  46843. // "description": "Project ID for this request.",
  46844. // "location": "path",
  46845. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46846. // "required": true,
  46847. // "type": "string"
  46848. // },
  46849. // "requestId": {
  46850. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46851. // "location": "query",
  46852. // "type": "string"
  46853. // }
  46854. // },
  46855. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  46856. // "response": {
  46857. // "$ref": "Operation"
  46858. // },
  46859. // "scopes": [
  46860. // "https://www.googleapis.com/auth/cloud-platform",
  46861. // "https://www.googleapis.com/auth/compute"
  46862. // ]
  46863. // }
  46864. }
  46865. // method id "compute.globalForwardingRules.get":
  46866. type GlobalForwardingRulesGetCall struct {
  46867. s *Service
  46868. project string
  46869. forwardingRule string
  46870. urlParams_ gensupport.URLParams
  46871. ifNoneMatch_ string
  46872. ctx_ context.Context
  46873. header_ http.Header
  46874. }
  46875. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  46876. // of available forwarding rules by making a list() request.
  46877. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  46878. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  46879. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46880. c.project = project
  46881. c.forwardingRule = forwardingRule
  46882. return c
  46883. }
  46884. // Fields allows partial responses to be retrieved. See
  46885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46886. // for more information.
  46887. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  46888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46889. return c
  46890. }
  46891. // IfNoneMatch sets the optional parameter which makes the operation
  46892. // fail if the object's ETag matches the given value. This is useful for
  46893. // getting updates only after the object has changed since the last
  46894. // request. Use googleapi.IsNotModified to check whether the response
  46895. // error from Do is the result of In-None-Match.
  46896. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  46897. c.ifNoneMatch_ = entityTag
  46898. return c
  46899. }
  46900. // Context sets the context to be used in this call's Do method. Any
  46901. // pending HTTP request will be aborted if the provided context is
  46902. // canceled.
  46903. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  46904. c.ctx_ = ctx
  46905. return c
  46906. }
  46907. // Header returns an http.Header that can be modified by the caller to
  46908. // add HTTP headers to the request.
  46909. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  46910. if c.header_ == nil {
  46911. c.header_ = make(http.Header)
  46912. }
  46913. return c.header_
  46914. }
  46915. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  46916. reqHeaders := make(http.Header)
  46917. for k, v := range c.header_ {
  46918. reqHeaders[k] = v
  46919. }
  46920. reqHeaders.Set("User-Agent", c.s.userAgent())
  46921. if c.ifNoneMatch_ != "" {
  46922. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46923. }
  46924. var body io.Reader = nil
  46925. c.urlParams_.Set("alt", alt)
  46926. c.urlParams_.Set("prettyPrint", "false")
  46927. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  46928. urls += "?" + c.urlParams_.Encode()
  46929. req, err := http.NewRequest("GET", urls, body)
  46930. if err != nil {
  46931. return nil, err
  46932. }
  46933. req.Header = reqHeaders
  46934. googleapi.Expand(req.URL, map[string]string{
  46935. "project": c.project,
  46936. "forwardingRule": c.forwardingRule,
  46937. })
  46938. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46939. }
  46940. // Do executes the "compute.globalForwardingRules.get" call.
  46941. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  46942. // status code is an error. Response headers are in either
  46943. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  46944. // at all) in error.(*googleapi.Error).Header. Use
  46945. // googleapi.IsNotModified to check whether the returned error was
  46946. // because http.StatusNotModified was returned.
  46947. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  46948. gensupport.SetOptions(c.urlParams_, opts...)
  46949. res, err := c.doRequest("json")
  46950. if res != nil && res.StatusCode == http.StatusNotModified {
  46951. if res.Body != nil {
  46952. res.Body.Close()
  46953. }
  46954. return nil, &googleapi.Error{
  46955. Code: res.StatusCode,
  46956. Header: res.Header,
  46957. }
  46958. }
  46959. if err != nil {
  46960. return nil, err
  46961. }
  46962. defer googleapi.CloseBody(res)
  46963. if err := googleapi.CheckResponse(res); err != nil {
  46964. return nil, err
  46965. }
  46966. ret := &ForwardingRule{
  46967. ServerResponse: googleapi.ServerResponse{
  46968. Header: res.Header,
  46969. HTTPStatusCode: res.StatusCode,
  46970. },
  46971. }
  46972. target := &ret
  46973. if err := gensupport.DecodeResponse(target, res); err != nil {
  46974. return nil, err
  46975. }
  46976. return ret, nil
  46977. // {
  46978. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  46979. // "httpMethod": "GET",
  46980. // "id": "compute.globalForwardingRules.get",
  46981. // "parameterOrder": [
  46982. // "project",
  46983. // "forwardingRule"
  46984. // ],
  46985. // "parameters": {
  46986. // "forwardingRule": {
  46987. // "description": "Name of the ForwardingRule resource to return.",
  46988. // "location": "path",
  46989. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46990. // "required": true,
  46991. // "type": "string"
  46992. // },
  46993. // "project": {
  46994. // "description": "Project ID for this request.",
  46995. // "location": "path",
  46996. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46997. // "required": true,
  46998. // "type": "string"
  46999. // }
  47000. // },
  47001. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  47002. // "response": {
  47003. // "$ref": "ForwardingRule"
  47004. // },
  47005. // "scopes": [
  47006. // "https://www.googleapis.com/auth/cloud-platform",
  47007. // "https://www.googleapis.com/auth/compute",
  47008. // "https://www.googleapis.com/auth/compute.readonly"
  47009. // ]
  47010. // }
  47011. }
  47012. // method id "compute.globalForwardingRules.insert":
  47013. type GlobalForwardingRulesInsertCall struct {
  47014. s *Service
  47015. project string
  47016. forwardingrule *ForwardingRule
  47017. urlParams_ gensupport.URLParams
  47018. ctx_ context.Context
  47019. header_ http.Header
  47020. }
  47021. // Insert: Creates a GlobalForwardingRule resource in the specified
  47022. // project using the data included in the request.
  47023. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  47024. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  47025. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47026. c.project = project
  47027. c.forwardingrule = forwardingrule
  47028. return c
  47029. }
  47030. // RequestId sets the optional parameter "requestId": An optional
  47031. // request ID to identify requests. Specify a unique request ID so that
  47032. // if you must retry your request, the server will know to ignore the
  47033. // request if it has already been completed.
  47034. //
  47035. // For example, consider a situation where you make an initial request
  47036. // and the request times out. If you make the request again with the
  47037. // same request ID, the server can check if original operation with the
  47038. // same request ID was received, and if so, will ignore the second
  47039. // request. This prevents clients from accidentally creating duplicate
  47040. // commitments.
  47041. //
  47042. // The request ID must be a valid UUID with the exception that zero UUID
  47043. // is not supported (00000000-0000-0000-0000-000000000000).
  47044. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  47045. c.urlParams_.Set("requestId", requestId)
  47046. return c
  47047. }
  47048. // Fields allows partial responses to be retrieved. See
  47049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47050. // for more information.
  47051. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  47052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47053. return c
  47054. }
  47055. // Context sets the context to be used in this call's Do method. Any
  47056. // pending HTTP request will be aborted if the provided context is
  47057. // canceled.
  47058. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  47059. c.ctx_ = ctx
  47060. return c
  47061. }
  47062. // Header returns an http.Header that can be modified by the caller to
  47063. // add HTTP headers to the request.
  47064. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  47065. if c.header_ == nil {
  47066. c.header_ = make(http.Header)
  47067. }
  47068. return c.header_
  47069. }
  47070. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  47071. reqHeaders := make(http.Header)
  47072. for k, v := range c.header_ {
  47073. reqHeaders[k] = v
  47074. }
  47075. reqHeaders.Set("User-Agent", c.s.userAgent())
  47076. var body io.Reader = nil
  47077. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  47078. if err != nil {
  47079. return nil, err
  47080. }
  47081. reqHeaders.Set("Content-Type", "application/json")
  47082. c.urlParams_.Set("alt", alt)
  47083. c.urlParams_.Set("prettyPrint", "false")
  47084. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  47085. urls += "?" + c.urlParams_.Encode()
  47086. req, err := http.NewRequest("POST", urls, body)
  47087. if err != nil {
  47088. return nil, err
  47089. }
  47090. req.Header = reqHeaders
  47091. googleapi.Expand(req.URL, map[string]string{
  47092. "project": c.project,
  47093. })
  47094. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47095. }
  47096. // Do executes the "compute.globalForwardingRules.insert" call.
  47097. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47098. // status code is an error. Response headers are in either
  47099. // *Operation.ServerResponse.Header or (if a response was returned at
  47100. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47101. // to check whether the returned error was because
  47102. // http.StatusNotModified was returned.
  47103. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47104. gensupport.SetOptions(c.urlParams_, opts...)
  47105. res, err := c.doRequest("json")
  47106. if res != nil && res.StatusCode == http.StatusNotModified {
  47107. if res.Body != nil {
  47108. res.Body.Close()
  47109. }
  47110. return nil, &googleapi.Error{
  47111. Code: res.StatusCode,
  47112. Header: res.Header,
  47113. }
  47114. }
  47115. if err != nil {
  47116. return nil, err
  47117. }
  47118. defer googleapi.CloseBody(res)
  47119. if err := googleapi.CheckResponse(res); err != nil {
  47120. return nil, err
  47121. }
  47122. ret := &Operation{
  47123. ServerResponse: googleapi.ServerResponse{
  47124. Header: res.Header,
  47125. HTTPStatusCode: res.StatusCode,
  47126. },
  47127. }
  47128. target := &ret
  47129. if err := gensupport.DecodeResponse(target, res); err != nil {
  47130. return nil, err
  47131. }
  47132. return ret, nil
  47133. // {
  47134. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  47135. // "httpMethod": "POST",
  47136. // "id": "compute.globalForwardingRules.insert",
  47137. // "parameterOrder": [
  47138. // "project"
  47139. // ],
  47140. // "parameters": {
  47141. // "project": {
  47142. // "description": "Project ID for this request.",
  47143. // "location": "path",
  47144. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47145. // "required": true,
  47146. // "type": "string"
  47147. // },
  47148. // "requestId": {
  47149. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47150. // "location": "query",
  47151. // "type": "string"
  47152. // }
  47153. // },
  47154. // "path": "{project}/global/forwardingRules",
  47155. // "request": {
  47156. // "$ref": "ForwardingRule"
  47157. // },
  47158. // "response": {
  47159. // "$ref": "Operation"
  47160. // },
  47161. // "scopes": [
  47162. // "https://www.googleapis.com/auth/cloud-platform",
  47163. // "https://www.googleapis.com/auth/compute"
  47164. // ]
  47165. // }
  47166. }
  47167. // method id "compute.globalForwardingRules.list":
  47168. type GlobalForwardingRulesListCall struct {
  47169. s *Service
  47170. project string
  47171. urlParams_ gensupport.URLParams
  47172. ifNoneMatch_ string
  47173. ctx_ context.Context
  47174. header_ http.Header
  47175. }
  47176. // List: Retrieves a list of GlobalForwardingRule resources available to
  47177. // the specified project.
  47178. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  47179. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  47180. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47181. c.project = project
  47182. return c
  47183. }
  47184. // Filter sets the optional parameter "filter": A filter expression that
  47185. // filters resources listed in the response. The expression must specify
  47186. // the field name, a comparison operator, and the value that you want to
  47187. // use for filtering. The value must be a string, a number, or a
  47188. // boolean. The comparison operator must be either =, !=, >, or <.
  47189. //
  47190. // For example, if you are filtering Compute Engine instances, you can
  47191. // exclude instances named example-instance by specifying name !=
  47192. // example-instance.
  47193. //
  47194. // You can also filter nested fields. For example, you could specify
  47195. // scheduling.automaticRestart = false to include instances only if they
  47196. // are not scheduled for automatic restarts. You can use filtering on
  47197. // nested fields to filter based on resource labels.
  47198. //
  47199. // To filter on multiple expressions, provide each separate expression
  47200. // within parentheses. For example, (scheduling.automaticRestart = true)
  47201. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47202. // AND expression. However, you can include AND and OR expressions
  47203. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47204. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47205. // true).
  47206. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  47207. c.urlParams_.Set("filter", filter)
  47208. return c
  47209. }
  47210. // MaxResults sets the optional parameter "maxResults": The maximum
  47211. // number of results per page that should be returned. If the number of
  47212. // available results is larger than maxResults, Compute Engine returns a
  47213. // nextPageToken that can be used to get the next page of results in
  47214. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47215. // (Default: 500)
  47216. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  47217. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47218. return c
  47219. }
  47220. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47221. // a certain order. By default, results are returned in alphanumerical
  47222. // order based on the resource name.
  47223. //
  47224. // You can also sort results in descending order based on the creation
  47225. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47226. // based on the creationTimestamp field in reverse chronological order
  47227. // (newest result first). Use this to sort resources like operations so
  47228. // that the newest operation is returned first.
  47229. //
  47230. // Currently, only sorting by name or creationTimestamp desc is
  47231. // supported.
  47232. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  47233. c.urlParams_.Set("orderBy", orderBy)
  47234. return c
  47235. }
  47236. // PageToken sets the optional parameter "pageToken": Specifies a page
  47237. // token to use. Set pageToken to the nextPageToken returned by a
  47238. // previous list request to get the next page of results.
  47239. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  47240. c.urlParams_.Set("pageToken", pageToken)
  47241. return c
  47242. }
  47243. // Fields allows partial responses to be retrieved. See
  47244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47245. // for more information.
  47246. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  47247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47248. return c
  47249. }
  47250. // IfNoneMatch sets the optional parameter which makes the operation
  47251. // fail if the object's ETag matches the given value. This is useful for
  47252. // getting updates only after the object has changed since the last
  47253. // request. Use googleapi.IsNotModified to check whether the response
  47254. // error from Do is the result of In-None-Match.
  47255. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  47256. c.ifNoneMatch_ = entityTag
  47257. return c
  47258. }
  47259. // Context sets the context to be used in this call's Do method. Any
  47260. // pending HTTP request will be aborted if the provided context is
  47261. // canceled.
  47262. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  47263. c.ctx_ = ctx
  47264. return c
  47265. }
  47266. // Header returns an http.Header that can be modified by the caller to
  47267. // add HTTP headers to the request.
  47268. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  47269. if c.header_ == nil {
  47270. c.header_ = make(http.Header)
  47271. }
  47272. return c.header_
  47273. }
  47274. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  47275. reqHeaders := make(http.Header)
  47276. for k, v := range c.header_ {
  47277. reqHeaders[k] = v
  47278. }
  47279. reqHeaders.Set("User-Agent", c.s.userAgent())
  47280. if c.ifNoneMatch_ != "" {
  47281. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47282. }
  47283. var body io.Reader = nil
  47284. c.urlParams_.Set("alt", alt)
  47285. c.urlParams_.Set("prettyPrint", "false")
  47286. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  47287. urls += "?" + c.urlParams_.Encode()
  47288. req, err := http.NewRequest("GET", urls, body)
  47289. if err != nil {
  47290. return nil, err
  47291. }
  47292. req.Header = reqHeaders
  47293. googleapi.Expand(req.URL, map[string]string{
  47294. "project": c.project,
  47295. })
  47296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47297. }
  47298. // Do executes the "compute.globalForwardingRules.list" call.
  47299. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  47300. // non-2xx status code is an error. Response headers are in either
  47301. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  47302. // returned at all) in error.(*googleapi.Error).Header. Use
  47303. // googleapi.IsNotModified to check whether the returned error was
  47304. // because http.StatusNotModified was returned.
  47305. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  47306. gensupport.SetOptions(c.urlParams_, opts...)
  47307. res, err := c.doRequest("json")
  47308. if res != nil && res.StatusCode == http.StatusNotModified {
  47309. if res.Body != nil {
  47310. res.Body.Close()
  47311. }
  47312. return nil, &googleapi.Error{
  47313. Code: res.StatusCode,
  47314. Header: res.Header,
  47315. }
  47316. }
  47317. if err != nil {
  47318. return nil, err
  47319. }
  47320. defer googleapi.CloseBody(res)
  47321. if err := googleapi.CheckResponse(res); err != nil {
  47322. return nil, err
  47323. }
  47324. ret := &ForwardingRuleList{
  47325. ServerResponse: googleapi.ServerResponse{
  47326. Header: res.Header,
  47327. HTTPStatusCode: res.StatusCode,
  47328. },
  47329. }
  47330. target := &ret
  47331. if err := gensupport.DecodeResponse(target, res); err != nil {
  47332. return nil, err
  47333. }
  47334. return ret, nil
  47335. // {
  47336. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  47337. // "httpMethod": "GET",
  47338. // "id": "compute.globalForwardingRules.list",
  47339. // "parameterOrder": [
  47340. // "project"
  47341. // ],
  47342. // "parameters": {
  47343. // "filter": {
  47344. // "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).",
  47345. // "location": "query",
  47346. // "type": "string"
  47347. // },
  47348. // "maxResults": {
  47349. // "default": "500",
  47350. // "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)",
  47351. // "format": "uint32",
  47352. // "location": "query",
  47353. // "minimum": "0",
  47354. // "type": "integer"
  47355. // },
  47356. // "orderBy": {
  47357. // "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.",
  47358. // "location": "query",
  47359. // "type": "string"
  47360. // },
  47361. // "pageToken": {
  47362. // "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.",
  47363. // "location": "query",
  47364. // "type": "string"
  47365. // },
  47366. // "project": {
  47367. // "description": "Project ID for this request.",
  47368. // "location": "path",
  47369. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47370. // "required": true,
  47371. // "type": "string"
  47372. // }
  47373. // },
  47374. // "path": "{project}/global/forwardingRules",
  47375. // "response": {
  47376. // "$ref": "ForwardingRuleList"
  47377. // },
  47378. // "scopes": [
  47379. // "https://www.googleapis.com/auth/cloud-platform",
  47380. // "https://www.googleapis.com/auth/compute",
  47381. // "https://www.googleapis.com/auth/compute.readonly"
  47382. // ]
  47383. // }
  47384. }
  47385. // Pages invokes f for each page of results.
  47386. // A non-nil error returned from f will halt the iteration.
  47387. // The provided context supersedes any context provided to the Context method.
  47388. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  47389. c.ctx_ = ctx
  47390. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47391. for {
  47392. x, err := c.Do()
  47393. if err != nil {
  47394. return err
  47395. }
  47396. if err := f(x); err != nil {
  47397. return err
  47398. }
  47399. if x.NextPageToken == "" {
  47400. return nil
  47401. }
  47402. c.PageToken(x.NextPageToken)
  47403. }
  47404. }
  47405. // method id "compute.globalForwardingRules.patch":
  47406. type GlobalForwardingRulesPatchCall struct {
  47407. s *Service
  47408. project string
  47409. forwardingRule string
  47410. forwardingrule *ForwardingRule
  47411. urlParams_ gensupport.URLParams
  47412. ctx_ context.Context
  47413. header_ http.Header
  47414. }
  47415. // Patch: Updates the specified forwarding rule with the data included
  47416. // in the request. This method supports PATCH semantics and uses the
  47417. // JSON merge patch format and processing rules. Currently, you can only
  47418. // patch the network_tier field.
  47419. func (r *GlobalForwardingRulesService) Patch(project string, forwardingRule string, forwardingrule *ForwardingRule) *GlobalForwardingRulesPatchCall {
  47420. c := &GlobalForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47421. c.project = project
  47422. c.forwardingRule = forwardingRule
  47423. c.forwardingrule = forwardingrule
  47424. return c
  47425. }
  47426. // RequestId sets the optional parameter "requestId": An optional
  47427. // request ID to identify requests. Specify a unique request ID so that
  47428. // if you must retry your request, the server will know to ignore the
  47429. // request if it has already been completed.
  47430. //
  47431. // For example, consider a situation where you make an initial request
  47432. // and the request times out. If you make the request again with the
  47433. // same request ID, the server can check if original operation with the
  47434. // same request ID was received, and if so, will ignore the second
  47435. // request. This prevents clients from accidentally creating duplicate
  47436. // commitments.
  47437. //
  47438. // The request ID must be a valid UUID with the exception that zero UUID
  47439. // is not supported (00000000-0000-0000-0000-000000000000).
  47440. func (c *GlobalForwardingRulesPatchCall) RequestId(requestId string) *GlobalForwardingRulesPatchCall {
  47441. c.urlParams_.Set("requestId", requestId)
  47442. return c
  47443. }
  47444. // Fields allows partial responses to be retrieved. See
  47445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47446. // for more information.
  47447. func (c *GlobalForwardingRulesPatchCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesPatchCall {
  47448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47449. return c
  47450. }
  47451. // Context sets the context to be used in this call's Do method. Any
  47452. // pending HTTP request will be aborted if the provided context is
  47453. // canceled.
  47454. func (c *GlobalForwardingRulesPatchCall) Context(ctx context.Context) *GlobalForwardingRulesPatchCall {
  47455. c.ctx_ = ctx
  47456. return c
  47457. }
  47458. // Header returns an http.Header that can be modified by the caller to
  47459. // add HTTP headers to the request.
  47460. func (c *GlobalForwardingRulesPatchCall) Header() http.Header {
  47461. if c.header_ == nil {
  47462. c.header_ = make(http.Header)
  47463. }
  47464. return c.header_
  47465. }
  47466. func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  47467. reqHeaders := make(http.Header)
  47468. for k, v := range c.header_ {
  47469. reqHeaders[k] = v
  47470. }
  47471. reqHeaders.Set("User-Agent", c.s.userAgent())
  47472. var body io.Reader = nil
  47473. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  47474. if err != nil {
  47475. return nil, err
  47476. }
  47477. reqHeaders.Set("Content-Type", "application/json")
  47478. c.urlParams_.Set("alt", alt)
  47479. c.urlParams_.Set("prettyPrint", "false")
  47480. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  47481. urls += "?" + c.urlParams_.Encode()
  47482. req, err := http.NewRequest("PATCH", urls, body)
  47483. if err != nil {
  47484. return nil, err
  47485. }
  47486. req.Header = reqHeaders
  47487. googleapi.Expand(req.URL, map[string]string{
  47488. "project": c.project,
  47489. "forwardingRule": c.forwardingRule,
  47490. })
  47491. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47492. }
  47493. // Do executes the "compute.globalForwardingRules.patch" call.
  47494. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47495. // status code is an error. Response headers are in either
  47496. // *Operation.ServerResponse.Header or (if a response was returned at
  47497. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47498. // to check whether the returned error was because
  47499. // http.StatusNotModified was returned.
  47500. func (c *GlobalForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47501. gensupport.SetOptions(c.urlParams_, opts...)
  47502. res, err := c.doRequest("json")
  47503. if res != nil && res.StatusCode == http.StatusNotModified {
  47504. if res.Body != nil {
  47505. res.Body.Close()
  47506. }
  47507. return nil, &googleapi.Error{
  47508. Code: res.StatusCode,
  47509. Header: res.Header,
  47510. }
  47511. }
  47512. if err != nil {
  47513. return nil, err
  47514. }
  47515. defer googleapi.CloseBody(res)
  47516. if err := googleapi.CheckResponse(res); err != nil {
  47517. return nil, err
  47518. }
  47519. ret := &Operation{
  47520. ServerResponse: googleapi.ServerResponse{
  47521. Header: res.Header,
  47522. HTTPStatusCode: res.StatusCode,
  47523. },
  47524. }
  47525. target := &ret
  47526. if err := gensupport.DecodeResponse(target, res); err != nil {
  47527. return nil, err
  47528. }
  47529. return ret, nil
  47530. // {
  47531. // "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.",
  47532. // "httpMethod": "PATCH",
  47533. // "id": "compute.globalForwardingRules.patch",
  47534. // "parameterOrder": [
  47535. // "project",
  47536. // "forwardingRule"
  47537. // ],
  47538. // "parameters": {
  47539. // "forwardingRule": {
  47540. // "description": "Name of the ForwardingRule resource to patch.",
  47541. // "location": "path",
  47542. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  47543. // "required": true,
  47544. // "type": "string"
  47545. // },
  47546. // "project": {
  47547. // "description": "Project ID for this request.",
  47548. // "location": "path",
  47549. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47550. // "required": true,
  47551. // "type": "string"
  47552. // },
  47553. // "requestId": {
  47554. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47555. // "location": "query",
  47556. // "type": "string"
  47557. // }
  47558. // },
  47559. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  47560. // "request": {
  47561. // "$ref": "ForwardingRule"
  47562. // },
  47563. // "response": {
  47564. // "$ref": "Operation"
  47565. // },
  47566. // "scopes": [
  47567. // "https://www.googleapis.com/auth/cloud-platform",
  47568. // "https://www.googleapis.com/auth/compute"
  47569. // ]
  47570. // }
  47571. }
  47572. // method id "compute.globalForwardingRules.setLabels":
  47573. type GlobalForwardingRulesSetLabelsCall struct {
  47574. s *Service
  47575. project string
  47576. resource string
  47577. globalsetlabelsrequest *GlobalSetLabelsRequest
  47578. urlParams_ gensupport.URLParams
  47579. ctx_ context.Context
  47580. header_ http.Header
  47581. }
  47582. // SetLabels: Sets the labels on the specified resource. To learn more
  47583. // about labels, read the Labeling Resources documentation.
  47584. func (r *GlobalForwardingRulesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalForwardingRulesSetLabelsCall {
  47585. c := &GlobalForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47586. c.project = project
  47587. c.resource = resource
  47588. c.globalsetlabelsrequest = globalsetlabelsrequest
  47589. return c
  47590. }
  47591. // Fields allows partial responses to be retrieved. See
  47592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47593. // for more information.
  47594. func (c *GlobalForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetLabelsCall {
  47595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47596. return c
  47597. }
  47598. // Context sets the context to be used in this call's Do method. Any
  47599. // pending HTTP request will be aborted if the provided context is
  47600. // canceled.
  47601. func (c *GlobalForwardingRulesSetLabelsCall) Context(ctx context.Context) *GlobalForwardingRulesSetLabelsCall {
  47602. c.ctx_ = ctx
  47603. return c
  47604. }
  47605. // Header returns an http.Header that can be modified by the caller to
  47606. // add HTTP headers to the request.
  47607. func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header {
  47608. if c.header_ == nil {
  47609. c.header_ = make(http.Header)
  47610. }
  47611. return c.header_
  47612. }
  47613. func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  47614. reqHeaders := make(http.Header)
  47615. for k, v := range c.header_ {
  47616. reqHeaders[k] = v
  47617. }
  47618. reqHeaders.Set("User-Agent", c.s.userAgent())
  47619. var body io.Reader = nil
  47620. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  47621. if err != nil {
  47622. return nil, err
  47623. }
  47624. reqHeaders.Set("Content-Type", "application/json")
  47625. c.urlParams_.Set("alt", alt)
  47626. c.urlParams_.Set("prettyPrint", "false")
  47627. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/setLabels")
  47628. urls += "?" + c.urlParams_.Encode()
  47629. req, err := http.NewRequest("POST", urls, body)
  47630. if err != nil {
  47631. return nil, err
  47632. }
  47633. req.Header = reqHeaders
  47634. googleapi.Expand(req.URL, map[string]string{
  47635. "project": c.project,
  47636. "resource": c.resource,
  47637. })
  47638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47639. }
  47640. // Do executes the "compute.globalForwardingRules.setLabels" call.
  47641. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47642. // status code is an error. Response headers are in either
  47643. // *Operation.ServerResponse.Header or (if a response was returned at
  47644. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47645. // to check whether the returned error was because
  47646. // http.StatusNotModified was returned.
  47647. func (c *GlobalForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47648. gensupport.SetOptions(c.urlParams_, opts...)
  47649. res, err := c.doRequest("json")
  47650. if res != nil && res.StatusCode == http.StatusNotModified {
  47651. if res.Body != nil {
  47652. res.Body.Close()
  47653. }
  47654. return nil, &googleapi.Error{
  47655. Code: res.StatusCode,
  47656. Header: res.Header,
  47657. }
  47658. }
  47659. if err != nil {
  47660. return nil, err
  47661. }
  47662. defer googleapi.CloseBody(res)
  47663. if err := googleapi.CheckResponse(res); err != nil {
  47664. return nil, err
  47665. }
  47666. ret := &Operation{
  47667. ServerResponse: googleapi.ServerResponse{
  47668. Header: res.Header,
  47669. HTTPStatusCode: res.StatusCode,
  47670. },
  47671. }
  47672. target := &ret
  47673. if err := gensupport.DecodeResponse(target, res); err != nil {
  47674. return nil, err
  47675. }
  47676. return ret, nil
  47677. // {
  47678. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  47679. // "httpMethod": "POST",
  47680. // "id": "compute.globalForwardingRules.setLabels",
  47681. // "parameterOrder": [
  47682. // "project",
  47683. // "resource"
  47684. // ],
  47685. // "parameters": {
  47686. // "project": {
  47687. // "description": "Project ID for this request.",
  47688. // "location": "path",
  47689. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47690. // "required": true,
  47691. // "type": "string"
  47692. // },
  47693. // "resource": {
  47694. // "description": "Name or id of the resource for this request.",
  47695. // "location": "path",
  47696. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  47697. // "required": true,
  47698. // "type": "string"
  47699. // }
  47700. // },
  47701. // "path": "{project}/global/forwardingRules/{resource}/setLabels",
  47702. // "request": {
  47703. // "$ref": "GlobalSetLabelsRequest"
  47704. // },
  47705. // "response": {
  47706. // "$ref": "Operation"
  47707. // },
  47708. // "scopes": [
  47709. // "https://www.googleapis.com/auth/cloud-platform",
  47710. // "https://www.googleapis.com/auth/compute"
  47711. // ]
  47712. // }
  47713. }
  47714. // method id "compute.globalForwardingRules.setTarget":
  47715. type GlobalForwardingRulesSetTargetCall struct {
  47716. s *Service
  47717. project string
  47718. forwardingRule string
  47719. targetreference *TargetReference
  47720. urlParams_ gensupport.URLParams
  47721. ctx_ context.Context
  47722. header_ http.Header
  47723. }
  47724. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  47725. // The new target should be of the same type as the old target.
  47726. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  47727. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  47728. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47729. c.project = project
  47730. c.forwardingRule = forwardingRule
  47731. c.targetreference = targetreference
  47732. return c
  47733. }
  47734. // RequestId sets the optional parameter "requestId": An optional
  47735. // request ID to identify requests. Specify a unique request ID so that
  47736. // if you must retry your request, the server will know to ignore the
  47737. // request if it has already been completed.
  47738. //
  47739. // For example, consider a situation where you make an initial request
  47740. // and the request times out. If you make the request again with the
  47741. // same request ID, the server can check if original operation with the
  47742. // same request ID was received, and if so, will ignore the second
  47743. // request. This prevents clients from accidentally creating duplicate
  47744. // commitments.
  47745. //
  47746. // The request ID must be a valid UUID with the exception that zero UUID
  47747. // is not supported (00000000-0000-0000-0000-000000000000).
  47748. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  47749. c.urlParams_.Set("requestId", requestId)
  47750. return c
  47751. }
  47752. // Fields allows partial responses to be retrieved. See
  47753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47754. // for more information.
  47755. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  47756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47757. return c
  47758. }
  47759. // Context sets the context to be used in this call's Do method. Any
  47760. // pending HTTP request will be aborted if the provided context is
  47761. // canceled.
  47762. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  47763. c.ctx_ = ctx
  47764. return c
  47765. }
  47766. // Header returns an http.Header that can be modified by the caller to
  47767. // add HTTP headers to the request.
  47768. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  47769. if c.header_ == nil {
  47770. c.header_ = make(http.Header)
  47771. }
  47772. return c.header_
  47773. }
  47774. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  47775. reqHeaders := make(http.Header)
  47776. for k, v := range c.header_ {
  47777. reqHeaders[k] = v
  47778. }
  47779. reqHeaders.Set("User-Agent", c.s.userAgent())
  47780. var body io.Reader = nil
  47781. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  47782. if err != nil {
  47783. return nil, err
  47784. }
  47785. reqHeaders.Set("Content-Type", "application/json")
  47786. c.urlParams_.Set("alt", alt)
  47787. c.urlParams_.Set("prettyPrint", "false")
  47788. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  47789. urls += "?" + c.urlParams_.Encode()
  47790. req, err := http.NewRequest("POST", urls, body)
  47791. if err != nil {
  47792. return nil, err
  47793. }
  47794. req.Header = reqHeaders
  47795. googleapi.Expand(req.URL, map[string]string{
  47796. "project": c.project,
  47797. "forwardingRule": c.forwardingRule,
  47798. })
  47799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47800. }
  47801. // Do executes the "compute.globalForwardingRules.setTarget" call.
  47802. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47803. // status code is an error. Response headers are in either
  47804. // *Operation.ServerResponse.Header or (if a response was returned at
  47805. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47806. // to check whether the returned error was because
  47807. // http.StatusNotModified was returned.
  47808. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47809. gensupport.SetOptions(c.urlParams_, opts...)
  47810. res, err := c.doRequest("json")
  47811. if res != nil && res.StatusCode == http.StatusNotModified {
  47812. if res.Body != nil {
  47813. res.Body.Close()
  47814. }
  47815. return nil, &googleapi.Error{
  47816. Code: res.StatusCode,
  47817. Header: res.Header,
  47818. }
  47819. }
  47820. if err != nil {
  47821. return nil, err
  47822. }
  47823. defer googleapi.CloseBody(res)
  47824. if err := googleapi.CheckResponse(res); err != nil {
  47825. return nil, err
  47826. }
  47827. ret := &Operation{
  47828. ServerResponse: googleapi.ServerResponse{
  47829. Header: res.Header,
  47830. HTTPStatusCode: res.StatusCode,
  47831. },
  47832. }
  47833. target := &ret
  47834. if err := gensupport.DecodeResponse(target, res); err != nil {
  47835. return nil, err
  47836. }
  47837. return ret, nil
  47838. // {
  47839. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  47840. // "httpMethod": "POST",
  47841. // "id": "compute.globalForwardingRules.setTarget",
  47842. // "parameterOrder": [
  47843. // "project",
  47844. // "forwardingRule"
  47845. // ],
  47846. // "parameters": {
  47847. // "forwardingRule": {
  47848. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  47849. // "location": "path",
  47850. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  47851. // "required": true,
  47852. // "type": "string"
  47853. // },
  47854. // "project": {
  47855. // "description": "Project ID for this request.",
  47856. // "location": "path",
  47857. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47858. // "required": true,
  47859. // "type": "string"
  47860. // },
  47861. // "requestId": {
  47862. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47863. // "location": "query",
  47864. // "type": "string"
  47865. // }
  47866. // },
  47867. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  47868. // "request": {
  47869. // "$ref": "TargetReference"
  47870. // },
  47871. // "response": {
  47872. // "$ref": "Operation"
  47873. // },
  47874. // "scopes": [
  47875. // "https://www.googleapis.com/auth/cloud-platform",
  47876. // "https://www.googleapis.com/auth/compute"
  47877. // ]
  47878. // }
  47879. }
  47880. // method id "compute.globalForwardingRules.testIamPermissions":
  47881. type GlobalForwardingRulesTestIamPermissionsCall struct {
  47882. s *Service
  47883. project string
  47884. resource string
  47885. testpermissionsrequest *TestPermissionsRequest
  47886. urlParams_ gensupport.URLParams
  47887. ctx_ context.Context
  47888. header_ http.Header
  47889. }
  47890. // TestIamPermissions: Returns permissions that a caller has on the
  47891. // specified resource.
  47892. func (r *GlobalForwardingRulesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalForwardingRulesTestIamPermissionsCall {
  47893. c := &GlobalForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47894. c.project = project
  47895. c.resource = resource
  47896. c.testpermissionsrequest = testpermissionsrequest
  47897. return c
  47898. }
  47899. // Fields allows partial responses to be retrieved. See
  47900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47901. // for more information.
  47902. func (c *GlobalForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesTestIamPermissionsCall {
  47903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47904. return c
  47905. }
  47906. // Context sets the context to be used in this call's Do method. Any
  47907. // pending HTTP request will be aborted if the provided context is
  47908. // canceled.
  47909. func (c *GlobalForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *GlobalForwardingRulesTestIamPermissionsCall {
  47910. c.ctx_ = ctx
  47911. return c
  47912. }
  47913. // Header returns an http.Header that can be modified by the caller to
  47914. // add HTTP headers to the request.
  47915. func (c *GlobalForwardingRulesTestIamPermissionsCall) Header() http.Header {
  47916. if c.header_ == nil {
  47917. c.header_ = make(http.Header)
  47918. }
  47919. return c.header_
  47920. }
  47921. func (c *GlobalForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  47922. reqHeaders := make(http.Header)
  47923. for k, v := range c.header_ {
  47924. reqHeaders[k] = v
  47925. }
  47926. reqHeaders.Set("User-Agent", c.s.userAgent())
  47927. var body io.Reader = nil
  47928. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  47929. if err != nil {
  47930. return nil, err
  47931. }
  47932. reqHeaders.Set("Content-Type", "application/json")
  47933. c.urlParams_.Set("alt", alt)
  47934. c.urlParams_.Set("prettyPrint", "false")
  47935. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/testIamPermissions")
  47936. urls += "?" + c.urlParams_.Encode()
  47937. req, err := http.NewRequest("POST", urls, body)
  47938. if err != nil {
  47939. return nil, err
  47940. }
  47941. req.Header = reqHeaders
  47942. googleapi.Expand(req.URL, map[string]string{
  47943. "project": c.project,
  47944. "resource": c.resource,
  47945. })
  47946. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47947. }
  47948. // Do executes the "compute.globalForwardingRules.testIamPermissions" call.
  47949. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  47950. // non-2xx status code is an error. Response headers are in either
  47951. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  47952. // returned at all) in error.(*googleapi.Error).Header. Use
  47953. // googleapi.IsNotModified to check whether the returned error was
  47954. // because http.StatusNotModified was returned.
  47955. func (c *GlobalForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  47956. gensupport.SetOptions(c.urlParams_, opts...)
  47957. res, err := c.doRequest("json")
  47958. if res != nil && res.StatusCode == http.StatusNotModified {
  47959. if res.Body != nil {
  47960. res.Body.Close()
  47961. }
  47962. return nil, &googleapi.Error{
  47963. Code: res.StatusCode,
  47964. Header: res.Header,
  47965. }
  47966. }
  47967. if err != nil {
  47968. return nil, err
  47969. }
  47970. defer googleapi.CloseBody(res)
  47971. if err := googleapi.CheckResponse(res); err != nil {
  47972. return nil, err
  47973. }
  47974. ret := &TestPermissionsResponse{
  47975. ServerResponse: googleapi.ServerResponse{
  47976. Header: res.Header,
  47977. HTTPStatusCode: res.StatusCode,
  47978. },
  47979. }
  47980. target := &ret
  47981. if err := gensupport.DecodeResponse(target, res); err != nil {
  47982. return nil, err
  47983. }
  47984. return ret, nil
  47985. // {
  47986. // "description": "Returns permissions that a caller has on the specified resource.",
  47987. // "httpMethod": "POST",
  47988. // "id": "compute.globalForwardingRules.testIamPermissions",
  47989. // "parameterOrder": [
  47990. // "project",
  47991. // "resource"
  47992. // ],
  47993. // "parameters": {
  47994. // "project": {
  47995. // "description": "Project ID for this request.",
  47996. // "location": "path",
  47997. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47998. // "required": true,
  47999. // "type": "string"
  48000. // },
  48001. // "resource": {
  48002. // "description": "Name or id of the resource for this request.",
  48003. // "location": "path",
  48004. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48005. // "required": true,
  48006. // "type": "string"
  48007. // }
  48008. // },
  48009. // "path": "{project}/global/forwardingRules/{resource}/testIamPermissions",
  48010. // "request": {
  48011. // "$ref": "TestPermissionsRequest"
  48012. // },
  48013. // "response": {
  48014. // "$ref": "TestPermissionsResponse"
  48015. // },
  48016. // "scopes": [
  48017. // "https://www.googleapis.com/auth/cloud-platform",
  48018. // "https://www.googleapis.com/auth/compute",
  48019. // "https://www.googleapis.com/auth/compute.readonly"
  48020. // ]
  48021. // }
  48022. }
  48023. // method id "compute.globalOperations.aggregatedList":
  48024. type GlobalOperationsAggregatedListCall struct {
  48025. s *Service
  48026. project string
  48027. urlParams_ gensupport.URLParams
  48028. ifNoneMatch_ string
  48029. ctx_ context.Context
  48030. header_ http.Header
  48031. }
  48032. // AggregatedList: Retrieves an aggregated list of all operations.
  48033. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  48034. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  48035. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48036. c.project = project
  48037. return c
  48038. }
  48039. // Filter sets the optional parameter "filter": A filter expression that
  48040. // filters resources listed in the response. The expression must specify
  48041. // the field name, a comparison operator, and the value that you want to
  48042. // use for filtering. The value must be a string, a number, or a
  48043. // boolean. The comparison operator must be either =, !=, >, or <.
  48044. //
  48045. // For example, if you are filtering Compute Engine instances, you can
  48046. // exclude instances named example-instance by specifying name !=
  48047. // example-instance.
  48048. //
  48049. // You can also filter nested fields. For example, you could specify
  48050. // scheduling.automaticRestart = false to include instances only if they
  48051. // are not scheduled for automatic restarts. You can use filtering on
  48052. // nested fields to filter based on resource labels.
  48053. //
  48054. // To filter on multiple expressions, provide each separate expression
  48055. // within parentheses. For example, (scheduling.automaticRestart = true)
  48056. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48057. // AND expression. However, you can include AND and OR expressions
  48058. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48059. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48060. // true).
  48061. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  48062. c.urlParams_.Set("filter", filter)
  48063. return c
  48064. }
  48065. // MaxResults sets the optional parameter "maxResults": The maximum
  48066. // number of results per page that should be returned. If the number of
  48067. // available results is larger than maxResults, Compute Engine returns a
  48068. // nextPageToken that can be used to get the next page of results in
  48069. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48070. // (Default: 500)
  48071. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  48072. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48073. return c
  48074. }
  48075. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48076. // a certain order. By default, results are returned in alphanumerical
  48077. // order based on the resource name.
  48078. //
  48079. // You can also sort results in descending order based on the creation
  48080. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48081. // based on the creationTimestamp field in reverse chronological order
  48082. // (newest result first). Use this to sort resources like operations so
  48083. // that the newest operation is returned first.
  48084. //
  48085. // Currently, only sorting by name or creationTimestamp desc is
  48086. // supported.
  48087. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  48088. c.urlParams_.Set("orderBy", orderBy)
  48089. return c
  48090. }
  48091. // PageToken sets the optional parameter "pageToken": Specifies a page
  48092. // token to use. Set pageToken to the nextPageToken returned by a
  48093. // previous list request to get the next page of results.
  48094. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  48095. c.urlParams_.Set("pageToken", pageToken)
  48096. return c
  48097. }
  48098. // Fields allows partial responses to be retrieved. See
  48099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48100. // for more information.
  48101. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  48102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48103. return c
  48104. }
  48105. // IfNoneMatch sets the optional parameter which makes the operation
  48106. // fail if the object's ETag matches the given value. This is useful for
  48107. // getting updates only after the object has changed since the last
  48108. // request. Use googleapi.IsNotModified to check whether the response
  48109. // error from Do is the result of In-None-Match.
  48110. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  48111. c.ifNoneMatch_ = entityTag
  48112. return c
  48113. }
  48114. // Context sets the context to be used in this call's Do method. Any
  48115. // pending HTTP request will be aborted if the provided context is
  48116. // canceled.
  48117. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  48118. c.ctx_ = ctx
  48119. return c
  48120. }
  48121. // Header returns an http.Header that can be modified by the caller to
  48122. // add HTTP headers to the request.
  48123. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  48124. if c.header_ == nil {
  48125. c.header_ = make(http.Header)
  48126. }
  48127. return c.header_
  48128. }
  48129. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  48130. reqHeaders := make(http.Header)
  48131. for k, v := range c.header_ {
  48132. reqHeaders[k] = v
  48133. }
  48134. reqHeaders.Set("User-Agent", c.s.userAgent())
  48135. if c.ifNoneMatch_ != "" {
  48136. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48137. }
  48138. var body io.Reader = nil
  48139. c.urlParams_.Set("alt", alt)
  48140. c.urlParams_.Set("prettyPrint", "false")
  48141. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  48142. urls += "?" + c.urlParams_.Encode()
  48143. req, err := http.NewRequest("GET", urls, body)
  48144. if err != nil {
  48145. return nil, err
  48146. }
  48147. req.Header = reqHeaders
  48148. googleapi.Expand(req.URL, map[string]string{
  48149. "project": c.project,
  48150. })
  48151. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48152. }
  48153. // Do executes the "compute.globalOperations.aggregatedList" call.
  48154. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  48155. // non-2xx status code is an error. Response headers are in either
  48156. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  48157. // returned at all) in error.(*googleapi.Error).Header. Use
  48158. // googleapi.IsNotModified to check whether the returned error was
  48159. // because http.StatusNotModified was returned.
  48160. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  48161. gensupport.SetOptions(c.urlParams_, opts...)
  48162. res, err := c.doRequest("json")
  48163. if res != nil && res.StatusCode == http.StatusNotModified {
  48164. if res.Body != nil {
  48165. res.Body.Close()
  48166. }
  48167. return nil, &googleapi.Error{
  48168. Code: res.StatusCode,
  48169. Header: res.Header,
  48170. }
  48171. }
  48172. if err != nil {
  48173. return nil, err
  48174. }
  48175. defer googleapi.CloseBody(res)
  48176. if err := googleapi.CheckResponse(res); err != nil {
  48177. return nil, err
  48178. }
  48179. ret := &OperationAggregatedList{
  48180. ServerResponse: googleapi.ServerResponse{
  48181. Header: res.Header,
  48182. HTTPStatusCode: res.StatusCode,
  48183. },
  48184. }
  48185. target := &ret
  48186. if err := gensupport.DecodeResponse(target, res); err != nil {
  48187. return nil, err
  48188. }
  48189. return ret, nil
  48190. // {
  48191. // "description": "Retrieves an aggregated list of all operations.",
  48192. // "httpMethod": "GET",
  48193. // "id": "compute.globalOperations.aggregatedList",
  48194. // "parameterOrder": [
  48195. // "project"
  48196. // ],
  48197. // "parameters": {
  48198. // "filter": {
  48199. // "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).",
  48200. // "location": "query",
  48201. // "type": "string"
  48202. // },
  48203. // "maxResults": {
  48204. // "default": "500",
  48205. // "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)",
  48206. // "format": "uint32",
  48207. // "location": "query",
  48208. // "minimum": "0",
  48209. // "type": "integer"
  48210. // },
  48211. // "orderBy": {
  48212. // "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.",
  48213. // "location": "query",
  48214. // "type": "string"
  48215. // },
  48216. // "pageToken": {
  48217. // "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.",
  48218. // "location": "query",
  48219. // "type": "string"
  48220. // },
  48221. // "project": {
  48222. // "description": "Project ID for this request.",
  48223. // "location": "path",
  48224. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48225. // "required": true,
  48226. // "type": "string"
  48227. // }
  48228. // },
  48229. // "path": "{project}/aggregated/operations",
  48230. // "response": {
  48231. // "$ref": "OperationAggregatedList"
  48232. // },
  48233. // "scopes": [
  48234. // "https://www.googleapis.com/auth/cloud-platform",
  48235. // "https://www.googleapis.com/auth/compute",
  48236. // "https://www.googleapis.com/auth/compute.readonly"
  48237. // ]
  48238. // }
  48239. }
  48240. // Pages invokes f for each page of results.
  48241. // A non-nil error returned from f will halt the iteration.
  48242. // The provided context supersedes any context provided to the Context method.
  48243. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  48244. c.ctx_ = ctx
  48245. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48246. for {
  48247. x, err := c.Do()
  48248. if err != nil {
  48249. return err
  48250. }
  48251. if err := f(x); err != nil {
  48252. return err
  48253. }
  48254. if x.NextPageToken == "" {
  48255. return nil
  48256. }
  48257. c.PageToken(x.NextPageToken)
  48258. }
  48259. }
  48260. // method id "compute.globalOperations.delete":
  48261. type GlobalOperationsDeleteCall struct {
  48262. s *Service
  48263. project string
  48264. operation string
  48265. urlParams_ gensupport.URLParams
  48266. ctx_ context.Context
  48267. header_ http.Header
  48268. }
  48269. // Delete: Deletes the specified Operations resource.
  48270. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  48271. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  48272. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48273. c.project = project
  48274. c.operation = operation
  48275. return c
  48276. }
  48277. // Fields allows partial responses to be retrieved. See
  48278. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48279. // for more information.
  48280. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  48281. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48282. return c
  48283. }
  48284. // Context sets the context to be used in this call's Do method. Any
  48285. // pending HTTP request will be aborted if the provided context is
  48286. // canceled.
  48287. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  48288. c.ctx_ = ctx
  48289. return c
  48290. }
  48291. // Header returns an http.Header that can be modified by the caller to
  48292. // add HTTP headers to the request.
  48293. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  48294. if c.header_ == nil {
  48295. c.header_ = make(http.Header)
  48296. }
  48297. return c.header_
  48298. }
  48299. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  48300. reqHeaders := make(http.Header)
  48301. for k, v := range c.header_ {
  48302. reqHeaders[k] = v
  48303. }
  48304. reqHeaders.Set("User-Agent", c.s.userAgent())
  48305. var body io.Reader = nil
  48306. c.urlParams_.Set("alt", alt)
  48307. c.urlParams_.Set("prettyPrint", "false")
  48308. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  48309. urls += "?" + c.urlParams_.Encode()
  48310. req, err := http.NewRequest("DELETE", urls, body)
  48311. if err != nil {
  48312. return nil, err
  48313. }
  48314. req.Header = reqHeaders
  48315. googleapi.Expand(req.URL, map[string]string{
  48316. "project": c.project,
  48317. "operation": c.operation,
  48318. })
  48319. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48320. }
  48321. // Do executes the "compute.globalOperations.delete" call.
  48322. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  48323. gensupport.SetOptions(c.urlParams_, opts...)
  48324. res, err := c.doRequest("json")
  48325. if err != nil {
  48326. return err
  48327. }
  48328. defer googleapi.CloseBody(res)
  48329. if err := googleapi.CheckResponse(res); err != nil {
  48330. return err
  48331. }
  48332. return nil
  48333. // {
  48334. // "description": "Deletes the specified Operations resource.",
  48335. // "httpMethod": "DELETE",
  48336. // "id": "compute.globalOperations.delete",
  48337. // "parameterOrder": [
  48338. // "project",
  48339. // "operation"
  48340. // ],
  48341. // "parameters": {
  48342. // "operation": {
  48343. // "description": "Name of the Operations resource to delete.",
  48344. // "location": "path",
  48345. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48346. // "required": true,
  48347. // "type": "string"
  48348. // },
  48349. // "project": {
  48350. // "description": "Project ID for this request.",
  48351. // "location": "path",
  48352. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48353. // "required": true,
  48354. // "type": "string"
  48355. // }
  48356. // },
  48357. // "path": "{project}/global/operations/{operation}",
  48358. // "scopes": [
  48359. // "https://www.googleapis.com/auth/cloud-platform",
  48360. // "https://www.googleapis.com/auth/compute"
  48361. // ]
  48362. // }
  48363. }
  48364. // method id "compute.globalOperations.get":
  48365. type GlobalOperationsGetCall struct {
  48366. s *Service
  48367. project string
  48368. operation string
  48369. urlParams_ gensupport.URLParams
  48370. ifNoneMatch_ string
  48371. ctx_ context.Context
  48372. header_ http.Header
  48373. }
  48374. // Get: Retrieves the specified Operations resource. Gets a list of
  48375. // operations by making a list() request.
  48376. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  48377. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  48378. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48379. c.project = project
  48380. c.operation = operation
  48381. return c
  48382. }
  48383. // Fields allows partial responses to be retrieved. See
  48384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48385. // for more information.
  48386. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  48387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48388. return c
  48389. }
  48390. // IfNoneMatch sets the optional parameter which makes the operation
  48391. // fail if the object's ETag matches the given value. This is useful for
  48392. // getting updates only after the object has changed since the last
  48393. // request. Use googleapi.IsNotModified to check whether the response
  48394. // error from Do is the result of In-None-Match.
  48395. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  48396. c.ifNoneMatch_ = entityTag
  48397. return c
  48398. }
  48399. // Context sets the context to be used in this call's Do method. Any
  48400. // pending HTTP request will be aborted if the provided context is
  48401. // canceled.
  48402. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  48403. c.ctx_ = ctx
  48404. return c
  48405. }
  48406. // Header returns an http.Header that can be modified by the caller to
  48407. // add HTTP headers to the request.
  48408. func (c *GlobalOperationsGetCall) Header() http.Header {
  48409. if c.header_ == nil {
  48410. c.header_ = make(http.Header)
  48411. }
  48412. return c.header_
  48413. }
  48414. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  48415. reqHeaders := make(http.Header)
  48416. for k, v := range c.header_ {
  48417. reqHeaders[k] = v
  48418. }
  48419. reqHeaders.Set("User-Agent", c.s.userAgent())
  48420. if c.ifNoneMatch_ != "" {
  48421. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48422. }
  48423. var body io.Reader = nil
  48424. c.urlParams_.Set("alt", alt)
  48425. c.urlParams_.Set("prettyPrint", "false")
  48426. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  48427. urls += "?" + c.urlParams_.Encode()
  48428. req, err := http.NewRequest("GET", urls, body)
  48429. if err != nil {
  48430. return nil, err
  48431. }
  48432. req.Header = reqHeaders
  48433. googleapi.Expand(req.URL, map[string]string{
  48434. "project": c.project,
  48435. "operation": c.operation,
  48436. })
  48437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48438. }
  48439. // Do executes the "compute.globalOperations.get" call.
  48440. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48441. // status code is an error. Response headers are in either
  48442. // *Operation.ServerResponse.Header or (if a response was returned at
  48443. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48444. // to check whether the returned error was because
  48445. // http.StatusNotModified was returned.
  48446. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48447. gensupport.SetOptions(c.urlParams_, opts...)
  48448. res, err := c.doRequest("json")
  48449. if res != nil && res.StatusCode == http.StatusNotModified {
  48450. if res.Body != nil {
  48451. res.Body.Close()
  48452. }
  48453. return nil, &googleapi.Error{
  48454. Code: res.StatusCode,
  48455. Header: res.Header,
  48456. }
  48457. }
  48458. if err != nil {
  48459. return nil, err
  48460. }
  48461. defer googleapi.CloseBody(res)
  48462. if err := googleapi.CheckResponse(res); err != nil {
  48463. return nil, err
  48464. }
  48465. ret := &Operation{
  48466. ServerResponse: googleapi.ServerResponse{
  48467. Header: res.Header,
  48468. HTTPStatusCode: res.StatusCode,
  48469. },
  48470. }
  48471. target := &ret
  48472. if err := gensupport.DecodeResponse(target, res); err != nil {
  48473. return nil, err
  48474. }
  48475. return ret, nil
  48476. // {
  48477. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  48478. // "httpMethod": "GET",
  48479. // "id": "compute.globalOperations.get",
  48480. // "parameterOrder": [
  48481. // "project",
  48482. // "operation"
  48483. // ],
  48484. // "parameters": {
  48485. // "operation": {
  48486. // "description": "Name of the Operations resource to return.",
  48487. // "location": "path",
  48488. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48489. // "required": true,
  48490. // "type": "string"
  48491. // },
  48492. // "project": {
  48493. // "description": "Project ID for this request.",
  48494. // "location": "path",
  48495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48496. // "required": true,
  48497. // "type": "string"
  48498. // }
  48499. // },
  48500. // "path": "{project}/global/operations/{operation}",
  48501. // "response": {
  48502. // "$ref": "Operation"
  48503. // },
  48504. // "scopes": [
  48505. // "https://www.googleapis.com/auth/cloud-platform",
  48506. // "https://www.googleapis.com/auth/compute",
  48507. // "https://www.googleapis.com/auth/compute.readonly"
  48508. // ]
  48509. // }
  48510. }
  48511. // method id "compute.globalOperations.list":
  48512. type GlobalOperationsListCall struct {
  48513. s *Service
  48514. project string
  48515. urlParams_ gensupport.URLParams
  48516. ifNoneMatch_ string
  48517. ctx_ context.Context
  48518. header_ http.Header
  48519. }
  48520. // List: Retrieves a list of Operation resources contained within the
  48521. // specified project.
  48522. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  48523. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  48524. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48525. c.project = project
  48526. return c
  48527. }
  48528. // Filter sets the optional parameter "filter": A filter expression that
  48529. // filters resources listed in the response. The expression must specify
  48530. // the field name, a comparison operator, and the value that you want to
  48531. // use for filtering. The value must be a string, a number, or a
  48532. // boolean. The comparison operator must be either =, !=, >, or <.
  48533. //
  48534. // For example, if you are filtering Compute Engine instances, you can
  48535. // exclude instances named example-instance by specifying name !=
  48536. // example-instance.
  48537. //
  48538. // You can also filter nested fields. For example, you could specify
  48539. // scheduling.automaticRestart = false to include instances only if they
  48540. // are not scheduled for automatic restarts. You can use filtering on
  48541. // nested fields to filter based on resource labels.
  48542. //
  48543. // To filter on multiple expressions, provide each separate expression
  48544. // within parentheses. For example, (scheduling.automaticRestart = true)
  48545. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48546. // AND expression. However, you can include AND and OR expressions
  48547. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48548. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48549. // true).
  48550. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  48551. c.urlParams_.Set("filter", filter)
  48552. return c
  48553. }
  48554. // MaxResults sets the optional parameter "maxResults": The maximum
  48555. // number of results per page that should be returned. If the number of
  48556. // available results is larger than maxResults, Compute Engine returns a
  48557. // nextPageToken that can be used to get the next page of results in
  48558. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48559. // (Default: 500)
  48560. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  48561. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48562. return c
  48563. }
  48564. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48565. // a certain order. By default, results are returned in alphanumerical
  48566. // order based on the resource name.
  48567. //
  48568. // You can also sort results in descending order based on the creation
  48569. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48570. // based on the creationTimestamp field in reverse chronological order
  48571. // (newest result first). Use this to sort resources like operations so
  48572. // that the newest operation is returned first.
  48573. //
  48574. // Currently, only sorting by name or creationTimestamp desc is
  48575. // supported.
  48576. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  48577. c.urlParams_.Set("orderBy", orderBy)
  48578. return c
  48579. }
  48580. // PageToken sets the optional parameter "pageToken": Specifies a page
  48581. // token to use. Set pageToken to the nextPageToken returned by a
  48582. // previous list request to get the next page of results.
  48583. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  48584. c.urlParams_.Set("pageToken", pageToken)
  48585. return c
  48586. }
  48587. // Fields allows partial responses to be retrieved. See
  48588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48589. // for more information.
  48590. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  48591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48592. return c
  48593. }
  48594. // IfNoneMatch sets the optional parameter which makes the operation
  48595. // fail if the object's ETag matches the given value. This is useful for
  48596. // getting updates only after the object has changed since the last
  48597. // request. Use googleapi.IsNotModified to check whether the response
  48598. // error from Do is the result of In-None-Match.
  48599. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  48600. c.ifNoneMatch_ = entityTag
  48601. return c
  48602. }
  48603. // Context sets the context to be used in this call's Do method. Any
  48604. // pending HTTP request will be aborted if the provided context is
  48605. // canceled.
  48606. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  48607. c.ctx_ = ctx
  48608. return c
  48609. }
  48610. // Header returns an http.Header that can be modified by the caller to
  48611. // add HTTP headers to the request.
  48612. func (c *GlobalOperationsListCall) Header() http.Header {
  48613. if c.header_ == nil {
  48614. c.header_ = make(http.Header)
  48615. }
  48616. return c.header_
  48617. }
  48618. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  48619. reqHeaders := make(http.Header)
  48620. for k, v := range c.header_ {
  48621. reqHeaders[k] = v
  48622. }
  48623. reqHeaders.Set("User-Agent", c.s.userAgent())
  48624. if c.ifNoneMatch_ != "" {
  48625. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48626. }
  48627. var body io.Reader = nil
  48628. c.urlParams_.Set("alt", alt)
  48629. c.urlParams_.Set("prettyPrint", "false")
  48630. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  48631. urls += "?" + c.urlParams_.Encode()
  48632. req, err := http.NewRequest("GET", urls, body)
  48633. if err != nil {
  48634. return nil, err
  48635. }
  48636. req.Header = reqHeaders
  48637. googleapi.Expand(req.URL, map[string]string{
  48638. "project": c.project,
  48639. })
  48640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48641. }
  48642. // Do executes the "compute.globalOperations.list" call.
  48643. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  48644. // status code is an error. Response headers are in either
  48645. // *OperationList.ServerResponse.Header or (if a response was returned
  48646. // at all) in error.(*googleapi.Error).Header. Use
  48647. // googleapi.IsNotModified to check whether the returned error was
  48648. // because http.StatusNotModified was returned.
  48649. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  48650. gensupport.SetOptions(c.urlParams_, opts...)
  48651. res, err := c.doRequest("json")
  48652. if res != nil && res.StatusCode == http.StatusNotModified {
  48653. if res.Body != nil {
  48654. res.Body.Close()
  48655. }
  48656. return nil, &googleapi.Error{
  48657. Code: res.StatusCode,
  48658. Header: res.Header,
  48659. }
  48660. }
  48661. if err != nil {
  48662. return nil, err
  48663. }
  48664. defer googleapi.CloseBody(res)
  48665. if err := googleapi.CheckResponse(res); err != nil {
  48666. return nil, err
  48667. }
  48668. ret := &OperationList{
  48669. ServerResponse: googleapi.ServerResponse{
  48670. Header: res.Header,
  48671. HTTPStatusCode: res.StatusCode,
  48672. },
  48673. }
  48674. target := &ret
  48675. if err := gensupport.DecodeResponse(target, res); err != nil {
  48676. return nil, err
  48677. }
  48678. return ret, nil
  48679. // {
  48680. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  48681. // "httpMethod": "GET",
  48682. // "id": "compute.globalOperations.list",
  48683. // "parameterOrder": [
  48684. // "project"
  48685. // ],
  48686. // "parameters": {
  48687. // "filter": {
  48688. // "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).",
  48689. // "location": "query",
  48690. // "type": "string"
  48691. // },
  48692. // "maxResults": {
  48693. // "default": "500",
  48694. // "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)",
  48695. // "format": "uint32",
  48696. // "location": "query",
  48697. // "minimum": "0",
  48698. // "type": "integer"
  48699. // },
  48700. // "orderBy": {
  48701. // "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.",
  48702. // "location": "query",
  48703. // "type": "string"
  48704. // },
  48705. // "pageToken": {
  48706. // "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.",
  48707. // "location": "query",
  48708. // "type": "string"
  48709. // },
  48710. // "project": {
  48711. // "description": "Project ID for this request.",
  48712. // "location": "path",
  48713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48714. // "required": true,
  48715. // "type": "string"
  48716. // }
  48717. // },
  48718. // "path": "{project}/global/operations",
  48719. // "response": {
  48720. // "$ref": "OperationList"
  48721. // },
  48722. // "scopes": [
  48723. // "https://www.googleapis.com/auth/cloud-platform",
  48724. // "https://www.googleapis.com/auth/compute",
  48725. // "https://www.googleapis.com/auth/compute.readonly"
  48726. // ]
  48727. // }
  48728. }
  48729. // Pages invokes f for each page of results.
  48730. // A non-nil error returned from f will halt the iteration.
  48731. // The provided context supersedes any context provided to the Context method.
  48732. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  48733. c.ctx_ = ctx
  48734. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48735. for {
  48736. x, err := c.Do()
  48737. if err != nil {
  48738. return err
  48739. }
  48740. if err := f(x); err != nil {
  48741. return err
  48742. }
  48743. if x.NextPageToken == "" {
  48744. return nil
  48745. }
  48746. c.PageToken(x.NextPageToken)
  48747. }
  48748. }
  48749. // method id "compute.healthChecks.delete":
  48750. type HealthChecksDeleteCall struct {
  48751. s *Service
  48752. project string
  48753. healthCheck string
  48754. urlParams_ gensupport.URLParams
  48755. ctx_ context.Context
  48756. header_ http.Header
  48757. }
  48758. // Delete: Deletes the specified HealthCheck resource.
  48759. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  48760. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48761. c.project = project
  48762. c.healthCheck = healthCheck
  48763. return c
  48764. }
  48765. // RequestId sets the optional parameter "requestId": An optional
  48766. // request ID to identify requests. Specify a unique request ID so that
  48767. // if you must retry your request, the server will know to ignore the
  48768. // request if it has already been completed.
  48769. //
  48770. // For example, consider a situation where you make an initial request
  48771. // and the request times out. If you make the request again with the
  48772. // same request ID, the server can check if original operation with the
  48773. // same request ID was received, and if so, will ignore the second
  48774. // request. This prevents clients from accidentally creating duplicate
  48775. // commitments.
  48776. //
  48777. // The request ID must be a valid UUID with the exception that zero UUID
  48778. // is not supported (00000000-0000-0000-0000-000000000000).
  48779. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  48780. c.urlParams_.Set("requestId", requestId)
  48781. return c
  48782. }
  48783. // Fields allows partial responses to be retrieved. See
  48784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48785. // for more information.
  48786. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  48787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48788. return c
  48789. }
  48790. // Context sets the context to be used in this call's Do method. Any
  48791. // pending HTTP request will be aborted if the provided context is
  48792. // canceled.
  48793. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  48794. c.ctx_ = ctx
  48795. return c
  48796. }
  48797. // Header returns an http.Header that can be modified by the caller to
  48798. // add HTTP headers to the request.
  48799. func (c *HealthChecksDeleteCall) Header() http.Header {
  48800. if c.header_ == nil {
  48801. c.header_ = make(http.Header)
  48802. }
  48803. return c.header_
  48804. }
  48805. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  48806. reqHeaders := make(http.Header)
  48807. for k, v := range c.header_ {
  48808. reqHeaders[k] = v
  48809. }
  48810. reqHeaders.Set("User-Agent", c.s.userAgent())
  48811. var body io.Reader = nil
  48812. c.urlParams_.Set("alt", alt)
  48813. c.urlParams_.Set("prettyPrint", "false")
  48814. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  48815. urls += "?" + c.urlParams_.Encode()
  48816. req, err := http.NewRequest("DELETE", urls, body)
  48817. if err != nil {
  48818. return nil, err
  48819. }
  48820. req.Header = reqHeaders
  48821. googleapi.Expand(req.URL, map[string]string{
  48822. "project": c.project,
  48823. "healthCheck": c.healthCheck,
  48824. })
  48825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48826. }
  48827. // Do executes the "compute.healthChecks.delete" call.
  48828. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48829. // status code is an error. Response headers are in either
  48830. // *Operation.ServerResponse.Header or (if a response was returned at
  48831. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48832. // to check whether the returned error was because
  48833. // http.StatusNotModified was returned.
  48834. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48835. gensupport.SetOptions(c.urlParams_, opts...)
  48836. res, err := c.doRequest("json")
  48837. if res != nil && res.StatusCode == http.StatusNotModified {
  48838. if res.Body != nil {
  48839. res.Body.Close()
  48840. }
  48841. return nil, &googleapi.Error{
  48842. Code: res.StatusCode,
  48843. Header: res.Header,
  48844. }
  48845. }
  48846. if err != nil {
  48847. return nil, err
  48848. }
  48849. defer googleapi.CloseBody(res)
  48850. if err := googleapi.CheckResponse(res); err != nil {
  48851. return nil, err
  48852. }
  48853. ret := &Operation{
  48854. ServerResponse: googleapi.ServerResponse{
  48855. Header: res.Header,
  48856. HTTPStatusCode: res.StatusCode,
  48857. },
  48858. }
  48859. target := &ret
  48860. if err := gensupport.DecodeResponse(target, res); err != nil {
  48861. return nil, err
  48862. }
  48863. return ret, nil
  48864. // {
  48865. // "description": "Deletes the specified HealthCheck resource.",
  48866. // "httpMethod": "DELETE",
  48867. // "id": "compute.healthChecks.delete",
  48868. // "parameterOrder": [
  48869. // "project",
  48870. // "healthCheck"
  48871. // ],
  48872. // "parameters": {
  48873. // "healthCheck": {
  48874. // "description": "Name of the HealthCheck resource to delete.",
  48875. // "location": "path",
  48876. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48877. // "required": true,
  48878. // "type": "string"
  48879. // },
  48880. // "project": {
  48881. // "description": "Project ID for this request.",
  48882. // "location": "path",
  48883. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48884. // "required": true,
  48885. // "type": "string"
  48886. // },
  48887. // "requestId": {
  48888. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48889. // "location": "query",
  48890. // "type": "string"
  48891. // }
  48892. // },
  48893. // "path": "{project}/global/healthChecks/{healthCheck}",
  48894. // "response": {
  48895. // "$ref": "Operation"
  48896. // },
  48897. // "scopes": [
  48898. // "https://www.googleapis.com/auth/cloud-platform",
  48899. // "https://www.googleapis.com/auth/compute"
  48900. // ]
  48901. // }
  48902. }
  48903. // method id "compute.healthChecks.get":
  48904. type HealthChecksGetCall struct {
  48905. s *Service
  48906. project string
  48907. healthCheck string
  48908. urlParams_ gensupport.URLParams
  48909. ifNoneMatch_ string
  48910. ctx_ context.Context
  48911. header_ http.Header
  48912. }
  48913. // Get: Returns the specified HealthCheck resource. Gets a list of
  48914. // available health checks by making a list() request.
  48915. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  48916. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48917. c.project = project
  48918. c.healthCheck = healthCheck
  48919. return c
  48920. }
  48921. // Fields allows partial responses to be retrieved. See
  48922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48923. // for more information.
  48924. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  48925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48926. return c
  48927. }
  48928. // IfNoneMatch sets the optional parameter which makes the operation
  48929. // fail if the object's ETag matches the given value. This is useful for
  48930. // getting updates only after the object has changed since the last
  48931. // request. Use googleapi.IsNotModified to check whether the response
  48932. // error from Do is the result of In-None-Match.
  48933. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  48934. c.ifNoneMatch_ = entityTag
  48935. return c
  48936. }
  48937. // Context sets the context to be used in this call's Do method. Any
  48938. // pending HTTP request will be aborted if the provided context is
  48939. // canceled.
  48940. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  48941. c.ctx_ = ctx
  48942. return c
  48943. }
  48944. // Header returns an http.Header that can be modified by the caller to
  48945. // add HTTP headers to the request.
  48946. func (c *HealthChecksGetCall) Header() http.Header {
  48947. if c.header_ == nil {
  48948. c.header_ = make(http.Header)
  48949. }
  48950. return c.header_
  48951. }
  48952. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  48953. reqHeaders := make(http.Header)
  48954. for k, v := range c.header_ {
  48955. reqHeaders[k] = v
  48956. }
  48957. reqHeaders.Set("User-Agent", c.s.userAgent())
  48958. if c.ifNoneMatch_ != "" {
  48959. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48960. }
  48961. var body io.Reader = nil
  48962. c.urlParams_.Set("alt", alt)
  48963. c.urlParams_.Set("prettyPrint", "false")
  48964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  48965. urls += "?" + c.urlParams_.Encode()
  48966. req, err := http.NewRequest("GET", urls, body)
  48967. if err != nil {
  48968. return nil, err
  48969. }
  48970. req.Header = reqHeaders
  48971. googleapi.Expand(req.URL, map[string]string{
  48972. "project": c.project,
  48973. "healthCheck": c.healthCheck,
  48974. })
  48975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48976. }
  48977. // Do executes the "compute.healthChecks.get" call.
  48978. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  48979. // status code is an error. Response headers are in either
  48980. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  48981. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48982. // to check whether the returned error was because
  48983. // http.StatusNotModified was returned.
  48984. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  48985. gensupport.SetOptions(c.urlParams_, opts...)
  48986. res, err := c.doRequest("json")
  48987. if res != nil && res.StatusCode == http.StatusNotModified {
  48988. if res.Body != nil {
  48989. res.Body.Close()
  48990. }
  48991. return nil, &googleapi.Error{
  48992. Code: res.StatusCode,
  48993. Header: res.Header,
  48994. }
  48995. }
  48996. if err != nil {
  48997. return nil, err
  48998. }
  48999. defer googleapi.CloseBody(res)
  49000. if err := googleapi.CheckResponse(res); err != nil {
  49001. return nil, err
  49002. }
  49003. ret := &HealthCheck{
  49004. ServerResponse: googleapi.ServerResponse{
  49005. Header: res.Header,
  49006. HTTPStatusCode: res.StatusCode,
  49007. },
  49008. }
  49009. target := &ret
  49010. if err := gensupport.DecodeResponse(target, res); err != nil {
  49011. return nil, err
  49012. }
  49013. return ret, nil
  49014. // {
  49015. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  49016. // "httpMethod": "GET",
  49017. // "id": "compute.healthChecks.get",
  49018. // "parameterOrder": [
  49019. // "project",
  49020. // "healthCheck"
  49021. // ],
  49022. // "parameters": {
  49023. // "healthCheck": {
  49024. // "description": "Name of the HealthCheck resource to return.",
  49025. // "location": "path",
  49026. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49027. // "required": true,
  49028. // "type": "string"
  49029. // },
  49030. // "project": {
  49031. // "description": "Project ID for this request.",
  49032. // "location": "path",
  49033. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49034. // "required": true,
  49035. // "type": "string"
  49036. // }
  49037. // },
  49038. // "path": "{project}/global/healthChecks/{healthCheck}",
  49039. // "response": {
  49040. // "$ref": "HealthCheck"
  49041. // },
  49042. // "scopes": [
  49043. // "https://www.googleapis.com/auth/cloud-platform",
  49044. // "https://www.googleapis.com/auth/compute",
  49045. // "https://www.googleapis.com/auth/compute.readonly"
  49046. // ]
  49047. // }
  49048. }
  49049. // method id "compute.healthChecks.insert":
  49050. type HealthChecksInsertCall struct {
  49051. s *Service
  49052. project string
  49053. healthcheck *HealthCheck
  49054. urlParams_ gensupport.URLParams
  49055. ctx_ context.Context
  49056. header_ http.Header
  49057. }
  49058. // Insert: Creates a HealthCheck resource in the specified project using
  49059. // the data included in the request.
  49060. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  49061. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49062. c.project = project
  49063. c.healthcheck = healthcheck
  49064. return c
  49065. }
  49066. // RequestId sets the optional parameter "requestId": An optional
  49067. // request ID to identify requests. Specify a unique request ID so that
  49068. // if you must retry your request, the server will know to ignore the
  49069. // request if it has already been completed.
  49070. //
  49071. // For example, consider a situation where you make an initial request
  49072. // and the request times out. If you make the request again with the
  49073. // same request ID, the server can check if original operation with the
  49074. // same request ID was received, and if so, will ignore the second
  49075. // request. This prevents clients from accidentally creating duplicate
  49076. // commitments.
  49077. //
  49078. // The request ID must be a valid UUID with the exception that zero UUID
  49079. // is not supported (00000000-0000-0000-0000-000000000000).
  49080. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  49081. c.urlParams_.Set("requestId", requestId)
  49082. return c
  49083. }
  49084. // Fields allows partial responses to be retrieved. See
  49085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49086. // for more information.
  49087. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  49088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49089. return c
  49090. }
  49091. // Context sets the context to be used in this call's Do method. Any
  49092. // pending HTTP request will be aborted if the provided context is
  49093. // canceled.
  49094. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  49095. c.ctx_ = ctx
  49096. return c
  49097. }
  49098. // Header returns an http.Header that can be modified by the caller to
  49099. // add HTTP headers to the request.
  49100. func (c *HealthChecksInsertCall) Header() http.Header {
  49101. if c.header_ == nil {
  49102. c.header_ = make(http.Header)
  49103. }
  49104. return c.header_
  49105. }
  49106. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  49107. reqHeaders := make(http.Header)
  49108. for k, v := range c.header_ {
  49109. reqHeaders[k] = v
  49110. }
  49111. reqHeaders.Set("User-Agent", c.s.userAgent())
  49112. var body io.Reader = nil
  49113. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  49114. if err != nil {
  49115. return nil, err
  49116. }
  49117. reqHeaders.Set("Content-Type", "application/json")
  49118. c.urlParams_.Set("alt", alt)
  49119. c.urlParams_.Set("prettyPrint", "false")
  49120. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  49121. urls += "?" + c.urlParams_.Encode()
  49122. req, err := http.NewRequest("POST", urls, body)
  49123. if err != nil {
  49124. return nil, err
  49125. }
  49126. req.Header = reqHeaders
  49127. googleapi.Expand(req.URL, map[string]string{
  49128. "project": c.project,
  49129. })
  49130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49131. }
  49132. // Do executes the "compute.healthChecks.insert" call.
  49133. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49134. // status code is an error. Response headers are in either
  49135. // *Operation.ServerResponse.Header or (if a response was returned at
  49136. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49137. // to check whether the returned error was because
  49138. // http.StatusNotModified was returned.
  49139. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49140. gensupport.SetOptions(c.urlParams_, opts...)
  49141. res, err := c.doRequest("json")
  49142. if res != nil && res.StatusCode == http.StatusNotModified {
  49143. if res.Body != nil {
  49144. res.Body.Close()
  49145. }
  49146. return nil, &googleapi.Error{
  49147. Code: res.StatusCode,
  49148. Header: res.Header,
  49149. }
  49150. }
  49151. if err != nil {
  49152. return nil, err
  49153. }
  49154. defer googleapi.CloseBody(res)
  49155. if err := googleapi.CheckResponse(res); err != nil {
  49156. return nil, err
  49157. }
  49158. ret := &Operation{
  49159. ServerResponse: googleapi.ServerResponse{
  49160. Header: res.Header,
  49161. HTTPStatusCode: res.StatusCode,
  49162. },
  49163. }
  49164. target := &ret
  49165. if err := gensupport.DecodeResponse(target, res); err != nil {
  49166. return nil, err
  49167. }
  49168. return ret, nil
  49169. // {
  49170. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  49171. // "httpMethod": "POST",
  49172. // "id": "compute.healthChecks.insert",
  49173. // "parameterOrder": [
  49174. // "project"
  49175. // ],
  49176. // "parameters": {
  49177. // "project": {
  49178. // "description": "Project ID for this request.",
  49179. // "location": "path",
  49180. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49181. // "required": true,
  49182. // "type": "string"
  49183. // },
  49184. // "requestId": {
  49185. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49186. // "location": "query",
  49187. // "type": "string"
  49188. // }
  49189. // },
  49190. // "path": "{project}/global/healthChecks",
  49191. // "request": {
  49192. // "$ref": "HealthCheck"
  49193. // },
  49194. // "response": {
  49195. // "$ref": "Operation"
  49196. // },
  49197. // "scopes": [
  49198. // "https://www.googleapis.com/auth/cloud-platform",
  49199. // "https://www.googleapis.com/auth/compute"
  49200. // ]
  49201. // }
  49202. }
  49203. // method id "compute.healthChecks.list":
  49204. type HealthChecksListCall struct {
  49205. s *Service
  49206. project string
  49207. urlParams_ gensupport.URLParams
  49208. ifNoneMatch_ string
  49209. ctx_ context.Context
  49210. header_ http.Header
  49211. }
  49212. // List: Retrieves the list of HealthCheck resources available to the
  49213. // specified project.
  49214. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  49215. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49216. c.project = project
  49217. return c
  49218. }
  49219. // Filter sets the optional parameter "filter": A filter expression that
  49220. // filters resources listed in the response. The expression must specify
  49221. // the field name, a comparison operator, and the value that you want to
  49222. // use for filtering. The value must be a string, a number, or a
  49223. // boolean. The comparison operator must be either =, !=, >, or <.
  49224. //
  49225. // For example, if you are filtering Compute Engine instances, you can
  49226. // exclude instances named example-instance by specifying name !=
  49227. // example-instance.
  49228. //
  49229. // You can also filter nested fields. For example, you could specify
  49230. // scheduling.automaticRestart = false to include instances only if they
  49231. // are not scheduled for automatic restarts. You can use filtering on
  49232. // nested fields to filter based on resource labels.
  49233. //
  49234. // To filter on multiple expressions, provide each separate expression
  49235. // within parentheses. For example, (scheduling.automaticRestart = true)
  49236. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  49237. // AND expression. However, you can include AND and OR expressions
  49238. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  49239. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  49240. // true).
  49241. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  49242. c.urlParams_.Set("filter", filter)
  49243. return c
  49244. }
  49245. // MaxResults sets the optional parameter "maxResults": The maximum
  49246. // number of results per page that should be returned. If the number of
  49247. // available results is larger than maxResults, Compute Engine returns a
  49248. // nextPageToken that can be used to get the next page of results in
  49249. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49250. // (Default: 500)
  49251. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  49252. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49253. return c
  49254. }
  49255. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49256. // a certain order. By default, results are returned in alphanumerical
  49257. // order based on the resource name.
  49258. //
  49259. // You can also sort results in descending order based on the creation
  49260. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49261. // based on the creationTimestamp field in reverse chronological order
  49262. // (newest result first). Use this to sort resources like operations so
  49263. // that the newest operation is returned first.
  49264. //
  49265. // Currently, only sorting by name or creationTimestamp desc is
  49266. // supported.
  49267. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  49268. c.urlParams_.Set("orderBy", orderBy)
  49269. return c
  49270. }
  49271. // PageToken sets the optional parameter "pageToken": Specifies a page
  49272. // token to use. Set pageToken to the nextPageToken returned by a
  49273. // previous list request to get the next page of results.
  49274. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  49275. c.urlParams_.Set("pageToken", pageToken)
  49276. return c
  49277. }
  49278. // Fields allows partial responses to be retrieved. See
  49279. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49280. // for more information.
  49281. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  49282. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49283. return c
  49284. }
  49285. // IfNoneMatch sets the optional parameter which makes the operation
  49286. // fail if the object's ETag matches the given value. This is useful for
  49287. // getting updates only after the object has changed since the last
  49288. // request. Use googleapi.IsNotModified to check whether the response
  49289. // error from Do is the result of In-None-Match.
  49290. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  49291. c.ifNoneMatch_ = entityTag
  49292. return c
  49293. }
  49294. // Context sets the context to be used in this call's Do method. Any
  49295. // pending HTTP request will be aborted if the provided context is
  49296. // canceled.
  49297. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  49298. c.ctx_ = ctx
  49299. return c
  49300. }
  49301. // Header returns an http.Header that can be modified by the caller to
  49302. // add HTTP headers to the request.
  49303. func (c *HealthChecksListCall) Header() http.Header {
  49304. if c.header_ == nil {
  49305. c.header_ = make(http.Header)
  49306. }
  49307. return c.header_
  49308. }
  49309. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  49310. reqHeaders := make(http.Header)
  49311. for k, v := range c.header_ {
  49312. reqHeaders[k] = v
  49313. }
  49314. reqHeaders.Set("User-Agent", c.s.userAgent())
  49315. if c.ifNoneMatch_ != "" {
  49316. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49317. }
  49318. var body io.Reader = nil
  49319. c.urlParams_.Set("alt", alt)
  49320. c.urlParams_.Set("prettyPrint", "false")
  49321. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  49322. urls += "?" + c.urlParams_.Encode()
  49323. req, err := http.NewRequest("GET", urls, body)
  49324. if err != nil {
  49325. return nil, err
  49326. }
  49327. req.Header = reqHeaders
  49328. googleapi.Expand(req.URL, map[string]string{
  49329. "project": c.project,
  49330. })
  49331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49332. }
  49333. // Do executes the "compute.healthChecks.list" call.
  49334. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  49335. // status code is an error. Response headers are in either
  49336. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  49337. // at all) in error.(*googleapi.Error).Header. Use
  49338. // googleapi.IsNotModified to check whether the returned error was
  49339. // because http.StatusNotModified was returned.
  49340. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  49341. gensupport.SetOptions(c.urlParams_, opts...)
  49342. res, err := c.doRequest("json")
  49343. if res != nil && res.StatusCode == http.StatusNotModified {
  49344. if res.Body != nil {
  49345. res.Body.Close()
  49346. }
  49347. return nil, &googleapi.Error{
  49348. Code: res.StatusCode,
  49349. Header: res.Header,
  49350. }
  49351. }
  49352. if err != nil {
  49353. return nil, err
  49354. }
  49355. defer googleapi.CloseBody(res)
  49356. if err := googleapi.CheckResponse(res); err != nil {
  49357. return nil, err
  49358. }
  49359. ret := &HealthCheckList{
  49360. ServerResponse: googleapi.ServerResponse{
  49361. Header: res.Header,
  49362. HTTPStatusCode: res.StatusCode,
  49363. },
  49364. }
  49365. target := &ret
  49366. if err := gensupport.DecodeResponse(target, res); err != nil {
  49367. return nil, err
  49368. }
  49369. return ret, nil
  49370. // {
  49371. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  49372. // "httpMethod": "GET",
  49373. // "id": "compute.healthChecks.list",
  49374. // "parameterOrder": [
  49375. // "project"
  49376. // ],
  49377. // "parameters": {
  49378. // "filter": {
  49379. // "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).",
  49380. // "location": "query",
  49381. // "type": "string"
  49382. // },
  49383. // "maxResults": {
  49384. // "default": "500",
  49385. // "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)",
  49386. // "format": "uint32",
  49387. // "location": "query",
  49388. // "minimum": "0",
  49389. // "type": "integer"
  49390. // },
  49391. // "orderBy": {
  49392. // "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.",
  49393. // "location": "query",
  49394. // "type": "string"
  49395. // },
  49396. // "pageToken": {
  49397. // "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.",
  49398. // "location": "query",
  49399. // "type": "string"
  49400. // },
  49401. // "project": {
  49402. // "description": "Project ID for this request.",
  49403. // "location": "path",
  49404. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49405. // "required": true,
  49406. // "type": "string"
  49407. // }
  49408. // },
  49409. // "path": "{project}/global/healthChecks",
  49410. // "response": {
  49411. // "$ref": "HealthCheckList"
  49412. // },
  49413. // "scopes": [
  49414. // "https://www.googleapis.com/auth/cloud-platform",
  49415. // "https://www.googleapis.com/auth/compute",
  49416. // "https://www.googleapis.com/auth/compute.readonly"
  49417. // ]
  49418. // }
  49419. }
  49420. // Pages invokes f for each page of results.
  49421. // A non-nil error returned from f will halt the iteration.
  49422. // The provided context supersedes any context provided to the Context method.
  49423. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  49424. c.ctx_ = ctx
  49425. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49426. for {
  49427. x, err := c.Do()
  49428. if err != nil {
  49429. return err
  49430. }
  49431. if err := f(x); err != nil {
  49432. return err
  49433. }
  49434. if x.NextPageToken == "" {
  49435. return nil
  49436. }
  49437. c.PageToken(x.NextPageToken)
  49438. }
  49439. }
  49440. // method id "compute.healthChecks.patch":
  49441. type HealthChecksPatchCall struct {
  49442. s *Service
  49443. project string
  49444. healthCheck string
  49445. healthcheck *HealthCheck
  49446. urlParams_ gensupport.URLParams
  49447. ctx_ context.Context
  49448. header_ http.Header
  49449. }
  49450. // Patch: Updates a HealthCheck resource in the specified project using
  49451. // the data included in the request. This method supports PATCH
  49452. // semantics and uses the JSON merge patch format and processing rules.
  49453. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  49454. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49455. c.project = project
  49456. c.healthCheck = healthCheck
  49457. c.healthcheck = healthcheck
  49458. return c
  49459. }
  49460. // RequestId sets the optional parameter "requestId": An optional
  49461. // request ID to identify requests. Specify a unique request ID so that
  49462. // if you must retry your request, the server will know to ignore the
  49463. // request if it has already been completed.
  49464. //
  49465. // For example, consider a situation where you make an initial request
  49466. // and the request times out. If you make the request again with the
  49467. // same request ID, the server can check if original operation with the
  49468. // same request ID was received, and if so, will ignore the second
  49469. // request. This prevents clients from accidentally creating duplicate
  49470. // commitments.
  49471. //
  49472. // The request ID must be a valid UUID with the exception that zero UUID
  49473. // is not supported (00000000-0000-0000-0000-000000000000).
  49474. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  49475. c.urlParams_.Set("requestId", requestId)
  49476. return c
  49477. }
  49478. // Fields allows partial responses to be retrieved. See
  49479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49480. // for more information.
  49481. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  49482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49483. return c
  49484. }
  49485. // Context sets the context to be used in this call's Do method. Any
  49486. // pending HTTP request will be aborted if the provided context is
  49487. // canceled.
  49488. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  49489. c.ctx_ = ctx
  49490. return c
  49491. }
  49492. // Header returns an http.Header that can be modified by the caller to
  49493. // add HTTP headers to the request.
  49494. func (c *HealthChecksPatchCall) Header() http.Header {
  49495. if c.header_ == nil {
  49496. c.header_ = make(http.Header)
  49497. }
  49498. return c.header_
  49499. }
  49500. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  49501. reqHeaders := make(http.Header)
  49502. for k, v := range c.header_ {
  49503. reqHeaders[k] = v
  49504. }
  49505. reqHeaders.Set("User-Agent", c.s.userAgent())
  49506. var body io.Reader = nil
  49507. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  49508. if err != nil {
  49509. return nil, err
  49510. }
  49511. reqHeaders.Set("Content-Type", "application/json")
  49512. c.urlParams_.Set("alt", alt)
  49513. c.urlParams_.Set("prettyPrint", "false")
  49514. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  49515. urls += "?" + c.urlParams_.Encode()
  49516. req, err := http.NewRequest("PATCH", urls, body)
  49517. if err != nil {
  49518. return nil, err
  49519. }
  49520. req.Header = reqHeaders
  49521. googleapi.Expand(req.URL, map[string]string{
  49522. "project": c.project,
  49523. "healthCheck": c.healthCheck,
  49524. })
  49525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49526. }
  49527. // Do executes the "compute.healthChecks.patch" call.
  49528. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49529. // status code is an error. Response headers are in either
  49530. // *Operation.ServerResponse.Header or (if a response was returned at
  49531. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49532. // to check whether the returned error was because
  49533. // http.StatusNotModified was returned.
  49534. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49535. gensupport.SetOptions(c.urlParams_, opts...)
  49536. res, err := c.doRequest("json")
  49537. if res != nil && res.StatusCode == http.StatusNotModified {
  49538. if res.Body != nil {
  49539. res.Body.Close()
  49540. }
  49541. return nil, &googleapi.Error{
  49542. Code: res.StatusCode,
  49543. Header: res.Header,
  49544. }
  49545. }
  49546. if err != nil {
  49547. return nil, err
  49548. }
  49549. defer googleapi.CloseBody(res)
  49550. if err := googleapi.CheckResponse(res); err != nil {
  49551. return nil, err
  49552. }
  49553. ret := &Operation{
  49554. ServerResponse: googleapi.ServerResponse{
  49555. Header: res.Header,
  49556. HTTPStatusCode: res.StatusCode,
  49557. },
  49558. }
  49559. target := &ret
  49560. if err := gensupport.DecodeResponse(target, res); err != nil {
  49561. return nil, err
  49562. }
  49563. return ret, nil
  49564. // {
  49565. // "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.",
  49566. // "httpMethod": "PATCH",
  49567. // "id": "compute.healthChecks.patch",
  49568. // "parameterOrder": [
  49569. // "project",
  49570. // "healthCheck"
  49571. // ],
  49572. // "parameters": {
  49573. // "healthCheck": {
  49574. // "description": "Name of the HealthCheck resource to patch.",
  49575. // "location": "path",
  49576. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49577. // "required": true,
  49578. // "type": "string"
  49579. // },
  49580. // "project": {
  49581. // "description": "Project ID for this request.",
  49582. // "location": "path",
  49583. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49584. // "required": true,
  49585. // "type": "string"
  49586. // },
  49587. // "requestId": {
  49588. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49589. // "location": "query",
  49590. // "type": "string"
  49591. // }
  49592. // },
  49593. // "path": "{project}/global/healthChecks/{healthCheck}",
  49594. // "request": {
  49595. // "$ref": "HealthCheck"
  49596. // },
  49597. // "response": {
  49598. // "$ref": "Operation"
  49599. // },
  49600. // "scopes": [
  49601. // "https://www.googleapis.com/auth/cloud-platform",
  49602. // "https://www.googleapis.com/auth/compute"
  49603. // ]
  49604. // }
  49605. }
  49606. // method id "compute.healthChecks.testIamPermissions":
  49607. type HealthChecksTestIamPermissionsCall struct {
  49608. s *Service
  49609. project string
  49610. resource string
  49611. testpermissionsrequest *TestPermissionsRequest
  49612. urlParams_ gensupport.URLParams
  49613. ctx_ context.Context
  49614. header_ http.Header
  49615. }
  49616. // TestIamPermissions: Returns permissions that a caller has on the
  49617. // specified resource.
  49618. func (r *HealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HealthChecksTestIamPermissionsCall {
  49619. c := &HealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49620. c.project = project
  49621. c.resource = resource
  49622. c.testpermissionsrequest = testpermissionsrequest
  49623. return c
  49624. }
  49625. // Fields allows partial responses to be retrieved. See
  49626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49627. // for more information.
  49628. func (c *HealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HealthChecksTestIamPermissionsCall {
  49629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49630. return c
  49631. }
  49632. // Context sets the context to be used in this call's Do method. Any
  49633. // pending HTTP request will be aborted if the provided context is
  49634. // canceled.
  49635. func (c *HealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HealthChecksTestIamPermissionsCall {
  49636. c.ctx_ = ctx
  49637. return c
  49638. }
  49639. // Header returns an http.Header that can be modified by the caller to
  49640. // add HTTP headers to the request.
  49641. func (c *HealthChecksTestIamPermissionsCall) Header() http.Header {
  49642. if c.header_ == nil {
  49643. c.header_ = make(http.Header)
  49644. }
  49645. return c.header_
  49646. }
  49647. func (c *HealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  49648. reqHeaders := make(http.Header)
  49649. for k, v := range c.header_ {
  49650. reqHeaders[k] = v
  49651. }
  49652. reqHeaders.Set("User-Agent", c.s.userAgent())
  49653. var body io.Reader = nil
  49654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  49655. if err != nil {
  49656. return nil, err
  49657. }
  49658. reqHeaders.Set("Content-Type", "application/json")
  49659. c.urlParams_.Set("alt", alt)
  49660. c.urlParams_.Set("prettyPrint", "false")
  49661. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{resource}/testIamPermissions")
  49662. urls += "?" + c.urlParams_.Encode()
  49663. req, err := http.NewRequest("POST", urls, body)
  49664. if err != nil {
  49665. return nil, err
  49666. }
  49667. req.Header = reqHeaders
  49668. googleapi.Expand(req.URL, map[string]string{
  49669. "project": c.project,
  49670. "resource": c.resource,
  49671. })
  49672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49673. }
  49674. // Do executes the "compute.healthChecks.testIamPermissions" call.
  49675. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  49676. // non-2xx status code is an error. Response headers are in either
  49677. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  49678. // returned at all) in error.(*googleapi.Error).Header. Use
  49679. // googleapi.IsNotModified to check whether the returned error was
  49680. // because http.StatusNotModified was returned.
  49681. func (c *HealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  49682. gensupport.SetOptions(c.urlParams_, opts...)
  49683. res, err := c.doRequest("json")
  49684. if res != nil && res.StatusCode == http.StatusNotModified {
  49685. if res.Body != nil {
  49686. res.Body.Close()
  49687. }
  49688. return nil, &googleapi.Error{
  49689. Code: res.StatusCode,
  49690. Header: res.Header,
  49691. }
  49692. }
  49693. if err != nil {
  49694. return nil, err
  49695. }
  49696. defer googleapi.CloseBody(res)
  49697. if err := googleapi.CheckResponse(res); err != nil {
  49698. return nil, err
  49699. }
  49700. ret := &TestPermissionsResponse{
  49701. ServerResponse: googleapi.ServerResponse{
  49702. Header: res.Header,
  49703. HTTPStatusCode: res.StatusCode,
  49704. },
  49705. }
  49706. target := &ret
  49707. if err := gensupport.DecodeResponse(target, res); err != nil {
  49708. return nil, err
  49709. }
  49710. return ret, nil
  49711. // {
  49712. // "description": "Returns permissions that a caller has on the specified resource.",
  49713. // "httpMethod": "POST",
  49714. // "id": "compute.healthChecks.testIamPermissions",
  49715. // "parameterOrder": [
  49716. // "project",
  49717. // "resource"
  49718. // ],
  49719. // "parameters": {
  49720. // "project": {
  49721. // "description": "Project ID for this request.",
  49722. // "location": "path",
  49723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49724. // "required": true,
  49725. // "type": "string"
  49726. // },
  49727. // "resource": {
  49728. // "description": "Name or id of the resource for this request.",
  49729. // "location": "path",
  49730. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49731. // "required": true,
  49732. // "type": "string"
  49733. // }
  49734. // },
  49735. // "path": "{project}/global/healthChecks/{resource}/testIamPermissions",
  49736. // "request": {
  49737. // "$ref": "TestPermissionsRequest"
  49738. // },
  49739. // "response": {
  49740. // "$ref": "TestPermissionsResponse"
  49741. // },
  49742. // "scopes": [
  49743. // "https://www.googleapis.com/auth/cloud-platform",
  49744. // "https://www.googleapis.com/auth/compute",
  49745. // "https://www.googleapis.com/auth/compute.readonly"
  49746. // ]
  49747. // }
  49748. }
  49749. // method id "compute.healthChecks.update":
  49750. type HealthChecksUpdateCall struct {
  49751. s *Service
  49752. project string
  49753. healthCheck string
  49754. healthcheck *HealthCheck
  49755. urlParams_ gensupport.URLParams
  49756. ctx_ context.Context
  49757. header_ http.Header
  49758. }
  49759. // Update: Updates a HealthCheck resource in the specified project using
  49760. // the data included in the request.
  49761. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  49762. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49763. c.project = project
  49764. c.healthCheck = healthCheck
  49765. c.healthcheck = healthcheck
  49766. return c
  49767. }
  49768. // RequestId sets the optional parameter "requestId": An optional
  49769. // request ID to identify requests. Specify a unique request ID so that
  49770. // if you must retry your request, the server will know to ignore the
  49771. // request if it has already been completed.
  49772. //
  49773. // For example, consider a situation where you make an initial request
  49774. // and the request times out. If you make the request again with the
  49775. // same request ID, the server can check if original operation with the
  49776. // same request ID was received, and if so, will ignore the second
  49777. // request. This prevents clients from accidentally creating duplicate
  49778. // commitments.
  49779. //
  49780. // The request ID must be a valid UUID with the exception that zero UUID
  49781. // is not supported (00000000-0000-0000-0000-000000000000).
  49782. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  49783. c.urlParams_.Set("requestId", requestId)
  49784. return c
  49785. }
  49786. // Fields allows partial responses to be retrieved. See
  49787. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49788. // for more information.
  49789. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  49790. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49791. return c
  49792. }
  49793. // Context sets the context to be used in this call's Do method. Any
  49794. // pending HTTP request will be aborted if the provided context is
  49795. // canceled.
  49796. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  49797. c.ctx_ = ctx
  49798. return c
  49799. }
  49800. // Header returns an http.Header that can be modified by the caller to
  49801. // add HTTP headers to the request.
  49802. func (c *HealthChecksUpdateCall) Header() http.Header {
  49803. if c.header_ == nil {
  49804. c.header_ = make(http.Header)
  49805. }
  49806. return c.header_
  49807. }
  49808. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  49809. reqHeaders := make(http.Header)
  49810. for k, v := range c.header_ {
  49811. reqHeaders[k] = v
  49812. }
  49813. reqHeaders.Set("User-Agent", c.s.userAgent())
  49814. var body io.Reader = nil
  49815. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  49816. if err != nil {
  49817. return nil, err
  49818. }
  49819. reqHeaders.Set("Content-Type", "application/json")
  49820. c.urlParams_.Set("alt", alt)
  49821. c.urlParams_.Set("prettyPrint", "false")
  49822. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  49823. urls += "?" + c.urlParams_.Encode()
  49824. req, err := http.NewRequest("PUT", urls, body)
  49825. if err != nil {
  49826. return nil, err
  49827. }
  49828. req.Header = reqHeaders
  49829. googleapi.Expand(req.URL, map[string]string{
  49830. "project": c.project,
  49831. "healthCheck": c.healthCheck,
  49832. })
  49833. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49834. }
  49835. // Do executes the "compute.healthChecks.update" call.
  49836. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49837. // status code is an error. Response headers are in either
  49838. // *Operation.ServerResponse.Header or (if a response was returned at
  49839. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49840. // to check whether the returned error was because
  49841. // http.StatusNotModified was returned.
  49842. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49843. gensupport.SetOptions(c.urlParams_, opts...)
  49844. res, err := c.doRequest("json")
  49845. if res != nil && res.StatusCode == http.StatusNotModified {
  49846. if res.Body != nil {
  49847. res.Body.Close()
  49848. }
  49849. return nil, &googleapi.Error{
  49850. Code: res.StatusCode,
  49851. Header: res.Header,
  49852. }
  49853. }
  49854. if err != nil {
  49855. return nil, err
  49856. }
  49857. defer googleapi.CloseBody(res)
  49858. if err := googleapi.CheckResponse(res); err != nil {
  49859. return nil, err
  49860. }
  49861. ret := &Operation{
  49862. ServerResponse: googleapi.ServerResponse{
  49863. Header: res.Header,
  49864. HTTPStatusCode: res.StatusCode,
  49865. },
  49866. }
  49867. target := &ret
  49868. if err := gensupport.DecodeResponse(target, res); err != nil {
  49869. return nil, err
  49870. }
  49871. return ret, nil
  49872. // {
  49873. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  49874. // "httpMethod": "PUT",
  49875. // "id": "compute.healthChecks.update",
  49876. // "parameterOrder": [
  49877. // "project",
  49878. // "healthCheck"
  49879. // ],
  49880. // "parameters": {
  49881. // "healthCheck": {
  49882. // "description": "Name of the HealthCheck resource to update.",
  49883. // "location": "path",
  49884. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49885. // "required": true,
  49886. // "type": "string"
  49887. // },
  49888. // "project": {
  49889. // "description": "Project ID for this request.",
  49890. // "location": "path",
  49891. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49892. // "required": true,
  49893. // "type": "string"
  49894. // },
  49895. // "requestId": {
  49896. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49897. // "location": "query",
  49898. // "type": "string"
  49899. // }
  49900. // },
  49901. // "path": "{project}/global/healthChecks/{healthCheck}",
  49902. // "request": {
  49903. // "$ref": "HealthCheck"
  49904. // },
  49905. // "response": {
  49906. // "$ref": "Operation"
  49907. // },
  49908. // "scopes": [
  49909. // "https://www.googleapis.com/auth/cloud-platform",
  49910. // "https://www.googleapis.com/auth/compute"
  49911. // ]
  49912. // }
  49913. }
  49914. // method id "compute.httpHealthChecks.delete":
  49915. type HttpHealthChecksDeleteCall struct {
  49916. s *Service
  49917. project string
  49918. httpHealthCheck string
  49919. urlParams_ gensupport.URLParams
  49920. ctx_ context.Context
  49921. header_ http.Header
  49922. }
  49923. // Delete: Deletes the specified HttpHealthCheck resource.
  49924. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  49925. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  49926. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49927. c.project = project
  49928. c.httpHealthCheck = httpHealthCheck
  49929. return c
  49930. }
  49931. // RequestId sets the optional parameter "requestId": An optional
  49932. // request ID to identify requests. Specify a unique request ID so that
  49933. // if you must retry your request, the server will know to ignore the
  49934. // request if it has already been completed.
  49935. //
  49936. // For example, consider a situation where you make an initial request
  49937. // and the request times out. If you make the request again with the
  49938. // same request ID, the server can check if original operation with the
  49939. // same request ID was received, and if so, will ignore the second
  49940. // request. This prevents clients from accidentally creating duplicate
  49941. // commitments.
  49942. //
  49943. // The request ID must be a valid UUID with the exception that zero UUID
  49944. // is not supported (00000000-0000-0000-0000-000000000000).
  49945. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  49946. c.urlParams_.Set("requestId", requestId)
  49947. return c
  49948. }
  49949. // Fields allows partial responses to be retrieved. See
  49950. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49951. // for more information.
  49952. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  49953. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49954. return c
  49955. }
  49956. // Context sets the context to be used in this call's Do method. Any
  49957. // pending HTTP request will be aborted if the provided context is
  49958. // canceled.
  49959. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  49960. c.ctx_ = ctx
  49961. return c
  49962. }
  49963. // Header returns an http.Header that can be modified by the caller to
  49964. // add HTTP headers to the request.
  49965. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  49966. if c.header_ == nil {
  49967. c.header_ = make(http.Header)
  49968. }
  49969. return c.header_
  49970. }
  49971. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  49972. reqHeaders := make(http.Header)
  49973. for k, v := range c.header_ {
  49974. reqHeaders[k] = v
  49975. }
  49976. reqHeaders.Set("User-Agent", c.s.userAgent())
  49977. var body io.Reader = nil
  49978. c.urlParams_.Set("alt", alt)
  49979. c.urlParams_.Set("prettyPrint", "false")
  49980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  49981. urls += "?" + c.urlParams_.Encode()
  49982. req, err := http.NewRequest("DELETE", urls, body)
  49983. if err != nil {
  49984. return nil, err
  49985. }
  49986. req.Header = reqHeaders
  49987. googleapi.Expand(req.URL, map[string]string{
  49988. "project": c.project,
  49989. "httpHealthCheck": c.httpHealthCheck,
  49990. })
  49991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49992. }
  49993. // Do executes the "compute.httpHealthChecks.delete" call.
  49994. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49995. // status code is an error. Response headers are in either
  49996. // *Operation.ServerResponse.Header or (if a response was returned at
  49997. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49998. // to check whether the returned error was because
  49999. // http.StatusNotModified was returned.
  50000. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50001. gensupport.SetOptions(c.urlParams_, opts...)
  50002. res, err := c.doRequest("json")
  50003. if res != nil && res.StatusCode == http.StatusNotModified {
  50004. if res.Body != nil {
  50005. res.Body.Close()
  50006. }
  50007. return nil, &googleapi.Error{
  50008. Code: res.StatusCode,
  50009. Header: res.Header,
  50010. }
  50011. }
  50012. if err != nil {
  50013. return nil, err
  50014. }
  50015. defer googleapi.CloseBody(res)
  50016. if err := googleapi.CheckResponse(res); err != nil {
  50017. return nil, err
  50018. }
  50019. ret := &Operation{
  50020. ServerResponse: googleapi.ServerResponse{
  50021. Header: res.Header,
  50022. HTTPStatusCode: res.StatusCode,
  50023. },
  50024. }
  50025. target := &ret
  50026. if err := gensupport.DecodeResponse(target, res); err != nil {
  50027. return nil, err
  50028. }
  50029. return ret, nil
  50030. // {
  50031. // "description": "Deletes the specified HttpHealthCheck resource.",
  50032. // "httpMethod": "DELETE",
  50033. // "id": "compute.httpHealthChecks.delete",
  50034. // "parameterOrder": [
  50035. // "project",
  50036. // "httpHealthCheck"
  50037. // ],
  50038. // "parameters": {
  50039. // "httpHealthCheck": {
  50040. // "description": "Name of the HttpHealthCheck resource to delete.",
  50041. // "location": "path",
  50042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50043. // "required": true,
  50044. // "type": "string"
  50045. // },
  50046. // "project": {
  50047. // "description": "Project ID for this request.",
  50048. // "location": "path",
  50049. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50050. // "required": true,
  50051. // "type": "string"
  50052. // },
  50053. // "requestId": {
  50054. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50055. // "location": "query",
  50056. // "type": "string"
  50057. // }
  50058. // },
  50059. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  50060. // "response": {
  50061. // "$ref": "Operation"
  50062. // },
  50063. // "scopes": [
  50064. // "https://www.googleapis.com/auth/cloud-platform",
  50065. // "https://www.googleapis.com/auth/compute"
  50066. // ]
  50067. // }
  50068. }
  50069. // method id "compute.httpHealthChecks.get":
  50070. type HttpHealthChecksGetCall struct {
  50071. s *Service
  50072. project string
  50073. httpHealthCheck string
  50074. urlParams_ gensupport.URLParams
  50075. ifNoneMatch_ string
  50076. ctx_ context.Context
  50077. header_ http.Header
  50078. }
  50079. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  50080. // available HTTP health checks by making a list() request.
  50081. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  50082. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  50083. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50084. c.project = project
  50085. c.httpHealthCheck = httpHealthCheck
  50086. return c
  50087. }
  50088. // Fields allows partial responses to be retrieved. See
  50089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50090. // for more information.
  50091. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  50092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50093. return c
  50094. }
  50095. // IfNoneMatch sets the optional parameter which makes the operation
  50096. // fail if the object's ETag matches the given value. This is useful for
  50097. // getting updates only after the object has changed since the last
  50098. // request. Use googleapi.IsNotModified to check whether the response
  50099. // error from Do is the result of In-None-Match.
  50100. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  50101. c.ifNoneMatch_ = entityTag
  50102. return c
  50103. }
  50104. // Context sets the context to be used in this call's Do method. Any
  50105. // pending HTTP request will be aborted if the provided context is
  50106. // canceled.
  50107. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  50108. c.ctx_ = ctx
  50109. return c
  50110. }
  50111. // Header returns an http.Header that can be modified by the caller to
  50112. // add HTTP headers to the request.
  50113. func (c *HttpHealthChecksGetCall) Header() http.Header {
  50114. if c.header_ == nil {
  50115. c.header_ = make(http.Header)
  50116. }
  50117. return c.header_
  50118. }
  50119. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  50120. reqHeaders := make(http.Header)
  50121. for k, v := range c.header_ {
  50122. reqHeaders[k] = v
  50123. }
  50124. reqHeaders.Set("User-Agent", c.s.userAgent())
  50125. if c.ifNoneMatch_ != "" {
  50126. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50127. }
  50128. var body io.Reader = nil
  50129. c.urlParams_.Set("alt", alt)
  50130. c.urlParams_.Set("prettyPrint", "false")
  50131. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  50132. urls += "?" + c.urlParams_.Encode()
  50133. req, err := http.NewRequest("GET", urls, body)
  50134. if err != nil {
  50135. return nil, err
  50136. }
  50137. req.Header = reqHeaders
  50138. googleapi.Expand(req.URL, map[string]string{
  50139. "project": c.project,
  50140. "httpHealthCheck": c.httpHealthCheck,
  50141. })
  50142. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50143. }
  50144. // Do executes the "compute.httpHealthChecks.get" call.
  50145. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  50146. // status code is an error. Response headers are in either
  50147. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  50148. // at all) in error.(*googleapi.Error).Header. Use
  50149. // googleapi.IsNotModified to check whether the returned error was
  50150. // because http.StatusNotModified was returned.
  50151. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  50152. gensupport.SetOptions(c.urlParams_, opts...)
  50153. res, err := c.doRequest("json")
  50154. if res != nil && res.StatusCode == http.StatusNotModified {
  50155. if res.Body != nil {
  50156. res.Body.Close()
  50157. }
  50158. return nil, &googleapi.Error{
  50159. Code: res.StatusCode,
  50160. Header: res.Header,
  50161. }
  50162. }
  50163. if err != nil {
  50164. return nil, err
  50165. }
  50166. defer googleapi.CloseBody(res)
  50167. if err := googleapi.CheckResponse(res); err != nil {
  50168. return nil, err
  50169. }
  50170. ret := &HttpHealthCheck{
  50171. ServerResponse: googleapi.ServerResponse{
  50172. Header: res.Header,
  50173. HTTPStatusCode: res.StatusCode,
  50174. },
  50175. }
  50176. target := &ret
  50177. if err := gensupport.DecodeResponse(target, res); err != nil {
  50178. return nil, err
  50179. }
  50180. return ret, nil
  50181. // {
  50182. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  50183. // "httpMethod": "GET",
  50184. // "id": "compute.httpHealthChecks.get",
  50185. // "parameterOrder": [
  50186. // "project",
  50187. // "httpHealthCheck"
  50188. // ],
  50189. // "parameters": {
  50190. // "httpHealthCheck": {
  50191. // "description": "Name of the HttpHealthCheck resource to return.",
  50192. // "location": "path",
  50193. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50194. // "required": true,
  50195. // "type": "string"
  50196. // },
  50197. // "project": {
  50198. // "description": "Project ID for this request.",
  50199. // "location": "path",
  50200. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50201. // "required": true,
  50202. // "type": "string"
  50203. // }
  50204. // },
  50205. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  50206. // "response": {
  50207. // "$ref": "HttpHealthCheck"
  50208. // },
  50209. // "scopes": [
  50210. // "https://www.googleapis.com/auth/cloud-platform",
  50211. // "https://www.googleapis.com/auth/compute",
  50212. // "https://www.googleapis.com/auth/compute.readonly"
  50213. // ]
  50214. // }
  50215. }
  50216. // method id "compute.httpHealthChecks.insert":
  50217. type HttpHealthChecksInsertCall struct {
  50218. s *Service
  50219. project string
  50220. httphealthcheck *HttpHealthCheck
  50221. urlParams_ gensupport.URLParams
  50222. ctx_ context.Context
  50223. header_ http.Header
  50224. }
  50225. // Insert: Creates a HttpHealthCheck resource in the specified project
  50226. // using the data included in the request.
  50227. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  50228. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  50229. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50230. c.project = project
  50231. c.httphealthcheck = httphealthcheck
  50232. return c
  50233. }
  50234. // RequestId sets the optional parameter "requestId": An optional
  50235. // request ID to identify requests. Specify a unique request ID so that
  50236. // if you must retry your request, the server will know to ignore the
  50237. // request if it has already been completed.
  50238. //
  50239. // For example, consider a situation where you make an initial request
  50240. // and the request times out. If you make the request again with the
  50241. // same request ID, the server can check if original operation with the
  50242. // same request ID was received, and if so, will ignore the second
  50243. // request. This prevents clients from accidentally creating duplicate
  50244. // commitments.
  50245. //
  50246. // The request ID must be a valid UUID with the exception that zero UUID
  50247. // is not supported (00000000-0000-0000-0000-000000000000).
  50248. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  50249. c.urlParams_.Set("requestId", requestId)
  50250. return c
  50251. }
  50252. // Fields allows partial responses to be retrieved. See
  50253. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50254. // for more information.
  50255. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  50256. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50257. return c
  50258. }
  50259. // Context sets the context to be used in this call's Do method. Any
  50260. // pending HTTP request will be aborted if the provided context is
  50261. // canceled.
  50262. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  50263. c.ctx_ = ctx
  50264. return c
  50265. }
  50266. // Header returns an http.Header that can be modified by the caller to
  50267. // add HTTP headers to the request.
  50268. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  50269. if c.header_ == nil {
  50270. c.header_ = make(http.Header)
  50271. }
  50272. return c.header_
  50273. }
  50274. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  50275. reqHeaders := make(http.Header)
  50276. for k, v := range c.header_ {
  50277. reqHeaders[k] = v
  50278. }
  50279. reqHeaders.Set("User-Agent", c.s.userAgent())
  50280. var body io.Reader = nil
  50281. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  50282. if err != nil {
  50283. return nil, err
  50284. }
  50285. reqHeaders.Set("Content-Type", "application/json")
  50286. c.urlParams_.Set("alt", alt)
  50287. c.urlParams_.Set("prettyPrint", "false")
  50288. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  50289. urls += "?" + c.urlParams_.Encode()
  50290. req, err := http.NewRequest("POST", urls, body)
  50291. if err != nil {
  50292. return nil, err
  50293. }
  50294. req.Header = reqHeaders
  50295. googleapi.Expand(req.URL, map[string]string{
  50296. "project": c.project,
  50297. })
  50298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50299. }
  50300. // Do executes the "compute.httpHealthChecks.insert" call.
  50301. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50302. // status code is an error. Response headers are in either
  50303. // *Operation.ServerResponse.Header or (if a response was returned at
  50304. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50305. // to check whether the returned error was because
  50306. // http.StatusNotModified was returned.
  50307. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50308. gensupport.SetOptions(c.urlParams_, opts...)
  50309. res, err := c.doRequest("json")
  50310. if res != nil && res.StatusCode == http.StatusNotModified {
  50311. if res.Body != nil {
  50312. res.Body.Close()
  50313. }
  50314. return nil, &googleapi.Error{
  50315. Code: res.StatusCode,
  50316. Header: res.Header,
  50317. }
  50318. }
  50319. if err != nil {
  50320. return nil, err
  50321. }
  50322. defer googleapi.CloseBody(res)
  50323. if err := googleapi.CheckResponse(res); err != nil {
  50324. return nil, err
  50325. }
  50326. ret := &Operation{
  50327. ServerResponse: googleapi.ServerResponse{
  50328. Header: res.Header,
  50329. HTTPStatusCode: res.StatusCode,
  50330. },
  50331. }
  50332. target := &ret
  50333. if err := gensupport.DecodeResponse(target, res); err != nil {
  50334. return nil, err
  50335. }
  50336. return ret, nil
  50337. // {
  50338. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  50339. // "httpMethod": "POST",
  50340. // "id": "compute.httpHealthChecks.insert",
  50341. // "parameterOrder": [
  50342. // "project"
  50343. // ],
  50344. // "parameters": {
  50345. // "project": {
  50346. // "description": "Project ID for this request.",
  50347. // "location": "path",
  50348. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50349. // "required": true,
  50350. // "type": "string"
  50351. // },
  50352. // "requestId": {
  50353. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50354. // "location": "query",
  50355. // "type": "string"
  50356. // }
  50357. // },
  50358. // "path": "{project}/global/httpHealthChecks",
  50359. // "request": {
  50360. // "$ref": "HttpHealthCheck"
  50361. // },
  50362. // "response": {
  50363. // "$ref": "Operation"
  50364. // },
  50365. // "scopes": [
  50366. // "https://www.googleapis.com/auth/cloud-platform",
  50367. // "https://www.googleapis.com/auth/compute"
  50368. // ]
  50369. // }
  50370. }
  50371. // method id "compute.httpHealthChecks.list":
  50372. type HttpHealthChecksListCall struct {
  50373. s *Service
  50374. project string
  50375. urlParams_ gensupport.URLParams
  50376. ifNoneMatch_ string
  50377. ctx_ context.Context
  50378. header_ http.Header
  50379. }
  50380. // List: Retrieves the list of HttpHealthCheck resources available to
  50381. // the specified project.
  50382. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  50383. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  50384. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50385. c.project = project
  50386. return c
  50387. }
  50388. // Filter sets the optional parameter "filter": A filter expression that
  50389. // filters resources listed in the response. The expression must specify
  50390. // the field name, a comparison operator, and the value that you want to
  50391. // use for filtering. The value must be a string, a number, or a
  50392. // boolean. The comparison operator must be either =, !=, >, or <.
  50393. //
  50394. // For example, if you are filtering Compute Engine instances, you can
  50395. // exclude instances named example-instance by specifying name !=
  50396. // example-instance.
  50397. //
  50398. // You can also filter nested fields. For example, you could specify
  50399. // scheduling.automaticRestart = false to include instances only if they
  50400. // are not scheduled for automatic restarts. You can use filtering on
  50401. // nested fields to filter based on resource labels.
  50402. //
  50403. // To filter on multiple expressions, provide each separate expression
  50404. // within parentheses. For example, (scheduling.automaticRestart = true)
  50405. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50406. // AND expression. However, you can include AND and OR expressions
  50407. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50408. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50409. // true).
  50410. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  50411. c.urlParams_.Set("filter", filter)
  50412. return c
  50413. }
  50414. // MaxResults sets the optional parameter "maxResults": The maximum
  50415. // number of results per page that should be returned. If the number of
  50416. // available results is larger than maxResults, Compute Engine returns a
  50417. // nextPageToken that can be used to get the next page of results in
  50418. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50419. // (Default: 500)
  50420. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  50421. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50422. return c
  50423. }
  50424. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50425. // a certain order. By default, results are returned in alphanumerical
  50426. // order based on the resource name.
  50427. //
  50428. // You can also sort results in descending order based on the creation
  50429. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50430. // based on the creationTimestamp field in reverse chronological order
  50431. // (newest result first). Use this to sort resources like operations so
  50432. // that the newest operation is returned first.
  50433. //
  50434. // Currently, only sorting by name or creationTimestamp desc is
  50435. // supported.
  50436. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  50437. c.urlParams_.Set("orderBy", orderBy)
  50438. return c
  50439. }
  50440. // PageToken sets the optional parameter "pageToken": Specifies a page
  50441. // token to use. Set pageToken to the nextPageToken returned by a
  50442. // previous list request to get the next page of results.
  50443. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  50444. c.urlParams_.Set("pageToken", pageToken)
  50445. return c
  50446. }
  50447. // Fields allows partial responses to be retrieved. See
  50448. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50449. // for more information.
  50450. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  50451. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50452. return c
  50453. }
  50454. // IfNoneMatch sets the optional parameter which makes the operation
  50455. // fail if the object's ETag matches the given value. This is useful for
  50456. // getting updates only after the object has changed since the last
  50457. // request. Use googleapi.IsNotModified to check whether the response
  50458. // error from Do is the result of In-None-Match.
  50459. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  50460. c.ifNoneMatch_ = entityTag
  50461. return c
  50462. }
  50463. // Context sets the context to be used in this call's Do method. Any
  50464. // pending HTTP request will be aborted if the provided context is
  50465. // canceled.
  50466. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  50467. c.ctx_ = ctx
  50468. return c
  50469. }
  50470. // Header returns an http.Header that can be modified by the caller to
  50471. // add HTTP headers to the request.
  50472. func (c *HttpHealthChecksListCall) Header() http.Header {
  50473. if c.header_ == nil {
  50474. c.header_ = make(http.Header)
  50475. }
  50476. return c.header_
  50477. }
  50478. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  50479. reqHeaders := make(http.Header)
  50480. for k, v := range c.header_ {
  50481. reqHeaders[k] = v
  50482. }
  50483. reqHeaders.Set("User-Agent", c.s.userAgent())
  50484. if c.ifNoneMatch_ != "" {
  50485. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50486. }
  50487. var body io.Reader = nil
  50488. c.urlParams_.Set("alt", alt)
  50489. c.urlParams_.Set("prettyPrint", "false")
  50490. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  50491. urls += "?" + c.urlParams_.Encode()
  50492. req, err := http.NewRequest("GET", urls, body)
  50493. if err != nil {
  50494. return nil, err
  50495. }
  50496. req.Header = reqHeaders
  50497. googleapi.Expand(req.URL, map[string]string{
  50498. "project": c.project,
  50499. })
  50500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50501. }
  50502. // Do executes the "compute.httpHealthChecks.list" call.
  50503. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  50504. // non-2xx status code is an error. Response headers are in either
  50505. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  50506. // returned at all) in error.(*googleapi.Error).Header. Use
  50507. // googleapi.IsNotModified to check whether the returned error was
  50508. // because http.StatusNotModified was returned.
  50509. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  50510. gensupport.SetOptions(c.urlParams_, opts...)
  50511. res, err := c.doRequest("json")
  50512. if res != nil && res.StatusCode == http.StatusNotModified {
  50513. if res.Body != nil {
  50514. res.Body.Close()
  50515. }
  50516. return nil, &googleapi.Error{
  50517. Code: res.StatusCode,
  50518. Header: res.Header,
  50519. }
  50520. }
  50521. if err != nil {
  50522. return nil, err
  50523. }
  50524. defer googleapi.CloseBody(res)
  50525. if err := googleapi.CheckResponse(res); err != nil {
  50526. return nil, err
  50527. }
  50528. ret := &HttpHealthCheckList{
  50529. ServerResponse: googleapi.ServerResponse{
  50530. Header: res.Header,
  50531. HTTPStatusCode: res.StatusCode,
  50532. },
  50533. }
  50534. target := &ret
  50535. if err := gensupport.DecodeResponse(target, res); err != nil {
  50536. return nil, err
  50537. }
  50538. return ret, nil
  50539. // {
  50540. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  50541. // "httpMethod": "GET",
  50542. // "id": "compute.httpHealthChecks.list",
  50543. // "parameterOrder": [
  50544. // "project"
  50545. // ],
  50546. // "parameters": {
  50547. // "filter": {
  50548. // "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).",
  50549. // "location": "query",
  50550. // "type": "string"
  50551. // },
  50552. // "maxResults": {
  50553. // "default": "500",
  50554. // "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)",
  50555. // "format": "uint32",
  50556. // "location": "query",
  50557. // "minimum": "0",
  50558. // "type": "integer"
  50559. // },
  50560. // "orderBy": {
  50561. // "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.",
  50562. // "location": "query",
  50563. // "type": "string"
  50564. // },
  50565. // "pageToken": {
  50566. // "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.",
  50567. // "location": "query",
  50568. // "type": "string"
  50569. // },
  50570. // "project": {
  50571. // "description": "Project ID for this request.",
  50572. // "location": "path",
  50573. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50574. // "required": true,
  50575. // "type": "string"
  50576. // }
  50577. // },
  50578. // "path": "{project}/global/httpHealthChecks",
  50579. // "response": {
  50580. // "$ref": "HttpHealthCheckList"
  50581. // },
  50582. // "scopes": [
  50583. // "https://www.googleapis.com/auth/cloud-platform",
  50584. // "https://www.googleapis.com/auth/compute",
  50585. // "https://www.googleapis.com/auth/compute.readonly"
  50586. // ]
  50587. // }
  50588. }
  50589. // Pages invokes f for each page of results.
  50590. // A non-nil error returned from f will halt the iteration.
  50591. // The provided context supersedes any context provided to the Context method.
  50592. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  50593. c.ctx_ = ctx
  50594. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50595. for {
  50596. x, err := c.Do()
  50597. if err != nil {
  50598. return err
  50599. }
  50600. if err := f(x); err != nil {
  50601. return err
  50602. }
  50603. if x.NextPageToken == "" {
  50604. return nil
  50605. }
  50606. c.PageToken(x.NextPageToken)
  50607. }
  50608. }
  50609. // method id "compute.httpHealthChecks.patch":
  50610. type HttpHealthChecksPatchCall struct {
  50611. s *Service
  50612. project string
  50613. httpHealthCheck string
  50614. httphealthcheck *HttpHealthCheck
  50615. urlParams_ gensupport.URLParams
  50616. ctx_ context.Context
  50617. header_ http.Header
  50618. }
  50619. // Patch: Updates a HttpHealthCheck resource in the specified project
  50620. // using the data included in the request. This method supports PATCH
  50621. // semantics and uses the JSON merge patch format and processing rules.
  50622. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  50623. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  50624. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50625. c.project = project
  50626. c.httpHealthCheck = httpHealthCheck
  50627. c.httphealthcheck = httphealthcheck
  50628. return c
  50629. }
  50630. // RequestId sets the optional parameter "requestId": An optional
  50631. // request ID to identify requests. Specify a unique request ID so that
  50632. // if you must retry your request, the server will know to ignore the
  50633. // request if it has already been completed.
  50634. //
  50635. // For example, consider a situation where you make an initial request
  50636. // and the request times out. If you make the request again with the
  50637. // same request ID, the server can check if original operation with the
  50638. // same request ID was received, and if so, will ignore the second
  50639. // request. This prevents clients from accidentally creating duplicate
  50640. // commitments.
  50641. //
  50642. // The request ID must be a valid UUID with the exception that zero UUID
  50643. // is not supported (00000000-0000-0000-0000-000000000000).
  50644. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  50645. c.urlParams_.Set("requestId", requestId)
  50646. return c
  50647. }
  50648. // Fields allows partial responses to be retrieved. See
  50649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50650. // for more information.
  50651. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  50652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50653. return c
  50654. }
  50655. // Context sets the context to be used in this call's Do method. Any
  50656. // pending HTTP request will be aborted if the provided context is
  50657. // canceled.
  50658. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  50659. c.ctx_ = ctx
  50660. return c
  50661. }
  50662. // Header returns an http.Header that can be modified by the caller to
  50663. // add HTTP headers to the request.
  50664. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  50665. if c.header_ == nil {
  50666. c.header_ = make(http.Header)
  50667. }
  50668. return c.header_
  50669. }
  50670. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  50671. reqHeaders := make(http.Header)
  50672. for k, v := range c.header_ {
  50673. reqHeaders[k] = v
  50674. }
  50675. reqHeaders.Set("User-Agent", c.s.userAgent())
  50676. var body io.Reader = nil
  50677. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  50678. if err != nil {
  50679. return nil, err
  50680. }
  50681. reqHeaders.Set("Content-Type", "application/json")
  50682. c.urlParams_.Set("alt", alt)
  50683. c.urlParams_.Set("prettyPrint", "false")
  50684. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  50685. urls += "?" + c.urlParams_.Encode()
  50686. req, err := http.NewRequest("PATCH", urls, body)
  50687. if err != nil {
  50688. return nil, err
  50689. }
  50690. req.Header = reqHeaders
  50691. googleapi.Expand(req.URL, map[string]string{
  50692. "project": c.project,
  50693. "httpHealthCheck": c.httpHealthCheck,
  50694. })
  50695. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50696. }
  50697. // Do executes the "compute.httpHealthChecks.patch" call.
  50698. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50699. // status code is an error. Response headers are in either
  50700. // *Operation.ServerResponse.Header or (if a response was returned at
  50701. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50702. // to check whether the returned error was because
  50703. // http.StatusNotModified was returned.
  50704. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50705. gensupport.SetOptions(c.urlParams_, opts...)
  50706. res, err := c.doRequest("json")
  50707. if res != nil && res.StatusCode == http.StatusNotModified {
  50708. if res.Body != nil {
  50709. res.Body.Close()
  50710. }
  50711. return nil, &googleapi.Error{
  50712. Code: res.StatusCode,
  50713. Header: res.Header,
  50714. }
  50715. }
  50716. if err != nil {
  50717. return nil, err
  50718. }
  50719. defer googleapi.CloseBody(res)
  50720. if err := googleapi.CheckResponse(res); err != nil {
  50721. return nil, err
  50722. }
  50723. ret := &Operation{
  50724. ServerResponse: googleapi.ServerResponse{
  50725. Header: res.Header,
  50726. HTTPStatusCode: res.StatusCode,
  50727. },
  50728. }
  50729. target := &ret
  50730. if err := gensupport.DecodeResponse(target, res); err != nil {
  50731. return nil, err
  50732. }
  50733. return ret, nil
  50734. // {
  50735. // "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.",
  50736. // "httpMethod": "PATCH",
  50737. // "id": "compute.httpHealthChecks.patch",
  50738. // "parameterOrder": [
  50739. // "project",
  50740. // "httpHealthCheck"
  50741. // ],
  50742. // "parameters": {
  50743. // "httpHealthCheck": {
  50744. // "description": "Name of the HttpHealthCheck resource to patch.",
  50745. // "location": "path",
  50746. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50747. // "required": true,
  50748. // "type": "string"
  50749. // },
  50750. // "project": {
  50751. // "description": "Project ID for this request.",
  50752. // "location": "path",
  50753. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50754. // "required": true,
  50755. // "type": "string"
  50756. // },
  50757. // "requestId": {
  50758. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50759. // "location": "query",
  50760. // "type": "string"
  50761. // }
  50762. // },
  50763. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  50764. // "request": {
  50765. // "$ref": "HttpHealthCheck"
  50766. // },
  50767. // "response": {
  50768. // "$ref": "Operation"
  50769. // },
  50770. // "scopes": [
  50771. // "https://www.googleapis.com/auth/cloud-platform",
  50772. // "https://www.googleapis.com/auth/compute"
  50773. // ]
  50774. // }
  50775. }
  50776. // method id "compute.httpHealthChecks.testIamPermissions":
  50777. type HttpHealthChecksTestIamPermissionsCall struct {
  50778. s *Service
  50779. project string
  50780. resource string
  50781. testpermissionsrequest *TestPermissionsRequest
  50782. urlParams_ gensupport.URLParams
  50783. ctx_ context.Context
  50784. header_ http.Header
  50785. }
  50786. // TestIamPermissions: Returns permissions that a caller has on the
  50787. // specified resource.
  50788. func (r *HttpHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpHealthChecksTestIamPermissionsCall {
  50789. c := &HttpHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50790. c.project = project
  50791. c.resource = resource
  50792. c.testpermissionsrequest = testpermissionsrequest
  50793. return c
  50794. }
  50795. // Fields allows partial responses to be retrieved. See
  50796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50797. // for more information.
  50798. func (c *HttpHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpHealthChecksTestIamPermissionsCall {
  50799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50800. return c
  50801. }
  50802. // Context sets the context to be used in this call's Do method. Any
  50803. // pending HTTP request will be aborted if the provided context is
  50804. // canceled.
  50805. func (c *HttpHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpHealthChecksTestIamPermissionsCall {
  50806. c.ctx_ = ctx
  50807. return c
  50808. }
  50809. // Header returns an http.Header that can be modified by the caller to
  50810. // add HTTP headers to the request.
  50811. func (c *HttpHealthChecksTestIamPermissionsCall) Header() http.Header {
  50812. if c.header_ == nil {
  50813. c.header_ = make(http.Header)
  50814. }
  50815. return c.header_
  50816. }
  50817. func (c *HttpHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  50818. reqHeaders := make(http.Header)
  50819. for k, v := range c.header_ {
  50820. reqHeaders[k] = v
  50821. }
  50822. reqHeaders.Set("User-Agent", c.s.userAgent())
  50823. var body io.Reader = nil
  50824. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  50825. if err != nil {
  50826. return nil, err
  50827. }
  50828. reqHeaders.Set("Content-Type", "application/json")
  50829. c.urlParams_.Set("alt", alt)
  50830. c.urlParams_.Set("prettyPrint", "false")
  50831. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{resource}/testIamPermissions")
  50832. urls += "?" + c.urlParams_.Encode()
  50833. req, err := http.NewRequest("POST", urls, body)
  50834. if err != nil {
  50835. return nil, err
  50836. }
  50837. req.Header = reqHeaders
  50838. googleapi.Expand(req.URL, map[string]string{
  50839. "project": c.project,
  50840. "resource": c.resource,
  50841. })
  50842. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50843. }
  50844. // Do executes the "compute.httpHealthChecks.testIamPermissions" call.
  50845. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  50846. // non-2xx status code is an error. Response headers are in either
  50847. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  50848. // returned at all) in error.(*googleapi.Error).Header. Use
  50849. // googleapi.IsNotModified to check whether the returned error was
  50850. // because http.StatusNotModified was returned.
  50851. func (c *HttpHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  50852. gensupport.SetOptions(c.urlParams_, opts...)
  50853. res, err := c.doRequest("json")
  50854. if res != nil && res.StatusCode == http.StatusNotModified {
  50855. if res.Body != nil {
  50856. res.Body.Close()
  50857. }
  50858. return nil, &googleapi.Error{
  50859. Code: res.StatusCode,
  50860. Header: res.Header,
  50861. }
  50862. }
  50863. if err != nil {
  50864. return nil, err
  50865. }
  50866. defer googleapi.CloseBody(res)
  50867. if err := googleapi.CheckResponse(res); err != nil {
  50868. return nil, err
  50869. }
  50870. ret := &TestPermissionsResponse{
  50871. ServerResponse: googleapi.ServerResponse{
  50872. Header: res.Header,
  50873. HTTPStatusCode: res.StatusCode,
  50874. },
  50875. }
  50876. target := &ret
  50877. if err := gensupport.DecodeResponse(target, res); err != nil {
  50878. return nil, err
  50879. }
  50880. return ret, nil
  50881. // {
  50882. // "description": "Returns permissions that a caller has on the specified resource.",
  50883. // "httpMethod": "POST",
  50884. // "id": "compute.httpHealthChecks.testIamPermissions",
  50885. // "parameterOrder": [
  50886. // "project",
  50887. // "resource"
  50888. // ],
  50889. // "parameters": {
  50890. // "project": {
  50891. // "description": "Project ID for this request.",
  50892. // "location": "path",
  50893. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50894. // "required": true,
  50895. // "type": "string"
  50896. // },
  50897. // "resource": {
  50898. // "description": "Name or id of the resource for this request.",
  50899. // "location": "path",
  50900. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50901. // "required": true,
  50902. // "type": "string"
  50903. // }
  50904. // },
  50905. // "path": "{project}/global/httpHealthChecks/{resource}/testIamPermissions",
  50906. // "request": {
  50907. // "$ref": "TestPermissionsRequest"
  50908. // },
  50909. // "response": {
  50910. // "$ref": "TestPermissionsResponse"
  50911. // },
  50912. // "scopes": [
  50913. // "https://www.googleapis.com/auth/cloud-platform",
  50914. // "https://www.googleapis.com/auth/compute",
  50915. // "https://www.googleapis.com/auth/compute.readonly"
  50916. // ]
  50917. // }
  50918. }
  50919. // method id "compute.httpHealthChecks.update":
  50920. type HttpHealthChecksUpdateCall struct {
  50921. s *Service
  50922. project string
  50923. httpHealthCheck string
  50924. httphealthcheck *HttpHealthCheck
  50925. urlParams_ gensupport.URLParams
  50926. ctx_ context.Context
  50927. header_ http.Header
  50928. }
  50929. // Update: Updates a HttpHealthCheck resource in the specified project
  50930. // using the data included in the request.
  50931. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  50932. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  50933. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50934. c.project = project
  50935. c.httpHealthCheck = httpHealthCheck
  50936. c.httphealthcheck = httphealthcheck
  50937. return c
  50938. }
  50939. // RequestId sets the optional parameter "requestId": An optional
  50940. // request ID to identify requests. Specify a unique request ID so that
  50941. // if you must retry your request, the server will know to ignore the
  50942. // request if it has already been completed.
  50943. //
  50944. // For example, consider a situation where you make an initial request
  50945. // and the request times out. If you make the request again with the
  50946. // same request ID, the server can check if original operation with the
  50947. // same request ID was received, and if so, will ignore the second
  50948. // request. This prevents clients from accidentally creating duplicate
  50949. // commitments.
  50950. //
  50951. // The request ID must be a valid UUID with the exception that zero UUID
  50952. // is not supported (00000000-0000-0000-0000-000000000000).
  50953. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  50954. c.urlParams_.Set("requestId", requestId)
  50955. return c
  50956. }
  50957. // Fields allows partial responses to be retrieved. See
  50958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50959. // for more information.
  50960. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  50961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50962. return c
  50963. }
  50964. // Context sets the context to be used in this call's Do method. Any
  50965. // pending HTTP request will be aborted if the provided context is
  50966. // canceled.
  50967. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  50968. c.ctx_ = ctx
  50969. return c
  50970. }
  50971. // Header returns an http.Header that can be modified by the caller to
  50972. // add HTTP headers to the request.
  50973. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  50974. if c.header_ == nil {
  50975. c.header_ = make(http.Header)
  50976. }
  50977. return c.header_
  50978. }
  50979. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  50980. reqHeaders := make(http.Header)
  50981. for k, v := range c.header_ {
  50982. reqHeaders[k] = v
  50983. }
  50984. reqHeaders.Set("User-Agent", c.s.userAgent())
  50985. var body io.Reader = nil
  50986. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  50987. if err != nil {
  50988. return nil, err
  50989. }
  50990. reqHeaders.Set("Content-Type", "application/json")
  50991. c.urlParams_.Set("alt", alt)
  50992. c.urlParams_.Set("prettyPrint", "false")
  50993. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  50994. urls += "?" + c.urlParams_.Encode()
  50995. req, err := http.NewRequest("PUT", urls, body)
  50996. if err != nil {
  50997. return nil, err
  50998. }
  50999. req.Header = reqHeaders
  51000. googleapi.Expand(req.URL, map[string]string{
  51001. "project": c.project,
  51002. "httpHealthCheck": c.httpHealthCheck,
  51003. })
  51004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51005. }
  51006. // Do executes the "compute.httpHealthChecks.update" call.
  51007. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51008. // status code is an error. Response headers are in either
  51009. // *Operation.ServerResponse.Header or (if a response was returned at
  51010. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51011. // to check whether the returned error was because
  51012. // http.StatusNotModified was returned.
  51013. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51014. gensupport.SetOptions(c.urlParams_, opts...)
  51015. res, err := c.doRequest("json")
  51016. if res != nil && res.StatusCode == http.StatusNotModified {
  51017. if res.Body != nil {
  51018. res.Body.Close()
  51019. }
  51020. return nil, &googleapi.Error{
  51021. Code: res.StatusCode,
  51022. Header: res.Header,
  51023. }
  51024. }
  51025. if err != nil {
  51026. return nil, err
  51027. }
  51028. defer googleapi.CloseBody(res)
  51029. if err := googleapi.CheckResponse(res); err != nil {
  51030. return nil, err
  51031. }
  51032. ret := &Operation{
  51033. ServerResponse: googleapi.ServerResponse{
  51034. Header: res.Header,
  51035. HTTPStatusCode: res.StatusCode,
  51036. },
  51037. }
  51038. target := &ret
  51039. if err := gensupport.DecodeResponse(target, res); err != nil {
  51040. return nil, err
  51041. }
  51042. return ret, nil
  51043. // {
  51044. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  51045. // "httpMethod": "PUT",
  51046. // "id": "compute.httpHealthChecks.update",
  51047. // "parameterOrder": [
  51048. // "project",
  51049. // "httpHealthCheck"
  51050. // ],
  51051. // "parameters": {
  51052. // "httpHealthCheck": {
  51053. // "description": "Name of the HttpHealthCheck resource to update.",
  51054. // "location": "path",
  51055. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51056. // "required": true,
  51057. // "type": "string"
  51058. // },
  51059. // "project": {
  51060. // "description": "Project ID for this request.",
  51061. // "location": "path",
  51062. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51063. // "required": true,
  51064. // "type": "string"
  51065. // },
  51066. // "requestId": {
  51067. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51068. // "location": "query",
  51069. // "type": "string"
  51070. // }
  51071. // },
  51072. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  51073. // "request": {
  51074. // "$ref": "HttpHealthCheck"
  51075. // },
  51076. // "response": {
  51077. // "$ref": "Operation"
  51078. // },
  51079. // "scopes": [
  51080. // "https://www.googleapis.com/auth/cloud-platform",
  51081. // "https://www.googleapis.com/auth/compute"
  51082. // ]
  51083. // }
  51084. }
  51085. // method id "compute.httpsHealthChecks.delete":
  51086. type HttpsHealthChecksDeleteCall struct {
  51087. s *Service
  51088. project string
  51089. httpsHealthCheck string
  51090. urlParams_ gensupport.URLParams
  51091. ctx_ context.Context
  51092. header_ http.Header
  51093. }
  51094. // Delete: Deletes the specified HttpsHealthCheck resource.
  51095. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  51096. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51097. c.project = project
  51098. c.httpsHealthCheck = httpsHealthCheck
  51099. return c
  51100. }
  51101. // RequestId sets the optional parameter "requestId": An optional
  51102. // request ID to identify requests. Specify a unique request ID so that
  51103. // if you must retry your request, the server will know to ignore the
  51104. // request if it has already been completed.
  51105. //
  51106. // For example, consider a situation where you make an initial request
  51107. // and the request times out. If you make the request again with the
  51108. // same request ID, the server can check if original operation with the
  51109. // same request ID was received, and if so, will ignore the second
  51110. // request. This prevents clients from accidentally creating duplicate
  51111. // commitments.
  51112. //
  51113. // The request ID must be a valid UUID with the exception that zero UUID
  51114. // is not supported (00000000-0000-0000-0000-000000000000).
  51115. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  51116. c.urlParams_.Set("requestId", requestId)
  51117. return c
  51118. }
  51119. // Fields allows partial responses to be retrieved. See
  51120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51121. // for more information.
  51122. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  51123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51124. return c
  51125. }
  51126. // Context sets the context to be used in this call's Do method. Any
  51127. // pending HTTP request will be aborted if the provided context is
  51128. // canceled.
  51129. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  51130. c.ctx_ = ctx
  51131. return c
  51132. }
  51133. // Header returns an http.Header that can be modified by the caller to
  51134. // add HTTP headers to the request.
  51135. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  51136. if c.header_ == nil {
  51137. c.header_ = make(http.Header)
  51138. }
  51139. return c.header_
  51140. }
  51141. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  51142. reqHeaders := make(http.Header)
  51143. for k, v := range c.header_ {
  51144. reqHeaders[k] = v
  51145. }
  51146. reqHeaders.Set("User-Agent", c.s.userAgent())
  51147. var body io.Reader = nil
  51148. c.urlParams_.Set("alt", alt)
  51149. c.urlParams_.Set("prettyPrint", "false")
  51150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  51151. urls += "?" + c.urlParams_.Encode()
  51152. req, err := http.NewRequest("DELETE", urls, body)
  51153. if err != nil {
  51154. return nil, err
  51155. }
  51156. req.Header = reqHeaders
  51157. googleapi.Expand(req.URL, map[string]string{
  51158. "project": c.project,
  51159. "httpsHealthCheck": c.httpsHealthCheck,
  51160. })
  51161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51162. }
  51163. // Do executes the "compute.httpsHealthChecks.delete" call.
  51164. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51165. // status code is an error. Response headers are in either
  51166. // *Operation.ServerResponse.Header or (if a response was returned at
  51167. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51168. // to check whether the returned error was because
  51169. // http.StatusNotModified was returned.
  51170. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51171. gensupport.SetOptions(c.urlParams_, opts...)
  51172. res, err := c.doRequest("json")
  51173. if res != nil && res.StatusCode == http.StatusNotModified {
  51174. if res.Body != nil {
  51175. res.Body.Close()
  51176. }
  51177. return nil, &googleapi.Error{
  51178. Code: res.StatusCode,
  51179. Header: res.Header,
  51180. }
  51181. }
  51182. if err != nil {
  51183. return nil, err
  51184. }
  51185. defer googleapi.CloseBody(res)
  51186. if err := googleapi.CheckResponse(res); err != nil {
  51187. return nil, err
  51188. }
  51189. ret := &Operation{
  51190. ServerResponse: googleapi.ServerResponse{
  51191. Header: res.Header,
  51192. HTTPStatusCode: res.StatusCode,
  51193. },
  51194. }
  51195. target := &ret
  51196. if err := gensupport.DecodeResponse(target, res); err != nil {
  51197. return nil, err
  51198. }
  51199. return ret, nil
  51200. // {
  51201. // "description": "Deletes the specified HttpsHealthCheck resource.",
  51202. // "httpMethod": "DELETE",
  51203. // "id": "compute.httpsHealthChecks.delete",
  51204. // "parameterOrder": [
  51205. // "project",
  51206. // "httpsHealthCheck"
  51207. // ],
  51208. // "parameters": {
  51209. // "httpsHealthCheck": {
  51210. // "description": "Name of the HttpsHealthCheck resource to delete.",
  51211. // "location": "path",
  51212. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51213. // "required": true,
  51214. // "type": "string"
  51215. // },
  51216. // "project": {
  51217. // "description": "Project ID for this request.",
  51218. // "location": "path",
  51219. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51220. // "required": true,
  51221. // "type": "string"
  51222. // },
  51223. // "requestId": {
  51224. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51225. // "location": "query",
  51226. // "type": "string"
  51227. // }
  51228. // },
  51229. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  51230. // "response": {
  51231. // "$ref": "Operation"
  51232. // },
  51233. // "scopes": [
  51234. // "https://www.googleapis.com/auth/cloud-platform",
  51235. // "https://www.googleapis.com/auth/compute"
  51236. // ]
  51237. // }
  51238. }
  51239. // method id "compute.httpsHealthChecks.get":
  51240. type HttpsHealthChecksGetCall struct {
  51241. s *Service
  51242. project string
  51243. httpsHealthCheck string
  51244. urlParams_ gensupport.URLParams
  51245. ifNoneMatch_ string
  51246. ctx_ context.Context
  51247. header_ http.Header
  51248. }
  51249. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  51250. // available HTTPS health checks by making a list() request.
  51251. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  51252. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51253. c.project = project
  51254. c.httpsHealthCheck = httpsHealthCheck
  51255. return c
  51256. }
  51257. // Fields allows partial responses to be retrieved. See
  51258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51259. // for more information.
  51260. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  51261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51262. return c
  51263. }
  51264. // IfNoneMatch sets the optional parameter which makes the operation
  51265. // fail if the object's ETag matches the given value. This is useful for
  51266. // getting updates only after the object has changed since the last
  51267. // request. Use googleapi.IsNotModified to check whether the response
  51268. // error from Do is the result of In-None-Match.
  51269. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  51270. c.ifNoneMatch_ = entityTag
  51271. return c
  51272. }
  51273. // Context sets the context to be used in this call's Do method. Any
  51274. // pending HTTP request will be aborted if the provided context is
  51275. // canceled.
  51276. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  51277. c.ctx_ = ctx
  51278. return c
  51279. }
  51280. // Header returns an http.Header that can be modified by the caller to
  51281. // add HTTP headers to the request.
  51282. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  51283. if c.header_ == nil {
  51284. c.header_ = make(http.Header)
  51285. }
  51286. return c.header_
  51287. }
  51288. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  51289. reqHeaders := make(http.Header)
  51290. for k, v := range c.header_ {
  51291. reqHeaders[k] = v
  51292. }
  51293. reqHeaders.Set("User-Agent", c.s.userAgent())
  51294. if c.ifNoneMatch_ != "" {
  51295. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51296. }
  51297. var body io.Reader = nil
  51298. c.urlParams_.Set("alt", alt)
  51299. c.urlParams_.Set("prettyPrint", "false")
  51300. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  51301. urls += "?" + c.urlParams_.Encode()
  51302. req, err := http.NewRequest("GET", urls, body)
  51303. if err != nil {
  51304. return nil, err
  51305. }
  51306. req.Header = reqHeaders
  51307. googleapi.Expand(req.URL, map[string]string{
  51308. "project": c.project,
  51309. "httpsHealthCheck": c.httpsHealthCheck,
  51310. })
  51311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51312. }
  51313. // Do executes the "compute.httpsHealthChecks.get" call.
  51314. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  51315. // non-2xx status code is an error. Response headers are in either
  51316. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  51317. // returned at all) in error.(*googleapi.Error).Header. Use
  51318. // googleapi.IsNotModified to check whether the returned error was
  51319. // because http.StatusNotModified was returned.
  51320. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  51321. gensupport.SetOptions(c.urlParams_, opts...)
  51322. res, err := c.doRequest("json")
  51323. if res != nil && res.StatusCode == http.StatusNotModified {
  51324. if res.Body != nil {
  51325. res.Body.Close()
  51326. }
  51327. return nil, &googleapi.Error{
  51328. Code: res.StatusCode,
  51329. Header: res.Header,
  51330. }
  51331. }
  51332. if err != nil {
  51333. return nil, err
  51334. }
  51335. defer googleapi.CloseBody(res)
  51336. if err := googleapi.CheckResponse(res); err != nil {
  51337. return nil, err
  51338. }
  51339. ret := &HttpsHealthCheck{
  51340. ServerResponse: googleapi.ServerResponse{
  51341. Header: res.Header,
  51342. HTTPStatusCode: res.StatusCode,
  51343. },
  51344. }
  51345. target := &ret
  51346. if err := gensupport.DecodeResponse(target, res); err != nil {
  51347. return nil, err
  51348. }
  51349. return ret, nil
  51350. // {
  51351. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  51352. // "httpMethod": "GET",
  51353. // "id": "compute.httpsHealthChecks.get",
  51354. // "parameterOrder": [
  51355. // "project",
  51356. // "httpsHealthCheck"
  51357. // ],
  51358. // "parameters": {
  51359. // "httpsHealthCheck": {
  51360. // "description": "Name of the HttpsHealthCheck resource to return.",
  51361. // "location": "path",
  51362. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51363. // "required": true,
  51364. // "type": "string"
  51365. // },
  51366. // "project": {
  51367. // "description": "Project ID for this request.",
  51368. // "location": "path",
  51369. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51370. // "required": true,
  51371. // "type": "string"
  51372. // }
  51373. // },
  51374. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  51375. // "response": {
  51376. // "$ref": "HttpsHealthCheck"
  51377. // },
  51378. // "scopes": [
  51379. // "https://www.googleapis.com/auth/cloud-platform",
  51380. // "https://www.googleapis.com/auth/compute",
  51381. // "https://www.googleapis.com/auth/compute.readonly"
  51382. // ]
  51383. // }
  51384. }
  51385. // method id "compute.httpsHealthChecks.insert":
  51386. type HttpsHealthChecksInsertCall struct {
  51387. s *Service
  51388. project string
  51389. httpshealthcheck *HttpsHealthCheck
  51390. urlParams_ gensupport.URLParams
  51391. ctx_ context.Context
  51392. header_ http.Header
  51393. }
  51394. // Insert: Creates a HttpsHealthCheck resource in the specified project
  51395. // using the data included in the request.
  51396. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  51397. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51398. c.project = project
  51399. c.httpshealthcheck = httpshealthcheck
  51400. return c
  51401. }
  51402. // RequestId sets the optional parameter "requestId": An optional
  51403. // request ID to identify requests. Specify a unique request ID so that
  51404. // if you must retry your request, the server will know to ignore the
  51405. // request if it has already been completed.
  51406. //
  51407. // For example, consider a situation where you make an initial request
  51408. // and the request times out. If you make the request again with the
  51409. // same request ID, the server can check if original operation with the
  51410. // same request ID was received, and if so, will ignore the second
  51411. // request. This prevents clients from accidentally creating duplicate
  51412. // commitments.
  51413. //
  51414. // The request ID must be a valid UUID with the exception that zero UUID
  51415. // is not supported (00000000-0000-0000-0000-000000000000).
  51416. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  51417. c.urlParams_.Set("requestId", requestId)
  51418. return c
  51419. }
  51420. // Fields allows partial responses to be retrieved. See
  51421. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51422. // for more information.
  51423. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  51424. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51425. return c
  51426. }
  51427. // Context sets the context to be used in this call's Do method. Any
  51428. // pending HTTP request will be aborted if the provided context is
  51429. // canceled.
  51430. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  51431. c.ctx_ = ctx
  51432. return c
  51433. }
  51434. // Header returns an http.Header that can be modified by the caller to
  51435. // add HTTP headers to the request.
  51436. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  51437. if c.header_ == nil {
  51438. c.header_ = make(http.Header)
  51439. }
  51440. return c.header_
  51441. }
  51442. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  51443. reqHeaders := make(http.Header)
  51444. for k, v := range c.header_ {
  51445. reqHeaders[k] = v
  51446. }
  51447. reqHeaders.Set("User-Agent", c.s.userAgent())
  51448. var body io.Reader = nil
  51449. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  51450. if err != nil {
  51451. return nil, err
  51452. }
  51453. reqHeaders.Set("Content-Type", "application/json")
  51454. c.urlParams_.Set("alt", alt)
  51455. c.urlParams_.Set("prettyPrint", "false")
  51456. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  51457. urls += "?" + c.urlParams_.Encode()
  51458. req, err := http.NewRequest("POST", urls, body)
  51459. if err != nil {
  51460. return nil, err
  51461. }
  51462. req.Header = reqHeaders
  51463. googleapi.Expand(req.URL, map[string]string{
  51464. "project": c.project,
  51465. })
  51466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51467. }
  51468. // Do executes the "compute.httpsHealthChecks.insert" call.
  51469. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51470. // status code is an error. Response headers are in either
  51471. // *Operation.ServerResponse.Header or (if a response was returned at
  51472. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51473. // to check whether the returned error was because
  51474. // http.StatusNotModified was returned.
  51475. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51476. gensupport.SetOptions(c.urlParams_, opts...)
  51477. res, err := c.doRequest("json")
  51478. if res != nil && res.StatusCode == http.StatusNotModified {
  51479. if res.Body != nil {
  51480. res.Body.Close()
  51481. }
  51482. return nil, &googleapi.Error{
  51483. Code: res.StatusCode,
  51484. Header: res.Header,
  51485. }
  51486. }
  51487. if err != nil {
  51488. return nil, err
  51489. }
  51490. defer googleapi.CloseBody(res)
  51491. if err := googleapi.CheckResponse(res); err != nil {
  51492. return nil, err
  51493. }
  51494. ret := &Operation{
  51495. ServerResponse: googleapi.ServerResponse{
  51496. Header: res.Header,
  51497. HTTPStatusCode: res.StatusCode,
  51498. },
  51499. }
  51500. target := &ret
  51501. if err := gensupport.DecodeResponse(target, res); err != nil {
  51502. return nil, err
  51503. }
  51504. return ret, nil
  51505. // {
  51506. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  51507. // "httpMethod": "POST",
  51508. // "id": "compute.httpsHealthChecks.insert",
  51509. // "parameterOrder": [
  51510. // "project"
  51511. // ],
  51512. // "parameters": {
  51513. // "project": {
  51514. // "description": "Project ID for this request.",
  51515. // "location": "path",
  51516. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51517. // "required": true,
  51518. // "type": "string"
  51519. // },
  51520. // "requestId": {
  51521. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51522. // "location": "query",
  51523. // "type": "string"
  51524. // }
  51525. // },
  51526. // "path": "{project}/global/httpsHealthChecks",
  51527. // "request": {
  51528. // "$ref": "HttpsHealthCheck"
  51529. // },
  51530. // "response": {
  51531. // "$ref": "Operation"
  51532. // },
  51533. // "scopes": [
  51534. // "https://www.googleapis.com/auth/cloud-platform",
  51535. // "https://www.googleapis.com/auth/compute"
  51536. // ]
  51537. // }
  51538. }
  51539. // method id "compute.httpsHealthChecks.list":
  51540. type HttpsHealthChecksListCall struct {
  51541. s *Service
  51542. project string
  51543. urlParams_ gensupport.URLParams
  51544. ifNoneMatch_ string
  51545. ctx_ context.Context
  51546. header_ http.Header
  51547. }
  51548. // List: Retrieves the list of HttpsHealthCheck resources available to
  51549. // the specified project.
  51550. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  51551. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51552. c.project = project
  51553. return c
  51554. }
  51555. // Filter sets the optional parameter "filter": A filter expression that
  51556. // filters resources listed in the response. The expression must specify
  51557. // the field name, a comparison operator, and the value that you want to
  51558. // use for filtering. The value must be a string, a number, or a
  51559. // boolean. The comparison operator must be either =, !=, >, or <.
  51560. //
  51561. // For example, if you are filtering Compute Engine instances, you can
  51562. // exclude instances named example-instance by specifying name !=
  51563. // example-instance.
  51564. //
  51565. // You can also filter nested fields. For example, you could specify
  51566. // scheduling.automaticRestart = false to include instances only if they
  51567. // are not scheduled for automatic restarts. You can use filtering on
  51568. // nested fields to filter based on resource labels.
  51569. //
  51570. // To filter on multiple expressions, provide each separate expression
  51571. // within parentheses. For example, (scheduling.automaticRestart = true)
  51572. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51573. // AND expression. However, you can include AND and OR expressions
  51574. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51575. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51576. // true).
  51577. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  51578. c.urlParams_.Set("filter", filter)
  51579. return c
  51580. }
  51581. // MaxResults sets the optional parameter "maxResults": The maximum
  51582. // number of results per page that should be returned. If the number of
  51583. // available results is larger than maxResults, Compute Engine returns a
  51584. // nextPageToken that can be used to get the next page of results in
  51585. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51586. // (Default: 500)
  51587. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  51588. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51589. return c
  51590. }
  51591. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51592. // a certain order. By default, results are returned in alphanumerical
  51593. // order based on the resource name.
  51594. //
  51595. // You can also sort results in descending order based on the creation
  51596. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51597. // based on the creationTimestamp field in reverse chronological order
  51598. // (newest result first). Use this to sort resources like operations so
  51599. // that the newest operation is returned first.
  51600. //
  51601. // Currently, only sorting by name or creationTimestamp desc is
  51602. // supported.
  51603. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  51604. c.urlParams_.Set("orderBy", orderBy)
  51605. return c
  51606. }
  51607. // PageToken sets the optional parameter "pageToken": Specifies a page
  51608. // token to use. Set pageToken to the nextPageToken returned by a
  51609. // previous list request to get the next page of results.
  51610. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  51611. c.urlParams_.Set("pageToken", pageToken)
  51612. return c
  51613. }
  51614. // Fields allows partial responses to be retrieved. See
  51615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51616. // for more information.
  51617. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  51618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51619. return c
  51620. }
  51621. // IfNoneMatch sets the optional parameter which makes the operation
  51622. // fail if the object's ETag matches the given value. This is useful for
  51623. // getting updates only after the object has changed since the last
  51624. // request. Use googleapi.IsNotModified to check whether the response
  51625. // error from Do is the result of In-None-Match.
  51626. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  51627. c.ifNoneMatch_ = entityTag
  51628. return c
  51629. }
  51630. // Context sets the context to be used in this call's Do method. Any
  51631. // pending HTTP request will be aborted if the provided context is
  51632. // canceled.
  51633. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  51634. c.ctx_ = ctx
  51635. return c
  51636. }
  51637. // Header returns an http.Header that can be modified by the caller to
  51638. // add HTTP headers to the request.
  51639. func (c *HttpsHealthChecksListCall) Header() http.Header {
  51640. if c.header_ == nil {
  51641. c.header_ = make(http.Header)
  51642. }
  51643. return c.header_
  51644. }
  51645. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  51646. reqHeaders := make(http.Header)
  51647. for k, v := range c.header_ {
  51648. reqHeaders[k] = v
  51649. }
  51650. reqHeaders.Set("User-Agent", c.s.userAgent())
  51651. if c.ifNoneMatch_ != "" {
  51652. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51653. }
  51654. var body io.Reader = nil
  51655. c.urlParams_.Set("alt", alt)
  51656. c.urlParams_.Set("prettyPrint", "false")
  51657. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  51658. urls += "?" + c.urlParams_.Encode()
  51659. req, err := http.NewRequest("GET", urls, body)
  51660. if err != nil {
  51661. return nil, err
  51662. }
  51663. req.Header = reqHeaders
  51664. googleapi.Expand(req.URL, map[string]string{
  51665. "project": c.project,
  51666. })
  51667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51668. }
  51669. // Do executes the "compute.httpsHealthChecks.list" call.
  51670. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  51671. // non-2xx status code is an error. Response headers are in either
  51672. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  51673. // returned at all) in error.(*googleapi.Error).Header. Use
  51674. // googleapi.IsNotModified to check whether the returned error was
  51675. // because http.StatusNotModified was returned.
  51676. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  51677. gensupport.SetOptions(c.urlParams_, opts...)
  51678. res, err := c.doRequest("json")
  51679. if res != nil && res.StatusCode == http.StatusNotModified {
  51680. if res.Body != nil {
  51681. res.Body.Close()
  51682. }
  51683. return nil, &googleapi.Error{
  51684. Code: res.StatusCode,
  51685. Header: res.Header,
  51686. }
  51687. }
  51688. if err != nil {
  51689. return nil, err
  51690. }
  51691. defer googleapi.CloseBody(res)
  51692. if err := googleapi.CheckResponse(res); err != nil {
  51693. return nil, err
  51694. }
  51695. ret := &HttpsHealthCheckList{
  51696. ServerResponse: googleapi.ServerResponse{
  51697. Header: res.Header,
  51698. HTTPStatusCode: res.StatusCode,
  51699. },
  51700. }
  51701. target := &ret
  51702. if err := gensupport.DecodeResponse(target, res); err != nil {
  51703. return nil, err
  51704. }
  51705. return ret, nil
  51706. // {
  51707. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  51708. // "httpMethod": "GET",
  51709. // "id": "compute.httpsHealthChecks.list",
  51710. // "parameterOrder": [
  51711. // "project"
  51712. // ],
  51713. // "parameters": {
  51714. // "filter": {
  51715. // "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).",
  51716. // "location": "query",
  51717. // "type": "string"
  51718. // },
  51719. // "maxResults": {
  51720. // "default": "500",
  51721. // "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)",
  51722. // "format": "uint32",
  51723. // "location": "query",
  51724. // "minimum": "0",
  51725. // "type": "integer"
  51726. // },
  51727. // "orderBy": {
  51728. // "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.",
  51729. // "location": "query",
  51730. // "type": "string"
  51731. // },
  51732. // "pageToken": {
  51733. // "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.",
  51734. // "location": "query",
  51735. // "type": "string"
  51736. // },
  51737. // "project": {
  51738. // "description": "Project ID for this request.",
  51739. // "location": "path",
  51740. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51741. // "required": true,
  51742. // "type": "string"
  51743. // }
  51744. // },
  51745. // "path": "{project}/global/httpsHealthChecks",
  51746. // "response": {
  51747. // "$ref": "HttpsHealthCheckList"
  51748. // },
  51749. // "scopes": [
  51750. // "https://www.googleapis.com/auth/cloud-platform",
  51751. // "https://www.googleapis.com/auth/compute",
  51752. // "https://www.googleapis.com/auth/compute.readonly"
  51753. // ]
  51754. // }
  51755. }
  51756. // Pages invokes f for each page of results.
  51757. // A non-nil error returned from f will halt the iteration.
  51758. // The provided context supersedes any context provided to the Context method.
  51759. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  51760. c.ctx_ = ctx
  51761. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51762. for {
  51763. x, err := c.Do()
  51764. if err != nil {
  51765. return err
  51766. }
  51767. if err := f(x); err != nil {
  51768. return err
  51769. }
  51770. if x.NextPageToken == "" {
  51771. return nil
  51772. }
  51773. c.PageToken(x.NextPageToken)
  51774. }
  51775. }
  51776. // method id "compute.httpsHealthChecks.patch":
  51777. type HttpsHealthChecksPatchCall struct {
  51778. s *Service
  51779. project string
  51780. httpsHealthCheck string
  51781. httpshealthcheck *HttpsHealthCheck
  51782. urlParams_ gensupport.URLParams
  51783. ctx_ context.Context
  51784. header_ http.Header
  51785. }
  51786. // Patch: Updates a HttpsHealthCheck resource in the specified project
  51787. // using the data included in the request. This method supports PATCH
  51788. // semantics and uses the JSON merge patch format and processing rules.
  51789. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  51790. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51791. c.project = project
  51792. c.httpsHealthCheck = httpsHealthCheck
  51793. c.httpshealthcheck = httpshealthcheck
  51794. return c
  51795. }
  51796. // RequestId sets the optional parameter "requestId": An optional
  51797. // request ID to identify requests. Specify a unique request ID so that
  51798. // if you must retry your request, the server will know to ignore the
  51799. // request if it has already been completed.
  51800. //
  51801. // For example, consider a situation where you make an initial request
  51802. // and the request times out. If you make the request again with the
  51803. // same request ID, the server can check if original operation with the
  51804. // same request ID was received, and if so, will ignore the second
  51805. // request. This prevents clients from accidentally creating duplicate
  51806. // commitments.
  51807. //
  51808. // The request ID must be a valid UUID with the exception that zero UUID
  51809. // is not supported (00000000-0000-0000-0000-000000000000).
  51810. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  51811. c.urlParams_.Set("requestId", requestId)
  51812. return c
  51813. }
  51814. // Fields allows partial responses to be retrieved. See
  51815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51816. // for more information.
  51817. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  51818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51819. return c
  51820. }
  51821. // Context sets the context to be used in this call's Do method. Any
  51822. // pending HTTP request will be aborted if the provided context is
  51823. // canceled.
  51824. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  51825. c.ctx_ = ctx
  51826. return c
  51827. }
  51828. // Header returns an http.Header that can be modified by the caller to
  51829. // add HTTP headers to the request.
  51830. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  51831. if c.header_ == nil {
  51832. c.header_ = make(http.Header)
  51833. }
  51834. return c.header_
  51835. }
  51836. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  51837. reqHeaders := make(http.Header)
  51838. for k, v := range c.header_ {
  51839. reqHeaders[k] = v
  51840. }
  51841. reqHeaders.Set("User-Agent", c.s.userAgent())
  51842. var body io.Reader = nil
  51843. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  51844. if err != nil {
  51845. return nil, err
  51846. }
  51847. reqHeaders.Set("Content-Type", "application/json")
  51848. c.urlParams_.Set("alt", alt)
  51849. c.urlParams_.Set("prettyPrint", "false")
  51850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  51851. urls += "?" + c.urlParams_.Encode()
  51852. req, err := http.NewRequest("PATCH", urls, body)
  51853. if err != nil {
  51854. return nil, err
  51855. }
  51856. req.Header = reqHeaders
  51857. googleapi.Expand(req.URL, map[string]string{
  51858. "project": c.project,
  51859. "httpsHealthCheck": c.httpsHealthCheck,
  51860. })
  51861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51862. }
  51863. // Do executes the "compute.httpsHealthChecks.patch" call.
  51864. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51865. // status code is an error. Response headers are in either
  51866. // *Operation.ServerResponse.Header or (if a response was returned at
  51867. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51868. // to check whether the returned error was because
  51869. // http.StatusNotModified was returned.
  51870. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51871. gensupport.SetOptions(c.urlParams_, opts...)
  51872. res, err := c.doRequest("json")
  51873. if res != nil && res.StatusCode == http.StatusNotModified {
  51874. if res.Body != nil {
  51875. res.Body.Close()
  51876. }
  51877. return nil, &googleapi.Error{
  51878. Code: res.StatusCode,
  51879. Header: res.Header,
  51880. }
  51881. }
  51882. if err != nil {
  51883. return nil, err
  51884. }
  51885. defer googleapi.CloseBody(res)
  51886. if err := googleapi.CheckResponse(res); err != nil {
  51887. return nil, err
  51888. }
  51889. ret := &Operation{
  51890. ServerResponse: googleapi.ServerResponse{
  51891. Header: res.Header,
  51892. HTTPStatusCode: res.StatusCode,
  51893. },
  51894. }
  51895. target := &ret
  51896. if err := gensupport.DecodeResponse(target, res); err != nil {
  51897. return nil, err
  51898. }
  51899. return ret, nil
  51900. // {
  51901. // "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.",
  51902. // "httpMethod": "PATCH",
  51903. // "id": "compute.httpsHealthChecks.patch",
  51904. // "parameterOrder": [
  51905. // "project",
  51906. // "httpsHealthCheck"
  51907. // ],
  51908. // "parameters": {
  51909. // "httpsHealthCheck": {
  51910. // "description": "Name of the HttpsHealthCheck resource to patch.",
  51911. // "location": "path",
  51912. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51913. // "required": true,
  51914. // "type": "string"
  51915. // },
  51916. // "project": {
  51917. // "description": "Project ID for this request.",
  51918. // "location": "path",
  51919. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51920. // "required": true,
  51921. // "type": "string"
  51922. // },
  51923. // "requestId": {
  51924. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51925. // "location": "query",
  51926. // "type": "string"
  51927. // }
  51928. // },
  51929. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  51930. // "request": {
  51931. // "$ref": "HttpsHealthCheck"
  51932. // },
  51933. // "response": {
  51934. // "$ref": "Operation"
  51935. // },
  51936. // "scopes": [
  51937. // "https://www.googleapis.com/auth/cloud-platform",
  51938. // "https://www.googleapis.com/auth/compute"
  51939. // ]
  51940. // }
  51941. }
  51942. // method id "compute.httpsHealthChecks.testIamPermissions":
  51943. type HttpsHealthChecksTestIamPermissionsCall struct {
  51944. s *Service
  51945. project string
  51946. resource string
  51947. testpermissionsrequest *TestPermissionsRequest
  51948. urlParams_ gensupport.URLParams
  51949. ctx_ context.Context
  51950. header_ http.Header
  51951. }
  51952. // TestIamPermissions: Returns permissions that a caller has on the
  51953. // specified resource.
  51954. func (r *HttpsHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpsHealthChecksTestIamPermissionsCall {
  51955. c := &HttpsHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51956. c.project = project
  51957. c.resource = resource
  51958. c.testpermissionsrequest = testpermissionsrequest
  51959. return c
  51960. }
  51961. // Fields allows partial responses to be retrieved. See
  51962. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51963. // for more information.
  51964. func (c *HttpsHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpsHealthChecksTestIamPermissionsCall {
  51965. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51966. return c
  51967. }
  51968. // Context sets the context to be used in this call's Do method. Any
  51969. // pending HTTP request will be aborted if the provided context is
  51970. // canceled.
  51971. func (c *HttpsHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpsHealthChecksTestIamPermissionsCall {
  51972. c.ctx_ = ctx
  51973. return c
  51974. }
  51975. // Header returns an http.Header that can be modified by the caller to
  51976. // add HTTP headers to the request.
  51977. func (c *HttpsHealthChecksTestIamPermissionsCall) Header() http.Header {
  51978. if c.header_ == nil {
  51979. c.header_ = make(http.Header)
  51980. }
  51981. return c.header_
  51982. }
  51983. func (c *HttpsHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  51984. reqHeaders := make(http.Header)
  51985. for k, v := range c.header_ {
  51986. reqHeaders[k] = v
  51987. }
  51988. reqHeaders.Set("User-Agent", c.s.userAgent())
  51989. var body io.Reader = nil
  51990. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  51991. if err != nil {
  51992. return nil, err
  51993. }
  51994. reqHeaders.Set("Content-Type", "application/json")
  51995. c.urlParams_.Set("alt", alt)
  51996. c.urlParams_.Set("prettyPrint", "false")
  51997. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{resource}/testIamPermissions")
  51998. urls += "?" + c.urlParams_.Encode()
  51999. req, err := http.NewRequest("POST", urls, body)
  52000. if err != nil {
  52001. return nil, err
  52002. }
  52003. req.Header = reqHeaders
  52004. googleapi.Expand(req.URL, map[string]string{
  52005. "project": c.project,
  52006. "resource": c.resource,
  52007. })
  52008. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52009. }
  52010. // Do executes the "compute.httpsHealthChecks.testIamPermissions" call.
  52011. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  52012. // non-2xx status code is an error. Response headers are in either
  52013. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  52014. // returned at all) in error.(*googleapi.Error).Header. Use
  52015. // googleapi.IsNotModified to check whether the returned error was
  52016. // because http.StatusNotModified was returned.
  52017. func (c *HttpsHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  52018. gensupport.SetOptions(c.urlParams_, opts...)
  52019. res, err := c.doRequest("json")
  52020. if res != nil && res.StatusCode == http.StatusNotModified {
  52021. if res.Body != nil {
  52022. res.Body.Close()
  52023. }
  52024. return nil, &googleapi.Error{
  52025. Code: res.StatusCode,
  52026. Header: res.Header,
  52027. }
  52028. }
  52029. if err != nil {
  52030. return nil, err
  52031. }
  52032. defer googleapi.CloseBody(res)
  52033. if err := googleapi.CheckResponse(res); err != nil {
  52034. return nil, err
  52035. }
  52036. ret := &TestPermissionsResponse{
  52037. ServerResponse: googleapi.ServerResponse{
  52038. Header: res.Header,
  52039. HTTPStatusCode: res.StatusCode,
  52040. },
  52041. }
  52042. target := &ret
  52043. if err := gensupport.DecodeResponse(target, res); err != nil {
  52044. return nil, err
  52045. }
  52046. return ret, nil
  52047. // {
  52048. // "description": "Returns permissions that a caller has on the specified resource.",
  52049. // "httpMethod": "POST",
  52050. // "id": "compute.httpsHealthChecks.testIamPermissions",
  52051. // "parameterOrder": [
  52052. // "project",
  52053. // "resource"
  52054. // ],
  52055. // "parameters": {
  52056. // "project": {
  52057. // "description": "Project ID for this request.",
  52058. // "location": "path",
  52059. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52060. // "required": true,
  52061. // "type": "string"
  52062. // },
  52063. // "resource": {
  52064. // "description": "Name or id of the resource for this request.",
  52065. // "location": "path",
  52066. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52067. // "required": true,
  52068. // "type": "string"
  52069. // }
  52070. // },
  52071. // "path": "{project}/global/httpsHealthChecks/{resource}/testIamPermissions",
  52072. // "request": {
  52073. // "$ref": "TestPermissionsRequest"
  52074. // },
  52075. // "response": {
  52076. // "$ref": "TestPermissionsResponse"
  52077. // },
  52078. // "scopes": [
  52079. // "https://www.googleapis.com/auth/cloud-platform",
  52080. // "https://www.googleapis.com/auth/compute",
  52081. // "https://www.googleapis.com/auth/compute.readonly"
  52082. // ]
  52083. // }
  52084. }
  52085. // method id "compute.httpsHealthChecks.update":
  52086. type HttpsHealthChecksUpdateCall struct {
  52087. s *Service
  52088. project string
  52089. httpsHealthCheck string
  52090. httpshealthcheck *HttpsHealthCheck
  52091. urlParams_ gensupport.URLParams
  52092. ctx_ context.Context
  52093. header_ http.Header
  52094. }
  52095. // Update: Updates a HttpsHealthCheck resource in the specified project
  52096. // using the data included in the request.
  52097. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  52098. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52099. c.project = project
  52100. c.httpsHealthCheck = httpsHealthCheck
  52101. c.httpshealthcheck = httpshealthcheck
  52102. return c
  52103. }
  52104. // RequestId sets the optional parameter "requestId": An optional
  52105. // request ID to identify requests. Specify a unique request ID so that
  52106. // if you must retry your request, the server will know to ignore the
  52107. // request if it has already been completed.
  52108. //
  52109. // For example, consider a situation where you make an initial request
  52110. // and the request times out. If you make the request again with the
  52111. // same request ID, the server can check if original operation with the
  52112. // same request ID was received, and if so, will ignore the second
  52113. // request. This prevents clients from accidentally creating duplicate
  52114. // commitments.
  52115. //
  52116. // The request ID must be a valid UUID with the exception that zero UUID
  52117. // is not supported (00000000-0000-0000-0000-000000000000).
  52118. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  52119. c.urlParams_.Set("requestId", requestId)
  52120. return c
  52121. }
  52122. // Fields allows partial responses to be retrieved. See
  52123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52124. // for more information.
  52125. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  52126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52127. return c
  52128. }
  52129. // Context sets the context to be used in this call's Do method. Any
  52130. // pending HTTP request will be aborted if the provided context is
  52131. // canceled.
  52132. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  52133. c.ctx_ = ctx
  52134. return c
  52135. }
  52136. // Header returns an http.Header that can be modified by the caller to
  52137. // add HTTP headers to the request.
  52138. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  52139. if c.header_ == nil {
  52140. c.header_ = make(http.Header)
  52141. }
  52142. return c.header_
  52143. }
  52144. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  52145. reqHeaders := make(http.Header)
  52146. for k, v := range c.header_ {
  52147. reqHeaders[k] = v
  52148. }
  52149. reqHeaders.Set("User-Agent", c.s.userAgent())
  52150. var body io.Reader = nil
  52151. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  52152. if err != nil {
  52153. return nil, err
  52154. }
  52155. reqHeaders.Set("Content-Type", "application/json")
  52156. c.urlParams_.Set("alt", alt)
  52157. c.urlParams_.Set("prettyPrint", "false")
  52158. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  52159. urls += "?" + c.urlParams_.Encode()
  52160. req, err := http.NewRequest("PUT", urls, body)
  52161. if err != nil {
  52162. return nil, err
  52163. }
  52164. req.Header = reqHeaders
  52165. googleapi.Expand(req.URL, map[string]string{
  52166. "project": c.project,
  52167. "httpsHealthCheck": c.httpsHealthCheck,
  52168. })
  52169. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52170. }
  52171. // Do executes the "compute.httpsHealthChecks.update" call.
  52172. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52173. // status code is an error. Response headers are in either
  52174. // *Operation.ServerResponse.Header or (if a response was returned at
  52175. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52176. // to check whether the returned error was because
  52177. // http.StatusNotModified was returned.
  52178. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52179. gensupport.SetOptions(c.urlParams_, opts...)
  52180. res, err := c.doRequest("json")
  52181. if res != nil && res.StatusCode == http.StatusNotModified {
  52182. if res.Body != nil {
  52183. res.Body.Close()
  52184. }
  52185. return nil, &googleapi.Error{
  52186. Code: res.StatusCode,
  52187. Header: res.Header,
  52188. }
  52189. }
  52190. if err != nil {
  52191. return nil, err
  52192. }
  52193. defer googleapi.CloseBody(res)
  52194. if err := googleapi.CheckResponse(res); err != nil {
  52195. return nil, err
  52196. }
  52197. ret := &Operation{
  52198. ServerResponse: googleapi.ServerResponse{
  52199. Header: res.Header,
  52200. HTTPStatusCode: res.StatusCode,
  52201. },
  52202. }
  52203. target := &ret
  52204. if err := gensupport.DecodeResponse(target, res); err != nil {
  52205. return nil, err
  52206. }
  52207. return ret, nil
  52208. // {
  52209. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  52210. // "httpMethod": "PUT",
  52211. // "id": "compute.httpsHealthChecks.update",
  52212. // "parameterOrder": [
  52213. // "project",
  52214. // "httpsHealthCheck"
  52215. // ],
  52216. // "parameters": {
  52217. // "httpsHealthCheck": {
  52218. // "description": "Name of the HttpsHealthCheck resource to update.",
  52219. // "location": "path",
  52220. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52221. // "required": true,
  52222. // "type": "string"
  52223. // },
  52224. // "project": {
  52225. // "description": "Project ID for this request.",
  52226. // "location": "path",
  52227. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52228. // "required": true,
  52229. // "type": "string"
  52230. // },
  52231. // "requestId": {
  52232. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52233. // "location": "query",
  52234. // "type": "string"
  52235. // }
  52236. // },
  52237. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  52238. // "request": {
  52239. // "$ref": "HttpsHealthCheck"
  52240. // },
  52241. // "response": {
  52242. // "$ref": "Operation"
  52243. // },
  52244. // "scopes": [
  52245. // "https://www.googleapis.com/auth/cloud-platform",
  52246. // "https://www.googleapis.com/auth/compute"
  52247. // ]
  52248. // }
  52249. }
  52250. // method id "compute.images.delete":
  52251. type ImagesDeleteCall struct {
  52252. s *Service
  52253. project string
  52254. image string
  52255. urlParams_ gensupport.URLParams
  52256. ctx_ context.Context
  52257. header_ http.Header
  52258. }
  52259. // Delete: Deletes the specified image.
  52260. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  52261. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  52262. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52263. c.project = project
  52264. c.image = image
  52265. return c
  52266. }
  52267. // RequestId sets the optional parameter "requestId": An optional
  52268. // request ID to identify requests. Specify a unique request ID so that
  52269. // if you must retry your request, the server will know to ignore the
  52270. // request if it has already been completed.
  52271. //
  52272. // For example, consider a situation where you make an initial request
  52273. // and the request times out. If you make the request again with the
  52274. // same request ID, the server can check if original operation with the
  52275. // same request ID was received, and if so, will ignore the second
  52276. // request. This prevents clients from accidentally creating duplicate
  52277. // commitments.
  52278. //
  52279. // The request ID must be a valid UUID with the exception that zero UUID
  52280. // is not supported (00000000-0000-0000-0000-000000000000).
  52281. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  52282. c.urlParams_.Set("requestId", requestId)
  52283. return c
  52284. }
  52285. // Fields allows partial responses to be retrieved. See
  52286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52287. // for more information.
  52288. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  52289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  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 *ImagesDeleteCall) Header() http.Header {
  52302. if c.header_ == nil {
  52303. c.header_ = make(http.Header)
  52304. }
  52305. return c.header_
  52306. }
  52307. func (c *ImagesDeleteCall) 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. var body io.Reader = nil
  52314. c.urlParams_.Set("alt", alt)
  52315. c.urlParams_.Set("prettyPrint", "false")
  52316. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  52317. urls += "?" + c.urlParams_.Encode()
  52318. req, err := http.NewRequest("DELETE", urls, body)
  52319. if err != nil {
  52320. return nil, err
  52321. }
  52322. req.Header = reqHeaders
  52323. googleapi.Expand(req.URL, map[string]string{
  52324. "project": c.project,
  52325. "image": c.image,
  52326. })
  52327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52328. }
  52329. // Do executes the "compute.images.delete" call.
  52330. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52331. // status code is an error. Response headers are in either
  52332. // *Operation.ServerResponse.Header or (if a response was returned at
  52333. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52334. // to check whether the returned error was because
  52335. // http.StatusNotModified was returned.
  52336. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52337. gensupport.SetOptions(c.urlParams_, opts...)
  52338. res, err := c.doRequest("json")
  52339. if res != nil && res.StatusCode == http.StatusNotModified {
  52340. if res.Body != nil {
  52341. res.Body.Close()
  52342. }
  52343. return nil, &googleapi.Error{
  52344. Code: res.StatusCode,
  52345. Header: res.Header,
  52346. }
  52347. }
  52348. if err != nil {
  52349. return nil, err
  52350. }
  52351. defer googleapi.CloseBody(res)
  52352. if err := googleapi.CheckResponse(res); err != nil {
  52353. return nil, err
  52354. }
  52355. ret := &Operation{
  52356. ServerResponse: googleapi.ServerResponse{
  52357. Header: res.Header,
  52358. HTTPStatusCode: res.StatusCode,
  52359. },
  52360. }
  52361. target := &ret
  52362. if err := gensupport.DecodeResponse(target, res); err != nil {
  52363. return nil, err
  52364. }
  52365. return ret, nil
  52366. // {
  52367. // "description": "Deletes the specified image.",
  52368. // "httpMethod": "DELETE",
  52369. // "id": "compute.images.delete",
  52370. // "parameterOrder": [
  52371. // "project",
  52372. // "image"
  52373. // ],
  52374. // "parameters": {
  52375. // "image": {
  52376. // "description": "Name of the image resource to delete.",
  52377. // "location": "path",
  52378. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52379. // "required": true,
  52380. // "type": "string"
  52381. // },
  52382. // "project": {
  52383. // "description": "Project ID for this request.",
  52384. // "location": "path",
  52385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52386. // "required": true,
  52387. // "type": "string"
  52388. // },
  52389. // "requestId": {
  52390. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52391. // "location": "query",
  52392. // "type": "string"
  52393. // }
  52394. // },
  52395. // "path": "{project}/global/images/{image}",
  52396. // "response": {
  52397. // "$ref": "Operation"
  52398. // },
  52399. // "scopes": [
  52400. // "https://www.googleapis.com/auth/cloud-platform",
  52401. // "https://www.googleapis.com/auth/compute"
  52402. // ]
  52403. // }
  52404. }
  52405. // method id "compute.images.deprecate":
  52406. type ImagesDeprecateCall struct {
  52407. s *Service
  52408. project string
  52409. image string
  52410. deprecationstatus *DeprecationStatus
  52411. urlParams_ gensupport.URLParams
  52412. ctx_ context.Context
  52413. header_ http.Header
  52414. }
  52415. // Deprecate: Sets the deprecation status of an image.
  52416. //
  52417. // If an empty request body is given, clears the deprecation status
  52418. // instead.
  52419. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  52420. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  52421. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52422. c.project = project
  52423. c.image = image
  52424. c.deprecationstatus = deprecationstatus
  52425. return c
  52426. }
  52427. // RequestId sets the optional parameter "requestId": An optional
  52428. // request ID to identify requests. Specify a unique request ID so that
  52429. // if you must retry your request, the server will know to ignore the
  52430. // request if it has already been completed.
  52431. //
  52432. // For example, consider a situation where you make an initial request
  52433. // and the request times out. If you make the request again with the
  52434. // same request ID, the server can check if original operation with the
  52435. // same request ID was received, and if so, will ignore the second
  52436. // request. This prevents clients from accidentally creating duplicate
  52437. // commitments.
  52438. //
  52439. // The request ID must be a valid UUID with the exception that zero UUID
  52440. // is not supported (00000000-0000-0000-0000-000000000000).
  52441. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  52442. c.urlParams_.Set("requestId", requestId)
  52443. return c
  52444. }
  52445. // Fields allows partial responses to be retrieved. See
  52446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52447. // for more information.
  52448. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  52449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52450. return c
  52451. }
  52452. // Context sets the context to be used in this call's Do method. Any
  52453. // pending HTTP request will be aborted if the provided context is
  52454. // canceled.
  52455. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  52456. c.ctx_ = ctx
  52457. return c
  52458. }
  52459. // Header returns an http.Header that can be modified by the caller to
  52460. // add HTTP headers to the request.
  52461. func (c *ImagesDeprecateCall) Header() http.Header {
  52462. if c.header_ == nil {
  52463. c.header_ = make(http.Header)
  52464. }
  52465. return c.header_
  52466. }
  52467. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  52468. reqHeaders := make(http.Header)
  52469. for k, v := range c.header_ {
  52470. reqHeaders[k] = v
  52471. }
  52472. reqHeaders.Set("User-Agent", c.s.userAgent())
  52473. var body io.Reader = nil
  52474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  52475. if err != nil {
  52476. return nil, err
  52477. }
  52478. reqHeaders.Set("Content-Type", "application/json")
  52479. c.urlParams_.Set("alt", alt)
  52480. c.urlParams_.Set("prettyPrint", "false")
  52481. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  52482. urls += "?" + c.urlParams_.Encode()
  52483. req, err := http.NewRequest("POST", urls, body)
  52484. if err != nil {
  52485. return nil, err
  52486. }
  52487. req.Header = reqHeaders
  52488. googleapi.Expand(req.URL, map[string]string{
  52489. "project": c.project,
  52490. "image": c.image,
  52491. })
  52492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52493. }
  52494. // Do executes the "compute.images.deprecate" call.
  52495. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52496. // status code is an error. Response headers are in either
  52497. // *Operation.ServerResponse.Header or (if a response was returned at
  52498. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52499. // to check whether the returned error was because
  52500. // http.StatusNotModified was returned.
  52501. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52502. gensupport.SetOptions(c.urlParams_, opts...)
  52503. res, err := c.doRequest("json")
  52504. if res != nil && res.StatusCode == http.StatusNotModified {
  52505. if res.Body != nil {
  52506. res.Body.Close()
  52507. }
  52508. return nil, &googleapi.Error{
  52509. Code: res.StatusCode,
  52510. Header: res.Header,
  52511. }
  52512. }
  52513. if err != nil {
  52514. return nil, err
  52515. }
  52516. defer googleapi.CloseBody(res)
  52517. if err := googleapi.CheckResponse(res); err != nil {
  52518. return nil, err
  52519. }
  52520. ret := &Operation{
  52521. ServerResponse: googleapi.ServerResponse{
  52522. Header: res.Header,
  52523. HTTPStatusCode: res.StatusCode,
  52524. },
  52525. }
  52526. target := &ret
  52527. if err := gensupport.DecodeResponse(target, res); err != nil {
  52528. return nil, err
  52529. }
  52530. return ret, nil
  52531. // {
  52532. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  52533. // "httpMethod": "POST",
  52534. // "id": "compute.images.deprecate",
  52535. // "parameterOrder": [
  52536. // "project",
  52537. // "image"
  52538. // ],
  52539. // "parameters": {
  52540. // "image": {
  52541. // "description": "Image name.",
  52542. // "location": "path",
  52543. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52544. // "required": true,
  52545. // "type": "string"
  52546. // },
  52547. // "project": {
  52548. // "description": "Project ID for this request.",
  52549. // "location": "path",
  52550. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52551. // "required": true,
  52552. // "type": "string"
  52553. // },
  52554. // "requestId": {
  52555. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52556. // "location": "query",
  52557. // "type": "string"
  52558. // }
  52559. // },
  52560. // "path": "{project}/global/images/{image}/deprecate",
  52561. // "request": {
  52562. // "$ref": "DeprecationStatus"
  52563. // },
  52564. // "response": {
  52565. // "$ref": "Operation"
  52566. // },
  52567. // "scopes": [
  52568. // "https://www.googleapis.com/auth/cloud-platform",
  52569. // "https://www.googleapis.com/auth/compute"
  52570. // ]
  52571. // }
  52572. }
  52573. // method id "compute.images.get":
  52574. type ImagesGetCall struct {
  52575. s *Service
  52576. project string
  52577. image string
  52578. urlParams_ gensupport.URLParams
  52579. ifNoneMatch_ string
  52580. ctx_ context.Context
  52581. header_ http.Header
  52582. }
  52583. // Get: Returns the specified image. Gets a list of available images by
  52584. // making a list() request.
  52585. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  52586. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  52587. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52588. c.project = project
  52589. c.image = image
  52590. return c
  52591. }
  52592. // Fields allows partial responses to be retrieved. See
  52593. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52594. // for more information.
  52595. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  52596. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52597. return c
  52598. }
  52599. // IfNoneMatch sets the optional parameter which makes the operation
  52600. // fail if the object's ETag matches the given value. This is useful for
  52601. // getting updates only after the object has changed since the last
  52602. // request. Use googleapi.IsNotModified to check whether the response
  52603. // error from Do is the result of In-None-Match.
  52604. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  52605. c.ifNoneMatch_ = entityTag
  52606. return c
  52607. }
  52608. // Context sets the context to be used in this call's Do method. Any
  52609. // pending HTTP request will be aborted if the provided context is
  52610. // canceled.
  52611. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  52612. c.ctx_ = ctx
  52613. return c
  52614. }
  52615. // Header returns an http.Header that can be modified by the caller to
  52616. // add HTTP headers to the request.
  52617. func (c *ImagesGetCall) Header() http.Header {
  52618. if c.header_ == nil {
  52619. c.header_ = make(http.Header)
  52620. }
  52621. return c.header_
  52622. }
  52623. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  52624. reqHeaders := make(http.Header)
  52625. for k, v := range c.header_ {
  52626. reqHeaders[k] = v
  52627. }
  52628. reqHeaders.Set("User-Agent", c.s.userAgent())
  52629. if c.ifNoneMatch_ != "" {
  52630. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52631. }
  52632. var body io.Reader = nil
  52633. c.urlParams_.Set("alt", alt)
  52634. c.urlParams_.Set("prettyPrint", "false")
  52635. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  52636. urls += "?" + c.urlParams_.Encode()
  52637. req, err := http.NewRequest("GET", urls, body)
  52638. if err != nil {
  52639. return nil, err
  52640. }
  52641. req.Header = reqHeaders
  52642. googleapi.Expand(req.URL, map[string]string{
  52643. "project": c.project,
  52644. "image": c.image,
  52645. })
  52646. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52647. }
  52648. // Do executes the "compute.images.get" call.
  52649. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  52650. // code is an error. Response headers are in either
  52651. // *Image.ServerResponse.Header or (if a response was returned at all)
  52652. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  52653. // check whether the returned error was because http.StatusNotModified
  52654. // was returned.
  52655. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  52656. gensupport.SetOptions(c.urlParams_, opts...)
  52657. res, err := c.doRequest("json")
  52658. if res != nil && res.StatusCode == http.StatusNotModified {
  52659. if res.Body != nil {
  52660. res.Body.Close()
  52661. }
  52662. return nil, &googleapi.Error{
  52663. Code: res.StatusCode,
  52664. Header: res.Header,
  52665. }
  52666. }
  52667. if err != nil {
  52668. return nil, err
  52669. }
  52670. defer googleapi.CloseBody(res)
  52671. if err := googleapi.CheckResponse(res); err != nil {
  52672. return nil, err
  52673. }
  52674. ret := &Image{
  52675. ServerResponse: googleapi.ServerResponse{
  52676. Header: res.Header,
  52677. HTTPStatusCode: res.StatusCode,
  52678. },
  52679. }
  52680. target := &ret
  52681. if err := gensupport.DecodeResponse(target, res); err != nil {
  52682. return nil, err
  52683. }
  52684. return ret, nil
  52685. // {
  52686. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  52687. // "httpMethod": "GET",
  52688. // "id": "compute.images.get",
  52689. // "parameterOrder": [
  52690. // "project",
  52691. // "image"
  52692. // ],
  52693. // "parameters": {
  52694. // "image": {
  52695. // "description": "Name of the image resource to return.",
  52696. // "location": "path",
  52697. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52698. // "required": true,
  52699. // "type": "string"
  52700. // },
  52701. // "project": {
  52702. // "description": "Project ID for this request.",
  52703. // "location": "path",
  52704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52705. // "required": true,
  52706. // "type": "string"
  52707. // }
  52708. // },
  52709. // "path": "{project}/global/images/{image}",
  52710. // "response": {
  52711. // "$ref": "Image"
  52712. // },
  52713. // "scopes": [
  52714. // "https://www.googleapis.com/auth/cloud-platform",
  52715. // "https://www.googleapis.com/auth/compute",
  52716. // "https://www.googleapis.com/auth/compute.readonly"
  52717. // ]
  52718. // }
  52719. }
  52720. // method id "compute.images.getFromFamily":
  52721. type ImagesGetFromFamilyCall struct {
  52722. s *Service
  52723. project string
  52724. family string
  52725. urlParams_ gensupport.URLParams
  52726. ifNoneMatch_ string
  52727. ctx_ context.Context
  52728. header_ http.Header
  52729. }
  52730. // GetFromFamily: Returns the latest image that is part of an image
  52731. // family and is not deprecated.
  52732. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  52733. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52734. c.project = project
  52735. c.family = family
  52736. return c
  52737. }
  52738. // Fields allows partial responses to be retrieved. See
  52739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52740. // for more information.
  52741. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  52742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52743. return c
  52744. }
  52745. // IfNoneMatch sets the optional parameter which makes the operation
  52746. // fail if the object's ETag matches the given value. This is useful for
  52747. // getting updates only after the object has changed since the last
  52748. // request. Use googleapi.IsNotModified to check whether the response
  52749. // error from Do is the result of In-None-Match.
  52750. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  52751. c.ifNoneMatch_ = entityTag
  52752. return c
  52753. }
  52754. // Context sets the context to be used in this call's Do method. Any
  52755. // pending HTTP request will be aborted if the provided context is
  52756. // canceled.
  52757. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  52758. c.ctx_ = ctx
  52759. return c
  52760. }
  52761. // Header returns an http.Header that can be modified by the caller to
  52762. // add HTTP headers to the request.
  52763. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  52764. if c.header_ == nil {
  52765. c.header_ = make(http.Header)
  52766. }
  52767. return c.header_
  52768. }
  52769. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  52770. reqHeaders := make(http.Header)
  52771. for k, v := range c.header_ {
  52772. reqHeaders[k] = v
  52773. }
  52774. reqHeaders.Set("User-Agent", c.s.userAgent())
  52775. if c.ifNoneMatch_ != "" {
  52776. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52777. }
  52778. var body io.Reader = nil
  52779. c.urlParams_.Set("alt", alt)
  52780. c.urlParams_.Set("prettyPrint", "false")
  52781. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  52782. urls += "?" + c.urlParams_.Encode()
  52783. req, err := http.NewRequest("GET", urls, body)
  52784. if err != nil {
  52785. return nil, err
  52786. }
  52787. req.Header = reqHeaders
  52788. googleapi.Expand(req.URL, map[string]string{
  52789. "project": c.project,
  52790. "family": c.family,
  52791. })
  52792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52793. }
  52794. // Do executes the "compute.images.getFromFamily" call.
  52795. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  52796. // code is an error. Response headers are in either
  52797. // *Image.ServerResponse.Header or (if a response was returned at all)
  52798. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  52799. // check whether the returned error was because http.StatusNotModified
  52800. // was returned.
  52801. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  52802. gensupport.SetOptions(c.urlParams_, opts...)
  52803. res, err := c.doRequest("json")
  52804. if res != nil && res.StatusCode == http.StatusNotModified {
  52805. if res.Body != nil {
  52806. res.Body.Close()
  52807. }
  52808. return nil, &googleapi.Error{
  52809. Code: res.StatusCode,
  52810. Header: res.Header,
  52811. }
  52812. }
  52813. if err != nil {
  52814. return nil, err
  52815. }
  52816. defer googleapi.CloseBody(res)
  52817. if err := googleapi.CheckResponse(res); err != nil {
  52818. return nil, err
  52819. }
  52820. ret := &Image{
  52821. ServerResponse: googleapi.ServerResponse{
  52822. Header: res.Header,
  52823. HTTPStatusCode: res.StatusCode,
  52824. },
  52825. }
  52826. target := &ret
  52827. if err := gensupport.DecodeResponse(target, res); err != nil {
  52828. return nil, err
  52829. }
  52830. return ret, nil
  52831. // {
  52832. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  52833. // "httpMethod": "GET",
  52834. // "id": "compute.images.getFromFamily",
  52835. // "parameterOrder": [
  52836. // "project",
  52837. // "family"
  52838. // ],
  52839. // "parameters": {
  52840. // "family": {
  52841. // "description": "Name of the image family to search for.",
  52842. // "location": "path",
  52843. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52844. // "required": true,
  52845. // "type": "string"
  52846. // },
  52847. // "project": {
  52848. // "description": "Project ID for this request.",
  52849. // "location": "path",
  52850. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52851. // "required": true,
  52852. // "type": "string"
  52853. // }
  52854. // },
  52855. // "path": "{project}/global/images/family/{family}",
  52856. // "response": {
  52857. // "$ref": "Image"
  52858. // },
  52859. // "scopes": [
  52860. // "https://www.googleapis.com/auth/cloud-platform",
  52861. // "https://www.googleapis.com/auth/compute",
  52862. // "https://www.googleapis.com/auth/compute.readonly"
  52863. // ]
  52864. // }
  52865. }
  52866. // method id "compute.images.getIamPolicy":
  52867. type ImagesGetIamPolicyCall struct {
  52868. s *Service
  52869. project string
  52870. resource string
  52871. urlParams_ gensupport.URLParams
  52872. ifNoneMatch_ string
  52873. ctx_ context.Context
  52874. header_ http.Header
  52875. }
  52876. // GetIamPolicy: Gets the access control policy for a resource. May be
  52877. // empty if no such policy or resource exists.
  52878. func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
  52879. c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52880. c.project = project
  52881. c.resource = resource
  52882. return c
  52883. }
  52884. // Fields allows partial responses to be retrieved. See
  52885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52886. // for more information.
  52887. func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
  52888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52889. return c
  52890. }
  52891. // IfNoneMatch sets the optional parameter which makes the operation
  52892. // fail if the object's ETag matches the given value. This is useful for
  52893. // getting updates only after the object has changed since the last
  52894. // request. Use googleapi.IsNotModified to check whether the response
  52895. // error from Do is the result of In-None-Match.
  52896. func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
  52897. c.ifNoneMatch_ = entityTag
  52898. return c
  52899. }
  52900. // Context sets the context to be used in this call's Do method. Any
  52901. // pending HTTP request will be aborted if the provided context is
  52902. // canceled.
  52903. func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
  52904. c.ctx_ = ctx
  52905. return c
  52906. }
  52907. // Header returns an http.Header that can be modified by the caller to
  52908. // add HTTP headers to the request.
  52909. func (c *ImagesGetIamPolicyCall) Header() http.Header {
  52910. if c.header_ == nil {
  52911. c.header_ = make(http.Header)
  52912. }
  52913. return c.header_
  52914. }
  52915. func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  52916. reqHeaders := make(http.Header)
  52917. for k, v := range c.header_ {
  52918. reqHeaders[k] = v
  52919. }
  52920. reqHeaders.Set("User-Agent", c.s.userAgent())
  52921. if c.ifNoneMatch_ != "" {
  52922. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52923. }
  52924. var body io.Reader = nil
  52925. c.urlParams_.Set("alt", alt)
  52926. c.urlParams_.Set("prettyPrint", "false")
  52927. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/getIamPolicy")
  52928. urls += "?" + c.urlParams_.Encode()
  52929. req, err := http.NewRequest("GET", urls, body)
  52930. if err != nil {
  52931. return nil, err
  52932. }
  52933. req.Header = reqHeaders
  52934. googleapi.Expand(req.URL, map[string]string{
  52935. "project": c.project,
  52936. "resource": c.resource,
  52937. })
  52938. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52939. }
  52940. // Do executes the "compute.images.getIamPolicy" call.
  52941. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  52942. // code is an error. Response headers are in either
  52943. // *Policy.ServerResponse.Header or (if a response was returned at all)
  52944. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  52945. // check whether the returned error was because http.StatusNotModified
  52946. // was returned.
  52947. func (c *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  52948. gensupport.SetOptions(c.urlParams_, opts...)
  52949. res, err := c.doRequest("json")
  52950. if res != nil && res.StatusCode == http.StatusNotModified {
  52951. if res.Body != nil {
  52952. res.Body.Close()
  52953. }
  52954. return nil, &googleapi.Error{
  52955. Code: res.StatusCode,
  52956. Header: res.Header,
  52957. }
  52958. }
  52959. if err != nil {
  52960. return nil, err
  52961. }
  52962. defer googleapi.CloseBody(res)
  52963. if err := googleapi.CheckResponse(res); err != nil {
  52964. return nil, err
  52965. }
  52966. ret := &Policy{
  52967. ServerResponse: googleapi.ServerResponse{
  52968. Header: res.Header,
  52969. HTTPStatusCode: res.StatusCode,
  52970. },
  52971. }
  52972. target := &ret
  52973. if err := gensupport.DecodeResponse(target, res); err != nil {
  52974. return nil, err
  52975. }
  52976. return ret, nil
  52977. // {
  52978. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  52979. // "httpMethod": "GET",
  52980. // "id": "compute.images.getIamPolicy",
  52981. // "parameterOrder": [
  52982. // "project",
  52983. // "resource"
  52984. // ],
  52985. // "parameters": {
  52986. // "project": {
  52987. // "description": "Project ID for this request.",
  52988. // "location": "path",
  52989. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52990. // "required": true,
  52991. // "type": "string"
  52992. // },
  52993. // "resource": {
  52994. // "description": "Name or id of the resource for this request.",
  52995. // "location": "path",
  52996. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52997. // "required": true,
  52998. // "type": "string"
  52999. // }
  53000. // },
  53001. // "path": "{project}/global/images/{resource}/getIamPolicy",
  53002. // "response": {
  53003. // "$ref": "Policy"
  53004. // },
  53005. // "scopes": [
  53006. // "https://www.googleapis.com/auth/cloud-platform",
  53007. // "https://www.googleapis.com/auth/compute",
  53008. // "https://www.googleapis.com/auth/compute.readonly"
  53009. // ]
  53010. // }
  53011. }
  53012. // method id "compute.images.insert":
  53013. type ImagesInsertCall struct {
  53014. s *Service
  53015. project string
  53016. image *Image
  53017. urlParams_ gensupport.URLParams
  53018. ctx_ context.Context
  53019. header_ http.Header
  53020. }
  53021. // Insert: Creates an image in the specified project using the data
  53022. // included in the request.
  53023. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  53024. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  53025. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53026. c.project = project
  53027. c.image = image
  53028. return c
  53029. }
  53030. // ForceCreate sets the optional parameter "forceCreate": Force image
  53031. // creation if true.
  53032. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  53033. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  53034. return c
  53035. }
  53036. // RequestId sets the optional parameter "requestId": An optional
  53037. // request ID to identify requests. Specify a unique request ID so that
  53038. // if you must retry your request, the server will know to ignore the
  53039. // request if it has already been completed.
  53040. //
  53041. // For example, consider a situation where you make an initial request
  53042. // and the request times out. If you make the request again with the
  53043. // same request ID, the server can check if original operation with the
  53044. // same request ID was received, and if so, will ignore the second
  53045. // request. This prevents clients from accidentally creating duplicate
  53046. // commitments.
  53047. //
  53048. // The request ID must be a valid UUID with the exception that zero UUID
  53049. // is not supported (00000000-0000-0000-0000-000000000000).
  53050. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  53051. c.urlParams_.Set("requestId", requestId)
  53052. return c
  53053. }
  53054. // Fields allows partial responses to be retrieved. See
  53055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53056. // for more information.
  53057. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  53058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53059. return c
  53060. }
  53061. // Context sets the context to be used in this call's Do method. Any
  53062. // pending HTTP request will be aborted if the provided context is
  53063. // canceled.
  53064. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  53065. c.ctx_ = ctx
  53066. return c
  53067. }
  53068. // Header returns an http.Header that can be modified by the caller to
  53069. // add HTTP headers to the request.
  53070. func (c *ImagesInsertCall) Header() http.Header {
  53071. if c.header_ == nil {
  53072. c.header_ = make(http.Header)
  53073. }
  53074. return c.header_
  53075. }
  53076. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  53077. reqHeaders := make(http.Header)
  53078. for k, v := range c.header_ {
  53079. reqHeaders[k] = v
  53080. }
  53081. reqHeaders.Set("User-Agent", c.s.userAgent())
  53082. var body io.Reader = nil
  53083. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  53084. if err != nil {
  53085. return nil, err
  53086. }
  53087. reqHeaders.Set("Content-Type", "application/json")
  53088. c.urlParams_.Set("alt", alt)
  53089. c.urlParams_.Set("prettyPrint", "false")
  53090. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  53091. urls += "?" + c.urlParams_.Encode()
  53092. req, err := http.NewRequest("POST", urls, body)
  53093. if err != nil {
  53094. return nil, err
  53095. }
  53096. req.Header = reqHeaders
  53097. googleapi.Expand(req.URL, map[string]string{
  53098. "project": c.project,
  53099. })
  53100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53101. }
  53102. // Do executes the "compute.images.insert" call.
  53103. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53104. // status code is an error. Response headers are in either
  53105. // *Operation.ServerResponse.Header or (if a response was returned at
  53106. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53107. // to check whether the returned error was because
  53108. // http.StatusNotModified was returned.
  53109. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53110. gensupport.SetOptions(c.urlParams_, opts...)
  53111. res, err := c.doRequest("json")
  53112. if res != nil && res.StatusCode == http.StatusNotModified {
  53113. if res.Body != nil {
  53114. res.Body.Close()
  53115. }
  53116. return nil, &googleapi.Error{
  53117. Code: res.StatusCode,
  53118. Header: res.Header,
  53119. }
  53120. }
  53121. if err != nil {
  53122. return nil, err
  53123. }
  53124. defer googleapi.CloseBody(res)
  53125. if err := googleapi.CheckResponse(res); err != nil {
  53126. return nil, err
  53127. }
  53128. ret := &Operation{
  53129. ServerResponse: googleapi.ServerResponse{
  53130. Header: res.Header,
  53131. HTTPStatusCode: res.StatusCode,
  53132. },
  53133. }
  53134. target := &ret
  53135. if err := gensupport.DecodeResponse(target, res); err != nil {
  53136. return nil, err
  53137. }
  53138. return ret, nil
  53139. // {
  53140. // "description": "Creates an image in the specified project using the data included in the request.",
  53141. // "httpMethod": "POST",
  53142. // "id": "compute.images.insert",
  53143. // "parameterOrder": [
  53144. // "project"
  53145. // ],
  53146. // "parameters": {
  53147. // "forceCreate": {
  53148. // "description": "Force image creation if true.",
  53149. // "location": "query",
  53150. // "type": "boolean"
  53151. // },
  53152. // "project": {
  53153. // "description": "Project ID for this request.",
  53154. // "location": "path",
  53155. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53156. // "required": true,
  53157. // "type": "string"
  53158. // },
  53159. // "requestId": {
  53160. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53161. // "location": "query",
  53162. // "type": "string"
  53163. // }
  53164. // },
  53165. // "path": "{project}/global/images",
  53166. // "request": {
  53167. // "$ref": "Image"
  53168. // },
  53169. // "response": {
  53170. // "$ref": "Operation"
  53171. // },
  53172. // "scopes": [
  53173. // "https://www.googleapis.com/auth/cloud-platform",
  53174. // "https://www.googleapis.com/auth/compute",
  53175. // "https://www.googleapis.com/auth/devstorage.full_control",
  53176. // "https://www.googleapis.com/auth/devstorage.read_only",
  53177. // "https://www.googleapis.com/auth/devstorage.read_write"
  53178. // ]
  53179. // }
  53180. }
  53181. // method id "compute.images.list":
  53182. type ImagesListCall struct {
  53183. s *Service
  53184. project string
  53185. urlParams_ gensupport.URLParams
  53186. ifNoneMatch_ string
  53187. ctx_ context.Context
  53188. header_ http.Header
  53189. }
  53190. // List: Retrieves the list of custom images available to the specified
  53191. // project. Custom images are images you create that belong to your
  53192. // project. This method does not get any images that belong to other
  53193. // projects, including publicly-available images, like Debian 8. If you
  53194. // want to get a list of publicly-available images, use this method to
  53195. // make a request to the respective image project, such as debian-cloud
  53196. // or windows-cloud.
  53197. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  53198. func (r *ImagesService) List(project string) *ImagesListCall {
  53199. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53200. c.project = project
  53201. return c
  53202. }
  53203. // Filter sets the optional parameter "filter": A filter expression that
  53204. // filters resources listed in the response. The expression must specify
  53205. // the field name, a comparison operator, and the value that you want to
  53206. // use for filtering. The value must be a string, a number, or a
  53207. // boolean. The comparison operator must be either =, !=, >, or <.
  53208. //
  53209. // For example, if you are filtering Compute Engine instances, you can
  53210. // exclude instances named example-instance by specifying name !=
  53211. // example-instance.
  53212. //
  53213. // You can also filter nested fields. For example, you could specify
  53214. // scheduling.automaticRestart = false to include instances only if they
  53215. // are not scheduled for automatic restarts. You can use filtering on
  53216. // nested fields to filter based on resource labels.
  53217. //
  53218. // To filter on multiple expressions, provide each separate expression
  53219. // within parentheses. For example, (scheduling.automaticRestart = true)
  53220. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  53221. // AND expression. However, you can include AND and OR expressions
  53222. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  53223. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  53224. // true).
  53225. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  53226. c.urlParams_.Set("filter", filter)
  53227. return c
  53228. }
  53229. // MaxResults sets the optional parameter "maxResults": The maximum
  53230. // number of results per page that should be returned. If the number of
  53231. // available results is larger than maxResults, Compute Engine returns a
  53232. // nextPageToken that can be used to get the next page of results in
  53233. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  53234. // (Default: 500)
  53235. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  53236. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53237. return c
  53238. }
  53239. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  53240. // a certain order. By default, results are returned in alphanumerical
  53241. // order based on the resource name.
  53242. //
  53243. // You can also sort results in descending order based on the creation
  53244. // timestamp using orderBy="creationTimestamp desc". This sorts results
  53245. // based on the creationTimestamp field in reverse chronological order
  53246. // (newest result first). Use this to sort resources like operations so
  53247. // that the newest operation is returned first.
  53248. //
  53249. // Currently, only sorting by name or creationTimestamp desc is
  53250. // supported.
  53251. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  53252. c.urlParams_.Set("orderBy", orderBy)
  53253. return c
  53254. }
  53255. // PageToken sets the optional parameter "pageToken": Specifies a page
  53256. // token to use. Set pageToken to the nextPageToken returned by a
  53257. // previous list request to get the next page of results.
  53258. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  53259. c.urlParams_.Set("pageToken", pageToken)
  53260. return c
  53261. }
  53262. // Fields allows partial responses to be retrieved. See
  53263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53264. // for more information.
  53265. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  53266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53267. return c
  53268. }
  53269. // IfNoneMatch sets the optional parameter which makes the operation
  53270. // fail if the object's ETag matches the given value. This is useful for
  53271. // getting updates only after the object has changed since the last
  53272. // request. Use googleapi.IsNotModified to check whether the response
  53273. // error from Do is the result of In-None-Match.
  53274. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  53275. c.ifNoneMatch_ = entityTag
  53276. return c
  53277. }
  53278. // Context sets the context to be used in this call's Do method. Any
  53279. // pending HTTP request will be aborted if the provided context is
  53280. // canceled.
  53281. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  53282. c.ctx_ = ctx
  53283. return c
  53284. }
  53285. // Header returns an http.Header that can be modified by the caller to
  53286. // add HTTP headers to the request.
  53287. func (c *ImagesListCall) Header() http.Header {
  53288. if c.header_ == nil {
  53289. c.header_ = make(http.Header)
  53290. }
  53291. return c.header_
  53292. }
  53293. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  53294. reqHeaders := make(http.Header)
  53295. for k, v := range c.header_ {
  53296. reqHeaders[k] = v
  53297. }
  53298. reqHeaders.Set("User-Agent", c.s.userAgent())
  53299. if c.ifNoneMatch_ != "" {
  53300. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53301. }
  53302. var body io.Reader = nil
  53303. c.urlParams_.Set("alt", alt)
  53304. c.urlParams_.Set("prettyPrint", "false")
  53305. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  53306. urls += "?" + c.urlParams_.Encode()
  53307. req, err := http.NewRequest("GET", urls, body)
  53308. if err != nil {
  53309. return nil, err
  53310. }
  53311. req.Header = reqHeaders
  53312. googleapi.Expand(req.URL, map[string]string{
  53313. "project": c.project,
  53314. })
  53315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53316. }
  53317. // Do executes the "compute.images.list" call.
  53318. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  53319. // status code is an error. Response headers are in either
  53320. // *ImageList.ServerResponse.Header or (if a response was returned at
  53321. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53322. // to check whether the returned error was because
  53323. // http.StatusNotModified was returned.
  53324. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  53325. gensupport.SetOptions(c.urlParams_, opts...)
  53326. res, err := c.doRequest("json")
  53327. if res != nil && res.StatusCode == http.StatusNotModified {
  53328. if res.Body != nil {
  53329. res.Body.Close()
  53330. }
  53331. return nil, &googleapi.Error{
  53332. Code: res.StatusCode,
  53333. Header: res.Header,
  53334. }
  53335. }
  53336. if err != nil {
  53337. return nil, err
  53338. }
  53339. defer googleapi.CloseBody(res)
  53340. if err := googleapi.CheckResponse(res); err != nil {
  53341. return nil, err
  53342. }
  53343. ret := &ImageList{
  53344. ServerResponse: googleapi.ServerResponse{
  53345. Header: res.Header,
  53346. HTTPStatusCode: res.StatusCode,
  53347. },
  53348. }
  53349. target := &ret
  53350. if err := gensupport.DecodeResponse(target, res); err != nil {
  53351. return nil, err
  53352. }
  53353. return ret, nil
  53354. // {
  53355. // "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.",
  53356. // "httpMethod": "GET",
  53357. // "id": "compute.images.list",
  53358. // "parameterOrder": [
  53359. // "project"
  53360. // ],
  53361. // "parameters": {
  53362. // "filter": {
  53363. // "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).",
  53364. // "location": "query",
  53365. // "type": "string"
  53366. // },
  53367. // "maxResults": {
  53368. // "default": "500",
  53369. // "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)",
  53370. // "format": "uint32",
  53371. // "location": "query",
  53372. // "minimum": "0",
  53373. // "type": "integer"
  53374. // },
  53375. // "orderBy": {
  53376. // "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.",
  53377. // "location": "query",
  53378. // "type": "string"
  53379. // },
  53380. // "pageToken": {
  53381. // "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.",
  53382. // "location": "query",
  53383. // "type": "string"
  53384. // },
  53385. // "project": {
  53386. // "description": "Project ID for this request.",
  53387. // "location": "path",
  53388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53389. // "required": true,
  53390. // "type": "string"
  53391. // }
  53392. // },
  53393. // "path": "{project}/global/images",
  53394. // "response": {
  53395. // "$ref": "ImageList"
  53396. // },
  53397. // "scopes": [
  53398. // "https://www.googleapis.com/auth/cloud-platform",
  53399. // "https://www.googleapis.com/auth/compute",
  53400. // "https://www.googleapis.com/auth/compute.readonly"
  53401. // ]
  53402. // }
  53403. }
  53404. // Pages invokes f for each page of results.
  53405. // A non-nil error returned from f will halt the iteration.
  53406. // The provided context supersedes any context provided to the Context method.
  53407. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  53408. c.ctx_ = ctx
  53409. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  53410. for {
  53411. x, err := c.Do()
  53412. if err != nil {
  53413. return err
  53414. }
  53415. if err := f(x); err != nil {
  53416. return err
  53417. }
  53418. if x.NextPageToken == "" {
  53419. return nil
  53420. }
  53421. c.PageToken(x.NextPageToken)
  53422. }
  53423. }
  53424. // method id "compute.images.setIamPolicy":
  53425. type ImagesSetIamPolicyCall struct {
  53426. s *Service
  53427. project string
  53428. resource string
  53429. globalsetpolicyrequest *GlobalSetPolicyRequest
  53430. urlParams_ gensupport.URLParams
  53431. ctx_ context.Context
  53432. header_ http.Header
  53433. }
  53434. // SetIamPolicy: Sets the access control policy on the specified
  53435. // resource. Replaces any existing policy.
  53436. func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
  53437. c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53438. c.project = project
  53439. c.resource = resource
  53440. c.globalsetpolicyrequest = globalsetpolicyrequest
  53441. return c
  53442. }
  53443. // Fields allows partial responses to be retrieved. See
  53444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53445. // for more information.
  53446. func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
  53447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53448. return c
  53449. }
  53450. // Context sets the context to be used in this call's Do method. Any
  53451. // pending HTTP request will be aborted if the provided context is
  53452. // canceled.
  53453. func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
  53454. c.ctx_ = ctx
  53455. return c
  53456. }
  53457. // Header returns an http.Header that can be modified by the caller to
  53458. // add HTTP headers to the request.
  53459. func (c *ImagesSetIamPolicyCall) Header() http.Header {
  53460. if c.header_ == nil {
  53461. c.header_ = make(http.Header)
  53462. }
  53463. return c.header_
  53464. }
  53465. func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  53466. reqHeaders := make(http.Header)
  53467. for k, v := range c.header_ {
  53468. reqHeaders[k] = v
  53469. }
  53470. reqHeaders.Set("User-Agent", c.s.userAgent())
  53471. var body io.Reader = nil
  53472. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  53473. if err != nil {
  53474. return nil, err
  53475. }
  53476. reqHeaders.Set("Content-Type", "application/json")
  53477. c.urlParams_.Set("alt", alt)
  53478. c.urlParams_.Set("prettyPrint", "false")
  53479. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setIamPolicy")
  53480. urls += "?" + c.urlParams_.Encode()
  53481. req, err := http.NewRequest("POST", urls, body)
  53482. if err != nil {
  53483. return nil, err
  53484. }
  53485. req.Header = reqHeaders
  53486. googleapi.Expand(req.URL, map[string]string{
  53487. "project": c.project,
  53488. "resource": c.resource,
  53489. })
  53490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53491. }
  53492. // Do executes the "compute.images.setIamPolicy" call.
  53493. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  53494. // code is an error. Response headers are in either
  53495. // *Policy.ServerResponse.Header or (if a response was returned at all)
  53496. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  53497. // check whether the returned error was because http.StatusNotModified
  53498. // was returned.
  53499. func (c *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  53500. gensupport.SetOptions(c.urlParams_, opts...)
  53501. res, err := c.doRequest("json")
  53502. if res != nil && res.StatusCode == http.StatusNotModified {
  53503. if res.Body != nil {
  53504. res.Body.Close()
  53505. }
  53506. return nil, &googleapi.Error{
  53507. Code: res.StatusCode,
  53508. Header: res.Header,
  53509. }
  53510. }
  53511. if err != nil {
  53512. return nil, err
  53513. }
  53514. defer googleapi.CloseBody(res)
  53515. if err := googleapi.CheckResponse(res); err != nil {
  53516. return nil, err
  53517. }
  53518. ret := &Policy{
  53519. ServerResponse: googleapi.ServerResponse{
  53520. Header: res.Header,
  53521. HTTPStatusCode: res.StatusCode,
  53522. },
  53523. }
  53524. target := &ret
  53525. if err := gensupport.DecodeResponse(target, res); err != nil {
  53526. return nil, err
  53527. }
  53528. return ret, nil
  53529. // {
  53530. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  53531. // "httpMethod": "POST",
  53532. // "id": "compute.images.setIamPolicy",
  53533. // "parameterOrder": [
  53534. // "project",
  53535. // "resource"
  53536. // ],
  53537. // "parameters": {
  53538. // "project": {
  53539. // "description": "Project ID for this request.",
  53540. // "location": "path",
  53541. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53542. // "required": true,
  53543. // "type": "string"
  53544. // },
  53545. // "resource": {
  53546. // "description": "Name or id of the resource for this request.",
  53547. // "location": "path",
  53548. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53549. // "required": true,
  53550. // "type": "string"
  53551. // }
  53552. // },
  53553. // "path": "{project}/global/images/{resource}/setIamPolicy",
  53554. // "request": {
  53555. // "$ref": "GlobalSetPolicyRequest"
  53556. // },
  53557. // "response": {
  53558. // "$ref": "Policy"
  53559. // },
  53560. // "scopes": [
  53561. // "https://www.googleapis.com/auth/cloud-platform",
  53562. // "https://www.googleapis.com/auth/compute"
  53563. // ]
  53564. // }
  53565. }
  53566. // method id "compute.images.setLabels":
  53567. type ImagesSetLabelsCall struct {
  53568. s *Service
  53569. project string
  53570. resource string
  53571. globalsetlabelsrequest *GlobalSetLabelsRequest
  53572. urlParams_ gensupport.URLParams
  53573. ctx_ context.Context
  53574. header_ http.Header
  53575. }
  53576. // SetLabels: Sets the labels on an image. To learn more about labels,
  53577. // read the Labeling Resources documentation.
  53578. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  53579. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53580. c.project = project
  53581. c.resource = resource
  53582. c.globalsetlabelsrequest = globalsetlabelsrequest
  53583. return c
  53584. }
  53585. // Fields allows partial responses to be retrieved. See
  53586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53587. // for more information.
  53588. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  53589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53590. return c
  53591. }
  53592. // Context sets the context to be used in this call's Do method. Any
  53593. // pending HTTP request will be aborted if the provided context is
  53594. // canceled.
  53595. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  53596. c.ctx_ = ctx
  53597. return c
  53598. }
  53599. // Header returns an http.Header that can be modified by the caller to
  53600. // add HTTP headers to the request.
  53601. func (c *ImagesSetLabelsCall) Header() http.Header {
  53602. if c.header_ == nil {
  53603. c.header_ = make(http.Header)
  53604. }
  53605. return c.header_
  53606. }
  53607. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  53608. reqHeaders := make(http.Header)
  53609. for k, v := range c.header_ {
  53610. reqHeaders[k] = v
  53611. }
  53612. reqHeaders.Set("User-Agent", c.s.userAgent())
  53613. var body io.Reader = nil
  53614. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  53615. if err != nil {
  53616. return nil, err
  53617. }
  53618. reqHeaders.Set("Content-Type", "application/json")
  53619. c.urlParams_.Set("alt", alt)
  53620. c.urlParams_.Set("prettyPrint", "false")
  53621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  53622. urls += "?" + c.urlParams_.Encode()
  53623. req, err := http.NewRequest("POST", urls, body)
  53624. if err != nil {
  53625. return nil, err
  53626. }
  53627. req.Header = reqHeaders
  53628. googleapi.Expand(req.URL, map[string]string{
  53629. "project": c.project,
  53630. "resource": c.resource,
  53631. })
  53632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53633. }
  53634. // Do executes the "compute.images.setLabels" call.
  53635. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53636. // status code is an error. Response headers are in either
  53637. // *Operation.ServerResponse.Header or (if a response was returned at
  53638. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53639. // to check whether the returned error was because
  53640. // http.StatusNotModified was returned.
  53641. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53642. gensupport.SetOptions(c.urlParams_, opts...)
  53643. res, err := c.doRequest("json")
  53644. if res != nil && res.StatusCode == http.StatusNotModified {
  53645. if res.Body != nil {
  53646. res.Body.Close()
  53647. }
  53648. return nil, &googleapi.Error{
  53649. Code: res.StatusCode,
  53650. Header: res.Header,
  53651. }
  53652. }
  53653. if err != nil {
  53654. return nil, err
  53655. }
  53656. defer googleapi.CloseBody(res)
  53657. if err := googleapi.CheckResponse(res); err != nil {
  53658. return nil, err
  53659. }
  53660. ret := &Operation{
  53661. ServerResponse: googleapi.ServerResponse{
  53662. Header: res.Header,
  53663. HTTPStatusCode: res.StatusCode,
  53664. },
  53665. }
  53666. target := &ret
  53667. if err := gensupport.DecodeResponse(target, res); err != nil {
  53668. return nil, err
  53669. }
  53670. return ret, nil
  53671. // {
  53672. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  53673. // "httpMethod": "POST",
  53674. // "id": "compute.images.setLabels",
  53675. // "parameterOrder": [
  53676. // "project",
  53677. // "resource"
  53678. // ],
  53679. // "parameters": {
  53680. // "project": {
  53681. // "description": "Project ID for this request.",
  53682. // "location": "path",
  53683. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53684. // "required": true,
  53685. // "type": "string"
  53686. // },
  53687. // "resource": {
  53688. // "description": "Name or id of the resource for this request.",
  53689. // "location": "path",
  53690. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53691. // "required": true,
  53692. // "type": "string"
  53693. // }
  53694. // },
  53695. // "path": "{project}/global/images/{resource}/setLabels",
  53696. // "request": {
  53697. // "$ref": "GlobalSetLabelsRequest"
  53698. // },
  53699. // "response": {
  53700. // "$ref": "Operation"
  53701. // },
  53702. // "scopes": [
  53703. // "https://www.googleapis.com/auth/cloud-platform",
  53704. // "https://www.googleapis.com/auth/compute"
  53705. // ]
  53706. // }
  53707. }
  53708. // method id "compute.images.testIamPermissions":
  53709. type ImagesTestIamPermissionsCall struct {
  53710. s *Service
  53711. project string
  53712. resource string
  53713. testpermissionsrequest *TestPermissionsRequest
  53714. urlParams_ gensupport.URLParams
  53715. ctx_ context.Context
  53716. header_ http.Header
  53717. }
  53718. // TestIamPermissions: Returns permissions that a caller has on the
  53719. // specified resource.
  53720. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  53721. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53722. c.project = project
  53723. c.resource = resource
  53724. c.testpermissionsrequest = testpermissionsrequest
  53725. return c
  53726. }
  53727. // Fields allows partial responses to be retrieved. See
  53728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53729. // for more information.
  53730. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  53731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53732. return c
  53733. }
  53734. // Context sets the context to be used in this call's Do method. Any
  53735. // pending HTTP request will be aborted if the provided context is
  53736. // canceled.
  53737. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  53738. c.ctx_ = ctx
  53739. return c
  53740. }
  53741. // Header returns an http.Header that can be modified by the caller to
  53742. // add HTTP headers to the request.
  53743. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  53744. if c.header_ == nil {
  53745. c.header_ = make(http.Header)
  53746. }
  53747. return c.header_
  53748. }
  53749. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  53750. reqHeaders := make(http.Header)
  53751. for k, v := range c.header_ {
  53752. reqHeaders[k] = v
  53753. }
  53754. reqHeaders.Set("User-Agent", c.s.userAgent())
  53755. var body io.Reader = nil
  53756. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  53757. if err != nil {
  53758. return nil, err
  53759. }
  53760. reqHeaders.Set("Content-Type", "application/json")
  53761. c.urlParams_.Set("alt", alt)
  53762. c.urlParams_.Set("prettyPrint", "false")
  53763. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  53764. urls += "?" + c.urlParams_.Encode()
  53765. req, err := http.NewRequest("POST", urls, body)
  53766. if err != nil {
  53767. return nil, err
  53768. }
  53769. req.Header = reqHeaders
  53770. googleapi.Expand(req.URL, map[string]string{
  53771. "project": c.project,
  53772. "resource": c.resource,
  53773. })
  53774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53775. }
  53776. // Do executes the "compute.images.testIamPermissions" call.
  53777. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  53778. // non-2xx status code is an error. Response headers are in either
  53779. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  53780. // returned at all) in error.(*googleapi.Error).Header. Use
  53781. // googleapi.IsNotModified to check whether the returned error was
  53782. // because http.StatusNotModified was returned.
  53783. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  53784. gensupport.SetOptions(c.urlParams_, opts...)
  53785. res, err := c.doRequest("json")
  53786. if res != nil && res.StatusCode == http.StatusNotModified {
  53787. if res.Body != nil {
  53788. res.Body.Close()
  53789. }
  53790. return nil, &googleapi.Error{
  53791. Code: res.StatusCode,
  53792. Header: res.Header,
  53793. }
  53794. }
  53795. if err != nil {
  53796. return nil, err
  53797. }
  53798. defer googleapi.CloseBody(res)
  53799. if err := googleapi.CheckResponse(res); err != nil {
  53800. return nil, err
  53801. }
  53802. ret := &TestPermissionsResponse{
  53803. ServerResponse: googleapi.ServerResponse{
  53804. Header: res.Header,
  53805. HTTPStatusCode: res.StatusCode,
  53806. },
  53807. }
  53808. target := &ret
  53809. if err := gensupport.DecodeResponse(target, res); err != nil {
  53810. return nil, err
  53811. }
  53812. return ret, nil
  53813. // {
  53814. // "description": "Returns permissions that a caller has on the specified resource.",
  53815. // "httpMethod": "POST",
  53816. // "id": "compute.images.testIamPermissions",
  53817. // "parameterOrder": [
  53818. // "project",
  53819. // "resource"
  53820. // ],
  53821. // "parameters": {
  53822. // "project": {
  53823. // "description": "Project ID for this request.",
  53824. // "location": "path",
  53825. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53826. // "required": true,
  53827. // "type": "string"
  53828. // },
  53829. // "resource": {
  53830. // "description": "Name or id of the resource for this request.",
  53831. // "location": "path",
  53832. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53833. // "required": true,
  53834. // "type": "string"
  53835. // }
  53836. // },
  53837. // "path": "{project}/global/images/{resource}/testIamPermissions",
  53838. // "request": {
  53839. // "$ref": "TestPermissionsRequest"
  53840. // },
  53841. // "response": {
  53842. // "$ref": "TestPermissionsResponse"
  53843. // },
  53844. // "scopes": [
  53845. // "https://www.googleapis.com/auth/cloud-platform",
  53846. // "https://www.googleapis.com/auth/compute",
  53847. // "https://www.googleapis.com/auth/compute.readonly"
  53848. // ]
  53849. // }
  53850. }
  53851. // method id "compute.instanceGroupManagers.abandonInstances":
  53852. type InstanceGroupManagersAbandonInstancesCall struct {
  53853. s *Service
  53854. project string
  53855. zone string
  53856. instanceGroupManager string
  53857. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  53858. urlParams_ gensupport.URLParams
  53859. ctx_ context.Context
  53860. header_ http.Header
  53861. }
  53862. // AbandonInstances: Flags the specified instances to be removed from
  53863. // the managed instance group. Abandoning an instance does not delete
  53864. // the instance, but it does remove the instance from any target pools
  53865. // that are applied by the managed instance group. This method reduces
  53866. // the targetSize of the managed instance group by the number of
  53867. // instances that you abandon. This operation is marked as DONE when the
  53868. // action is scheduled even if the instances have not yet been removed
  53869. // from the group. You must separately verify the status of the
  53870. // abandoning action with the listmanagedinstances method.
  53871. //
  53872. // If the group is part of a backend service that has enabled connection
  53873. // draining, it can take up to 60 seconds after the connection draining
  53874. // duration has elapsed before the VM instance is removed or
  53875. // deleted.
  53876. //
  53877. // You can specify a maximum of 1000 instances with this method per
  53878. // request.
  53879. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  53880. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53881. c.project = project
  53882. c.zone = zone
  53883. c.instanceGroupManager = instanceGroupManager
  53884. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  53885. return c
  53886. }
  53887. // RequestId sets the optional parameter "requestId": An optional
  53888. // request ID to identify requests. Specify a unique request ID so that
  53889. // if you must retry your request, the server will know to ignore the
  53890. // request if it has already been completed.
  53891. //
  53892. // For example, consider a situation where you make an initial request
  53893. // and the request times out. If you make the request again with the
  53894. // same request ID, the server can check if original operation with the
  53895. // same request ID was received, and if so, will ignore the second
  53896. // request. This prevents clients from accidentally creating duplicate
  53897. // commitments.
  53898. //
  53899. // The request ID must be a valid UUID with the exception that zero UUID
  53900. // is not supported (00000000-0000-0000-0000-000000000000).
  53901. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  53902. c.urlParams_.Set("requestId", requestId)
  53903. return c
  53904. }
  53905. // Fields allows partial responses to be retrieved. See
  53906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53907. // for more information.
  53908. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  53909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53910. return c
  53911. }
  53912. // Context sets the context to be used in this call's Do method. Any
  53913. // pending HTTP request will be aborted if the provided context is
  53914. // canceled.
  53915. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  53916. c.ctx_ = ctx
  53917. return c
  53918. }
  53919. // Header returns an http.Header that can be modified by the caller to
  53920. // add HTTP headers to the request.
  53921. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  53922. if c.header_ == nil {
  53923. c.header_ = make(http.Header)
  53924. }
  53925. return c.header_
  53926. }
  53927. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  53928. reqHeaders := make(http.Header)
  53929. for k, v := range c.header_ {
  53930. reqHeaders[k] = v
  53931. }
  53932. reqHeaders.Set("User-Agent", c.s.userAgent())
  53933. var body io.Reader = nil
  53934. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  53935. if err != nil {
  53936. return nil, err
  53937. }
  53938. reqHeaders.Set("Content-Type", "application/json")
  53939. c.urlParams_.Set("alt", alt)
  53940. c.urlParams_.Set("prettyPrint", "false")
  53941. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  53942. urls += "?" + c.urlParams_.Encode()
  53943. req, err := http.NewRequest("POST", urls, body)
  53944. if err != nil {
  53945. return nil, err
  53946. }
  53947. req.Header = reqHeaders
  53948. googleapi.Expand(req.URL, map[string]string{
  53949. "project": c.project,
  53950. "zone": c.zone,
  53951. "instanceGroupManager": c.instanceGroupManager,
  53952. })
  53953. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53954. }
  53955. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  53956. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53957. // status code is an error. Response headers are in either
  53958. // *Operation.ServerResponse.Header or (if a response was returned at
  53959. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53960. // to check whether the returned error was because
  53961. // http.StatusNotModified was returned.
  53962. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53963. gensupport.SetOptions(c.urlParams_, opts...)
  53964. res, err := c.doRequest("json")
  53965. if res != nil && res.StatusCode == http.StatusNotModified {
  53966. if res.Body != nil {
  53967. res.Body.Close()
  53968. }
  53969. return nil, &googleapi.Error{
  53970. Code: res.StatusCode,
  53971. Header: res.Header,
  53972. }
  53973. }
  53974. if err != nil {
  53975. return nil, err
  53976. }
  53977. defer googleapi.CloseBody(res)
  53978. if err := googleapi.CheckResponse(res); err != nil {
  53979. return nil, err
  53980. }
  53981. ret := &Operation{
  53982. ServerResponse: googleapi.ServerResponse{
  53983. Header: res.Header,
  53984. HTTPStatusCode: res.StatusCode,
  53985. },
  53986. }
  53987. target := &ret
  53988. if err := gensupport.DecodeResponse(target, res); err != nil {
  53989. return nil, err
  53990. }
  53991. return ret, nil
  53992. // {
  53993. // "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.",
  53994. // "httpMethod": "POST",
  53995. // "id": "compute.instanceGroupManagers.abandonInstances",
  53996. // "parameterOrder": [
  53997. // "project",
  53998. // "zone",
  53999. // "instanceGroupManager"
  54000. // ],
  54001. // "parameters": {
  54002. // "instanceGroupManager": {
  54003. // "description": "The name of the managed instance group.",
  54004. // "location": "path",
  54005. // "required": true,
  54006. // "type": "string"
  54007. // },
  54008. // "project": {
  54009. // "description": "Project ID for this request.",
  54010. // "location": "path",
  54011. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54012. // "required": true,
  54013. // "type": "string"
  54014. // },
  54015. // "requestId": {
  54016. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54017. // "location": "query",
  54018. // "type": "string"
  54019. // },
  54020. // "zone": {
  54021. // "description": "The name of the zone where the managed instance group is located.",
  54022. // "location": "path",
  54023. // "required": true,
  54024. // "type": "string"
  54025. // }
  54026. // },
  54027. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  54028. // "request": {
  54029. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  54030. // },
  54031. // "response": {
  54032. // "$ref": "Operation"
  54033. // },
  54034. // "scopes": [
  54035. // "https://www.googleapis.com/auth/cloud-platform",
  54036. // "https://www.googleapis.com/auth/compute"
  54037. // ]
  54038. // }
  54039. }
  54040. // method id "compute.instanceGroupManagers.aggregatedList":
  54041. type InstanceGroupManagersAggregatedListCall struct {
  54042. s *Service
  54043. project string
  54044. urlParams_ gensupport.URLParams
  54045. ifNoneMatch_ string
  54046. ctx_ context.Context
  54047. header_ http.Header
  54048. }
  54049. // AggregatedList: Retrieves the list of managed instance groups and
  54050. // groups them by zone.
  54051. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  54052. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54053. c.project = project
  54054. return c
  54055. }
  54056. // Filter sets the optional parameter "filter": A filter expression that
  54057. // filters resources listed in the response. The expression must specify
  54058. // the field name, a comparison operator, and the value that you want to
  54059. // use for filtering. The value must be a string, a number, or a
  54060. // boolean. The comparison operator must be either =, !=, >, or <.
  54061. //
  54062. // For example, if you are filtering Compute Engine instances, you can
  54063. // exclude instances named example-instance by specifying name !=
  54064. // example-instance.
  54065. //
  54066. // You can also filter nested fields. For example, you could specify
  54067. // scheduling.automaticRestart = false to include instances only if they
  54068. // are not scheduled for automatic restarts. You can use filtering on
  54069. // nested fields to filter based on resource labels.
  54070. //
  54071. // To filter on multiple expressions, provide each separate expression
  54072. // within parentheses. For example, (scheduling.automaticRestart = true)
  54073. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  54074. // AND expression. However, you can include AND and OR expressions
  54075. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  54076. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  54077. // true).
  54078. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  54079. c.urlParams_.Set("filter", filter)
  54080. return c
  54081. }
  54082. // MaxResults sets the optional parameter "maxResults": The maximum
  54083. // number of results per page that should be returned. If the number of
  54084. // available results is larger than maxResults, Compute Engine returns a
  54085. // nextPageToken that can be used to get the next page of results in
  54086. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  54087. // (Default: 500)
  54088. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  54089. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  54090. return c
  54091. }
  54092. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  54093. // a certain order. By default, results are returned in alphanumerical
  54094. // order based on the resource name.
  54095. //
  54096. // You can also sort results in descending order based on the creation
  54097. // timestamp using orderBy="creationTimestamp desc". This sorts results
  54098. // based on the creationTimestamp field in reverse chronological order
  54099. // (newest result first). Use this to sort resources like operations so
  54100. // that the newest operation is returned first.
  54101. //
  54102. // Currently, only sorting by name or creationTimestamp desc is
  54103. // supported.
  54104. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  54105. c.urlParams_.Set("orderBy", orderBy)
  54106. return c
  54107. }
  54108. // PageToken sets the optional parameter "pageToken": Specifies a page
  54109. // token to use. Set pageToken to the nextPageToken returned by a
  54110. // previous list request to get the next page of results.
  54111. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  54112. c.urlParams_.Set("pageToken", pageToken)
  54113. return c
  54114. }
  54115. // Fields allows partial responses to be retrieved. See
  54116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54117. // for more information.
  54118. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  54119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54120. return c
  54121. }
  54122. // IfNoneMatch sets the optional parameter which makes the operation
  54123. // fail if the object's ETag matches the given value. This is useful for
  54124. // getting updates only after the object has changed since the last
  54125. // request. Use googleapi.IsNotModified to check whether the response
  54126. // error from Do is the result of In-None-Match.
  54127. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  54128. c.ifNoneMatch_ = entityTag
  54129. return c
  54130. }
  54131. // Context sets the context to be used in this call's Do method. Any
  54132. // pending HTTP request will be aborted if the provided context is
  54133. // canceled.
  54134. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  54135. c.ctx_ = ctx
  54136. return c
  54137. }
  54138. // Header returns an http.Header that can be modified by the caller to
  54139. // add HTTP headers to the request.
  54140. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  54141. if c.header_ == nil {
  54142. c.header_ = make(http.Header)
  54143. }
  54144. return c.header_
  54145. }
  54146. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  54147. reqHeaders := make(http.Header)
  54148. for k, v := range c.header_ {
  54149. reqHeaders[k] = v
  54150. }
  54151. reqHeaders.Set("User-Agent", c.s.userAgent())
  54152. if c.ifNoneMatch_ != "" {
  54153. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54154. }
  54155. var body io.Reader = nil
  54156. c.urlParams_.Set("alt", alt)
  54157. c.urlParams_.Set("prettyPrint", "false")
  54158. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  54159. urls += "?" + c.urlParams_.Encode()
  54160. req, err := http.NewRequest("GET", urls, body)
  54161. if err != nil {
  54162. return nil, err
  54163. }
  54164. req.Header = reqHeaders
  54165. googleapi.Expand(req.URL, map[string]string{
  54166. "project": c.project,
  54167. })
  54168. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54169. }
  54170. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  54171. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  54172. // non-nil. Any non-2xx status code is an error. Response headers are in
  54173. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  54174. // (if a response was returned at all) in
  54175. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  54176. // whether the returned error was because http.StatusNotModified was
  54177. // returned.
  54178. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  54179. gensupport.SetOptions(c.urlParams_, opts...)
  54180. res, err := c.doRequest("json")
  54181. if res != nil && res.StatusCode == http.StatusNotModified {
  54182. if res.Body != nil {
  54183. res.Body.Close()
  54184. }
  54185. return nil, &googleapi.Error{
  54186. Code: res.StatusCode,
  54187. Header: res.Header,
  54188. }
  54189. }
  54190. if err != nil {
  54191. return nil, err
  54192. }
  54193. defer googleapi.CloseBody(res)
  54194. if err := googleapi.CheckResponse(res); err != nil {
  54195. return nil, err
  54196. }
  54197. ret := &InstanceGroupManagerAggregatedList{
  54198. ServerResponse: googleapi.ServerResponse{
  54199. Header: res.Header,
  54200. HTTPStatusCode: res.StatusCode,
  54201. },
  54202. }
  54203. target := &ret
  54204. if err := gensupport.DecodeResponse(target, res); err != nil {
  54205. return nil, err
  54206. }
  54207. return ret, nil
  54208. // {
  54209. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  54210. // "httpMethod": "GET",
  54211. // "id": "compute.instanceGroupManagers.aggregatedList",
  54212. // "parameterOrder": [
  54213. // "project"
  54214. // ],
  54215. // "parameters": {
  54216. // "filter": {
  54217. // "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).",
  54218. // "location": "query",
  54219. // "type": "string"
  54220. // },
  54221. // "maxResults": {
  54222. // "default": "500",
  54223. // "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)",
  54224. // "format": "uint32",
  54225. // "location": "query",
  54226. // "minimum": "0",
  54227. // "type": "integer"
  54228. // },
  54229. // "orderBy": {
  54230. // "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.",
  54231. // "location": "query",
  54232. // "type": "string"
  54233. // },
  54234. // "pageToken": {
  54235. // "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.",
  54236. // "location": "query",
  54237. // "type": "string"
  54238. // },
  54239. // "project": {
  54240. // "description": "Project ID for this request.",
  54241. // "location": "path",
  54242. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54243. // "required": true,
  54244. // "type": "string"
  54245. // }
  54246. // },
  54247. // "path": "{project}/aggregated/instanceGroupManagers",
  54248. // "response": {
  54249. // "$ref": "InstanceGroupManagerAggregatedList"
  54250. // },
  54251. // "scopes": [
  54252. // "https://www.googleapis.com/auth/cloud-platform",
  54253. // "https://www.googleapis.com/auth/compute",
  54254. // "https://www.googleapis.com/auth/compute.readonly"
  54255. // ]
  54256. // }
  54257. }
  54258. // Pages invokes f for each page of results.
  54259. // A non-nil error returned from f will halt the iteration.
  54260. // The provided context supersedes any context provided to the Context method.
  54261. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  54262. c.ctx_ = ctx
  54263. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54264. for {
  54265. x, err := c.Do()
  54266. if err != nil {
  54267. return err
  54268. }
  54269. if err := f(x); err != nil {
  54270. return err
  54271. }
  54272. if x.NextPageToken == "" {
  54273. return nil
  54274. }
  54275. c.PageToken(x.NextPageToken)
  54276. }
  54277. }
  54278. // method id "compute.instanceGroupManagers.delete":
  54279. type InstanceGroupManagersDeleteCall struct {
  54280. s *Service
  54281. project string
  54282. zone string
  54283. instanceGroupManager string
  54284. urlParams_ gensupport.URLParams
  54285. ctx_ context.Context
  54286. header_ http.Header
  54287. }
  54288. // Delete: Deletes the specified managed instance group and all of the
  54289. // instances in that group. Note that the instance group must not belong
  54290. // to a backend service. Read Deleting an instance group for more
  54291. // information.
  54292. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  54293. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54294. c.project = project
  54295. c.zone = zone
  54296. c.instanceGroupManager = instanceGroupManager
  54297. return c
  54298. }
  54299. // RequestId sets the optional parameter "requestId": An optional
  54300. // request ID to identify requests. Specify a unique request ID so that
  54301. // if you must retry your request, the server will know to ignore the
  54302. // request if it has already been completed.
  54303. //
  54304. // For example, consider a situation where you make an initial request
  54305. // and the request times out. If you make the request again with the
  54306. // same request ID, the server can check if original operation with the
  54307. // same request ID was received, and if so, will ignore the second
  54308. // request. This prevents clients from accidentally creating duplicate
  54309. // commitments.
  54310. //
  54311. // The request ID must be a valid UUID with the exception that zero UUID
  54312. // is not supported (00000000-0000-0000-0000-000000000000).
  54313. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  54314. c.urlParams_.Set("requestId", requestId)
  54315. return c
  54316. }
  54317. // Fields allows partial responses to be retrieved. See
  54318. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54319. // for more information.
  54320. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  54321. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54322. return c
  54323. }
  54324. // Context sets the context to be used in this call's Do method. Any
  54325. // pending HTTP request will be aborted if the provided context is
  54326. // canceled.
  54327. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  54328. c.ctx_ = ctx
  54329. return c
  54330. }
  54331. // Header returns an http.Header that can be modified by the caller to
  54332. // add HTTP headers to the request.
  54333. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  54334. if c.header_ == nil {
  54335. c.header_ = make(http.Header)
  54336. }
  54337. return c.header_
  54338. }
  54339. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  54340. reqHeaders := make(http.Header)
  54341. for k, v := range c.header_ {
  54342. reqHeaders[k] = v
  54343. }
  54344. reqHeaders.Set("User-Agent", c.s.userAgent())
  54345. var body io.Reader = nil
  54346. c.urlParams_.Set("alt", alt)
  54347. c.urlParams_.Set("prettyPrint", "false")
  54348. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  54349. urls += "?" + c.urlParams_.Encode()
  54350. req, err := http.NewRequest("DELETE", urls, body)
  54351. if err != nil {
  54352. return nil, err
  54353. }
  54354. req.Header = reqHeaders
  54355. googleapi.Expand(req.URL, map[string]string{
  54356. "project": c.project,
  54357. "zone": c.zone,
  54358. "instanceGroupManager": c.instanceGroupManager,
  54359. })
  54360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54361. }
  54362. // Do executes the "compute.instanceGroupManagers.delete" call.
  54363. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54364. // status code is an error. Response headers are in either
  54365. // *Operation.ServerResponse.Header or (if a response was returned at
  54366. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54367. // to check whether the returned error was because
  54368. // http.StatusNotModified was returned.
  54369. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54370. gensupport.SetOptions(c.urlParams_, opts...)
  54371. res, err := c.doRequest("json")
  54372. if res != nil && res.StatusCode == http.StatusNotModified {
  54373. if res.Body != nil {
  54374. res.Body.Close()
  54375. }
  54376. return nil, &googleapi.Error{
  54377. Code: res.StatusCode,
  54378. Header: res.Header,
  54379. }
  54380. }
  54381. if err != nil {
  54382. return nil, err
  54383. }
  54384. defer googleapi.CloseBody(res)
  54385. if err := googleapi.CheckResponse(res); err != nil {
  54386. return nil, err
  54387. }
  54388. ret := &Operation{
  54389. ServerResponse: googleapi.ServerResponse{
  54390. Header: res.Header,
  54391. HTTPStatusCode: res.StatusCode,
  54392. },
  54393. }
  54394. target := &ret
  54395. if err := gensupport.DecodeResponse(target, res); err != nil {
  54396. return nil, err
  54397. }
  54398. return ret, nil
  54399. // {
  54400. // "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.",
  54401. // "httpMethod": "DELETE",
  54402. // "id": "compute.instanceGroupManagers.delete",
  54403. // "parameterOrder": [
  54404. // "project",
  54405. // "zone",
  54406. // "instanceGroupManager"
  54407. // ],
  54408. // "parameters": {
  54409. // "instanceGroupManager": {
  54410. // "description": "The name of the managed instance group to delete.",
  54411. // "location": "path",
  54412. // "required": true,
  54413. // "type": "string"
  54414. // },
  54415. // "project": {
  54416. // "description": "Project ID for this request.",
  54417. // "location": "path",
  54418. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54419. // "required": true,
  54420. // "type": "string"
  54421. // },
  54422. // "requestId": {
  54423. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54424. // "location": "query",
  54425. // "type": "string"
  54426. // },
  54427. // "zone": {
  54428. // "description": "The name of the zone where the managed instance group is located.",
  54429. // "location": "path",
  54430. // "required": true,
  54431. // "type": "string"
  54432. // }
  54433. // },
  54434. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  54435. // "response": {
  54436. // "$ref": "Operation"
  54437. // },
  54438. // "scopes": [
  54439. // "https://www.googleapis.com/auth/cloud-platform",
  54440. // "https://www.googleapis.com/auth/compute"
  54441. // ]
  54442. // }
  54443. }
  54444. // method id "compute.instanceGroupManagers.deleteInstances":
  54445. type InstanceGroupManagersDeleteInstancesCall struct {
  54446. s *Service
  54447. project string
  54448. zone string
  54449. instanceGroupManager string
  54450. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  54451. urlParams_ gensupport.URLParams
  54452. ctx_ context.Context
  54453. header_ http.Header
  54454. }
  54455. // DeleteInstances: Flags the specified instances in the managed
  54456. // instance group for immediate deletion. The instances are also removed
  54457. // from any target pools of which they were a member. This method
  54458. // reduces the targetSize of the managed instance group by the number of
  54459. // instances that you delete. This operation is marked as DONE when the
  54460. // action is scheduled even if the instances are still being deleted.
  54461. // You must separately verify the status of the deleting action with the
  54462. // listmanagedinstances method.
  54463. //
  54464. // If the group is part of a backend service that has enabled connection
  54465. // draining, it can take up to 60 seconds after the connection draining
  54466. // duration has elapsed before the VM instance is removed or
  54467. // deleted.
  54468. //
  54469. // You can specify a maximum of 1000 instances with this method per
  54470. // request.
  54471. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  54472. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54473. c.project = project
  54474. c.zone = zone
  54475. c.instanceGroupManager = instanceGroupManager
  54476. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  54477. return c
  54478. }
  54479. // RequestId sets the optional parameter "requestId": An optional
  54480. // request ID to identify requests. Specify a unique request ID so that
  54481. // if you must retry your request, the server will know to ignore the
  54482. // request if it has already been completed.
  54483. //
  54484. // For example, consider a situation where you make an initial request
  54485. // and the request times out. If you make the request again with the
  54486. // same request ID, the server can check if original operation with the
  54487. // same request ID was received, and if so, will ignore the second
  54488. // request. This prevents clients from accidentally creating duplicate
  54489. // commitments.
  54490. //
  54491. // The request ID must be a valid UUID with the exception that zero UUID
  54492. // is not supported (00000000-0000-0000-0000-000000000000).
  54493. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  54494. c.urlParams_.Set("requestId", requestId)
  54495. return c
  54496. }
  54497. // Fields allows partial responses to be retrieved. See
  54498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54499. // for more information.
  54500. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  54501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54502. return c
  54503. }
  54504. // Context sets the context to be used in this call's Do method. Any
  54505. // pending HTTP request will be aborted if the provided context is
  54506. // canceled.
  54507. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  54508. c.ctx_ = ctx
  54509. return c
  54510. }
  54511. // Header returns an http.Header that can be modified by the caller to
  54512. // add HTTP headers to the request.
  54513. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  54514. if c.header_ == nil {
  54515. c.header_ = make(http.Header)
  54516. }
  54517. return c.header_
  54518. }
  54519. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  54520. reqHeaders := make(http.Header)
  54521. for k, v := range c.header_ {
  54522. reqHeaders[k] = v
  54523. }
  54524. reqHeaders.Set("User-Agent", c.s.userAgent())
  54525. var body io.Reader = nil
  54526. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  54527. if err != nil {
  54528. return nil, err
  54529. }
  54530. reqHeaders.Set("Content-Type", "application/json")
  54531. c.urlParams_.Set("alt", alt)
  54532. c.urlParams_.Set("prettyPrint", "false")
  54533. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  54534. urls += "?" + c.urlParams_.Encode()
  54535. req, err := http.NewRequest("POST", urls, body)
  54536. if err != nil {
  54537. return nil, err
  54538. }
  54539. req.Header = reqHeaders
  54540. googleapi.Expand(req.URL, map[string]string{
  54541. "project": c.project,
  54542. "zone": c.zone,
  54543. "instanceGroupManager": c.instanceGroupManager,
  54544. })
  54545. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54546. }
  54547. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  54548. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54549. // status code is an error. Response headers are in either
  54550. // *Operation.ServerResponse.Header or (if a response was returned at
  54551. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54552. // to check whether the returned error was because
  54553. // http.StatusNotModified was returned.
  54554. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54555. gensupport.SetOptions(c.urlParams_, opts...)
  54556. res, err := c.doRequest("json")
  54557. if res != nil && res.StatusCode == http.StatusNotModified {
  54558. if res.Body != nil {
  54559. res.Body.Close()
  54560. }
  54561. return nil, &googleapi.Error{
  54562. Code: res.StatusCode,
  54563. Header: res.Header,
  54564. }
  54565. }
  54566. if err != nil {
  54567. return nil, err
  54568. }
  54569. defer googleapi.CloseBody(res)
  54570. if err := googleapi.CheckResponse(res); err != nil {
  54571. return nil, err
  54572. }
  54573. ret := &Operation{
  54574. ServerResponse: googleapi.ServerResponse{
  54575. Header: res.Header,
  54576. HTTPStatusCode: res.StatusCode,
  54577. },
  54578. }
  54579. target := &ret
  54580. if err := gensupport.DecodeResponse(target, res); err != nil {
  54581. return nil, err
  54582. }
  54583. return ret, nil
  54584. // {
  54585. // "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.",
  54586. // "httpMethod": "POST",
  54587. // "id": "compute.instanceGroupManagers.deleteInstances",
  54588. // "parameterOrder": [
  54589. // "project",
  54590. // "zone",
  54591. // "instanceGroupManager"
  54592. // ],
  54593. // "parameters": {
  54594. // "instanceGroupManager": {
  54595. // "description": "The name of the managed instance group.",
  54596. // "location": "path",
  54597. // "required": true,
  54598. // "type": "string"
  54599. // },
  54600. // "project": {
  54601. // "description": "Project ID for this request.",
  54602. // "location": "path",
  54603. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54604. // "required": true,
  54605. // "type": "string"
  54606. // },
  54607. // "requestId": {
  54608. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54609. // "location": "query",
  54610. // "type": "string"
  54611. // },
  54612. // "zone": {
  54613. // "description": "The name of the zone where the managed instance group is located.",
  54614. // "location": "path",
  54615. // "required": true,
  54616. // "type": "string"
  54617. // }
  54618. // },
  54619. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  54620. // "request": {
  54621. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  54622. // },
  54623. // "response": {
  54624. // "$ref": "Operation"
  54625. // },
  54626. // "scopes": [
  54627. // "https://www.googleapis.com/auth/cloud-platform",
  54628. // "https://www.googleapis.com/auth/compute"
  54629. // ]
  54630. // }
  54631. }
  54632. // method id "compute.instanceGroupManagers.get":
  54633. type InstanceGroupManagersGetCall struct {
  54634. s *Service
  54635. project string
  54636. zone string
  54637. instanceGroupManager string
  54638. urlParams_ gensupport.URLParams
  54639. ifNoneMatch_ string
  54640. ctx_ context.Context
  54641. header_ http.Header
  54642. }
  54643. // Get: Returns all of the details about the specified managed instance
  54644. // group. Gets a list of available managed instance groups by making a
  54645. // list() request.
  54646. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  54647. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54648. c.project = project
  54649. c.zone = zone
  54650. c.instanceGroupManager = instanceGroupManager
  54651. return c
  54652. }
  54653. // Fields allows partial responses to be retrieved. See
  54654. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54655. // for more information.
  54656. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  54657. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54658. return c
  54659. }
  54660. // IfNoneMatch sets the optional parameter which makes the operation
  54661. // fail if the object's ETag matches the given value. This is useful for
  54662. // getting updates only after the object has changed since the last
  54663. // request. Use googleapi.IsNotModified to check whether the response
  54664. // error from Do is the result of In-None-Match.
  54665. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  54666. c.ifNoneMatch_ = entityTag
  54667. return c
  54668. }
  54669. // Context sets the context to be used in this call's Do method. Any
  54670. // pending HTTP request will be aborted if the provided context is
  54671. // canceled.
  54672. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  54673. c.ctx_ = ctx
  54674. return c
  54675. }
  54676. // Header returns an http.Header that can be modified by the caller to
  54677. // add HTTP headers to the request.
  54678. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  54679. if c.header_ == nil {
  54680. c.header_ = make(http.Header)
  54681. }
  54682. return c.header_
  54683. }
  54684. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  54685. reqHeaders := make(http.Header)
  54686. for k, v := range c.header_ {
  54687. reqHeaders[k] = v
  54688. }
  54689. reqHeaders.Set("User-Agent", c.s.userAgent())
  54690. if c.ifNoneMatch_ != "" {
  54691. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54692. }
  54693. var body io.Reader = nil
  54694. c.urlParams_.Set("alt", alt)
  54695. c.urlParams_.Set("prettyPrint", "false")
  54696. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  54697. urls += "?" + c.urlParams_.Encode()
  54698. req, err := http.NewRequest("GET", urls, body)
  54699. if err != nil {
  54700. return nil, err
  54701. }
  54702. req.Header = reqHeaders
  54703. googleapi.Expand(req.URL, map[string]string{
  54704. "project": c.project,
  54705. "zone": c.zone,
  54706. "instanceGroupManager": c.instanceGroupManager,
  54707. })
  54708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54709. }
  54710. // Do executes the "compute.instanceGroupManagers.get" call.
  54711. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  54712. // non-2xx status code is an error. Response headers are in either
  54713. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  54714. // returned at all) in error.(*googleapi.Error).Header. Use
  54715. // googleapi.IsNotModified to check whether the returned error was
  54716. // because http.StatusNotModified was returned.
  54717. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  54718. gensupport.SetOptions(c.urlParams_, opts...)
  54719. res, err := c.doRequest("json")
  54720. if res != nil && res.StatusCode == http.StatusNotModified {
  54721. if res.Body != nil {
  54722. res.Body.Close()
  54723. }
  54724. return nil, &googleapi.Error{
  54725. Code: res.StatusCode,
  54726. Header: res.Header,
  54727. }
  54728. }
  54729. if err != nil {
  54730. return nil, err
  54731. }
  54732. defer googleapi.CloseBody(res)
  54733. if err := googleapi.CheckResponse(res); err != nil {
  54734. return nil, err
  54735. }
  54736. ret := &InstanceGroupManager{
  54737. ServerResponse: googleapi.ServerResponse{
  54738. Header: res.Header,
  54739. HTTPStatusCode: res.StatusCode,
  54740. },
  54741. }
  54742. target := &ret
  54743. if err := gensupport.DecodeResponse(target, res); err != nil {
  54744. return nil, err
  54745. }
  54746. return ret, nil
  54747. // {
  54748. // "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.",
  54749. // "httpMethod": "GET",
  54750. // "id": "compute.instanceGroupManagers.get",
  54751. // "parameterOrder": [
  54752. // "project",
  54753. // "zone",
  54754. // "instanceGroupManager"
  54755. // ],
  54756. // "parameters": {
  54757. // "instanceGroupManager": {
  54758. // "description": "The name of the managed instance group.",
  54759. // "location": "path",
  54760. // "required": true,
  54761. // "type": "string"
  54762. // },
  54763. // "project": {
  54764. // "description": "Project ID for this request.",
  54765. // "location": "path",
  54766. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54767. // "required": true,
  54768. // "type": "string"
  54769. // },
  54770. // "zone": {
  54771. // "description": "The name of the zone where the managed instance group is located.",
  54772. // "location": "path",
  54773. // "required": true,
  54774. // "type": "string"
  54775. // }
  54776. // },
  54777. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  54778. // "response": {
  54779. // "$ref": "InstanceGroupManager"
  54780. // },
  54781. // "scopes": [
  54782. // "https://www.googleapis.com/auth/cloud-platform",
  54783. // "https://www.googleapis.com/auth/compute",
  54784. // "https://www.googleapis.com/auth/compute.readonly"
  54785. // ]
  54786. // }
  54787. }
  54788. // method id "compute.instanceGroupManagers.insert":
  54789. type InstanceGroupManagersInsertCall struct {
  54790. s *Service
  54791. project string
  54792. zone string
  54793. instancegroupmanager *InstanceGroupManager
  54794. urlParams_ gensupport.URLParams
  54795. ctx_ context.Context
  54796. header_ http.Header
  54797. }
  54798. // Insert: Creates a managed instance group using the information that
  54799. // you specify in the request. After the group is created, instances in
  54800. // the group are created using the specified instance template. This
  54801. // operation is marked as DONE when the group is created even if the
  54802. // instances in the group have not yet been created. You must separately
  54803. // verify the status of the individual instances with the
  54804. // listmanagedinstances method.
  54805. //
  54806. // A managed instance group can have up to 1000 VM instances per group.
  54807. // Please contact Cloud Support if you need an increase in this limit.
  54808. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  54809. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54810. c.project = project
  54811. c.zone = zone
  54812. c.instancegroupmanager = instancegroupmanager
  54813. return c
  54814. }
  54815. // RequestId sets the optional parameter "requestId": An optional
  54816. // request ID to identify requests. Specify a unique request ID so that
  54817. // if you must retry your request, the server will know to ignore the
  54818. // request if it has already been completed.
  54819. //
  54820. // For example, consider a situation where you make an initial request
  54821. // and the request times out. If you make the request again with the
  54822. // same request ID, the server can check if original operation with the
  54823. // same request ID was received, and if so, will ignore the second
  54824. // request. This prevents clients from accidentally creating duplicate
  54825. // commitments.
  54826. //
  54827. // The request ID must be a valid UUID with the exception that zero UUID
  54828. // is not supported (00000000-0000-0000-0000-000000000000).
  54829. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  54830. c.urlParams_.Set("requestId", requestId)
  54831. return c
  54832. }
  54833. // Fields allows partial responses to be retrieved. See
  54834. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54835. // for more information.
  54836. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  54837. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54838. return c
  54839. }
  54840. // Context sets the context to be used in this call's Do method. Any
  54841. // pending HTTP request will be aborted if the provided context is
  54842. // canceled.
  54843. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  54844. c.ctx_ = ctx
  54845. return c
  54846. }
  54847. // Header returns an http.Header that can be modified by the caller to
  54848. // add HTTP headers to the request.
  54849. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  54850. if c.header_ == nil {
  54851. c.header_ = make(http.Header)
  54852. }
  54853. return c.header_
  54854. }
  54855. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  54856. reqHeaders := make(http.Header)
  54857. for k, v := range c.header_ {
  54858. reqHeaders[k] = v
  54859. }
  54860. reqHeaders.Set("User-Agent", c.s.userAgent())
  54861. var body io.Reader = nil
  54862. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  54863. if err != nil {
  54864. return nil, err
  54865. }
  54866. reqHeaders.Set("Content-Type", "application/json")
  54867. c.urlParams_.Set("alt", alt)
  54868. c.urlParams_.Set("prettyPrint", "false")
  54869. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  54870. urls += "?" + c.urlParams_.Encode()
  54871. req, err := http.NewRequest("POST", urls, body)
  54872. if err != nil {
  54873. return nil, err
  54874. }
  54875. req.Header = reqHeaders
  54876. googleapi.Expand(req.URL, map[string]string{
  54877. "project": c.project,
  54878. "zone": c.zone,
  54879. })
  54880. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54881. }
  54882. // Do executes the "compute.instanceGroupManagers.insert" call.
  54883. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54884. // status code is an error. Response headers are in either
  54885. // *Operation.ServerResponse.Header or (if a response was returned at
  54886. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54887. // to check whether the returned error was because
  54888. // http.StatusNotModified was returned.
  54889. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54890. gensupport.SetOptions(c.urlParams_, opts...)
  54891. res, err := c.doRequest("json")
  54892. if res != nil && res.StatusCode == http.StatusNotModified {
  54893. if res.Body != nil {
  54894. res.Body.Close()
  54895. }
  54896. return nil, &googleapi.Error{
  54897. Code: res.StatusCode,
  54898. Header: res.Header,
  54899. }
  54900. }
  54901. if err != nil {
  54902. return nil, err
  54903. }
  54904. defer googleapi.CloseBody(res)
  54905. if err := googleapi.CheckResponse(res); err != nil {
  54906. return nil, err
  54907. }
  54908. ret := &Operation{
  54909. ServerResponse: googleapi.ServerResponse{
  54910. Header: res.Header,
  54911. HTTPStatusCode: res.StatusCode,
  54912. },
  54913. }
  54914. target := &ret
  54915. if err := gensupport.DecodeResponse(target, res); err != nil {
  54916. return nil, err
  54917. }
  54918. return ret, nil
  54919. // {
  54920. // "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.",
  54921. // "httpMethod": "POST",
  54922. // "id": "compute.instanceGroupManagers.insert",
  54923. // "parameterOrder": [
  54924. // "project",
  54925. // "zone"
  54926. // ],
  54927. // "parameters": {
  54928. // "project": {
  54929. // "description": "Project ID for this request.",
  54930. // "location": "path",
  54931. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54932. // "required": true,
  54933. // "type": "string"
  54934. // },
  54935. // "requestId": {
  54936. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54937. // "location": "query",
  54938. // "type": "string"
  54939. // },
  54940. // "zone": {
  54941. // "description": "The name of the zone where you want to create the managed instance group.",
  54942. // "location": "path",
  54943. // "required": true,
  54944. // "type": "string"
  54945. // }
  54946. // },
  54947. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  54948. // "request": {
  54949. // "$ref": "InstanceGroupManager"
  54950. // },
  54951. // "response": {
  54952. // "$ref": "Operation"
  54953. // },
  54954. // "scopes": [
  54955. // "https://www.googleapis.com/auth/cloud-platform",
  54956. // "https://www.googleapis.com/auth/compute"
  54957. // ]
  54958. // }
  54959. }
  54960. // method id "compute.instanceGroupManagers.list":
  54961. type InstanceGroupManagersListCall struct {
  54962. s *Service
  54963. project string
  54964. zone string
  54965. urlParams_ gensupport.URLParams
  54966. ifNoneMatch_ string
  54967. ctx_ context.Context
  54968. header_ http.Header
  54969. }
  54970. // List: Retrieves a list of managed instance groups that are contained
  54971. // within the specified project and zone.
  54972. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  54973. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54974. c.project = project
  54975. c.zone = zone
  54976. return c
  54977. }
  54978. // Filter sets the optional parameter "filter": A filter expression that
  54979. // filters resources listed in the response. The expression must specify
  54980. // the field name, a comparison operator, and the value that you want to
  54981. // use for filtering. The value must be a string, a number, or a
  54982. // boolean. The comparison operator must be either =, !=, >, or <.
  54983. //
  54984. // For example, if you are filtering Compute Engine instances, you can
  54985. // exclude instances named example-instance by specifying name !=
  54986. // example-instance.
  54987. //
  54988. // You can also filter nested fields. For example, you could specify
  54989. // scheduling.automaticRestart = false to include instances only if they
  54990. // are not scheduled for automatic restarts. You can use filtering on
  54991. // nested fields to filter based on resource labels.
  54992. //
  54993. // To filter on multiple expressions, provide each separate expression
  54994. // within parentheses. For example, (scheduling.automaticRestart = true)
  54995. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  54996. // AND expression. However, you can include AND and OR expressions
  54997. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  54998. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  54999. // true).
  55000. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  55001. c.urlParams_.Set("filter", filter)
  55002. return c
  55003. }
  55004. // MaxResults sets the optional parameter "maxResults": The maximum
  55005. // number of results per page that should be returned. If the number of
  55006. // available results is larger than maxResults, Compute Engine returns a
  55007. // nextPageToken that can be used to get the next page of results in
  55008. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55009. // (Default: 500)
  55010. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  55011. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55012. return c
  55013. }
  55014. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55015. // a certain order. By default, results are returned in alphanumerical
  55016. // order based on the resource name.
  55017. //
  55018. // You can also sort results in descending order based on the creation
  55019. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55020. // based on the creationTimestamp field in reverse chronological order
  55021. // (newest result first). Use this to sort resources like operations so
  55022. // that the newest operation is returned first.
  55023. //
  55024. // Currently, only sorting by name or creationTimestamp desc is
  55025. // supported.
  55026. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  55027. c.urlParams_.Set("orderBy", orderBy)
  55028. return c
  55029. }
  55030. // PageToken sets the optional parameter "pageToken": Specifies a page
  55031. // token to use. Set pageToken to the nextPageToken returned by a
  55032. // previous list request to get the next page of results.
  55033. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  55034. c.urlParams_.Set("pageToken", pageToken)
  55035. return c
  55036. }
  55037. // Fields allows partial responses to be retrieved. See
  55038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55039. // for more information.
  55040. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  55041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55042. return c
  55043. }
  55044. // IfNoneMatch sets the optional parameter which makes the operation
  55045. // fail if the object's ETag matches the given value. This is useful for
  55046. // getting updates only after the object has changed since the last
  55047. // request. Use googleapi.IsNotModified to check whether the response
  55048. // error from Do is the result of In-None-Match.
  55049. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  55050. c.ifNoneMatch_ = entityTag
  55051. return c
  55052. }
  55053. // Context sets the context to be used in this call's Do method. Any
  55054. // pending HTTP request will be aborted if the provided context is
  55055. // canceled.
  55056. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  55057. c.ctx_ = ctx
  55058. return c
  55059. }
  55060. // Header returns an http.Header that can be modified by the caller to
  55061. // add HTTP headers to the request.
  55062. func (c *InstanceGroupManagersListCall) Header() http.Header {
  55063. if c.header_ == nil {
  55064. c.header_ = make(http.Header)
  55065. }
  55066. return c.header_
  55067. }
  55068. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  55069. reqHeaders := make(http.Header)
  55070. for k, v := range c.header_ {
  55071. reqHeaders[k] = v
  55072. }
  55073. reqHeaders.Set("User-Agent", c.s.userAgent())
  55074. if c.ifNoneMatch_ != "" {
  55075. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55076. }
  55077. var body io.Reader = nil
  55078. c.urlParams_.Set("alt", alt)
  55079. c.urlParams_.Set("prettyPrint", "false")
  55080. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  55081. urls += "?" + c.urlParams_.Encode()
  55082. req, err := http.NewRequest("GET", urls, body)
  55083. if err != nil {
  55084. return nil, err
  55085. }
  55086. req.Header = reqHeaders
  55087. googleapi.Expand(req.URL, map[string]string{
  55088. "project": c.project,
  55089. "zone": c.zone,
  55090. })
  55091. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55092. }
  55093. // Do executes the "compute.instanceGroupManagers.list" call.
  55094. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  55095. // Any non-2xx status code is an error. Response headers are in either
  55096. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  55097. // returned at all) in error.(*googleapi.Error).Header. Use
  55098. // googleapi.IsNotModified to check whether the returned error was
  55099. // because http.StatusNotModified was returned.
  55100. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  55101. gensupport.SetOptions(c.urlParams_, opts...)
  55102. res, err := c.doRequest("json")
  55103. if res != nil && res.StatusCode == http.StatusNotModified {
  55104. if res.Body != nil {
  55105. res.Body.Close()
  55106. }
  55107. return nil, &googleapi.Error{
  55108. Code: res.StatusCode,
  55109. Header: res.Header,
  55110. }
  55111. }
  55112. if err != nil {
  55113. return nil, err
  55114. }
  55115. defer googleapi.CloseBody(res)
  55116. if err := googleapi.CheckResponse(res); err != nil {
  55117. return nil, err
  55118. }
  55119. ret := &InstanceGroupManagerList{
  55120. ServerResponse: googleapi.ServerResponse{
  55121. Header: res.Header,
  55122. HTTPStatusCode: res.StatusCode,
  55123. },
  55124. }
  55125. target := &ret
  55126. if err := gensupport.DecodeResponse(target, res); err != nil {
  55127. return nil, err
  55128. }
  55129. return ret, nil
  55130. // {
  55131. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  55132. // "httpMethod": "GET",
  55133. // "id": "compute.instanceGroupManagers.list",
  55134. // "parameterOrder": [
  55135. // "project",
  55136. // "zone"
  55137. // ],
  55138. // "parameters": {
  55139. // "filter": {
  55140. // "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).",
  55141. // "location": "query",
  55142. // "type": "string"
  55143. // },
  55144. // "maxResults": {
  55145. // "default": "500",
  55146. // "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)",
  55147. // "format": "uint32",
  55148. // "location": "query",
  55149. // "minimum": "0",
  55150. // "type": "integer"
  55151. // },
  55152. // "orderBy": {
  55153. // "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.",
  55154. // "location": "query",
  55155. // "type": "string"
  55156. // },
  55157. // "pageToken": {
  55158. // "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.",
  55159. // "location": "query",
  55160. // "type": "string"
  55161. // },
  55162. // "project": {
  55163. // "description": "Project ID for this request.",
  55164. // "location": "path",
  55165. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55166. // "required": true,
  55167. // "type": "string"
  55168. // },
  55169. // "zone": {
  55170. // "description": "The name of the zone where the managed instance group is located.",
  55171. // "location": "path",
  55172. // "required": true,
  55173. // "type": "string"
  55174. // }
  55175. // },
  55176. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  55177. // "response": {
  55178. // "$ref": "InstanceGroupManagerList"
  55179. // },
  55180. // "scopes": [
  55181. // "https://www.googleapis.com/auth/cloud-platform",
  55182. // "https://www.googleapis.com/auth/compute",
  55183. // "https://www.googleapis.com/auth/compute.readonly"
  55184. // ]
  55185. // }
  55186. }
  55187. // Pages invokes f for each page of results.
  55188. // A non-nil error returned from f will halt the iteration.
  55189. // The provided context supersedes any context provided to the Context method.
  55190. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  55191. c.ctx_ = ctx
  55192. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55193. for {
  55194. x, err := c.Do()
  55195. if err != nil {
  55196. return err
  55197. }
  55198. if err := f(x); err != nil {
  55199. return err
  55200. }
  55201. if x.NextPageToken == "" {
  55202. return nil
  55203. }
  55204. c.PageToken(x.NextPageToken)
  55205. }
  55206. }
  55207. // method id "compute.instanceGroupManagers.listManagedInstances":
  55208. type InstanceGroupManagersListManagedInstancesCall struct {
  55209. s *Service
  55210. project string
  55211. zone string
  55212. instanceGroupManager string
  55213. urlParams_ gensupport.URLParams
  55214. ctx_ context.Context
  55215. header_ http.Header
  55216. }
  55217. // ListManagedInstances: Lists all of the instances in the managed
  55218. // instance group. Each instance in the list has a currentAction, which
  55219. // indicates the action that the managed instance group is performing on
  55220. // the instance. For example, if the group is still creating an
  55221. // instance, the currentAction is CREATING. If a previous action failed,
  55222. // the list displays the errors for that failed action.
  55223. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  55224. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55225. c.project = project
  55226. c.zone = zone
  55227. c.instanceGroupManager = instanceGroupManager
  55228. return c
  55229. }
  55230. // Filter sets the optional parameter "filter": A filter expression that
  55231. // filters resources listed in the response. The expression must specify
  55232. // the field name, a comparison operator, and the value that you want to
  55233. // use for filtering. The value must be a string, a number, or a
  55234. // boolean. The comparison operator must be either =, !=, >, or <.
  55235. //
  55236. // For example, if you are filtering Compute Engine instances, you can
  55237. // exclude instances named example-instance by specifying name !=
  55238. // example-instance.
  55239. //
  55240. // You can also filter nested fields. For example, you could specify
  55241. // scheduling.automaticRestart = false to include instances only if they
  55242. // are not scheduled for automatic restarts. You can use filtering on
  55243. // nested fields to filter based on resource labels.
  55244. //
  55245. // To filter on multiple expressions, provide each separate expression
  55246. // within parentheses. For example, (scheduling.automaticRestart = true)
  55247. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55248. // AND expression. However, you can include AND and OR expressions
  55249. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55250. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55251. // true).
  55252. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  55253. c.urlParams_.Set("filter", filter)
  55254. return c
  55255. }
  55256. // MaxResults sets the optional parameter "maxResults": The maximum
  55257. // number of results per page that should be returned. If the number of
  55258. // available results is larger than maxResults, Compute Engine returns a
  55259. // nextPageToken that can be used to get the next page of results in
  55260. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55261. // (Default: 500)
  55262. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  55263. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55264. return c
  55265. }
  55266. // OrderBy sets the optional parameter "order_by": Sorts list results by
  55267. // a certain order. By default, results are returned in alphanumerical
  55268. // order based on the resource name.
  55269. //
  55270. // You can also sort results in descending order based on the creation
  55271. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55272. // based on the creationTimestamp field in reverse chronological order
  55273. // (newest result first). Use this to sort resources like operations so
  55274. // that the newest operation is returned first.
  55275. //
  55276. // Currently, only sorting by name or creationTimestamp desc is
  55277. // supported.
  55278. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  55279. c.urlParams_.Set("order_by", orderBy)
  55280. return c
  55281. }
  55282. // PageToken sets the optional parameter "pageToken": Specifies a page
  55283. // token to use. Set pageToken to the nextPageToken returned by a
  55284. // previous list request to get the next page of results.
  55285. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  55286. c.urlParams_.Set("pageToken", pageToken)
  55287. return c
  55288. }
  55289. // Fields allows partial responses to be retrieved. See
  55290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55291. // for more information.
  55292. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  55293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55294. return c
  55295. }
  55296. // Context sets the context to be used in this call's Do method. Any
  55297. // pending HTTP request will be aborted if the provided context is
  55298. // canceled.
  55299. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  55300. c.ctx_ = ctx
  55301. return c
  55302. }
  55303. // Header returns an http.Header that can be modified by the caller to
  55304. // add HTTP headers to the request.
  55305. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  55306. if c.header_ == nil {
  55307. c.header_ = make(http.Header)
  55308. }
  55309. return c.header_
  55310. }
  55311. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  55312. reqHeaders := make(http.Header)
  55313. for k, v := range c.header_ {
  55314. reqHeaders[k] = v
  55315. }
  55316. reqHeaders.Set("User-Agent", c.s.userAgent())
  55317. var body io.Reader = nil
  55318. c.urlParams_.Set("alt", alt)
  55319. c.urlParams_.Set("prettyPrint", "false")
  55320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  55321. urls += "?" + c.urlParams_.Encode()
  55322. req, err := http.NewRequest("POST", urls, body)
  55323. if err != nil {
  55324. return nil, err
  55325. }
  55326. req.Header = reqHeaders
  55327. googleapi.Expand(req.URL, map[string]string{
  55328. "project": c.project,
  55329. "zone": c.zone,
  55330. "instanceGroupManager": c.instanceGroupManager,
  55331. })
  55332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55333. }
  55334. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  55335. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  55336. // error will be non-nil. Any non-2xx status code is an error. Response
  55337. // headers are in either
  55338. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  55339. // er or (if a response was returned at all) in
  55340. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  55341. // whether the returned error was because http.StatusNotModified was
  55342. // returned.
  55343. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  55344. gensupport.SetOptions(c.urlParams_, opts...)
  55345. res, err := c.doRequest("json")
  55346. if res != nil && res.StatusCode == http.StatusNotModified {
  55347. if res.Body != nil {
  55348. res.Body.Close()
  55349. }
  55350. return nil, &googleapi.Error{
  55351. Code: res.StatusCode,
  55352. Header: res.Header,
  55353. }
  55354. }
  55355. if err != nil {
  55356. return nil, err
  55357. }
  55358. defer googleapi.CloseBody(res)
  55359. if err := googleapi.CheckResponse(res); err != nil {
  55360. return nil, err
  55361. }
  55362. ret := &InstanceGroupManagersListManagedInstancesResponse{
  55363. ServerResponse: googleapi.ServerResponse{
  55364. Header: res.Header,
  55365. HTTPStatusCode: res.StatusCode,
  55366. },
  55367. }
  55368. target := &ret
  55369. if err := gensupport.DecodeResponse(target, res); err != nil {
  55370. return nil, err
  55371. }
  55372. return ret, nil
  55373. // {
  55374. // "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.",
  55375. // "httpMethod": "POST",
  55376. // "id": "compute.instanceGroupManagers.listManagedInstances",
  55377. // "parameterOrder": [
  55378. // "project",
  55379. // "zone",
  55380. // "instanceGroupManager"
  55381. // ],
  55382. // "parameters": {
  55383. // "filter": {
  55384. // "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).",
  55385. // "location": "query",
  55386. // "type": "string"
  55387. // },
  55388. // "instanceGroupManager": {
  55389. // "description": "The name of the managed instance group.",
  55390. // "location": "path",
  55391. // "required": true,
  55392. // "type": "string"
  55393. // },
  55394. // "maxResults": {
  55395. // "default": "500",
  55396. // "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)",
  55397. // "format": "uint32",
  55398. // "location": "query",
  55399. // "minimum": "0",
  55400. // "type": "integer"
  55401. // },
  55402. // "order_by": {
  55403. // "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.",
  55404. // "location": "query",
  55405. // "type": "string"
  55406. // },
  55407. // "pageToken": {
  55408. // "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.",
  55409. // "location": "query",
  55410. // "type": "string"
  55411. // },
  55412. // "project": {
  55413. // "description": "Project ID for this request.",
  55414. // "location": "path",
  55415. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55416. // "required": true,
  55417. // "type": "string"
  55418. // },
  55419. // "zone": {
  55420. // "description": "The name of the zone where the managed instance group is located.",
  55421. // "location": "path",
  55422. // "required": true,
  55423. // "type": "string"
  55424. // }
  55425. // },
  55426. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  55427. // "response": {
  55428. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  55429. // },
  55430. // "scopes": [
  55431. // "https://www.googleapis.com/auth/cloud-platform",
  55432. // "https://www.googleapis.com/auth/compute",
  55433. // "https://www.googleapis.com/auth/compute.readonly"
  55434. // ]
  55435. // }
  55436. }
  55437. // Pages invokes f for each page of results.
  55438. // A non-nil error returned from f will halt the iteration.
  55439. // The provided context supersedes any context provided to the Context method.
  55440. func (c *InstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListManagedInstancesResponse) error) error {
  55441. c.ctx_ = ctx
  55442. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55443. for {
  55444. x, err := c.Do()
  55445. if err != nil {
  55446. return err
  55447. }
  55448. if err := f(x); err != nil {
  55449. return err
  55450. }
  55451. if x.NextPageToken == "" {
  55452. return nil
  55453. }
  55454. c.PageToken(x.NextPageToken)
  55455. }
  55456. }
  55457. // method id "compute.instanceGroupManagers.patch":
  55458. type InstanceGroupManagersPatchCall struct {
  55459. s *Service
  55460. project string
  55461. zone string
  55462. instanceGroupManager string
  55463. instancegroupmanager *InstanceGroupManager
  55464. urlParams_ gensupport.URLParams
  55465. ctx_ context.Context
  55466. header_ http.Header
  55467. }
  55468. // Patch: Updates a managed instance group using the information that
  55469. // you specify in the request. This operation is marked as DONE when the
  55470. // group is patched even if the instances in the group are still in the
  55471. // process of being patched. You must separately verify the status of
  55472. // the individual instances with the listManagedInstances method. This
  55473. // method supports PATCH semantics and uses the JSON merge patch format
  55474. // and processing rules.
  55475. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  55476. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55477. c.project = project
  55478. c.zone = zone
  55479. c.instanceGroupManager = instanceGroupManager
  55480. c.instancegroupmanager = instancegroupmanager
  55481. return c
  55482. }
  55483. // RequestId sets the optional parameter "requestId": An optional
  55484. // request ID to identify requests. Specify a unique request ID so that
  55485. // if you must retry your request, the server will know to ignore the
  55486. // request if it has already been completed.
  55487. //
  55488. // For example, consider a situation where you make an initial request
  55489. // and the request times out. If you make the request again with the
  55490. // same request ID, the server can check if original operation with the
  55491. // same request ID was received, and if so, will ignore the second
  55492. // request. This prevents clients from accidentally creating duplicate
  55493. // commitments.
  55494. //
  55495. // The request ID must be a valid UUID with the exception that zero UUID
  55496. // is not supported (00000000-0000-0000-0000-000000000000).
  55497. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  55498. c.urlParams_.Set("requestId", requestId)
  55499. return c
  55500. }
  55501. // Fields allows partial responses to be retrieved. See
  55502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55503. // for more information.
  55504. func (c *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  55505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55506. return c
  55507. }
  55508. // Context sets the context to be used in this call's Do method. Any
  55509. // pending HTTP request will be aborted if the provided context is
  55510. // canceled.
  55511. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  55512. c.ctx_ = ctx
  55513. return c
  55514. }
  55515. // Header returns an http.Header that can be modified by the caller to
  55516. // add HTTP headers to the request.
  55517. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  55518. if c.header_ == nil {
  55519. c.header_ = make(http.Header)
  55520. }
  55521. return c.header_
  55522. }
  55523. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  55524. reqHeaders := make(http.Header)
  55525. for k, v := range c.header_ {
  55526. reqHeaders[k] = v
  55527. }
  55528. reqHeaders.Set("User-Agent", c.s.userAgent())
  55529. var body io.Reader = nil
  55530. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  55531. if err != nil {
  55532. return nil, err
  55533. }
  55534. reqHeaders.Set("Content-Type", "application/json")
  55535. c.urlParams_.Set("alt", alt)
  55536. c.urlParams_.Set("prettyPrint", "false")
  55537. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  55538. urls += "?" + c.urlParams_.Encode()
  55539. req, err := http.NewRequest("PATCH", urls, body)
  55540. if err != nil {
  55541. return nil, err
  55542. }
  55543. req.Header = reqHeaders
  55544. googleapi.Expand(req.URL, map[string]string{
  55545. "project": c.project,
  55546. "zone": c.zone,
  55547. "instanceGroupManager": c.instanceGroupManager,
  55548. })
  55549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55550. }
  55551. // Do executes the "compute.instanceGroupManagers.patch" call.
  55552. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55553. // status code is an error. Response headers are in either
  55554. // *Operation.ServerResponse.Header or (if a response was returned at
  55555. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55556. // to check whether the returned error was because
  55557. // http.StatusNotModified was returned.
  55558. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55559. gensupport.SetOptions(c.urlParams_, opts...)
  55560. res, err := c.doRequest("json")
  55561. if res != nil && res.StatusCode == http.StatusNotModified {
  55562. if res.Body != nil {
  55563. res.Body.Close()
  55564. }
  55565. return nil, &googleapi.Error{
  55566. Code: res.StatusCode,
  55567. Header: res.Header,
  55568. }
  55569. }
  55570. if err != nil {
  55571. return nil, err
  55572. }
  55573. defer googleapi.CloseBody(res)
  55574. if err := googleapi.CheckResponse(res); err != nil {
  55575. return nil, err
  55576. }
  55577. ret := &Operation{
  55578. ServerResponse: googleapi.ServerResponse{
  55579. Header: res.Header,
  55580. HTTPStatusCode: res.StatusCode,
  55581. },
  55582. }
  55583. target := &ret
  55584. if err := gensupport.DecodeResponse(target, res); err != nil {
  55585. return nil, err
  55586. }
  55587. return ret, nil
  55588. // {
  55589. // "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.",
  55590. // "httpMethod": "PATCH",
  55591. // "id": "compute.instanceGroupManagers.patch",
  55592. // "parameterOrder": [
  55593. // "project",
  55594. // "zone",
  55595. // "instanceGroupManager"
  55596. // ],
  55597. // "parameters": {
  55598. // "instanceGroupManager": {
  55599. // "description": "The name of the instance group manager.",
  55600. // "location": "path",
  55601. // "required": true,
  55602. // "type": "string"
  55603. // },
  55604. // "project": {
  55605. // "description": "Project ID for this request.",
  55606. // "location": "path",
  55607. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55608. // "required": true,
  55609. // "type": "string"
  55610. // },
  55611. // "requestId": {
  55612. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55613. // "location": "query",
  55614. // "type": "string"
  55615. // },
  55616. // "zone": {
  55617. // "description": "The name of the zone where you want to create the managed instance group.",
  55618. // "location": "path",
  55619. // "required": true,
  55620. // "type": "string"
  55621. // }
  55622. // },
  55623. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  55624. // "request": {
  55625. // "$ref": "InstanceGroupManager"
  55626. // },
  55627. // "response": {
  55628. // "$ref": "Operation"
  55629. // },
  55630. // "scopes": [
  55631. // "https://www.googleapis.com/auth/cloud-platform",
  55632. // "https://www.googleapis.com/auth/compute"
  55633. // ]
  55634. // }
  55635. }
  55636. // method id "compute.instanceGroupManagers.recreateInstances":
  55637. type InstanceGroupManagersRecreateInstancesCall struct {
  55638. s *Service
  55639. project string
  55640. zone string
  55641. instanceGroupManager string
  55642. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  55643. urlParams_ gensupport.URLParams
  55644. ctx_ context.Context
  55645. header_ http.Header
  55646. }
  55647. // RecreateInstances: Flags the specified instances in the managed
  55648. // instance group to be immediately recreated. The instances are deleted
  55649. // and recreated using the current instance template for the managed
  55650. // instance group. This operation is marked as DONE when the flag is set
  55651. // even if the instances have not yet been recreated. You must
  55652. // separately verify the status of the recreating action with the
  55653. // listmanagedinstances method.
  55654. //
  55655. // If the group is part of a backend service that has enabled connection
  55656. // draining, it can take up to 60 seconds after the connection draining
  55657. // duration has elapsed before the VM instance is removed or
  55658. // deleted.
  55659. //
  55660. // You can specify a maximum of 1000 instances with this method per
  55661. // request.
  55662. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  55663. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55664. c.project = project
  55665. c.zone = zone
  55666. c.instanceGroupManager = instanceGroupManager
  55667. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  55668. return c
  55669. }
  55670. // RequestId sets the optional parameter "requestId": An optional
  55671. // request ID to identify requests. Specify a unique request ID so that
  55672. // if you must retry your request, the server will know to ignore the
  55673. // request if it has already been completed.
  55674. //
  55675. // For example, consider a situation where you make an initial request
  55676. // and the request times out. If you make the request again with the
  55677. // same request ID, the server can check if original operation with the
  55678. // same request ID was received, and if so, will ignore the second
  55679. // request. This prevents clients from accidentally creating duplicate
  55680. // commitments.
  55681. //
  55682. // The request ID must be a valid UUID with the exception that zero UUID
  55683. // is not supported (00000000-0000-0000-0000-000000000000).
  55684. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  55685. c.urlParams_.Set("requestId", requestId)
  55686. return c
  55687. }
  55688. // Fields allows partial responses to be retrieved. See
  55689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55690. // for more information.
  55691. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  55692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55693. return c
  55694. }
  55695. // Context sets the context to be used in this call's Do method. Any
  55696. // pending HTTP request will be aborted if the provided context is
  55697. // canceled.
  55698. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  55699. c.ctx_ = ctx
  55700. return c
  55701. }
  55702. // Header returns an http.Header that can be modified by the caller to
  55703. // add HTTP headers to the request.
  55704. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  55705. if c.header_ == nil {
  55706. c.header_ = make(http.Header)
  55707. }
  55708. return c.header_
  55709. }
  55710. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  55711. reqHeaders := make(http.Header)
  55712. for k, v := range c.header_ {
  55713. reqHeaders[k] = v
  55714. }
  55715. reqHeaders.Set("User-Agent", c.s.userAgent())
  55716. var body io.Reader = nil
  55717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  55718. if err != nil {
  55719. return nil, err
  55720. }
  55721. reqHeaders.Set("Content-Type", "application/json")
  55722. c.urlParams_.Set("alt", alt)
  55723. c.urlParams_.Set("prettyPrint", "false")
  55724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  55725. urls += "?" + c.urlParams_.Encode()
  55726. req, err := http.NewRequest("POST", urls, body)
  55727. if err != nil {
  55728. return nil, err
  55729. }
  55730. req.Header = reqHeaders
  55731. googleapi.Expand(req.URL, map[string]string{
  55732. "project": c.project,
  55733. "zone": c.zone,
  55734. "instanceGroupManager": c.instanceGroupManager,
  55735. })
  55736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55737. }
  55738. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  55739. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55740. // status code is an error. Response headers are in either
  55741. // *Operation.ServerResponse.Header or (if a response was returned at
  55742. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55743. // to check whether the returned error was because
  55744. // http.StatusNotModified was returned.
  55745. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55746. gensupport.SetOptions(c.urlParams_, opts...)
  55747. res, err := c.doRequest("json")
  55748. if res != nil && res.StatusCode == http.StatusNotModified {
  55749. if res.Body != nil {
  55750. res.Body.Close()
  55751. }
  55752. return nil, &googleapi.Error{
  55753. Code: res.StatusCode,
  55754. Header: res.Header,
  55755. }
  55756. }
  55757. if err != nil {
  55758. return nil, err
  55759. }
  55760. defer googleapi.CloseBody(res)
  55761. if err := googleapi.CheckResponse(res); err != nil {
  55762. return nil, err
  55763. }
  55764. ret := &Operation{
  55765. ServerResponse: googleapi.ServerResponse{
  55766. Header: res.Header,
  55767. HTTPStatusCode: res.StatusCode,
  55768. },
  55769. }
  55770. target := &ret
  55771. if err := gensupport.DecodeResponse(target, res); err != nil {
  55772. return nil, err
  55773. }
  55774. return ret, nil
  55775. // {
  55776. // "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.",
  55777. // "httpMethod": "POST",
  55778. // "id": "compute.instanceGroupManagers.recreateInstances",
  55779. // "parameterOrder": [
  55780. // "project",
  55781. // "zone",
  55782. // "instanceGroupManager"
  55783. // ],
  55784. // "parameters": {
  55785. // "instanceGroupManager": {
  55786. // "description": "The name of the managed instance group.",
  55787. // "location": "path",
  55788. // "required": true,
  55789. // "type": "string"
  55790. // },
  55791. // "project": {
  55792. // "description": "Project ID for this request.",
  55793. // "location": "path",
  55794. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55795. // "required": true,
  55796. // "type": "string"
  55797. // },
  55798. // "requestId": {
  55799. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55800. // "location": "query",
  55801. // "type": "string"
  55802. // },
  55803. // "zone": {
  55804. // "description": "The name of the zone where the managed instance group is located.",
  55805. // "location": "path",
  55806. // "required": true,
  55807. // "type": "string"
  55808. // }
  55809. // },
  55810. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  55811. // "request": {
  55812. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  55813. // },
  55814. // "response": {
  55815. // "$ref": "Operation"
  55816. // },
  55817. // "scopes": [
  55818. // "https://www.googleapis.com/auth/cloud-platform",
  55819. // "https://www.googleapis.com/auth/compute"
  55820. // ]
  55821. // }
  55822. }
  55823. // method id "compute.instanceGroupManagers.resize":
  55824. type InstanceGroupManagersResizeCall struct {
  55825. s *Service
  55826. project string
  55827. zone string
  55828. instanceGroupManager string
  55829. urlParams_ gensupport.URLParams
  55830. ctx_ context.Context
  55831. header_ http.Header
  55832. }
  55833. // Resize: Resizes the managed instance group. If you increase the size,
  55834. // the group creates new instances using the current instance template.
  55835. // If you decrease the size, the group deletes instances. The resize
  55836. // operation is marked DONE when the resize actions are scheduled even
  55837. // if the group has not yet added or deleted any instances. You must
  55838. // separately verify the status of the creating or deleting actions with
  55839. // the listmanagedinstances method.
  55840. //
  55841. // When resizing down, the instance group arbitrarily chooses the order
  55842. // in which VMs are deleted. The group takes into account some VM
  55843. // attributes when making the selection including:
  55844. //
  55845. // + The status of the VM instance. + The health of the VM instance. +
  55846. // The instance template version the VM is based on. + For regional
  55847. // managed instance groups, the location of the VM instance.
  55848. //
  55849. // This list is subject to change.
  55850. //
  55851. // If the group is part of a backend service that has enabled connection
  55852. // draining, it can take up to 60 seconds after the connection draining
  55853. // duration has elapsed before the VM instance is removed or deleted.
  55854. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  55855. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55856. c.project = project
  55857. c.zone = zone
  55858. c.instanceGroupManager = instanceGroupManager
  55859. c.urlParams_.Set("size", fmt.Sprint(size))
  55860. return c
  55861. }
  55862. // RequestId sets the optional parameter "requestId": An optional
  55863. // request ID to identify requests. Specify a unique request ID so that
  55864. // if you must retry your request, the server will know to ignore the
  55865. // request if it has already been completed.
  55866. //
  55867. // For example, consider a situation where you make an initial request
  55868. // and the request times out. If you make the request again with the
  55869. // same request ID, the server can check if original operation with the
  55870. // same request ID was received, and if so, will ignore the second
  55871. // request. This prevents clients from accidentally creating duplicate
  55872. // commitments.
  55873. //
  55874. // The request ID must be a valid UUID with the exception that zero UUID
  55875. // is not supported (00000000-0000-0000-0000-000000000000).
  55876. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  55877. c.urlParams_.Set("requestId", requestId)
  55878. return c
  55879. }
  55880. // Fields allows partial responses to be retrieved. See
  55881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55882. // for more information.
  55883. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  55884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55885. return c
  55886. }
  55887. // Context sets the context to be used in this call's Do method. Any
  55888. // pending HTTP request will be aborted if the provided context is
  55889. // canceled.
  55890. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  55891. c.ctx_ = ctx
  55892. return c
  55893. }
  55894. // Header returns an http.Header that can be modified by the caller to
  55895. // add HTTP headers to the request.
  55896. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  55897. if c.header_ == nil {
  55898. c.header_ = make(http.Header)
  55899. }
  55900. return c.header_
  55901. }
  55902. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  55903. reqHeaders := make(http.Header)
  55904. for k, v := range c.header_ {
  55905. reqHeaders[k] = v
  55906. }
  55907. reqHeaders.Set("User-Agent", c.s.userAgent())
  55908. var body io.Reader = nil
  55909. c.urlParams_.Set("alt", alt)
  55910. c.urlParams_.Set("prettyPrint", "false")
  55911. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  55912. urls += "?" + c.urlParams_.Encode()
  55913. req, err := http.NewRequest("POST", urls, body)
  55914. if err != nil {
  55915. return nil, err
  55916. }
  55917. req.Header = reqHeaders
  55918. googleapi.Expand(req.URL, map[string]string{
  55919. "project": c.project,
  55920. "zone": c.zone,
  55921. "instanceGroupManager": c.instanceGroupManager,
  55922. })
  55923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55924. }
  55925. // Do executes the "compute.instanceGroupManagers.resize" call.
  55926. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55927. // status code is an error. Response headers are in either
  55928. // *Operation.ServerResponse.Header or (if a response was returned at
  55929. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55930. // to check whether the returned error was because
  55931. // http.StatusNotModified was returned.
  55932. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55933. gensupport.SetOptions(c.urlParams_, opts...)
  55934. res, err := c.doRequest("json")
  55935. if res != nil && res.StatusCode == http.StatusNotModified {
  55936. if res.Body != nil {
  55937. res.Body.Close()
  55938. }
  55939. return nil, &googleapi.Error{
  55940. Code: res.StatusCode,
  55941. Header: res.Header,
  55942. }
  55943. }
  55944. if err != nil {
  55945. return nil, err
  55946. }
  55947. defer googleapi.CloseBody(res)
  55948. if err := googleapi.CheckResponse(res); err != nil {
  55949. return nil, err
  55950. }
  55951. ret := &Operation{
  55952. ServerResponse: googleapi.ServerResponse{
  55953. Header: res.Header,
  55954. HTTPStatusCode: res.StatusCode,
  55955. },
  55956. }
  55957. target := &ret
  55958. if err := gensupport.DecodeResponse(target, res); err != nil {
  55959. return nil, err
  55960. }
  55961. return ret, nil
  55962. // {
  55963. // "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.",
  55964. // "httpMethod": "POST",
  55965. // "id": "compute.instanceGroupManagers.resize",
  55966. // "parameterOrder": [
  55967. // "project",
  55968. // "zone",
  55969. // "instanceGroupManager",
  55970. // "size"
  55971. // ],
  55972. // "parameters": {
  55973. // "instanceGroupManager": {
  55974. // "description": "The name of the managed instance group.",
  55975. // "location": "path",
  55976. // "required": true,
  55977. // "type": "string"
  55978. // },
  55979. // "project": {
  55980. // "description": "Project ID for this request.",
  55981. // "location": "path",
  55982. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55983. // "required": true,
  55984. // "type": "string"
  55985. // },
  55986. // "requestId": {
  55987. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55988. // "location": "query",
  55989. // "type": "string"
  55990. // },
  55991. // "size": {
  55992. // "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.",
  55993. // "format": "int32",
  55994. // "location": "query",
  55995. // "required": true,
  55996. // "type": "integer"
  55997. // },
  55998. // "zone": {
  55999. // "description": "The name of the zone where the managed instance group is located.",
  56000. // "location": "path",
  56001. // "required": true,
  56002. // "type": "string"
  56003. // }
  56004. // },
  56005. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  56006. // "response": {
  56007. // "$ref": "Operation"
  56008. // },
  56009. // "scopes": [
  56010. // "https://www.googleapis.com/auth/cloud-platform",
  56011. // "https://www.googleapis.com/auth/compute"
  56012. // ]
  56013. // }
  56014. }
  56015. // method id "compute.instanceGroupManagers.resizeAdvanced":
  56016. type InstanceGroupManagersResizeAdvancedCall struct {
  56017. s *Service
  56018. project string
  56019. zone string
  56020. instanceGroupManager string
  56021. instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest
  56022. urlParams_ gensupport.URLParams
  56023. ctx_ context.Context
  56024. header_ http.Header
  56025. }
  56026. // ResizeAdvanced: Resizes the managed instance group with advanced
  56027. // configuration options like disabling creation retries. This is an
  56028. // extended version of the resize method.
  56029. //
  56030. // If you increase the size of the instance group, the group creates new
  56031. // instances using the current instance template. If you decrease the
  56032. // size, the group deletes instances. The resize operation is marked
  56033. // DONE when the resize actions are scheduled even if the group has not
  56034. // yet added or deleted any instances. You must separately verify the
  56035. // status of the creating, creatingWithoutRetries, or deleting actions
  56036. // with the get or listmanagedinstances method.
  56037. //
  56038. // If the group is part of a backend service that has enabled connection
  56039. // draining, it can take up to 60 seconds after the connection draining
  56040. // duration has elapsed before the VM instance is removed or deleted.
  56041. func (r *InstanceGroupManagersService) ResizeAdvanced(project string, zone string, instanceGroupManager string, instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest) *InstanceGroupManagersResizeAdvancedCall {
  56042. c := &InstanceGroupManagersResizeAdvancedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56043. c.project = project
  56044. c.zone = zone
  56045. c.instanceGroupManager = instanceGroupManager
  56046. c.instancegroupmanagersresizeadvancedrequest = instancegroupmanagersresizeadvancedrequest
  56047. return c
  56048. }
  56049. // RequestId sets the optional parameter "requestId": An optional
  56050. // request ID to identify requests. Specify a unique request ID so that
  56051. // if you must retry your request, the server will know to ignore the
  56052. // request if it has already been completed.
  56053. //
  56054. // For example, consider a situation where you make an initial request
  56055. // and the request times out. If you make the request again with the
  56056. // same request ID, the server can check if original operation with the
  56057. // same request ID was received, and if so, will ignore the second
  56058. // request. This prevents clients from accidentally creating duplicate
  56059. // commitments.
  56060. //
  56061. // The request ID must be a valid UUID with the exception that zero UUID
  56062. // is not supported (00000000-0000-0000-0000-000000000000).
  56063. func (c *InstanceGroupManagersResizeAdvancedCall) RequestId(requestId string) *InstanceGroupManagersResizeAdvancedCall {
  56064. c.urlParams_.Set("requestId", requestId)
  56065. return c
  56066. }
  56067. // Fields allows partial responses to be retrieved. See
  56068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56069. // for more information.
  56070. func (c *InstanceGroupManagersResizeAdvancedCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeAdvancedCall {
  56071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56072. return c
  56073. }
  56074. // Context sets the context to be used in this call's Do method. Any
  56075. // pending HTTP request will be aborted if the provided context is
  56076. // canceled.
  56077. func (c *InstanceGroupManagersResizeAdvancedCall) Context(ctx context.Context) *InstanceGroupManagersResizeAdvancedCall {
  56078. c.ctx_ = ctx
  56079. return c
  56080. }
  56081. // Header returns an http.Header that can be modified by the caller to
  56082. // add HTTP headers to the request.
  56083. func (c *InstanceGroupManagersResizeAdvancedCall) Header() http.Header {
  56084. if c.header_ == nil {
  56085. c.header_ = make(http.Header)
  56086. }
  56087. return c.header_
  56088. }
  56089. func (c *InstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) {
  56090. reqHeaders := make(http.Header)
  56091. for k, v := range c.header_ {
  56092. reqHeaders[k] = v
  56093. }
  56094. reqHeaders.Set("User-Agent", c.s.userAgent())
  56095. var body io.Reader = nil
  56096. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresizeadvancedrequest)
  56097. if err != nil {
  56098. return nil, err
  56099. }
  56100. reqHeaders.Set("Content-Type", "application/json")
  56101. c.urlParams_.Set("alt", alt)
  56102. c.urlParams_.Set("prettyPrint", "false")
  56103. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced")
  56104. urls += "?" + c.urlParams_.Encode()
  56105. req, err := http.NewRequest("POST", urls, body)
  56106. if err != nil {
  56107. return nil, err
  56108. }
  56109. req.Header = reqHeaders
  56110. googleapi.Expand(req.URL, map[string]string{
  56111. "project": c.project,
  56112. "zone": c.zone,
  56113. "instanceGroupManager": c.instanceGroupManager,
  56114. })
  56115. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56116. }
  56117. // Do executes the "compute.instanceGroupManagers.resizeAdvanced" call.
  56118. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56119. // status code is an error. Response headers are in either
  56120. // *Operation.ServerResponse.Header or (if a response was returned at
  56121. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56122. // to check whether the returned error was because
  56123. // http.StatusNotModified was returned.
  56124. func (c *InstanceGroupManagersResizeAdvancedCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56125. gensupport.SetOptions(c.urlParams_, opts...)
  56126. res, err := c.doRequest("json")
  56127. if res != nil && res.StatusCode == http.StatusNotModified {
  56128. if res.Body != nil {
  56129. res.Body.Close()
  56130. }
  56131. return nil, &googleapi.Error{
  56132. Code: res.StatusCode,
  56133. Header: res.Header,
  56134. }
  56135. }
  56136. if err != nil {
  56137. return nil, err
  56138. }
  56139. defer googleapi.CloseBody(res)
  56140. if err := googleapi.CheckResponse(res); err != nil {
  56141. return nil, err
  56142. }
  56143. ret := &Operation{
  56144. ServerResponse: googleapi.ServerResponse{
  56145. Header: res.Header,
  56146. HTTPStatusCode: res.StatusCode,
  56147. },
  56148. }
  56149. target := &ret
  56150. if err := gensupport.DecodeResponse(target, res); err != nil {
  56151. return nil, err
  56152. }
  56153. return ret, nil
  56154. // {
  56155. // "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.",
  56156. // "httpMethod": "POST",
  56157. // "id": "compute.instanceGroupManagers.resizeAdvanced",
  56158. // "parameterOrder": [
  56159. // "project",
  56160. // "zone",
  56161. // "instanceGroupManager"
  56162. // ],
  56163. // "parameters": {
  56164. // "instanceGroupManager": {
  56165. // "description": "The name of the managed instance group.",
  56166. // "location": "path",
  56167. // "required": true,
  56168. // "type": "string"
  56169. // },
  56170. // "project": {
  56171. // "description": "Project ID for this request.",
  56172. // "location": "path",
  56173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56174. // "required": true,
  56175. // "type": "string"
  56176. // },
  56177. // "requestId": {
  56178. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56179. // "location": "query",
  56180. // "type": "string"
  56181. // },
  56182. // "zone": {
  56183. // "description": "The name of the zone where the managed instance group is located.",
  56184. // "location": "path",
  56185. // "required": true,
  56186. // "type": "string"
  56187. // }
  56188. // },
  56189. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced",
  56190. // "request": {
  56191. // "$ref": "InstanceGroupManagersResizeAdvancedRequest"
  56192. // },
  56193. // "response": {
  56194. // "$ref": "Operation"
  56195. // },
  56196. // "scopes": [
  56197. // "https://www.googleapis.com/auth/cloud-platform",
  56198. // "https://www.googleapis.com/auth/compute"
  56199. // ]
  56200. // }
  56201. }
  56202. // method id "compute.instanceGroupManagers.setAutoHealingPolicies":
  56203. type InstanceGroupManagersSetAutoHealingPoliciesCall struct {
  56204. s *Service
  56205. project string
  56206. zone string
  56207. instanceGroupManager string
  56208. instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest
  56209. urlParams_ gensupport.URLParams
  56210. ctx_ context.Context
  56211. header_ http.Header
  56212. }
  56213. // SetAutoHealingPolicies: Modifies the autohealing policies.
  56214. // [Deprecated] This method is deprecated. Please use Patch instead.
  56215. func (r *InstanceGroupManagersService) SetAutoHealingPolicies(project string, zone string, instanceGroupManager string, instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  56216. c := &InstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56217. c.project = project
  56218. c.zone = zone
  56219. c.instanceGroupManager = instanceGroupManager
  56220. c.instancegroupmanagerssetautohealingrequest = instancegroupmanagerssetautohealingrequest
  56221. return c
  56222. }
  56223. // RequestId sets the optional parameter "requestId": An optional
  56224. // request ID to identify requests. Specify a unique request ID so that
  56225. // if you must retry your request, the server will know to ignore the
  56226. // request if it has already been completed.
  56227. //
  56228. // For example, consider a situation where you make an initial request
  56229. // and the request times out. If you make the request again with the
  56230. // same request ID, the server can check if original operation with the
  56231. // same request ID was received, and if so, will ignore the second
  56232. // request. This prevents clients from accidentally creating duplicate
  56233. // commitments.
  56234. //
  56235. // The request ID must be a valid UUID with the exception that zero UUID
  56236. // is not supported (00000000-0000-0000-0000-000000000000).
  56237. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  56238. c.urlParams_.Set("requestId", requestId)
  56239. return c
  56240. }
  56241. // Fields allows partial responses to be retrieved. See
  56242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56243. // for more information.
  56244. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  56245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56246. return c
  56247. }
  56248. // Context sets the context to be used in this call's Do method. Any
  56249. // pending HTTP request will be aborted if the provided context is
  56250. // canceled.
  56251. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  56252. c.ctx_ = ctx
  56253. return c
  56254. }
  56255. // Header returns an http.Header that can be modified by the caller to
  56256. // add HTTP headers to the request.
  56257. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  56258. if c.header_ == nil {
  56259. c.header_ = make(http.Header)
  56260. }
  56261. return c.header_
  56262. }
  56263. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  56264. reqHeaders := make(http.Header)
  56265. for k, v := range c.header_ {
  56266. reqHeaders[k] = v
  56267. }
  56268. reqHeaders.Set("User-Agent", c.s.userAgent())
  56269. var body io.Reader = nil
  56270. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest)
  56271. if err != nil {
  56272. return nil, err
  56273. }
  56274. reqHeaders.Set("Content-Type", "application/json")
  56275. c.urlParams_.Set("alt", alt)
  56276. c.urlParams_.Set("prettyPrint", "false")
  56277. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  56278. urls += "?" + c.urlParams_.Encode()
  56279. req, err := http.NewRequest("POST", urls, body)
  56280. if err != nil {
  56281. return nil, err
  56282. }
  56283. req.Header = reqHeaders
  56284. googleapi.Expand(req.URL, map[string]string{
  56285. "project": c.project,
  56286. "zone": c.zone,
  56287. "instanceGroupManager": c.instanceGroupManager,
  56288. })
  56289. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56290. }
  56291. // Do executes the "compute.instanceGroupManagers.setAutoHealingPolicies" call.
  56292. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56293. // status code is an error. Response headers are in either
  56294. // *Operation.ServerResponse.Header or (if a response was returned at
  56295. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56296. // to check whether the returned error was because
  56297. // http.StatusNotModified was returned.
  56298. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56299. gensupport.SetOptions(c.urlParams_, opts...)
  56300. res, err := c.doRequest("json")
  56301. if res != nil && res.StatusCode == http.StatusNotModified {
  56302. if res.Body != nil {
  56303. res.Body.Close()
  56304. }
  56305. return nil, &googleapi.Error{
  56306. Code: res.StatusCode,
  56307. Header: res.Header,
  56308. }
  56309. }
  56310. if err != nil {
  56311. return nil, err
  56312. }
  56313. defer googleapi.CloseBody(res)
  56314. if err := googleapi.CheckResponse(res); err != nil {
  56315. return nil, err
  56316. }
  56317. ret := &Operation{
  56318. ServerResponse: googleapi.ServerResponse{
  56319. Header: res.Header,
  56320. HTTPStatusCode: res.StatusCode,
  56321. },
  56322. }
  56323. target := &ret
  56324. if err := gensupport.DecodeResponse(target, res); err != nil {
  56325. return nil, err
  56326. }
  56327. return ret, nil
  56328. // {
  56329. // "description": "Modifies the autohealing policies. [Deprecated] This method is deprecated. Please use Patch instead.",
  56330. // "httpMethod": "POST",
  56331. // "id": "compute.instanceGroupManagers.setAutoHealingPolicies",
  56332. // "parameterOrder": [
  56333. // "project",
  56334. // "zone",
  56335. // "instanceGroupManager"
  56336. // ],
  56337. // "parameters": {
  56338. // "instanceGroupManager": {
  56339. // "description": "The name of the instance group manager.",
  56340. // "location": "path",
  56341. // "required": true,
  56342. // "type": "string"
  56343. // },
  56344. // "project": {
  56345. // "description": "Project ID for this request.",
  56346. // "location": "path",
  56347. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56348. // "required": true,
  56349. // "type": "string"
  56350. // },
  56351. // "requestId": {
  56352. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56353. // "location": "query",
  56354. // "type": "string"
  56355. // },
  56356. // "zone": {
  56357. // "description": "The name of the zone where the managed instance group is located.",
  56358. // "location": "path",
  56359. // "required": true,
  56360. // "type": "string"
  56361. // }
  56362. // },
  56363. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  56364. // "request": {
  56365. // "$ref": "InstanceGroupManagersSetAutoHealingRequest"
  56366. // },
  56367. // "response": {
  56368. // "$ref": "Operation"
  56369. // },
  56370. // "scopes": [
  56371. // "https://www.googleapis.com/auth/cloud-platform",
  56372. // "https://www.googleapis.com/auth/compute"
  56373. // ]
  56374. // }
  56375. }
  56376. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  56377. type InstanceGroupManagersSetInstanceTemplateCall struct {
  56378. s *Service
  56379. project string
  56380. zone string
  56381. instanceGroupManager string
  56382. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  56383. urlParams_ gensupport.URLParams
  56384. ctx_ context.Context
  56385. header_ http.Header
  56386. }
  56387. // SetInstanceTemplate: Specifies the instance template to use when
  56388. // creating new instances in this group. The templates for existing
  56389. // instances in the group do not change unless you recreate them.
  56390. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  56391. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56392. c.project = project
  56393. c.zone = zone
  56394. c.instanceGroupManager = instanceGroupManager
  56395. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  56396. return c
  56397. }
  56398. // RequestId sets the optional parameter "requestId": An optional
  56399. // request ID to identify requests. Specify a unique request ID so that
  56400. // if you must retry your request, the server will know to ignore the
  56401. // request if it has already been completed.
  56402. //
  56403. // For example, consider a situation where you make an initial request
  56404. // and the request times out. If you make the request again with the
  56405. // same request ID, the server can check if original operation with the
  56406. // same request ID was received, and if so, will ignore the second
  56407. // request. This prevents clients from accidentally creating duplicate
  56408. // commitments.
  56409. //
  56410. // The request ID must be a valid UUID with the exception that zero UUID
  56411. // is not supported (00000000-0000-0000-0000-000000000000).
  56412. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  56413. c.urlParams_.Set("requestId", requestId)
  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 *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  56420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56421. return c
  56422. }
  56423. // Context sets the context to be used in this call's Do method. Any
  56424. // pending HTTP request will be aborted if the provided context is
  56425. // canceled.
  56426. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  56427. c.ctx_ = ctx
  56428. return c
  56429. }
  56430. // Header returns an http.Header that can be modified by the caller to
  56431. // add HTTP headers to the request.
  56432. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  56433. if c.header_ == nil {
  56434. c.header_ = make(http.Header)
  56435. }
  56436. return c.header_
  56437. }
  56438. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  56439. reqHeaders := make(http.Header)
  56440. for k, v := range c.header_ {
  56441. reqHeaders[k] = v
  56442. }
  56443. reqHeaders.Set("User-Agent", c.s.userAgent())
  56444. var body io.Reader = nil
  56445. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  56446. if err != nil {
  56447. return nil, err
  56448. }
  56449. reqHeaders.Set("Content-Type", "application/json")
  56450. c.urlParams_.Set("alt", alt)
  56451. c.urlParams_.Set("prettyPrint", "false")
  56452. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  56453. urls += "?" + c.urlParams_.Encode()
  56454. req, err := http.NewRequest("POST", urls, body)
  56455. if err != nil {
  56456. return nil, err
  56457. }
  56458. req.Header = reqHeaders
  56459. googleapi.Expand(req.URL, map[string]string{
  56460. "project": c.project,
  56461. "zone": c.zone,
  56462. "instanceGroupManager": c.instanceGroupManager,
  56463. })
  56464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56465. }
  56466. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  56467. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56468. // status code is an error. Response headers are in either
  56469. // *Operation.ServerResponse.Header or (if a response was returned at
  56470. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56471. // to check whether the returned error was because
  56472. // http.StatusNotModified was returned.
  56473. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56474. gensupport.SetOptions(c.urlParams_, opts...)
  56475. res, err := c.doRequest("json")
  56476. if res != nil && res.StatusCode == http.StatusNotModified {
  56477. if res.Body != nil {
  56478. res.Body.Close()
  56479. }
  56480. return nil, &googleapi.Error{
  56481. Code: res.StatusCode,
  56482. Header: res.Header,
  56483. }
  56484. }
  56485. if err != nil {
  56486. return nil, err
  56487. }
  56488. defer googleapi.CloseBody(res)
  56489. if err := googleapi.CheckResponse(res); err != nil {
  56490. return nil, err
  56491. }
  56492. ret := &Operation{
  56493. ServerResponse: googleapi.ServerResponse{
  56494. Header: res.Header,
  56495. HTTPStatusCode: res.StatusCode,
  56496. },
  56497. }
  56498. target := &ret
  56499. if err := gensupport.DecodeResponse(target, res); err != nil {
  56500. return nil, err
  56501. }
  56502. return ret, nil
  56503. // {
  56504. // "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.",
  56505. // "httpMethod": "POST",
  56506. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  56507. // "parameterOrder": [
  56508. // "project",
  56509. // "zone",
  56510. // "instanceGroupManager"
  56511. // ],
  56512. // "parameters": {
  56513. // "instanceGroupManager": {
  56514. // "description": "The name of the managed instance group.",
  56515. // "location": "path",
  56516. // "required": true,
  56517. // "type": "string"
  56518. // },
  56519. // "project": {
  56520. // "description": "Project ID for this request.",
  56521. // "location": "path",
  56522. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56523. // "required": true,
  56524. // "type": "string"
  56525. // },
  56526. // "requestId": {
  56527. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56528. // "location": "query",
  56529. // "type": "string"
  56530. // },
  56531. // "zone": {
  56532. // "description": "The name of the zone where the managed instance group is located.",
  56533. // "location": "path",
  56534. // "required": true,
  56535. // "type": "string"
  56536. // }
  56537. // },
  56538. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  56539. // "request": {
  56540. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  56541. // },
  56542. // "response": {
  56543. // "$ref": "Operation"
  56544. // },
  56545. // "scopes": [
  56546. // "https://www.googleapis.com/auth/cloud-platform",
  56547. // "https://www.googleapis.com/auth/compute"
  56548. // ]
  56549. // }
  56550. }
  56551. // method id "compute.instanceGroupManagers.setTargetPools":
  56552. type InstanceGroupManagersSetTargetPoolsCall struct {
  56553. s *Service
  56554. project string
  56555. zone string
  56556. instanceGroupManager string
  56557. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  56558. urlParams_ gensupport.URLParams
  56559. ctx_ context.Context
  56560. header_ http.Header
  56561. }
  56562. // SetTargetPools: Modifies the target pools to which all instances in
  56563. // this managed instance group are assigned. The target pools
  56564. // automatically apply to all of the instances in the managed instance
  56565. // group. This operation is marked DONE when you make the request even
  56566. // if the instances have not yet been added to their target pools. The
  56567. // change might take some time to apply to all of the instances in the
  56568. // group depending on the size of the group.
  56569. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  56570. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56571. c.project = project
  56572. c.zone = zone
  56573. c.instanceGroupManager = instanceGroupManager
  56574. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  56575. return c
  56576. }
  56577. // RequestId sets the optional parameter "requestId": An optional
  56578. // request ID to identify requests. Specify a unique request ID so that
  56579. // if you must retry your request, the server will know to ignore the
  56580. // request if it has already been completed.
  56581. //
  56582. // For example, consider a situation where you make an initial request
  56583. // and the request times out. If you make the request again with the
  56584. // same request ID, the server can check if original operation with the
  56585. // same request ID was received, and if so, will ignore the second
  56586. // request. This prevents clients from accidentally creating duplicate
  56587. // commitments.
  56588. //
  56589. // The request ID must be a valid UUID with the exception that zero UUID
  56590. // is not supported (00000000-0000-0000-0000-000000000000).
  56591. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  56592. c.urlParams_.Set("requestId", requestId)
  56593. return c
  56594. }
  56595. // Fields allows partial responses to be retrieved. See
  56596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56597. // for more information.
  56598. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  56599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56600. return c
  56601. }
  56602. // Context sets the context to be used in this call's Do method. Any
  56603. // pending HTTP request will be aborted if the provided context is
  56604. // canceled.
  56605. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  56606. c.ctx_ = ctx
  56607. return c
  56608. }
  56609. // Header returns an http.Header that can be modified by the caller to
  56610. // add HTTP headers to the request.
  56611. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  56612. if c.header_ == nil {
  56613. c.header_ = make(http.Header)
  56614. }
  56615. return c.header_
  56616. }
  56617. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  56618. reqHeaders := make(http.Header)
  56619. for k, v := range c.header_ {
  56620. reqHeaders[k] = v
  56621. }
  56622. reqHeaders.Set("User-Agent", c.s.userAgent())
  56623. var body io.Reader = nil
  56624. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  56625. if err != nil {
  56626. return nil, err
  56627. }
  56628. reqHeaders.Set("Content-Type", "application/json")
  56629. c.urlParams_.Set("alt", alt)
  56630. c.urlParams_.Set("prettyPrint", "false")
  56631. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  56632. urls += "?" + c.urlParams_.Encode()
  56633. req, err := http.NewRequest("POST", urls, body)
  56634. if err != nil {
  56635. return nil, err
  56636. }
  56637. req.Header = reqHeaders
  56638. googleapi.Expand(req.URL, map[string]string{
  56639. "project": c.project,
  56640. "zone": c.zone,
  56641. "instanceGroupManager": c.instanceGroupManager,
  56642. })
  56643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56644. }
  56645. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  56646. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56647. // status code is an error. Response headers are in either
  56648. // *Operation.ServerResponse.Header or (if a response was returned at
  56649. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56650. // to check whether the returned error was because
  56651. // http.StatusNotModified was returned.
  56652. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56653. gensupport.SetOptions(c.urlParams_, opts...)
  56654. res, err := c.doRequest("json")
  56655. if res != nil && res.StatusCode == http.StatusNotModified {
  56656. if res.Body != nil {
  56657. res.Body.Close()
  56658. }
  56659. return nil, &googleapi.Error{
  56660. Code: res.StatusCode,
  56661. Header: res.Header,
  56662. }
  56663. }
  56664. if err != nil {
  56665. return nil, err
  56666. }
  56667. defer googleapi.CloseBody(res)
  56668. if err := googleapi.CheckResponse(res); err != nil {
  56669. return nil, err
  56670. }
  56671. ret := &Operation{
  56672. ServerResponse: googleapi.ServerResponse{
  56673. Header: res.Header,
  56674. HTTPStatusCode: res.StatusCode,
  56675. },
  56676. }
  56677. target := &ret
  56678. if err := gensupport.DecodeResponse(target, res); err != nil {
  56679. return nil, err
  56680. }
  56681. return ret, nil
  56682. // {
  56683. // "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.",
  56684. // "httpMethod": "POST",
  56685. // "id": "compute.instanceGroupManagers.setTargetPools",
  56686. // "parameterOrder": [
  56687. // "project",
  56688. // "zone",
  56689. // "instanceGroupManager"
  56690. // ],
  56691. // "parameters": {
  56692. // "instanceGroupManager": {
  56693. // "description": "The name of the managed instance group.",
  56694. // "location": "path",
  56695. // "required": true,
  56696. // "type": "string"
  56697. // },
  56698. // "project": {
  56699. // "description": "Project ID for this request.",
  56700. // "location": "path",
  56701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56702. // "required": true,
  56703. // "type": "string"
  56704. // },
  56705. // "requestId": {
  56706. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56707. // "location": "query",
  56708. // "type": "string"
  56709. // },
  56710. // "zone": {
  56711. // "description": "The name of the zone where the managed instance group is located.",
  56712. // "location": "path",
  56713. // "required": true,
  56714. // "type": "string"
  56715. // }
  56716. // },
  56717. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  56718. // "request": {
  56719. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  56720. // },
  56721. // "response": {
  56722. // "$ref": "Operation"
  56723. // },
  56724. // "scopes": [
  56725. // "https://www.googleapis.com/auth/cloud-platform",
  56726. // "https://www.googleapis.com/auth/compute"
  56727. // ]
  56728. // }
  56729. }
  56730. // method id "compute.instanceGroupManagers.testIamPermissions":
  56731. type InstanceGroupManagersTestIamPermissionsCall struct {
  56732. s *Service
  56733. project string
  56734. zone string
  56735. resource string
  56736. testpermissionsrequest *TestPermissionsRequest
  56737. urlParams_ gensupport.URLParams
  56738. ctx_ context.Context
  56739. header_ http.Header
  56740. }
  56741. // TestIamPermissions: Returns permissions that a caller has on the
  56742. // specified resource.
  56743. func (r *InstanceGroupManagersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupManagersTestIamPermissionsCall {
  56744. c := &InstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56745. c.project = project
  56746. c.zone = zone
  56747. c.resource = resource
  56748. c.testpermissionsrequest = testpermissionsrequest
  56749. return c
  56750. }
  56751. // Fields allows partial responses to be retrieved. See
  56752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56753. // for more information.
  56754. func (c *InstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersTestIamPermissionsCall {
  56755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56756. return c
  56757. }
  56758. // Context sets the context to be used in this call's Do method. Any
  56759. // pending HTTP request will be aborted if the provided context is
  56760. // canceled.
  56761. func (c *InstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupManagersTestIamPermissionsCall {
  56762. c.ctx_ = ctx
  56763. return c
  56764. }
  56765. // Header returns an http.Header that can be modified by the caller to
  56766. // add HTTP headers to the request.
  56767. func (c *InstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  56768. if c.header_ == nil {
  56769. c.header_ = make(http.Header)
  56770. }
  56771. return c.header_
  56772. }
  56773. func (c *InstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  56774. reqHeaders := make(http.Header)
  56775. for k, v := range c.header_ {
  56776. reqHeaders[k] = v
  56777. }
  56778. reqHeaders.Set("User-Agent", c.s.userAgent())
  56779. var body io.Reader = nil
  56780. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  56781. if err != nil {
  56782. return nil, err
  56783. }
  56784. reqHeaders.Set("Content-Type", "application/json")
  56785. c.urlParams_.Set("alt", alt)
  56786. c.urlParams_.Set("prettyPrint", "false")
  56787. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions")
  56788. urls += "?" + c.urlParams_.Encode()
  56789. req, err := http.NewRequest("POST", urls, body)
  56790. if err != nil {
  56791. return nil, err
  56792. }
  56793. req.Header = reqHeaders
  56794. googleapi.Expand(req.URL, map[string]string{
  56795. "project": c.project,
  56796. "zone": c.zone,
  56797. "resource": c.resource,
  56798. })
  56799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56800. }
  56801. // Do executes the "compute.instanceGroupManagers.testIamPermissions" call.
  56802. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  56803. // non-2xx status code is an error. Response headers are in either
  56804. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  56805. // returned at all) in error.(*googleapi.Error).Header. Use
  56806. // googleapi.IsNotModified to check whether the returned error was
  56807. // because http.StatusNotModified was returned.
  56808. func (c *InstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  56809. gensupport.SetOptions(c.urlParams_, opts...)
  56810. res, err := c.doRequest("json")
  56811. if res != nil && res.StatusCode == http.StatusNotModified {
  56812. if res.Body != nil {
  56813. res.Body.Close()
  56814. }
  56815. return nil, &googleapi.Error{
  56816. Code: res.StatusCode,
  56817. Header: res.Header,
  56818. }
  56819. }
  56820. if err != nil {
  56821. return nil, err
  56822. }
  56823. defer googleapi.CloseBody(res)
  56824. if err := googleapi.CheckResponse(res); err != nil {
  56825. return nil, err
  56826. }
  56827. ret := &TestPermissionsResponse{
  56828. ServerResponse: googleapi.ServerResponse{
  56829. Header: res.Header,
  56830. HTTPStatusCode: res.StatusCode,
  56831. },
  56832. }
  56833. target := &ret
  56834. if err := gensupport.DecodeResponse(target, res); err != nil {
  56835. return nil, err
  56836. }
  56837. return ret, nil
  56838. // {
  56839. // "description": "Returns permissions that a caller has on the specified resource.",
  56840. // "httpMethod": "POST",
  56841. // "id": "compute.instanceGroupManagers.testIamPermissions",
  56842. // "parameterOrder": [
  56843. // "project",
  56844. // "zone",
  56845. // "resource"
  56846. // ],
  56847. // "parameters": {
  56848. // "project": {
  56849. // "description": "Project ID for this request.",
  56850. // "location": "path",
  56851. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56852. // "required": true,
  56853. // "type": "string"
  56854. // },
  56855. // "resource": {
  56856. // "description": "Name or id of the resource for this request.",
  56857. // "location": "path",
  56858. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56859. // "required": true,
  56860. // "type": "string"
  56861. // },
  56862. // "zone": {
  56863. // "description": "The name of the zone for this request.",
  56864. // "location": "path",
  56865. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56866. // "required": true,
  56867. // "type": "string"
  56868. // }
  56869. // },
  56870. // "path": "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions",
  56871. // "request": {
  56872. // "$ref": "TestPermissionsRequest"
  56873. // },
  56874. // "response": {
  56875. // "$ref": "TestPermissionsResponse"
  56876. // },
  56877. // "scopes": [
  56878. // "https://www.googleapis.com/auth/cloud-platform",
  56879. // "https://www.googleapis.com/auth/compute",
  56880. // "https://www.googleapis.com/auth/compute.readonly"
  56881. // ]
  56882. // }
  56883. }
  56884. // method id "compute.instanceGroupManagers.update":
  56885. type InstanceGroupManagersUpdateCall struct {
  56886. s *Service
  56887. project string
  56888. zone string
  56889. instanceGroupManager string
  56890. instancegroupmanager *InstanceGroupManager
  56891. urlParams_ gensupport.URLParams
  56892. ctx_ context.Context
  56893. header_ http.Header
  56894. }
  56895. // Update: Updates a managed instance group using the information that
  56896. // you specify in the request. This operation is marked as DONE when the
  56897. // group is updated even if the instances in the group have not yet been
  56898. // updated. You must separately verify the status of the individual
  56899. // instances with the listManagedInstances method.
  56900. func (r *InstanceGroupManagersService) Update(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersUpdateCall {
  56901. c := &InstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56902. c.project = project
  56903. c.zone = zone
  56904. c.instanceGroupManager = instanceGroupManager
  56905. c.instancegroupmanager = instancegroupmanager
  56906. return c
  56907. }
  56908. // RequestId sets the optional parameter "requestId": An optional
  56909. // request ID to identify requests. Specify a unique request ID so that
  56910. // if you must retry your request, the server will know to ignore the
  56911. // request if it has already been completed.
  56912. //
  56913. // For example, consider a situation where you make an initial request
  56914. // and the request times out. If you make the request again with the
  56915. // same request ID, the server can check if original operation with the
  56916. // same request ID was received, and if so, will ignore the second
  56917. // request. This prevents clients from accidentally creating duplicate
  56918. // commitments.
  56919. //
  56920. // The request ID must be a valid UUID with the exception that zero UUID
  56921. // is not supported (00000000-0000-0000-0000-000000000000).
  56922. func (c *InstanceGroupManagersUpdateCall) RequestId(requestId string) *InstanceGroupManagersUpdateCall {
  56923. c.urlParams_.Set("requestId", requestId)
  56924. return c
  56925. }
  56926. // Fields allows partial responses to be retrieved. See
  56927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56928. // for more information.
  56929. func (c *InstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdateCall {
  56930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56931. return c
  56932. }
  56933. // Context sets the context to be used in this call's Do method. Any
  56934. // pending HTTP request will be aborted if the provided context is
  56935. // canceled.
  56936. func (c *InstanceGroupManagersUpdateCall) Context(ctx context.Context) *InstanceGroupManagersUpdateCall {
  56937. c.ctx_ = ctx
  56938. return c
  56939. }
  56940. // Header returns an http.Header that can be modified by the caller to
  56941. // add HTTP headers to the request.
  56942. func (c *InstanceGroupManagersUpdateCall) Header() http.Header {
  56943. if c.header_ == nil {
  56944. c.header_ = make(http.Header)
  56945. }
  56946. return c.header_
  56947. }
  56948. func (c *InstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  56949. reqHeaders := make(http.Header)
  56950. for k, v := range c.header_ {
  56951. reqHeaders[k] = v
  56952. }
  56953. reqHeaders.Set("User-Agent", c.s.userAgent())
  56954. var body io.Reader = nil
  56955. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  56956. if err != nil {
  56957. return nil, err
  56958. }
  56959. reqHeaders.Set("Content-Type", "application/json")
  56960. c.urlParams_.Set("alt", alt)
  56961. c.urlParams_.Set("prettyPrint", "false")
  56962. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  56963. urls += "?" + c.urlParams_.Encode()
  56964. req, err := http.NewRequest("PUT", urls, body)
  56965. if err != nil {
  56966. return nil, err
  56967. }
  56968. req.Header = reqHeaders
  56969. googleapi.Expand(req.URL, map[string]string{
  56970. "project": c.project,
  56971. "zone": c.zone,
  56972. "instanceGroupManager": c.instanceGroupManager,
  56973. })
  56974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56975. }
  56976. // Do executes the "compute.instanceGroupManagers.update" call.
  56977. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56978. // status code is an error. Response headers are in either
  56979. // *Operation.ServerResponse.Header or (if a response was returned at
  56980. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56981. // to check whether the returned error was because
  56982. // http.StatusNotModified was returned.
  56983. func (c *InstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56984. gensupport.SetOptions(c.urlParams_, opts...)
  56985. res, err := c.doRequest("json")
  56986. if res != nil && res.StatusCode == http.StatusNotModified {
  56987. if res.Body != nil {
  56988. res.Body.Close()
  56989. }
  56990. return nil, &googleapi.Error{
  56991. Code: res.StatusCode,
  56992. Header: res.Header,
  56993. }
  56994. }
  56995. if err != nil {
  56996. return nil, err
  56997. }
  56998. defer googleapi.CloseBody(res)
  56999. if err := googleapi.CheckResponse(res); err != nil {
  57000. return nil, err
  57001. }
  57002. ret := &Operation{
  57003. ServerResponse: googleapi.ServerResponse{
  57004. Header: res.Header,
  57005. HTTPStatusCode: res.StatusCode,
  57006. },
  57007. }
  57008. target := &ret
  57009. if err := gensupport.DecodeResponse(target, res); err != nil {
  57010. return nil, err
  57011. }
  57012. return ret, nil
  57013. // {
  57014. // "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.",
  57015. // "httpMethod": "PUT",
  57016. // "id": "compute.instanceGroupManagers.update",
  57017. // "parameterOrder": [
  57018. // "project",
  57019. // "zone",
  57020. // "instanceGroupManager"
  57021. // ],
  57022. // "parameters": {
  57023. // "instanceGroupManager": {
  57024. // "description": "The name of the instance group manager.",
  57025. // "location": "path",
  57026. // "required": true,
  57027. // "type": "string"
  57028. // },
  57029. // "project": {
  57030. // "description": "Project ID for this request.",
  57031. // "location": "path",
  57032. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57033. // "required": true,
  57034. // "type": "string"
  57035. // },
  57036. // "requestId": {
  57037. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57038. // "location": "query",
  57039. // "type": "string"
  57040. // },
  57041. // "zone": {
  57042. // "description": "The name of the zone where you want to create the managed instance group.",
  57043. // "location": "path",
  57044. // "required": true,
  57045. // "type": "string"
  57046. // }
  57047. // },
  57048. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  57049. // "request": {
  57050. // "$ref": "InstanceGroupManager"
  57051. // },
  57052. // "response": {
  57053. // "$ref": "Operation"
  57054. // },
  57055. // "scopes": [
  57056. // "https://www.googleapis.com/auth/cloud-platform",
  57057. // "https://www.googleapis.com/auth/compute"
  57058. // ]
  57059. // }
  57060. }
  57061. // method id "compute.instanceGroups.addInstances":
  57062. type InstanceGroupsAddInstancesCall struct {
  57063. s *Service
  57064. project string
  57065. zone string
  57066. instanceGroup string
  57067. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  57068. urlParams_ gensupport.URLParams
  57069. ctx_ context.Context
  57070. header_ http.Header
  57071. }
  57072. // AddInstances: Adds a list of instances to the specified instance
  57073. // group. All of the instances in the instance group must be in the same
  57074. // network/subnetwork. Read Adding instances for more information.
  57075. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  57076. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57077. c.project = project
  57078. c.zone = zone
  57079. c.instanceGroup = instanceGroup
  57080. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  57081. return c
  57082. }
  57083. // RequestId sets the optional parameter "requestId": An optional
  57084. // request ID to identify requests. Specify a unique request ID so that
  57085. // if you must retry your request, the server will know to ignore the
  57086. // request if it has already been completed.
  57087. //
  57088. // For example, consider a situation where you make an initial request
  57089. // and the request times out. If you make the request again with the
  57090. // same request ID, the server can check if original operation with the
  57091. // same request ID was received, and if so, will ignore the second
  57092. // request. This prevents clients from accidentally creating duplicate
  57093. // commitments.
  57094. //
  57095. // The request ID must be a valid UUID with the exception that zero UUID
  57096. // is not supported (00000000-0000-0000-0000-000000000000).
  57097. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  57098. c.urlParams_.Set("requestId", requestId)
  57099. return c
  57100. }
  57101. // Fields allows partial responses to be retrieved. See
  57102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57103. // for more information.
  57104. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  57105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57106. return c
  57107. }
  57108. // Context sets the context to be used in this call's Do method. Any
  57109. // pending HTTP request will be aborted if the provided context is
  57110. // canceled.
  57111. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  57112. c.ctx_ = ctx
  57113. return c
  57114. }
  57115. // Header returns an http.Header that can be modified by the caller to
  57116. // add HTTP headers to the request.
  57117. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  57118. if c.header_ == nil {
  57119. c.header_ = make(http.Header)
  57120. }
  57121. return c.header_
  57122. }
  57123. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  57124. reqHeaders := make(http.Header)
  57125. for k, v := range c.header_ {
  57126. reqHeaders[k] = v
  57127. }
  57128. reqHeaders.Set("User-Agent", c.s.userAgent())
  57129. var body io.Reader = nil
  57130. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  57131. if err != nil {
  57132. return nil, err
  57133. }
  57134. reqHeaders.Set("Content-Type", "application/json")
  57135. c.urlParams_.Set("alt", alt)
  57136. c.urlParams_.Set("prettyPrint", "false")
  57137. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  57138. urls += "?" + c.urlParams_.Encode()
  57139. req, err := http.NewRequest("POST", urls, body)
  57140. if err != nil {
  57141. return nil, err
  57142. }
  57143. req.Header = reqHeaders
  57144. googleapi.Expand(req.URL, map[string]string{
  57145. "project": c.project,
  57146. "zone": c.zone,
  57147. "instanceGroup": c.instanceGroup,
  57148. })
  57149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57150. }
  57151. // Do executes the "compute.instanceGroups.addInstances" call.
  57152. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57153. // status code is an error. Response headers are in either
  57154. // *Operation.ServerResponse.Header or (if a response was returned at
  57155. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57156. // to check whether the returned error was because
  57157. // http.StatusNotModified was returned.
  57158. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57159. gensupport.SetOptions(c.urlParams_, opts...)
  57160. res, err := c.doRequest("json")
  57161. if res != nil && res.StatusCode == http.StatusNotModified {
  57162. if res.Body != nil {
  57163. res.Body.Close()
  57164. }
  57165. return nil, &googleapi.Error{
  57166. Code: res.StatusCode,
  57167. Header: res.Header,
  57168. }
  57169. }
  57170. if err != nil {
  57171. return nil, err
  57172. }
  57173. defer googleapi.CloseBody(res)
  57174. if err := googleapi.CheckResponse(res); err != nil {
  57175. return nil, err
  57176. }
  57177. ret := &Operation{
  57178. ServerResponse: googleapi.ServerResponse{
  57179. Header: res.Header,
  57180. HTTPStatusCode: res.StatusCode,
  57181. },
  57182. }
  57183. target := &ret
  57184. if err := gensupport.DecodeResponse(target, res); err != nil {
  57185. return nil, err
  57186. }
  57187. return ret, nil
  57188. // {
  57189. // "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.",
  57190. // "httpMethod": "POST",
  57191. // "id": "compute.instanceGroups.addInstances",
  57192. // "parameterOrder": [
  57193. // "project",
  57194. // "zone",
  57195. // "instanceGroup"
  57196. // ],
  57197. // "parameters": {
  57198. // "instanceGroup": {
  57199. // "description": "The name of the instance group where you are adding instances.",
  57200. // "location": "path",
  57201. // "required": true,
  57202. // "type": "string"
  57203. // },
  57204. // "project": {
  57205. // "description": "Project ID for this request.",
  57206. // "location": "path",
  57207. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57208. // "required": true,
  57209. // "type": "string"
  57210. // },
  57211. // "requestId": {
  57212. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57213. // "location": "query",
  57214. // "type": "string"
  57215. // },
  57216. // "zone": {
  57217. // "description": "The name of the zone where the instance group is located.",
  57218. // "location": "path",
  57219. // "required": true,
  57220. // "type": "string"
  57221. // }
  57222. // },
  57223. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  57224. // "request": {
  57225. // "$ref": "InstanceGroupsAddInstancesRequest"
  57226. // },
  57227. // "response": {
  57228. // "$ref": "Operation"
  57229. // },
  57230. // "scopes": [
  57231. // "https://www.googleapis.com/auth/cloud-platform",
  57232. // "https://www.googleapis.com/auth/compute"
  57233. // ]
  57234. // }
  57235. }
  57236. // method id "compute.instanceGroups.aggregatedList":
  57237. type InstanceGroupsAggregatedListCall struct {
  57238. s *Service
  57239. project string
  57240. urlParams_ gensupport.URLParams
  57241. ifNoneMatch_ string
  57242. ctx_ context.Context
  57243. header_ http.Header
  57244. }
  57245. // AggregatedList: Retrieves the list of instance groups and sorts them
  57246. // by zone.
  57247. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  57248. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57249. c.project = project
  57250. return c
  57251. }
  57252. // Filter sets the optional parameter "filter": A filter expression that
  57253. // filters resources listed in the response. The expression must specify
  57254. // the field name, a comparison operator, and the value that you want to
  57255. // use for filtering. The value must be a string, a number, or a
  57256. // boolean. The comparison operator must be either =, !=, >, or <.
  57257. //
  57258. // For example, if you are filtering Compute Engine instances, you can
  57259. // exclude instances named example-instance by specifying name !=
  57260. // example-instance.
  57261. //
  57262. // You can also filter nested fields. For example, you could specify
  57263. // scheduling.automaticRestart = false to include instances only if they
  57264. // are not scheduled for automatic restarts. You can use filtering on
  57265. // nested fields to filter based on resource labels.
  57266. //
  57267. // To filter on multiple expressions, provide each separate expression
  57268. // within parentheses. For example, (scheduling.automaticRestart = true)
  57269. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57270. // AND expression. However, you can include AND and OR expressions
  57271. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57272. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57273. // true).
  57274. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  57275. c.urlParams_.Set("filter", filter)
  57276. return c
  57277. }
  57278. // MaxResults sets the optional parameter "maxResults": The maximum
  57279. // number of results per page that should be returned. If the number of
  57280. // available results is larger than maxResults, Compute Engine returns a
  57281. // nextPageToken that can be used to get the next page of results in
  57282. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57283. // (Default: 500)
  57284. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  57285. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57286. return c
  57287. }
  57288. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57289. // a certain order. By default, results are returned in alphanumerical
  57290. // order based on the resource name.
  57291. //
  57292. // You can also sort results in descending order based on the creation
  57293. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57294. // based on the creationTimestamp field in reverse chronological order
  57295. // (newest result first). Use this to sort resources like operations so
  57296. // that the newest operation is returned first.
  57297. //
  57298. // Currently, only sorting by name or creationTimestamp desc is
  57299. // supported.
  57300. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  57301. c.urlParams_.Set("orderBy", orderBy)
  57302. return c
  57303. }
  57304. // PageToken sets the optional parameter "pageToken": Specifies a page
  57305. // token to use. Set pageToken to the nextPageToken returned by a
  57306. // previous list request to get the next page of results.
  57307. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  57308. c.urlParams_.Set("pageToken", pageToken)
  57309. return c
  57310. }
  57311. // Fields allows partial responses to be retrieved. See
  57312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57313. // for more information.
  57314. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  57315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57316. return c
  57317. }
  57318. // IfNoneMatch sets the optional parameter which makes the operation
  57319. // fail if the object's ETag matches the given value. This is useful for
  57320. // getting updates only after the object has changed since the last
  57321. // request. Use googleapi.IsNotModified to check whether the response
  57322. // error from Do is the result of In-None-Match.
  57323. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  57324. c.ifNoneMatch_ = entityTag
  57325. return c
  57326. }
  57327. // Context sets the context to be used in this call's Do method. Any
  57328. // pending HTTP request will be aborted if the provided context is
  57329. // canceled.
  57330. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  57331. c.ctx_ = ctx
  57332. return c
  57333. }
  57334. // Header returns an http.Header that can be modified by the caller to
  57335. // add HTTP headers to the request.
  57336. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  57337. if c.header_ == nil {
  57338. c.header_ = make(http.Header)
  57339. }
  57340. return c.header_
  57341. }
  57342. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  57343. reqHeaders := make(http.Header)
  57344. for k, v := range c.header_ {
  57345. reqHeaders[k] = v
  57346. }
  57347. reqHeaders.Set("User-Agent", c.s.userAgent())
  57348. if c.ifNoneMatch_ != "" {
  57349. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57350. }
  57351. var body io.Reader = nil
  57352. c.urlParams_.Set("alt", alt)
  57353. c.urlParams_.Set("prettyPrint", "false")
  57354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  57355. urls += "?" + c.urlParams_.Encode()
  57356. req, err := http.NewRequest("GET", urls, body)
  57357. if err != nil {
  57358. return nil, err
  57359. }
  57360. req.Header = reqHeaders
  57361. googleapi.Expand(req.URL, map[string]string{
  57362. "project": c.project,
  57363. })
  57364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57365. }
  57366. // Do executes the "compute.instanceGroups.aggregatedList" call.
  57367. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  57368. // Any non-2xx status code is an error. Response headers are in either
  57369. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  57370. // was returned at all) in error.(*googleapi.Error).Header. Use
  57371. // googleapi.IsNotModified to check whether the returned error was
  57372. // because http.StatusNotModified was returned.
  57373. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  57374. gensupport.SetOptions(c.urlParams_, opts...)
  57375. res, err := c.doRequest("json")
  57376. if res != nil && res.StatusCode == http.StatusNotModified {
  57377. if res.Body != nil {
  57378. res.Body.Close()
  57379. }
  57380. return nil, &googleapi.Error{
  57381. Code: res.StatusCode,
  57382. Header: res.Header,
  57383. }
  57384. }
  57385. if err != nil {
  57386. return nil, err
  57387. }
  57388. defer googleapi.CloseBody(res)
  57389. if err := googleapi.CheckResponse(res); err != nil {
  57390. return nil, err
  57391. }
  57392. ret := &InstanceGroupAggregatedList{
  57393. ServerResponse: googleapi.ServerResponse{
  57394. Header: res.Header,
  57395. HTTPStatusCode: res.StatusCode,
  57396. },
  57397. }
  57398. target := &ret
  57399. if err := gensupport.DecodeResponse(target, res); err != nil {
  57400. return nil, err
  57401. }
  57402. return ret, nil
  57403. // {
  57404. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  57405. // "httpMethod": "GET",
  57406. // "id": "compute.instanceGroups.aggregatedList",
  57407. // "parameterOrder": [
  57408. // "project"
  57409. // ],
  57410. // "parameters": {
  57411. // "filter": {
  57412. // "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).",
  57413. // "location": "query",
  57414. // "type": "string"
  57415. // },
  57416. // "maxResults": {
  57417. // "default": "500",
  57418. // "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)",
  57419. // "format": "uint32",
  57420. // "location": "query",
  57421. // "minimum": "0",
  57422. // "type": "integer"
  57423. // },
  57424. // "orderBy": {
  57425. // "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.",
  57426. // "location": "query",
  57427. // "type": "string"
  57428. // },
  57429. // "pageToken": {
  57430. // "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.",
  57431. // "location": "query",
  57432. // "type": "string"
  57433. // },
  57434. // "project": {
  57435. // "description": "Project ID for this request.",
  57436. // "location": "path",
  57437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57438. // "required": true,
  57439. // "type": "string"
  57440. // }
  57441. // },
  57442. // "path": "{project}/aggregated/instanceGroups",
  57443. // "response": {
  57444. // "$ref": "InstanceGroupAggregatedList"
  57445. // },
  57446. // "scopes": [
  57447. // "https://www.googleapis.com/auth/cloud-platform",
  57448. // "https://www.googleapis.com/auth/compute",
  57449. // "https://www.googleapis.com/auth/compute.readonly"
  57450. // ]
  57451. // }
  57452. }
  57453. // Pages invokes f for each page of results.
  57454. // A non-nil error returned from f will halt the iteration.
  57455. // The provided context supersedes any context provided to the Context method.
  57456. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  57457. c.ctx_ = ctx
  57458. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57459. for {
  57460. x, err := c.Do()
  57461. if err != nil {
  57462. return err
  57463. }
  57464. if err := f(x); err != nil {
  57465. return err
  57466. }
  57467. if x.NextPageToken == "" {
  57468. return nil
  57469. }
  57470. c.PageToken(x.NextPageToken)
  57471. }
  57472. }
  57473. // method id "compute.instanceGroups.delete":
  57474. type InstanceGroupsDeleteCall struct {
  57475. s *Service
  57476. project string
  57477. zone string
  57478. instanceGroup string
  57479. urlParams_ gensupport.URLParams
  57480. ctx_ context.Context
  57481. header_ http.Header
  57482. }
  57483. // Delete: Deletes the specified instance group. The instances in the
  57484. // group are not deleted. Note that instance group must not belong to a
  57485. // backend service. Read Deleting an instance group for more
  57486. // information.
  57487. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  57488. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57489. c.project = project
  57490. c.zone = zone
  57491. c.instanceGroup = instanceGroup
  57492. return c
  57493. }
  57494. // RequestId sets the optional parameter "requestId": An optional
  57495. // request ID to identify requests. Specify a unique request ID so that
  57496. // if you must retry your request, the server will know to ignore the
  57497. // request if it has already been completed.
  57498. //
  57499. // For example, consider a situation where you make an initial request
  57500. // and the request times out. If you make the request again with the
  57501. // same request ID, the server can check if original operation with the
  57502. // same request ID was received, and if so, will ignore the second
  57503. // request. This prevents clients from accidentally creating duplicate
  57504. // commitments.
  57505. //
  57506. // The request ID must be a valid UUID with the exception that zero UUID
  57507. // is not supported (00000000-0000-0000-0000-000000000000).
  57508. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  57509. c.urlParams_.Set("requestId", requestId)
  57510. return c
  57511. }
  57512. // Fields allows partial responses to be retrieved. See
  57513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57514. // for more information.
  57515. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  57516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57517. return c
  57518. }
  57519. // Context sets the context to be used in this call's Do method. Any
  57520. // pending HTTP request will be aborted if the provided context is
  57521. // canceled.
  57522. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  57523. c.ctx_ = ctx
  57524. return c
  57525. }
  57526. // Header returns an http.Header that can be modified by the caller to
  57527. // add HTTP headers to the request.
  57528. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  57529. if c.header_ == nil {
  57530. c.header_ = make(http.Header)
  57531. }
  57532. return c.header_
  57533. }
  57534. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  57535. reqHeaders := make(http.Header)
  57536. for k, v := range c.header_ {
  57537. reqHeaders[k] = v
  57538. }
  57539. reqHeaders.Set("User-Agent", c.s.userAgent())
  57540. var body io.Reader = nil
  57541. c.urlParams_.Set("alt", alt)
  57542. c.urlParams_.Set("prettyPrint", "false")
  57543. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  57544. urls += "?" + c.urlParams_.Encode()
  57545. req, err := http.NewRequest("DELETE", urls, body)
  57546. if err != nil {
  57547. return nil, err
  57548. }
  57549. req.Header = reqHeaders
  57550. googleapi.Expand(req.URL, map[string]string{
  57551. "project": c.project,
  57552. "zone": c.zone,
  57553. "instanceGroup": c.instanceGroup,
  57554. })
  57555. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57556. }
  57557. // Do executes the "compute.instanceGroups.delete" call.
  57558. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57559. // status code is an error. Response headers are in either
  57560. // *Operation.ServerResponse.Header or (if a response was returned at
  57561. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57562. // to check whether the returned error was because
  57563. // http.StatusNotModified was returned.
  57564. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57565. gensupport.SetOptions(c.urlParams_, opts...)
  57566. res, err := c.doRequest("json")
  57567. if res != nil && res.StatusCode == http.StatusNotModified {
  57568. if res.Body != nil {
  57569. res.Body.Close()
  57570. }
  57571. return nil, &googleapi.Error{
  57572. Code: res.StatusCode,
  57573. Header: res.Header,
  57574. }
  57575. }
  57576. if err != nil {
  57577. return nil, err
  57578. }
  57579. defer googleapi.CloseBody(res)
  57580. if err := googleapi.CheckResponse(res); err != nil {
  57581. return nil, err
  57582. }
  57583. ret := &Operation{
  57584. ServerResponse: googleapi.ServerResponse{
  57585. Header: res.Header,
  57586. HTTPStatusCode: res.StatusCode,
  57587. },
  57588. }
  57589. target := &ret
  57590. if err := gensupport.DecodeResponse(target, res); err != nil {
  57591. return nil, err
  57592. }
  57593. return ret, nil
  57594. // {
  57595. // "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.",
  57596. // "httpMethod": "DELETE",
  57597. // "id": "compute.instanceGroups.delete",
  57598. // "parameterOrder": [
  57599. // "project",
  57600. // "zone",
  57601. // "instanceGroup"
  57602. // ],
  57603. // "parameters": {
  57604. // "instanceGroup": {
  57605. // "description": "The name of the instance group to delete.",
  57606. // "location": "path",
  57607. // "required": true,
  57608. // "type": "string"
  57609. // },
  57610. // "project": {
  57611. // "description": "Project ID for this request.",
  57612. // "location": "path",
  57613. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57614. // "required": true,
  57615. // "type": "string"
  57616. // },
  57617. // "requestId": {
  57618. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57619. // "location": "query",
  57620. // "type": "string"
  57621. // },
  57622. // "zone": {
  57623. // "description": "The name of the zone where the instance group is located.",
  57624. // "location": "path",
  57625. // "required": true,
  57626. // "type": "string"
  57627. // }
  57628. // },
  57629. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  57630. // "response": {
  57631. // "$ref": "Operation"
  57632. // },
  57633. // "scopes": [
  57634. // "https://www.googleapis.com/auth/cloud-platform",
  57635. // "https://www.googleapis.com/auth/compute"
  57636. // ]
  57637. // }
  57638. }
  57639. // method id "compute.instanceGroups.get":
  57640. type InstanceGroupsGetCall struct {
  57641. s *Service
  57642. project string
  57643. zone string
  57644. instanceGroup string
  57645. urlParams_ gensupport.URLParams
  57646. ifNoneMatch_ string
  57647. ctx_ context.Context
  57648. header_ http.Header
  57649. }
  57650. // Get: Returns the specified instance group. Gets a list of available
  57651. // instance groups by making a list() request.
  57652. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  57653. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57654. c.project = project
  57655. c.zone = zone
  57656. c.instanceGroup = instanceGroup
  57657. return c
  57658. }
  57659. // Fields allows partial responses to be retrieved. See
  57660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57661. // for more information.
  57662. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  57663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57664. return c
  57665. }
  57666. // IfNoneMatch sets the optional parameter which makes the operation
  57667. // fail if the object's ETag matches the given value. This is useful for
  57668. // getting updates only after the object has changed since the last
  57669. // request. Use googleapi.IsNotModified to check whether the response
  57670. // error from Do is the result of In-None-Match.
  57671. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  57672. c.ifNoneMatch_ = entityTag
  57673. return c
  57674. }
  57675. // Context sets the context to be used in this call's Do method. Any
  57676. // pending HTTP request will be aborted if the provided context is
  57677. // canceled.
  57678. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  57679. c.ctx_ = ctx
  57680. return c
  57681. }
  57682. // Header returns an http.Header that can be modified by the caller to
  57683. // add HTTP headers to the request.
  57684. func (c *InstanceGroupsGetCall) Header() http.Header {
  57685. if c.header_ == nil {
  57686. c.header_ = make(http.Header)
  57687. }
  57688. return c.header_
  57689. }
  57690. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  57691. reqHeaders := make(http.Header)
  57692. for k, v := range c.header_ {
  57693. reqHeaders[k] = v
  57694. }
  57695. reqHeaders.Set("User-Agent", c.s.userAgent())
  57696. if c.ifNoneMatch_ != "" {
  57697. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57698. }
  57699. var body io.Reader = nil
  57700. c.urlParams_.Set("alt", alt)
  57701. c.urlParams_.Set("prettyPrint", "false")
  57702. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  57703. urls += "?" + c.urlParams_.Encode()
  57704. req, err := http.NewRequest("GET", urls, body)
  57705. if err != nil {
  57706. return nil, err
  57707. }
  57708. req.Header = reqHeaders
  57709. googleapi.Expand(req.URL, map[string]string{
  57710. "project": c.project,
  57711. "zone": c.zone,
  57712. "instanceGroup": c.instanceGroup,
  57713. })
  57714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57715. }
  57716. // Do executes the "compute.instanceGroups.get" call.
  57717. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  57718. // status code is an error. Response headers are in either
  57719. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  57720. // at all) in error.(*googleapi.Error).Header. Use
  57721. // googleapi.IsNotModified to check whether the returned error was
  57722. // because http.StatusNotModified was returned.
  57723. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  57724. gensupport.SetOptions(c.urlParams_, opts...)
  57725. res, err := c.doRequest("json")
  57726. if res != nil && res.StatusCode == http.StatusNotModified {
  57727. if res.Body != nil {
  57728. res.Body.Close()
  57729. }
  57730. return nil, &googleapi.Error{
  57731. Code: res.StatusCode,
  57732. Header: res.Header,
  57733. }
  57734. }
  57735. if err != nil {
  57736. return nil, err
  57737. }
  57738. defer googleapi.CloseBody(res)
  57739. if err := googleapi.CheckResponse(res); err != nil {
  57740. return nil, err
  57741. }
  57742. ret := &InstanceGroup{
  57743. ServerResponse: googleapi.ServerResponse{
  57744. Header: res.Header,
  57745. HTTPStatusCode: res.StatusCode,
  57746. },
  57747. }
  57748. target := &ret
  57749. if err := gensupport.DecodeResponse(target, res); err != nil {
  57750. return nil, err
  57751. }
  57752. return ret, nil
  57753. // {
  57754. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  57755. // "httpMethod": "GET",
  57756. // "id": "compute.instanceGroups.get",
  57757. // "parameterOrder": [
  57758. // "project",
  57759. // "zone",
  57760. // "instanceGroup"
  57761. // ],
  57762. // "parameters": {
  57763. // "instanceGroup": {
  57764. // "description": "The name of the instance group.",
  57765. // "location": "path",
  57766. // "required": true,
  57767. // "type": "string"
  57768. // },
  57769. // "project": {
  57770. // "description": "Project ID for this request.",
  57771. // "location": "path",
  57772. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57773. // "required": true,
  57774. // "type": "string"
  57775. // },
  57776. // "zone": {
  57777. // "description": "The name of the zone where the instance group is located.",
  57778. // "location": "path",
  57779. // "required": true,
  57780. // "type": "string"
  57781. // }
  57782. // },
  57783. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  57784. // "response": {
  57785. // "$ref": "InstanceGroup"
  57786. // },
  57787. // "scopes": [
  57788. // "https://www.googleapis.com/auth/cloud-platform",
  57789. // "https://www.googleapis.com/auth/compute",
  57790. // "https://www.googleapis.com/auth/compute.readonly"
  57791. // ]
  57792. // }
  57793. }
  57794. // method id "compute.instanceGroups.insert":
  57795. type InstanceGroupsInsertCall struct {
  57796. s *Service
  57797. project string
  57798. zone string
  57799. instancegroup *InstanceGroup
  57800. urlParams_ gensupport.URLParams
  57801. ctx_ context.Context
  57802. header_ http.Header
  57803. }
  57804. // Insert: Creates an instance group in the specified project using the
  57805. // parameters that are included in the request.
  57806. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  57807. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57808. c.project = project
  57809. c.zone = zone
  57810. c.instancegroup = instancegroup
  57811. return c
  57812. }
  57813. // RequestId sets the optional parameter "requestId": An optional
  57814. // request ID to identify requests. Specify a unique request ID so that
  57815. // if you must retry your request, the server will know to ignore the
  57816. // request if it has already been completed.
  57817. //
  57818. // For example, consider a situation where you make an initial request
  57819. // and the request times out. If you make the request again with the
  57820. // same request ID, the server can check if original operation with the
  57821. // same request ID was received, and if so, will ignore the second
  57822. // request. This prevents clients from accidentally creating duplicate
  57823. // commitments.
  57824. //
  57825. // The request ID must be a valid UUID with the exception that zero UUID
  57826. // is not supported (00000000-0000-0000-0000-000000000000).
  57827. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  57828. c.urlParams_.Set("requestId", requestId)
  57829. return c
  57830. }
  57831. // Fields allows partial responses to be retrieved. See
  57832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57833. // for more information.
  57834. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  57835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57836. return c
  57837. }
  57838. // Context sets the context to be used in this call's Do method. Any
  57839. // pending HTTP request will be aborted if the provided context is
  57840. // canceled.
  57841. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  57842. c.ctx_ = ctx
  57843. return c
  57844. }
  57845. // Header returns an http.Header that can be modified by the caller to
  57846. // add HTTP headers to the request.
  57847. func (c *InstanceGroupsInsertCall) Header() http.Header {
  57848. if c.header_ == nil {
  57849. c.header_ = make(http.Header)
  57850. }
  57851. return c.header_
  57852. }
  57853. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  57854. reqHeaders := make(http.Header)
  57855. for k, v := range c.header_ {
  57856. reqHeaders[k] = v
  57857. }
  57858. reqHeaders.Set("User-Agent", c.s.userAgent())
  57859. var body io.Reader = nil
  57860. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  57861. if err != nil {
  57862. return nil, err
  57863. }
  57864. reqHeaders.Set("Content-Type", "application/json")
  57865. c.urlParams_.Set("alt", alt)
  57866. c.urlParams_.Set("prettyPrint", "false")
  57867. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  57868. urls += "?" + c.urlParams_.Encode()
  57869. req, err := http.NewRequest("POST", urls, body)
  57870. if err != nil {
  57871. return nil, err
  57872. }
  57873. req.Header = reqHeaders
  57874. googleapi.Expand(req.URL, map[string]string{
  57875. "project": c.project,
  57876. "zone": c.zone,
  57877. })
  57878. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57879. }
  57880. // Do executes the "compute.instanceGroups.insert" call.
  57881. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57882. // status code is an error. Response headers are in either
  57883. // *Operation.ServerResponse.Header or (if a response was returned at
  57884. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57885. // to check whether the returned error was because
  57886. // http.StatusNotModified was returned.
  57887. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57888. gensupport.SetOptions(c.urlParams_, opts...)
  57889. res, err := c.doRequest("json")
  57890. if res != nil && res.StatusCode == http.StatusNotModified {
  57891. if res.Body != nil {
  57892. res.Body.Close()
  57893. }
  57894. return nil, &googleapi.Error{
  57895. Code: res.StatusCode,
  57896. Header: res.Header,
  57897. }
  57898. }
  57899. if err != nil {
  57900. return nil, err
  57901. }
  57902. defer googleapi.CloseBody(res)
  57903. if err := googleapi.CheckResponse(res); err != nil {
  57904. return nil, err
  57905. }
  57906. ret := &Operation{
  57907. ServerResponse: googleapi.ServerResponse{
  57908. Header: res.Header,
  57909. HTTPStatusCode: res.StatusCode,
  57910. },
  57911. }
  57912. target := &ret
  57913. if err := gensupport.DecodeResponse(target, res); err != nil {
  57914. return nil, err
  57915. }
  57916. return ret, nil
  57917. // {
  57918. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  57919. // "httpMethod": "POST",
  57920. // "id": "compute.instanceGroups.insert",
  57921. // "parameterOrder": [
  57922. // "project",
  57923. // "zone"
  57924. // ],
  57925. // "parameters": {
  57926. // "project": {
  57927. // "description": "Project ID for this request.",
  57928. // "location": "path",
  57929. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57930. // "required": true,
  57931. // "type": "string"
  57932. // },
  57933. // "requestId": {
  57934. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57935. // "location": "query",
  57936. // "type": "string"
  57937. // },
  57938. // "zone": {
  57939. // "description": "The name of the zone where you want to create the instance group.",
  57940. // "location": "path",
  57941. // "required": true,
  57942. // "type": "string"
  57943. // }
  57944. // },
  57945. // "path": "{project}/zones/{zone}/instanceGroups",
  57946. // "request": {
  57947. // "$ref": "InstanceGroup"
  57948. // },
  57949. // "response": {
  57950. // "$ref": "Operation"
  57951. // },
  57952. // "scopes": [
  57953. // "https://www.googleapis.com/auth/cloud-platform",
  57954. // "https://www.googleapis.com/auth/compute"
  57955. // ]
  57956. // }
  57957. }
  57958. // method id "compute.instanceGroups.list":
  57959. type InstanceGroupsListCall struct {
  57960. s *Service
  57961. project string
  57962. zone string
  57963. urlParams_ gensupport.URLParams
  57964. ifNoneMatch_ string
  57965. ctx_ context.Context
  57966. header_ http.Header
  57967. }
  57968. // List: Retrieves the list of instance groups that are located in the
  57969. // specified project and zone.
  57970. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  57971. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57972. c.project = project
  57973. c.zone = zone
  57974. return c
  57975. }
  57976. // Filter sets the optional parameter "filter": A filter expression that
  57977. // filters resources listed in the response. The expression must specify
  57978. // the field name, a comparison operator, and the value that you want to
  57979. // use for filtering. The value must be a string, a number, or a
  57980. // boolean. The comparison operator must be either =, !=, >, or <.
  57981. //
  57982. // For example, if you are filtering Compute Engine instances, you can
  57983. // exclude instances named example-instance by specifying name !=
  57984. // example-instance.
  57985. //
  57986. // You can also filter nested fields. For example, you could specify
  57987. // scheduling.automaticRestart = false to include instances only if they
  57988. // are not scheduled for automatic restarts. You can use filtering on
  57989. // nested fields to filter based on resource labels.
  57990. //
  57991. // To filter on multiple expressions, provide each separate expression
  57992. // within parentheses. For example, (scheduling.automaticRestart = true)
  57993. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57994. // AND expression. However, you can include AND and OR expressions
  57995. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57996. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57997. // true).
  57998. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  57999. c.urlParams_.Set("filter", filter)
  58000. return c
  58001. }
  58002. // MaxResults sets the optional parameter "maxResults": The maximum
  58003. // number of results per page that should be returned. If the number of
  58004. // available results is larger than maxResults, Compute Engine returns a
  58005. // nextPageToken that can be used to get the next page of results in
  58006. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58007. // (Default: 500)
  58008. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  58009. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58010. return c
  58011. }
  58012. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58013. // a certain order. By default, results are returned in alphanumerical
  58014. // order based on the resource name.
  58015. //
  58016. // You can also sort results in descending order based on the creation
  58017. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58018. // based on the creationTimestamp field in reverse chronological order
  58019. // (newest result first). Use this to sort resources like operations so
  58020. // that the newest operation is returned first.
  58021. //
  58022. // Currently, only sorting by name or creationTimestamp desc is
  58023. // supported.
  58024. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  58025. c.urlParams_.Set("orderBy", orderBy)
  58026. return c
  58027. }
  58028. // PageToken sets the optional parameter "pageToken": Specifies a page
  58029. // token to use. Set pageToken to the nextPageToken returned by a
  58030. // previous list request to get the next page of results.
  58031. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  58032. c.urlParams_.Set("pageToken", pageToken)
  58033. return c
  58034. }
  58035. // Fields allows partial responses to be retrieved. See
  58036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58037. // for more information.
  58038. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  58039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58040. return c
  58041. }
  58042. // IfNoneMatch sets the optional parameter which makes the operation
  58043. // fail if the object's ETag matches the given value. This is useful for
  58044. // getting updates only after the object has changed since the last
  58045. // request. Use googleapi.IsNotModified to check whether the response
  58046. // error from Do is the result of In-None-Match.
  58047. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  58048. c.ifNoneMatch_ = entityTag
  58049. return c
  58050. }
  58051. // Context sets the context to be used in this call's Do method. Any
  58052. // pending HTTP request will be aborted if the provided context is
  58053. // canceled.
  58054. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  58055. c.ctx_ = ctx
  58056. return c
  58057. }
  58058. // Header returns an http.Header that can be modified by the caller to
  58059. // add HTTP headers to the request.
  58060. func (c *InstanceGroupsListCall) Header() http.Header {
  58061. if c.header_ == nil {
  58062. c.header_ = make(http.Header)
  58063. }
  58064. return c.header_
  58065. }
  58066. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  58067. reqHeaders := make(http.Header)
  58068. for k, v := range c.header_ {
  58069. reqHeaders[k] = v
  58070. }
  58071. reqHeaders.Set("User-Agent", c.s.userAgent())
  58072. if c.ifNoneMatch_ != "" {
  58073. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58074. }
  58075. var body io.Reader = nil
  58076. c.urlParams_.Set("alt", alt)
  58077. c.urlParams_.Set("prettyPrint", "false")
  58078. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  58079. urls += "?" + c.urlParams_.Encode()
  58080. req, err := http.NewRequest("GET", urls, body)
  58081. if err != nil {
  58082. return nil, err
  58083. }
  58084. req.Header = reqHeaders
  58085. googleapi.Expand(req.URL, map[string]string{
  58086. "project": c.project,
  58087. "zone": c.zone,
  58088. })
  58089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58090. }
  58091. // Do executes the "compute.instanceGroups.list" call.
  58092. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  58093. // non-2xx status code is an error. Response headers are in either
  58094. // *InstanceGroupList.ServerResponse.Header or (if a response was
  58095. // returned at all) in error.(*googleapi.Error).Header. Use
  58096. // googleapi.IsNotModified to check whether the returned error was
  58097. // because http.StatusNotModified was returned.
  58098. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  58099. gensupport.SetOptions(c.urlParams_, opts...)
  58100. res, err := c.doRequest("json")
  58101. if res != nil && res.StatusCode == http.StatusNotModified {
  58102. if res.Body != nil {
  58103. res.Body.Close()
  58104. }
  58105. return nil, &googleapi.Error{
  58106. Code: res.StatusCode,
  58107. Header: res.Header,
  58108. }
  58109. }
  58110. if err != nil {
  58111. return nil, err
  58112. }
  58113. defer googleapi.CloseBody(res)
  58114. if err := googleapi.CheckResponse(res); err != nil {
  58115. return nil, err
  58116. }
  58117. ret := &InstanceGroupList{
  58118. ServerResponse: googleapi.ServerResponse{
  58119. Header: res.Header,
  58120. HTTPStatusCode: res.StatusCode,
  58121. },
  58122. }
  58123. target := &ret
  58124. if err := gensupport.DecodeResponse(target, res); err != nil {
  58125. return nil, err
  58126. }
  58127. return ret, nil
  58128. // {
  58129. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  58130. // "httpMethod": "GET",
  58131. // "id": "compute.instanceGroups.list",
  58132. // "parameterOrder": [
  58133. // "project",
  58134. // "zone"
  58135. // ],
  58136. // "parameters": {
  58137. // "filter": {
  58138. // "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).",
  58139. // "location": "query",
  58140. // "type": "string"
  58141. // },
  58142. // "maxResults": {
  58143. // "default": "500",
  58144. // "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)",
  58145. // "format": "uint32",
  58146. // "location": "query",
  58147. // "minimum": "0",
  58148. // "type": "integer"
  58149. // },
  58150. // "orderBy": {
  58151. // "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.",
  58152. // "location": "query",
  58153. // "type": "string"
  58154. // },
  58155. // "pageToken": {
  58156. // "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.",
  58157. // "location": "query",
  58158. // "type": "string"
  58159. // },
  58160. // "project": {
  58161. // "description": "Project ID for this request.",
  58162. // "location": "path",
  58163. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58164. // "required": true,
  58165. // "type": "string"
  58166. // },
  58167. // "zone": {
  58168. // "description": "The name of the zone where the instance group is located.",
  58169. // "location": "path",
  58170. // "required": true,
  58171. // "type": "string"
  58172. // }
  58173. // },
  58174. // "path": "{project}/zones/{zone}/instanceGroups",
  58175. // "response": {
  58176. // "$ref": "InstanceGroupList"
  58177. // },
  58178. // "scopes": [
  58179. // "https://www.googleapis.com/auth/cloud-platform",
  58180. // "https://www.googleapis.com/auth/compute",
  58181. // "https://www.googleapis.com/auth/compute.readonly"
  58182. // ]
  58183. // }
  58184. }
  58185. // Pages invokes f for each page of results.
  58186. // A non-nil error returned from f will halt the iteration.
  58187. // The provided context supersedes any context provided to the Context method.
  58188. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  58189. c.ctx_ = ctx
  58190. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58191. for {
  58192. x, err := c.Do()
  58193. if err != nil {
  58194. return err
  58195. }
  58196. if err := f(x); err != nil {
  58197. return err
  58198. }
  58199. if x.NextPageToken == "" {
  58200. return nil
  58201. }
  58202. c.PageToken(x.NextPageToken)
  58203. }
  58204. }
  58205. // method id "compute.instanceGroups.listInstances":
  58206. type InstanceGroupsListInstancesCall struct {
  58207. s *Service
  58208. project string
  58209. zone string
  58210. instanceGroup string
  58211. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  58212. urlParams_ gensupport.URLParams
  58213. ctx_ context.Context
  58214. header_ http.Header
  58215. }
  58216. // ListInstances: Lists the instances in the specified instance group.
  58217. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  58218. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58219. c.project = project
  58220. c.zone = zone
  58221. c.instanceGroup = instanceGroup
  58222. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  58223. return c
  58224. }
  58225. // Filter sets the optional parameter "filter": A filter expression that
  58226. // filters resources listed in the response. The expression must specify
  58227. // the field name, a comparison operator, and the value that you want to
  58228. // use for filtering. The value must be a string, a number, or a
  58229. // boolean. The comparison operator must be either =, !=, >, or <.
  58230. //
  58231. // For example, if you are filtering Compute Engine instances, you can
  58232. // exclude instances named example-instance by specifying name !=
  58233. // example-instance.
  58234. //
  58235. // You can also filter nested fields. For example, you could specify
  58236. // scheduling.automaticRestart = false to include instances only if they
  58237. // are not scheduled for automatic restarts. You can use filtering on
  58238. // nested fields to filter based on resource labels.
  58239. //
  58240. // To filter on multiple expressions, provide each separate expression
  58241. // within parentheses. For example, (scheduling.automaticRestart = true)
  58242. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58243. // AND expression. However, you can include AND and OR expressions
  58244. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58245. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58246. // true).
  58247. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  58248. c.urlParams_.Set("filter", filter)
  58249. return c
  58250. }
  58251. // MaxResults sets the optional parameter "maxResults": The maximum
  58252. // number of results per page that should be returned. If the number of
  58253. // available results is larger than maxResults, Compute Engine returns a
  58254. // nextPageToken that can be used to get the next page of results in
  58255. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58256. // (Default: 500)
  58257. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  58258. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58259. return c
  58260. }
  58261. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58262. // a certain order. By default, results are returned in alphanumerical
  58263. // order based on the resource name.
  58264. //
  58265. // You can also sort results in descending order based on the creation
  58266. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58267. // based on the creationTimestamp field in reverse chronological order
  58268. // (newest result first). Use this to sort resources like operations so
  58269. // that the newest operation is returned first.
  58270. //
  58271. // Currently, only sorting by name or creationTimestamp desc is
  58272. // supported.
  58273. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  58274. c.urlParams_.Set("orderBy", orderBy)
  58275. return c
  58276. }
  58277. // PageToken sets the optional parameter "pageToken": Specifies a page
  58278. // token to use. Set pageToken to the nextPageToken returned by a
  58279. // previous list request to get the next page of results.
  58280. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  58281. c.urlParams_.Set("pageToken", pageToken)
  58282. return c
  58283. }
  58284. // Fields allows partial responses to be retrieved. See
  58285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58286. // for more information.
  58287. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  58288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58289. return c
  58290. }
  58291. // Context sets the context to be used in this call's Do method. Any
  58292. // pending HTTP request will be aborted if the provided context is
  58293. // canceled.
  58294. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  58295. c.ctx_ = ctx
  58296. return c
  58297. }
  58298. // Header returns an http.Header that can be modified by the caller to
  58299. // add HTTP headers to the request.
  58300. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  58301. if c.header_ == nil {
  58302. c.header_ = make(http.Header)
  58303. }
  58304. return c.header_
  58305. }
  58306. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  58307. reqHeaders := make(http.Header)
  58308. for k, v := range c.header_ {
  58309. reqHeaders[k] = v
  58310. }
  58311. reqHeaders.Set("User-Agent", c.s.userAgent())
  58312. var body io.Reader = nil
  58313. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  58314. if err != nil {
  58315. return nil, err
  58316. }
  58317. reqHeaders.Set("Content-Type", "application/json")
  58318. c.urlParams_.Set("alt", alt)
  58319. c.urlParams_.Set("prettyPrint", "false")
  58320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  58321. urls += "?" + c.urlParams_.Encode()
  58322. req, err := http.NewRequest("POST", urls, body)
  58323. if err != nil {
  58324. return nil, err
  58325. }
  58326. req.Header = reqHeaders
  58327. googleapi.Expand(req.URL, map[string]string{
  58328. "project": c.project,
  58329. "zone": c.zone,
  58330. "instanceGroup": c.instanceGroup,
  58331. })
  58332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58333. }
  58334. // Do executes the "compute.instanceGroups.listInstances" call.
  58335. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  58336. // Any non-2xx status code is an error. Response headers are in either
  58337. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  58338. // was returned at all) in error.(*googleapi.Error).Header. Use
  58339. // googleapi.IsNotModified to check whether the returned error was
  58340. // because http.StatusNotModified was returned.
  58341. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  58342. gensupport.SetOptions(c.urlParams_, opts...)
  58343. res, err := c.doRequest("json")
  58344. if res != nil && res.StatusCode == http.StatusNotModified {
  58345. if res.Body != nil {
  58346. res.Body.Close()
  58347. }
  58348. return nil, &googleapi.Error{
  58349. Code: res.StatusCode,
  58350. Header: res.Header,
  58351. }
  58352. }
  58353. if err != nil {
  58354. return nil, err
  58355. }
  58356. defer googleapi.CloseBody(res)
  58357. if err := googleapi.CheckResponse(res); err != nil {
  58358. return nil, err
  58359. }
  58360. ret := &InstanceGroupsListInstances{
  58361. ServerResponse: googleapi.ServerResponse{
  58362. Header: res.Header,
  58363. HTTPStatusCode: res.StatusCode,
  58364. },
  58365. }
  58366. target := &ret
  58367. if err := gensupport.DecodeResponse(target, res); err != nil {
  58368. return nil, err
  58369. }
  58370. return ret, nil
  58371. // {
  58372. // "description": "Lists the instances in the specified instance group.",
  58373. // "httpMethod": "POST",
  58374. // "id": "compute.instanceGroups.listInstances",
  58375. // "parameterOrder": [
  58376. // "project",
  58377. // "zone",
  58378. // "instanceGroup"
  58379. // ],
  58380. // "parameters": {
  58381. // "filter": {
  58382. // "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).",
  58383. // "location": "query",
  58384. // "type": "string"
  58385. // },
  58386. // "instanceGroup": {
  58387. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  58388. // "location": "path",
  58389. // "required": true,
  58390. // "type": "string"
  58391. // },
  58392. // "maxResults": {
  58393. // "default": "500",
  58394. // "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)",
  58395. // "format": "uint32",
  58396. // "location": "query",
  58397. // "minimum": "0",
  58398. // "type": "integer"
  58399. // },
  58400. // "orderBy": {
  58401. // "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.",
  58402. // "location": "query",
  58403. // "type": "string"
  58404. // },
  58405. // "pageToken": {
  58406. // "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.",
  58407. // "location": "query",
  58408. // "type": "string"
  58409. // },
  58410. // "project": {
  58411. // "description": "Project ID for this request.",
  58412. // "location": "path",
  58413. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58414. // "required": true,
  58415. // "type": "string"
  58416. // },
  58417. // "zone": {
  58418. // "description": "The name of the zone where the instance group is located.",
  58419. // "location": "path",
  58420. // "required": true,
  58421. // "type": "string"
  58422. // }
  58423. // },
  58424. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  58425. // "request": {
  58426. // "$ref": "InstanceGroupsListInstancesRequest"
  58427. // },
  58428. // "response": {
  58429. // "$ref": "InstanceGroupsListInstances"
  58430. // },
  58431. // "scopes": [
  58432. // "https://www.googleapis.com/auth/cloud-platform",
  58433. // "https://www.googleapis.com/auth/compute",
  58434. // "https://www.googleapis.com/auth/compute.readonly"
  58435. // ]
  58436. // }
  58437. }
  58438. // Pages invokes f for each page of results.
  58439. // A non-nil error returned from f will halt the iteration.
  58440. // The provided context supersedes any context provided to the Context method.
  58441. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  58442. c.ctx_ = ctx
  58443. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58444. for {
  58445. x, err := c.Do()
  58446. if err != nil {
  58447. return err
  58448. }
  58449. if err := f(x); err != nil {
  58450. return err
  58451. }
  58452. if x.NextPageToken == "" {
  58453. return nil
  58454. }
  58455. c.PageToken(x.NextPageToken)
  58456. }
  58457. }
  58458. // method id "compute.instanceGroups.removeInstances":
  58459. type InstanceGroupsRemoveInstancesCall struct {
  58460. s *Service
  58461. project string
  58462. zone string
  58463. instanceGroup string
  58464. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  58465. urlParams_ gensupport.URLParams
  58466. ctx_ context.Context
  58467. header_ http.Header
  58468. }
  58469. // RemoveInstances: Removes one or more instances from the specified
  58470. // instance group, but does not delete those instances.
  58471. //
  58472. // If the group is part of a backend service that has enabled connection
  58473. // draining, it can take up to 60 seconds after the connection draining
  58474. // duration before the VM instance is removed or deleted.
  58475. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  58476. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58477. c.project = project
  58478. c.zone = zone
  58479. c.instanceGroup = instanceGroup
  58480. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  58481. return c
  58482. }
  58483. // RequestId sets the optional parameter "requestId": An optional
  58484. // request ID to identify requests. Specify a unique request ID so that
  58485. // if you must retry your request, the server will know to ignore the
  58486. // request if it has already been completed.
  58487. //
  58488. // For example, consider a situation where you make an initial request
  58489. // and the request times out. If you make the request again with the
  58490. // same request ID, the server can check if original operation with the
  58491. // same request ID was received, and if so, will ignore the second
  58492. // request. This prevents clients from accidentally creating duplicate
  58493. // commitments.
  58494. //
  58495. // The request ID must be a valid UUID with the exception that zero UUID
  58496. // is not supported (00000000-0000-0000-0000-000000000000).
  58497. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  58498. c.urlParams_.Set("requestId", requestId)
  58499. return c
  58500. }
  58501. // Fields allows partial responses to be retrieved. See
  58502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58503. // for more information.
  58504. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  58505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58506. return c
  58507. }
  58508. // Context sets the context to be used in this call's Do method. Any
  58509. // pending HTTP request will be aborted if the provided context is
  58510. // canceled.
  58511. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  58512. c.ctx_ = ctx
  58513. return c
  58514. }
  58515. // Header returns an http.Header that can be modified by the caller to
  58516. // add HTTP headers to the request.
  58517. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  58518. if c.header_ == nil {
  58519. c.header_ = make(http.Header)
  58520. }
  58521. return c.header_
  58522. }
  58523. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  58524. reqHeaders := make(http.Header)
  58525. for k, v := range c.header_ {
  58526. reqHeaders[k] = v
  58527. }
  58528. reqHeaders.Set("User-Agent", c.s.userAgent())
  58529. var body io.Reader = nil
  58530. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  58531. if err != nil {
  58532. return nil, err
  58533. }
  58534. reqHeaders.Set("Content-Type", "application/json")
  58535. c.urlParams_.Set("alt", alt)
  58536. c.urlParams_.Set("prettyPrint", "false")
  58537. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  58538. urls += "?" + c.urlParams_.Encode()
  58539. req, err := http.NewRequest("POST", urls, body)
  58540. if err != nil {
  58541. return nil, err
  58542. }
  58543. req.Header = reqHeaders
  58544. googleapi.Expand(req.URL, map[string]string{
  58545. "project": c.project,
  58546. "zone": c.zone,
  58547. "instanceGroup": c.instanceGroup,
  58548. })
  58549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58550. }
  58551. // Do executes the "compute.instanceGroups.removeInstances" call.
  58552. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58553. // status code is an error. Response headers are in either
  58554. // *Operation.ServerResponse.Header or (if a response was returned at
  58555. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58556. // to check whether the returned error was because
  58557. // http.StatusNotModified was returned.
  58558. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58559. gensupport.SetOptions(c.urlParams_, opts...)
  58560. res, err := c.doRequest("json")
  58561. if res != nil && res.StatusCode == http.StatusNotModified {
  58562. if res.Body != nil {
  58563. res.Body.Close()
  58564. }
  58565. return nil, &googleapi.Error{
  58566. Code: res.StatusCode,
  58567. Header: res.Header,
  58568. }
  58569. }
  58570. if err != nil {
  58571. return nil, err
  58572. }
  58573. defer googleapi.CloseBody(res)
  58574. if err := googleapi.CheckResponse(res); err != nil {
  58575. return nil, err
  58576. }
  58577. ret := &Operation{
  58578. ServerResponse: googleapi.ServerResponse{
  58579. Header: res.Header,
  58580. HTTPStatusCode: res.StatusCode,
  58581. },
  58582. }
  58583. target := &ret
  58584. if err := gensupport.DecodeResponse(target, res); err != nil {
  58585. return nil, err
  58586. }
  58587. return ret, nil
  58588. // {
  58589. // "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.",
  58590. // "httpMethod": "POST",
  58591. // "id": "compute.instanceGroups.removeInstances",
  58592. // "parameterOrder": [
  58593. // "project",
  58594. // "zone",
  58595. // "instanceGroup"
  58596. // ],
  58597. // "parameters": {
  58598. // "instanceGroup": {
  58599. // "description": "The name of the instance group where the specified instances will be removed.",
  58600. // "location": "path",
  58601. // "required": true,
  58602. // "type": "string"
  58603. // },
  58604. // "project": {
  58605. // "description": "Project ID for this request.",
  58606. // "location": "path",
  58607. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58608. // "required": true,
  58609. // "type": "string"
  58610. // },
  58611. // "requestId": {
  58612. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58613. // "location": "query",
  58614. // "type": "string"
  58615. // },
  58616. // "zone": {
  58617. // "description": "The name of the zone where the instance group is located.",
  58618. // "location": "path",
  58619. // "required": true,
  58620. // "type": "string"
  58621. // }
  58622. // },
  58623. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  58624. // "request": {
  58625. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  58626. // },
  58627. // "response": {
  58628. // "$ref": "Operation"
  58629. // },
  58630. // "scopes": [
  58631. // "https://www.googleapis.com/auth/cloud-platform",
  58632. // "https://www.googleapis.com/auth/compute"
  58633. // ]
  58634. // }
  58635. }
  58636. // method id "compute.instanceGroups.setNamedPorts":
  58637. type InstanceGroupsSetNamedPortsCall struct {
  58638. s *Service
  58639. project string
  58640. zone string
  58641. instanceGroup string
  58642. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  58643. urlParams_ gensupport.URLParams
  58644. ctx_ context.Context
  58645. header_ http.Header
  58646. }
  58647. // SetNamedPorts: Sets the named ports for the specified instance group.
  58648. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  58649. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58650. c.project = project
  58651. c.zone = zone
  58652. c.instanceGroup = instanceGroup
  58653. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  58654. return c
  58655. }
  58656. // RequestId sets the optional parameter "requestId": An optional
  58657. // request ID to identify requests. Specify a unique request ID so that
  58658. // if you must retry your request, the server will know to ignore the
  58659. // request if it has already been completed.
  58660. //
  58661. // For example, consider a situation where you make an initial request
  58662. // and the request times out. If you make the request again with the
  58663. // same request ID, the server can check if original operation with the
  58664. // same request ID was received, and if so, will ignore the second
  58665. // request. This prevents clients from accidentally creating duplicate
  58666. // commitments.
  58667. //
  58668. // The request ID must be a valid UUID with the exception that zero UUID
  58669. // is not supported (00000000-0000-0000-0000-000000000000).
  58670. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  58671. c.urlParams_.Set("requestId", requestId)
  58672. return c
  58673. }
  58674. // Fields allows partial responses to be retrieved. See
  58675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58676. // for more information.
  58677. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  58678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58679. return c
  58680. }
  58681. // Context sets the context to be used in this call's Do method. Any
  58682. // pending HTTP request will be aborted if the provided context is
  58683. // canceled.
  58684. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  58685. c.ctx_ = ctx
  58686. return c
  58687. }
  58688. // Header returns an http.Header that can be modified by the caller to
  58689. // add HTTP headers to the request.
  58690. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  58691. if c.header_ == nil {
  58692. c.header_ = make(http.Header)
  58693. }
  58694. return c.header_
  58695. }
  58696. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  58697. reqHeaders := make(http.Header)
  58698. for k, v := range c.header_ {
  58699. reqHeaders[k] = v
  58700. }
  58701. reqHeaders.Set("User-Agent", c.s.userAgent())
  58702. var body io.Reader = nil
  58703. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  58704. if err != nil {
  58705. return nil, err
  58706. }
  58707. reqHeaders.Set("Content-Type", "application/json")
  58708. c.urlParams_.Set("alt", alt)
  58709. c.urlParams_.Set("prettyPrint", "false")
  58710. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  58711. urls += "?" + c.urlParams_.Encode()
  58712. req, err := http.NewRequest("POST", urls, body)
  58713. if err != nil {
  58714. return nil, err
  58715. }
  58716. req.Header = reqHeaders
  58717. googleapi.Expand(req.URL, map[string]string{
  58718. "project": c.project,
  58719. "zone": c.zone,
  58720. "instanceGroup": c.instanceGroup,
  58721. })
  58722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58723. }
  58724. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  58725. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58726. // status code is an error. Response headers are in either
  58727. // *Operation.ServerResponse.Header or (if a response was returned at
  58728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58729. // to check whether the returned error was because
  58730. // http.StatusNotModified was returned.
  58731. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58732. gensupport.SetOptions(c.urlParams_, opts...)
  58733. res, err := c.doRequest("json")
  58734. if res != nil && res.StatusCode == http.StatusNotModified {
  58735. if res.Body != nil {
  58736. res.Body.Close()
  58737. }
  58738. return nil, &googleapi.Error{
  58739. Code: res.StatusCode,
  58740. Header: res.Header,
  58741. }
  58742. }
  58743. if err != nil {
  58744. return nil, err
  58745. }
  58746. defer googleapi.CloseBody(res)
  58747. if err := googleapi.CheckResponse(res); err != nil {
  58748. return nil, err
  58749. }
  58750. ret := &Operation{
  58751. ServerResponse: googleapi.ServerResponse{
  58752. Header: res.Header,
  58753. HTTPStatusCode: res.StatusCode,
  58754. },
  58755. }
  58756. target := &ret
  58757. if err := gensupport.DecodeResponse(target, res); err != nil {
  58758. return nil, err
  58759. }
  58760. return ret, nil
  58761. // {
  58762. // "description": "Sets the named ports for the specified instance group.",
  58763. // "httpMethod": "POST",
  58764. // "id": "compute.instanceGroups.setNamedPorts",
  58765. // "parameterOrder": [
  58766. // "project",
  58767. // "zone",
  58768. // "instanceGroup"
  58769. // ],
  58770. // "parameters": {
  58771. // "instanceGroup": {
  58772. // "description": "The name of the instance group where the named ports are updated.",
  58773. // "location": "path",
  58774. // "required": true,
  58775. // "type": "string"
  58776. // },
  58777. // "project": {
  58778. // "description": "Project ID for this request.",
  58779. // "location": "path",
  58780. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58781. // "required": true,
  58782. // "type": "string"
  58783. // },
  58784. // "requestId": {
  58785. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58786. // "location": "query",
  58787. // "type": "string"
  58788. // },
  58789. // "zone": {
  58790. // "description": "The name of the zone where the instance group is located.",
  58791. // "location": "path",
  58792. // "required": true,
  58793. // "type": "string"
  58794. // }
  58795. // },
  58796. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  58797. // "request": {
  58798. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  58799. // },
  58800. // "response": {
  58801. // "$ref": "Operation"
  58802. // },
  58803. // "scopes": [
  58804. // "https://www.googleapis.com/auth/cloud-platform",
  58805. // "https://www.googleapis.com/auth/compute"
  58806. // ]
  58807. // }
  58808. }
  58809. // method id "compute.instanceGroups.testIamPermissions":
  58810. type InstanceGroupsTestIamPermissionsCall struct {
  58811. s *Service
  58812. project string
  58813. zone string
  58814. resource string
  58815. testpermissionsrequest *TestPermissionsRequest
  58816. urlParams_ gensupport.URLParams
  58817. ctx_ context.Context
  58818. header_ http.Header
  58819. }
  58820. // TestIamPermissions: Returns permissions that a caller has on the
  58821. // specified resource.
  58822. func (r *InstanceGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupsTestIamPermissionsCall {
  58823. c := &InstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58824. c.project = project
  58825. c.zone = zone
  58826. c.resource = resource
  58827. c.testpermissionsrequest = testpermissionsrequest
  58828. return c
  58829. }
  58830. // Fields allows partial responses to be retrieved. See
  58831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58832. // for more information.
  58833. func (c *InstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupsTestIamPermissionsCall {
  58834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58835. return c
  58836. }
  58837. // Context sets the context to be used in this call's Do method. Any
  58838. // pending HTTP request will be aborted if the provided context is
  58839. // canceled.
  58840. func (c *InstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupsTestIamPermissionsCall {
  58841. c.ctx_ = ctx
  58842. return c
  58843. }
  58844. // Header returns an http.Header that can be modified by the caller to
  58845. // add HTTP headers to the request.
  58846. func (c *InstanceGroupsTestIamPermissionsCall) Header() http.Header {
  58847. if c.header_ == nil {
  58848. c.header_ = make(http.Header)
  58849. }
  58850. return c.header_
  58851. }
  58852. func (c *InstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  58853. reqHeaders := make(http.Header)
  58854. for k, v := range c.header_ {
  58855. reqHeaders[k] = v
  58856. }
  58857. reqHeaders.Set("User-Agent", c.s.userAgent())
  58858. var body io.Reader = nil
  58859. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  58860. if err != nil {
  58861. return nil, err
  58862. }
  58863. reqHeaders.Set("Content-Type", "application/json")
  58864. c.urlParams_.Set("alt", alt)
  58865. c.urlParams_.Set("prettyPrint", "false")
  58866. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions")
  58867. urls += "?" + c.urlParams_.Encode()
  58868. req, err := http.NewRequest("POST", urls, body)
  58869. if err != nil {
  58870. return nil, err
  58871. }
  58872. req.Header = reqHeaders
  58873. googleapi.Expand(req.URL, map[string]string{
  58874. "project": c.project,
  58875. "zone": c.zone,
  58876. "resource": c.resource,
  58877. })
  58878. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58879. }
  58880. // Do executes the "compute.instanceGroups.testIamPermissions" call.
  58881. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  58882. // non-2xx status code is an error. Response headers are in either
  58883. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  58884. // returned at all) in error.(*googleapi.Error).Header. Use
  58885. // googleapi.IsNotModified to check whether the returned error was
  58886. // because http.StatusNotModified was returned.
  58887. func (c *InstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  58888. gensupport.SetOptions(c.urlParams_, opts...)
  58889. res, err := c.doRequest("json")
  58890. if res != nil && res.StatusCode == http.StatusNotModified {
  58891. if res.Body != nil {
  58892. res.Body.Close()
  58893. }
  58894. return nil, &googleapi.Error{
  58895. Code: res.StatusCode,
  58896. Header: res.Header,
  58897. }
  58898. }
  58899. if err != nil {
  58900. return nil, err
  58901. }
  58902. defer googleapi.CloseBody(res)
  58903. if err := googleapi.CheckResponse(res); err != nil {
  58904. return nil, err
  58905. }
  58906. ret := &TestPermissionsResponse{
  58907. ServerResponse: googleapi.ServerResponse{
  58908. Header: res.Header,
  58909. HTTPStatusCode: res.StatusCode,
  58910. },
  58911. }
  58912. target := &ret
  58913. if err := gensupport.DecodeResponse(target, res); err != nil {
  58914. return nil, err
  58915. }
  58916. return ret, nil
  58917. // {
  58918. // "description": "Returns permissions that a caller has on the specified resource.",
  58919. // "httpMethod": "POST",
  58920. // "id": "compute.instanceGroups.testIamPermissions",
  58921. // "parameterOrder": [
  58922. // "project",
  58923. // "zone",
  58924. // "resource"
  58925. // ],
  58926. // "parameters": {
  58927. // "project": {
  58928. // "description": "Project ID for this request.",
  58929. // "location": "path",
  58930. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58931. // "required": true,
  58932. // "type": "string"
  58933. // },
  58934. // "resource": {
  58935. // "description": "Name or id of the resource for this request.",
  58936. // "location": "path",
  58937. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58938. // "required": true,
  58939. // "type": "string"
  58940. // },
  58941. // "zone": {
  58942. // "description": "The name of the zone for this request.",
  58943. // "location": "path",
  58944. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58945. // "required": true,
  58946. // "type": "string"
  58947. // }
  58948. // },
  58949. // "path": "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions",
  58950. // "request": {
  58951. // "$ref": "TestPermissionsRequest"
  58952. // },
  58953. // "response": {
  58954. // "$ref": "TestPermissionsResponse"
  58955. // },
  58956. // "scopes": [
  58957. // "https://www.googleapis.com/auth/cloud-platform",
  58958. // "https://www.googleapis.com/auth/compute",
  58959. // "https://www.googleapis.com/auth/compute.readonly"
  58960. // ]
  58961. // }
  58962. }
  58963. // method id "compute.instanceTemplates.delete":
  58964. type InstanceTemplatesDeleteCall struct {
  58965. s *Service
  58966. project string
  58967. instanceTemplate string
  58968. urlParams_ gensupport.URLParams
  58969. ctx_ context.Context
  58970. header_ http.Header
  58971. }
  58972. // Delete: Deletes the specified instance template. Deleting an instance
  58973. // template is permanent and cannot be undone. It is not possible to
  58974. // delete templates that are already in use by a managed instance group.
  58975. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  58976. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  58977. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58978. c.project = project
  58979. c.instanceTemplate = instanceTemplate
  58980. return c
  58981. }
  58982. // RequestId sets the optional parameter "requestId": An optional
  58983. // request ID to identify requests. Specify a unique request ID so that
  58984. // if you must retry your request, the server will know to ignore the
  58985. // request if it has already been completed.
  58986. //
  58987. // For example, consider a situation where you make an initial request
  58988. // and the request times out. If you make the request again with the
  58989. // same request ID, the server can check if original operation with the
  58990. // same request ID was received, and if so, will ignore the second
  58991. // request. This prevents clients from accidentally creating duplicate
  58992. // commitments.
  58993. //
  58994. // The request ID must be a valid UUID with the exception that zero UUID
  58995. // is not supported (00000000-0000-0000-0000-000000000000).
  58996. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  58997. c.urlParams_.Set("requestId", requestId)
  58998. return c
  58999. }
  59000. // Fields allows partial responses to be retrieved. See
  59001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59002. // for more information.
  59003. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  59004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59005. return c
  59006. }
  59007. // Context sets the context to be used in this call's Do method. Any
  59008. // pending HTTP request will be aborted if the provided context is
  59009. // canceled.
  59010. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  59011. c.ctx_ = ctx
  59012. return c
  59013. }
  59014. // Header returns an http.Header that can be modified by the caller to
  59015. // add HTTP headers to the request.
  59016. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  59017. if c.header_ == nil {
  59018. c.header_ = make(http.Header)
  59019. }
  59020. return c.header_
  59021. }
  59022. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  59023. reqHeaders := make(http.Header)
  59024. for k, v := range c.header_ {
  59025. reqHeaders[k] = v
  59026. }
  59027. reqHeaders.Set("User-Agent", c.s.userAgent())
  59028. var body io.Reader = nil
  59029. c.urlParams_.Set("alt", alt)
  59030. c.urlParams_.Set("prettyPrint", "false")
  59031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  59032. urls += "?" + c.urlParams_.Encode()
  59033. req, err := http.NewRequest("DELETE", urls, body)
  59034. if err != nil {
  59035. return nil, err
  59036. }
  59037. req.Header = reqHeaders
  59038. googleapi.Expand(req.URL, map[string]string{
  59039. "project": c.project,
  59040. "instanceTemplate": c.instanceTemplate,
  59041. })
  59042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59043. }
  59044. // Do executes the "compute.instanceTemplates.delete" call.
  59045. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59046. // status code is an error. Response headers are in either
  59047. // *Operation.ServerResponse.Header or (if a response was returned at
  59048. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59049. // to check whether the returned error was because
  59050. // http.StatusNotModified was returned.
  59051. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59052. gensupport.SetOptions(c.urlParams_, opts...)
  59053. res, err := c.doRequest("json")
  59054. if res != nil && res.StatusCode == http.StatusNotModified {
  59055. if res.Body != nil {
  59056. res.Body.Close()
  59057. }
  59058. return nil, &googleapi.Error{
  59059. Code: res.StatusCode,
  59060. Header: res.Header,
  59061. }
  59062. }
  59063. if err != nil {
  59064. return nil, err
  59065. }
  59066. defer googleapi.CloseBody(res)
  59067. if err := googleapi.CheckResponse(res); err != nil {
  59068. return nil, err
  59069. }
  59070. ret := &Operation{
  59071. ServerResponse: googleapi.ServerResponse{
  59072. Header: res.Header,
  59073. HTTPStatusCode: res.StatusCode,
  59074. },
  59075. }
  59076. target := &ret
  59077. if err := gensupport.DecodeResponse(target, res); err != nil {
  59078. return nil, err
  59079. }
  59080. return ret, nil
  59081. // {
  59082. // "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.",
  59083. // "httpMethod": "DELETE",
  59084. // "id": "compute.instanceTemplates.delete",
  59085. // "parameterOrder": [
  59086. // "project",
  59087. // "instanceTemplate"
  59088. // ],
  59089. // "parameters": {
  59090. // "instanceTemplate": {
  59091. // "description": "The name of the instance template to delete.",
  59092. // "location": "path",
  59093. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59094. // "required": true,
  59095. // "type": "string"
  59096. // },
  59097. // "project": {
  59098. // "description": "Project ID for this request.",
  59099. // "location": "path",
  59100. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59101. // "required": true,
  59102. // "type": "string"
  59103. // },
  59104. // "requestId": {
  59105. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59106. // "location": "query",
  59107. // "type": "string"
  59108. // }
  59109. // },
  59110. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  59111. // "response": {
  59112. // "$ref": "Operation"
  59113. // },
  59114. // "scopes": [
  59115. // "https://www.googleapis.com/auth/cloud-platform",
  59116. // "https://www.googleapis.com/auth/compute"
  59117. // ]
  59118. // }
  59119. }
  59120. // method id "compute.instanceTemplates.get":
  59121. type InstanceTemplatesGetCall struct {
  59122. s *Service
  59123. project string
  59124. instanceTemplate string
  59125. urlParams_ gensupport.URLParams
  59126. ifNoneMatch_ string
  59127. ctx_ context.Context
  59128. header_ http.Header
  59129. }
  59130. // Get: Returns the specified instance template. Gets a list of
  59131. // available instance templates by making a list() request.
  59132. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  59133. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  59134. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59135. c.project = project
  59136. c.instanceTemplate = instanceTemplate
  59137. return c
  59138. }
  59139. // Fields allows partial responses to be retrieved. See
  59140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59141. // for more information.
  59142. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  59143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59144. return c
  59145. }
  59146. // IfNoneMatch sets the optional parameter which makes the operation
  59147. // fail if the object's ETag matches the given value. This is useful for
  59148. // getting updates only after the object has changed since the last
  59149. // request. Use googleapi.IsNotModified to check whether the response
  59150. // error from Do is the result of In-None-Match.
  59151. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  59152. c.ifNoneMatch_ = entityTag
  59153. return c
  59154. }
  59155. // Context sets the context to be used in this call's Do method. Any
  59156. // pending HTTP request will be aborted if the provided context is
  59157. // canceled.
  59158. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  59159. c.ctx_ = ctx
  59160. return c
  59161. }
  59162. // Header returns an http.Header that can be modified by the caller to
  59163. // add HTTP headers to the request.
  59164. func (c *InstanceTemplatesGetCall) Header() http.Header {
  59165. if c.header_ == nil {
  59166. c.header_ = make(http.Header)
  59167. }
  59168. return c.header_
  59169. }
  59170. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  59171. reqHeaders := make(http.Header)
  59172. for k, v := range c.header_ {
  59173. reqHeaders[k] = v
  59174. }
  59175. reqHeaders.Set("User-Agent", c.s.userAgent())
  59176. if c.ifNoneMatch_ != "" {
  59177. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59178. }
  59179. var body io.Reader = nil
  59180. c.urlParams_.Set("alt", alt)
  59181. c.urlParams_.Set("prettyPrint", "false")
  59182. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  59183. urls += "?" + c.urlParams_.Encode()
  59184. req, err := http.NewRequest("GET", urls, body)
  59185. if err != nil {
  59186. return nil, err
  59187. }
  59188. req.Header = reqHeaders
  59189. googleapi.Expand(req.URL, map[string]string{
  59190. "project": c.project,
  59191. "instanceTemplate": c.instanceTemplate,
  59192. })
  59193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59194. }
  59195. // Do executes the "compute.instanceTemplates.get" call.
  59196. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  59197. // non-2xx status code is an error. Response headers are in either
  59198. // *InstanceTemplate.ServerResponse.Header or (if a response was
  59199. // returned at all) in error.(*googleapi.Error).Header. Use
  59200. // googleapi.IsNotModified to check whether the returned error was
  59201. // because http.StatusNotModified was returned.
  59202. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  59203. gensupport.SetOptions(c.urlParams_, opts...)
  59204. res, err := c.doRequest("json")
  59205. if res != nil && res.StatusCode == http.StatusNotModified {
  59206. if res.Body != nil {
  59207. res.Body.Close()
  59208. }
  59209. return nil, &googleapi.Error{
  59210. Code: res.StatusCode,
  59211. Header: res.Header,
  59212. }
  59213. }
  59214. if err != nil {
  59215. return nil, err
  59216. }
  59217. defer googleapi.CloseBody(res)
  59218. if err := googleapi.CheckResponse(res); err != nil {
  59219. return nil, err
  59220. }
  59221. ret := &InstanceTemplate{
  59222. ServerResponse: googleapi.ServerResponse{
  59223. Header: res.Header,
  59224. HTTPStatusCode: res.StatusCode,
  59225. },
  59226. }
  59227. target := &ret
  59228. if err := gensupport.DecodeResponse(target, res); err != nil {
  59229. return nil, err
  59230. }
  59231. return ret, nil
  59232. // {
  59233. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  59234. // "httpMethod": "GET",
  59235. // "id": "compute.instanceTemplates.get",
  59236. // "parameterOrder": [
  59237. // "project",
  59238. // "instanceTemplate"
  59239. // ],
  59240. // "parameters": {
  59241. // "instanceTemplate": {
  59242. // "description": "The name of the instance template.",
  59243. // "location": "path",
  59244. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59245. // "required": true,
  59246. // "type": "string"
  59247. // },
  59248. // "project": {
  59249. // "description": "Project ID for this request.",
  59250. // "location": "path",
  59251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59252. // "required": true,
  59253. // "type": "string"
  59254. // }
  59255. // },
  59256. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  59257. // "response": {
  59258. // "$ref": "InstanceTemplate"
  59259. // },
  59260. // "scopes": [
  59261. // "https://www.googleapis.com/auth/cloud-platform",
  59262. // "https://www.googleapis.com/auth/compute",
  59263. // "https://www.googleapis.com/auth/compute.readonly"
  59264. // ]
  59265. // }
  59266. }
  59267. // method id "compute.instanceTemplates.getIamPolicy":
  59268. type InstanceTemplatesGetIamPolicyCall struct {
  59269. s *Service
  59270. project string
  59271. resource string
  59272. urlParams_ gensupport.URLParams
  59273. ifNoneMatch_ string
  59274. ctx_ context.Context
  59275. header_ http.Header
  59276. }
  59277. // GetIamPolicy: Gets the access control policy for a resource. May be
  59278. // empty if no such policy or resource exists.
  59279. func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall {
  59280. c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59281. c.project = project
  59282. c.resource = resource
  59283. return c
  59284. }
  59285. // Fields allows partial responses to be retrieved. See
  59286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59287. // for more information.
  59288. func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall {
  59289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59290. return c
  59291. }
  59292. // IfNoneMatch sets the optional parameter which makes the operation
  59293. // fail if the object's ETag matches the given value. This is useful for
  59294. // getting updates only after the object has changed since the last
  59295. // request. Use googleapi.IsNotModified to check whether the response
  59296. // error from Do is the result of In-None-Match.
  59297. func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall {
  59298. c.ifNoneMatch_ = entityTag
  59299. return c
  59300. }
  59301. // Context sets the context to be used in this call's Do method. Any
  59302. // pending HTTP request will be aborted if the provided context is
  59303. // canceled.
  59304. func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall {
  59305. c.ctx_ = ctx
  59306. return c
  59307. }
  59308. // Header returns an http.Header that can be modified by the caller to
  59309. // add HTTP headers to the request.
  59310. func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header {
  59311. if c.header_ == nil {
  59312. c.header_ = make(http.Header)
  59313. }
  59314. return c.header_
  59315. }
  59316. func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  59317. reqHeaders := make(http.Header)
  59318. for k, v := range c.header_ {
  59319. reqHeaders[k] = v
  59320. }
  59321. reqHeaders.Set("User-Agent", c.s.userAgent())
  59322. if c.ifNoneMatch_ != "" {
  59323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59324. }
  59325. var body io.Reader = nil
  59326. c.urlParams_.Set("alt", alt)
  59327. c.urlParams_.Set("prettyPrint", "false")
  59328. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/getIamPolicy")
  59329. urls += "?" + c.urlParams_.Encode()
  59330. req, err := http.NewRequest("GET", urls, body)
  59331. if err != nil {
  59332. return nil, err
  59333. }
  59334. req.Header = reqHeaders
  59335. googleapi.Expand(req.URL, map[string]string{
  59336. "project": c.project,
  59337. "resource": c.resource,
  59338. })
  59339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59340. }
  59341. // Do executes the "compute.instanceTemplates.getIamPolicy" call.
  59342. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  59343. // code is an error. Response headers are in either
  59344. // *Policy.ServerResponse.Header or (if a response was returned at all)
  59345. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  59346. // check whether the returned error was because http.StatusNotModified
  59347. // was returned.
  59348. func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  59349. gensupport.SetOptions(c.urlParams_, opts...)
  59350. res, err := c.doRequest("json")
  59351. if res != nil && res.StatusCode == http.StatusNotModified {
  59352. if res.Body != nil {
  59353. res.Body.Close()
  59354. }
  59355. return nil, &googleapi.Error{
  59356. Code: res.StatusCode,
  59357. Header: res.Header,
  59358. }
  59359. }
  59360. if err != nil {
  59361. return nil, err
  59362. }
  59363. defer googleapi.CloseBody(res)
  59364. if err := googleapi.CheckResponse(res); err != nil {
  59365. return nil, err
  59366. }
  59367. ret := &Policy{
  59368. ServerResponse: googleapi.ServerResponse{
  59369. Header: res.Header,
  59370. HTTPStatusCode: res.StatusCode,
  59371. },
  59372. }
  59373. target := &ret
  59374. if err := gensupport.DecodeResponse(target, res); err != nil {
  59375. return nil, err
  59376. }
  59377. return ret, nil
  59378. // {
  59379. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  59380. // "httpMethod": "GET",
  59381. // "id": "compute.instanceTemplates.getIamPolicy",
  59382. // "parameterOrder": [
  59383. // "project",
  59384. // "resource"
  59385. // ],
  59386. // "parameters": {
  59387. // "project": {
  59388. // "description": "Project ID for this request.",
  59389. // "location": "path",
  59390. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59391. // "required": true,
  59392. // "type": "string"
  59393. // },
  59394. // "resource": {
  59395. // "description": "Name or id of the resource for this request.",
  59396. // "location": "path",
  59397. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59398. // "required": true,
  59399. // "type": "string"
  59400. // }
  59401. // },
  59402. // "path": "{project}/global/instanceTemplates/{resource}/getIamPolicy",
  59403. // "response": {
  59404. // "$ref": "Policy"
  59405. // },
  59406. // "scopes": [
  59407. // "https://www.googleapis.com/auth/cloud-platform",
  59408. // "https://www.googleapis.com/auth/compute",
  59409. // "https://www.googleapis.com/auth/compute.readonly"
  59410. // ]
  59411. // }
  59412. }
  59413. // method id "compute.instanceTemplates.insert":
  59414. type InstanceTemplatesInsertCall struct {
  59415. s *Service
  59416. project string
  59417. instancetemplate *InstanceTemplate
  59418. urlParams_ gensupport.URLParams
  59419. ctx_ context.Context
  59420. header_ http.Header
  59421. }
  59422. // Insert: Creates an instance template in the specified project using
  59423. // the data that is included in the request. If you are creating a new
  59424. // template to update an existing instance group, your new instance
  59425. // template must use the same network or, if applicable, the same
  59426. // subnetwork as the original template.
  59427. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  59428. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  59429. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59430. c.project = project
  59431. c.instancetemplate = instancetemplate
  59432. return c
  59433. }
  59434. // RequestId sets the optional parameter "requestId": An optional
  59435. // request ID to identify requests. Specify a unique request ID so that
  59436. // if you must retry your request, the server will know to ignore the
  59437. // request if it has already been completed.
  59438. //
  59439. // For example, consider a situation where you make an initial request
  59440. // and the request times out. If you make the request again with the
  59441. // same request ID, the server can check if original operation with the
  59442. // same request ID was received, and if so, will ignore the second
  59443. // request. This prevents clients from accidentally creating duplicate
  59444. // commitments.
  59445. //
  59446. // The request ID must be a valid UUID with the exception that zero UUID
  59447. // is not supported (00000000-0000-0000-0000-000000000000).
  59448. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  59449. c.urlParams_.Set("requestId", requestId)
  59450. return c
  59451. }
  59452. // Fields allows partial responses to be retrieved. See
  59453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59454. // for more information.
  59455. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  59456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59457. return c
  59458. }
  59459. // Context sets the context to be used in this call's Do method. Any
  59460. // pending HTTP request will be aborted if the provided context is
  59461. // canceled.
  59462. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  59463. c.ctx_ = ctx
  59464. return c
  59465. }
  59466. // Header returns an http.Header that can be modified by the caller to
  59467. // add HTTP headers to the request.
  59468. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  59469. if c.header_ == nil {
  59470. c.header_ = make(http.Header)
  59471. }
  59472. return c.header_
  59473. }
  59474. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  59475. reqHeaders := make(http.Header)
  59476. for k, v := range c.header_ {
  59477. reqHeaders[k] = v
  59478. }
  59479. reqHeaders.Set("User-Agent", c.s.userAgent())
  59480. var body io.Reader = nil
  59481. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  59482. if err != nil {
  59483. return nil, err
  59484. }
  59485. reqHeaders.Set("Content-Type", "application/json")
  59486. c.urlParams_.Set("alt", alt)
  59487. c.urlParams_.Set("prettyPrint", "false")
  59488. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  59489. urls += "?" + c.urlParams_.Encode()
  59490. req, err := http.NewRequest("POST", urls, body)
  59491. if err != nil {
  59492. return nil, err
  59493. }
  59494. req.Header = reqHeaders
  59495. googleapi.Expand(req.URL, map[string]string{
  59496. "project": c.project,
  59497. })
  59498. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59499. }
  59500. // Do executes the "compute.instanceTemplates.insert" call.
  59501. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59502. // status code is an error. Response headers are in either
  59503. // *Operation.ServerResponse.Header or (if a response was returned at
  59504. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59505. // to check whether the returned error was because
  59506. // http.StatusNotModified was returned.
  59507. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59508. gensupport.SetOptions(c.urlParams_, opts...)
  59509. res, err := c.doRequest("json")
  59510. if res != nil && res.StatusCode == http.StatusNotModified {
  59511. if res.Body != nil {
  59512. res.Body.Close()
  59513. }
  59514. return nil, &googleapi.Error{
  59515. Code: res.StatusCode,
  59516. Header: res.Header,
  59517. }
  59518. }
  59519. if err != nil {
  59520. return nil, err
  59521. }
  59522. defer googleapi.CloseBody(res)
  59523. if err := googleapi.CheckResponse(res); err != nil {
  59524. return nil, err
  59525. }
  59526. ret := &Operation{
  59527. ServerResponse: googleapi.ServerResponse{
  59528. Header: res.Header,
  59529. HTTPStatusCode: res.StatusCode,
  59530. },
  59531. }
  59532. target := &ret
  59533. if err := gensupport.DecodeResponse(target, res); err != nil {
  59534. return nil, err
  59535. }
  59536. return ret, nil
  59537. // {
  59538. // "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.",
  59539. // "httpMethod": "POST",
  59540. // "id": "compute.instanceTemplates.insert",
  59541. // "parameterOrder": [
  59542. // "project"
  59543. // ],
  59544. // "parameters": {
  59545. // "project": {
  59546. // "description": "Project ID for this request.",
  59547. // "location": "path",
  59548. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59549. // "required": true,
  59550. // "type": "string"
  59551. // },
  59552. // "requestId": {
  59553. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59554. // "location": "query",
  59555. // "type": "string"
  59556. // }
  59557. // },
  59558. // "path": "{project}/global/instanceTemplates",
  59559. // "request": {
  59560. // "$ref": "InstanceTemplate"
  59561. // },
  59562. // "response": {
  59563. // "$ref": "Operation"
  59564. // },
  59565. // "scopes": [
  59566. // "https://www.googleapis.com/auth/cloud-platform",
  59567. // "https://www.googleapis.com/auth/compute"
  59568. // ]
  59569. // }
  59570. }
  59571. // method id "compute.instanceTemplates.list":
  59572. type InstanceTemplatesListCall struct {
  59573. s *Service
  59574. project string
  59575. urlParams_ gensupport.URLParams
  59576. ifNoneMatch_ string
  59577. ctx_ context.Context
  59578. header_ http.Header
  59579. }
  59580. // List: Retrieves a list of instance templates that are contained
  59581. // within the specified project.
  59582. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  59583. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  59584. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59585. c.project = project
  59586. return c
  59587. }
  59588. // Filter sets the optional parameter "filter": A filter expression that
  59589. // filters resources listed in the response. The expression must specify
  59590. // the field name, a comparison operator, and the value that you want to
  59591. // use for filtering. The value must be a string, a number, or a
  59592. // boolean. The comparison operator must be either =, !=, >, or <.
  59593. //
  59594. // For example, if you are filtering Compute Engine instances, you can
  59595. // exclude instances named example-instance by specifying name !=
  59596. // example-instance.
  59597. //
  59598. // You can also filter nested fields. For example, you could specify
  59599. // scheduling.automaticRestart = false to include instances only if they
  59600. // are not scheduled for automatic restarts. You can use filtering on
  59601. // nested fields to filter based on resource labels.
  59602. //
  59603. // To filter on multiple expressions, provide each separate expression
  59604. // within parentheses. For example, (scheduling.automaticRestart = true)
  59605. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59606. // AND expression. However, you can include AND and OR expressions
  59607. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59608. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59609. // true).
  59610. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  59611. c.urlParams_.Set("filter", filter)
  59612. return c
  59613. }
  59614. // MaxResults sets the optional parameter "maxResults": The maximum
  59615. // number of results per page that should be returned. If the number of
  59616. // available results is larger than maxResults, Compute Engine returns a
  59617. // nextPageToken that can be used to get the next page of results in
  59618. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59619. // (Default: 500)
  59620. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  59621. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59622. return c
  59623. }
  59624. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59625. // a certain order. By default, results are returned in alphanumerical
  59626. // order based on the resource name.
  59627. //
  59628. // You can also sort results in descending order based on the creation
  59629. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59630. // based on the creationTimestamp field in reverse chronological order
  59631. // (newest result first). Use this to sort resources like operations so
  59632. // that the newest operation is returned first.
  59633. //
  59634. // Currently, only sorting by name or creationTimestamp desc is
  59635. // supported.
  59636. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  59637. c.urlParams_.Set("orderBy", orderBy)
  59638. return c
  59639. }
  59640. // PageToken sets the optional parameter "pageToken": Specifies a page
  59641. // token to use. Set pageToken to the nextPageToken returned by a
  59642. // previous list request to get the next page of results.
  59643. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  59644. c.urlParams_.Set("pageToken", pageToken)
  59645. return c
  59646. }
  59647. // Fields allows partial responses to be retrieved. See
  59648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59649. // for more information.
  59650. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  59651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59652. return c
  59653. }
  59654. // IfNoneMatch sets the optional parameter which makes the operation
  59655. // fail if the object's ETag matches the given value. This is useful for
  59656. // getting updates only after the object has changed since the last
  59657. // request. Use googleapi.IsNotModified to check whether the response
  59658. // error from Do is the result of In-None-Match.
  59659. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  59660. c.ifNoneMatch_ = entityTag
  59661. return c
  59662. }
  59663. // Context sets the context to be used in this call's Do method. Any
  59664. // pending HTTP request will be aborted if the provided context is
  59665. // canceled.
  59666. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  59667. c.ctx_ = ctx
  59668. return c
  59669. }
  59670. // Header returns an http.Header that can be modified by the caller to
  59671. // add HTTP headers to the request.
  59672. func (c *InstanceTemplatesListCall) Header() http.Header {
  59673. if c.header_ == nil {
  59674. c.header_ = make(http.Header)
  59675. }
  59676. return c.header_
  59677. }
  59678. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  59679. reqHeaders := make(http.Header)
  59680. for k, v := range c.header_ {
  59681. reqHeaders[k] = v
  59682. }
  59683. reqHeaders.Set("User-Agent", c.s.userAgent())
  59684. if c.ifNoneMatch_ != "" {
  59685. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59686. }
  59687. var body io.Reader = nil
  59688. c.urlParams_.Set("alt", alt)
  59689. c.urlParams_.Set("prettyPrint", "false")
  59690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  59691. urls += "?" + c.urlParams_.Encode()
  59692. req, err := http.NewRequest("GET", urls, body)
  59693. if err != nil {
  59694. return nil, err
  59695. }
  59696. req.Header = reqHeaders
  59697. googleapi.Expand(req.URL, map[string]string{
  59698. "project": c.project,
  59699. })
  59700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59701. }
  59702. // Do executes the "compute.instanceTemplates.list" call.
  59703. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  59704. // non-2xx status code is an error. Response headers are in either
  59705. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  59706. // returned at all) in error.(*googleapi.Error).Header. Use
  59707. // googleapi.IsNotModified to check whether the returned error was
  59708. // because http.StatusNotModified was returned.
  59709. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  59710. gensupport.SetOptions(c.urlParams_, opts...)
  59711. res, err := c.doRequest("json")
  59712. if res != nil && res.StatusCode == http.StatusNotModified {
  59713. if res.Body != nil {
  59714. res.Body.Close()
  59715. }
  59716. return nil, &googleapi.Error{
  59717. Code: res.StatusCode,
  59718. Header: res.Header,
  59719. }
  59720. }
  59721. if err != nil {
  59722. return nil, err
  59723. }
  59724. defer googleapi.CloseBody(res)
  59725. if err := googleapi.CheckResponse(res); err != nil {
  59726. return nil, err
  59727. }
  59728. ret := &InstanceTemplateList{
  59729. ServerResponse: googleapi.ServerResponse{
  59730. Header: res.Header,
  59731. HTTPStatusCode: res.StatusCode,
  59732. },
  59733. }
  59734. target := &ret
  59735. if err := gensupport.DecodeResponse(target, res); err != nil {
  59736. return nil, err
  59737. }
  59738. return ret, nil
  59739. // {
  59740. // "description": "Retrieves a list of instance templates that are contained within the specified project.",
  59741. // "httpMethod": "GET",
  59742. // "id": "compute.instanceTemplates.list",
  59743. // "parameterOrder": [
  59744. // "project"
  59745. // ],
  59746. // "parameters": {
  59747. // "filter": {
  59748. // "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).",
  59749. // "location": "query",
  59750. // "type": "string"
  59751. // },
  59752. // "maxResults": {
  59753. // "default": "500",
  59754. // "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)",
  59755. // "format": "uint32",
  59756. // "location": "query",
  59757. // "minimum": "0",
  59758. // "type": "integer"
  59759. // },
  59760. // "orderBy": {
  59761. // "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.",
  59762. // "location": "query",
  59763. // "type": "string"
  59764. // },
  59765. // "pageToken": {
  59766. // "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.",
  59767. // "location": "query",
  59768. // "type": "string"
  59769. // },
  59770. // "project": {
  59771. // "description": "Project ID for this request.",
  59772. // "location": "path",
  59773. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59774. // "required": true,
  59775. // "type": "string"
  59776. // }
  59777. // },
  59778. // "path": "{project}/global/instanceTemplates",
  59779. // "response": {
  59780. // "$ref": "InstanceTemplateList"
  59781. // },
  59782. // "scopes": [
  59783. // "https://www.googleapis.com/auth/cloud-platform",
  59784. // "https://www.googleapis.com/auth/compute",
  59785. // "https://www.googleapis.com/auth/compute.readonly"
  59786. // ]
  59787. // }
  59788. }
  59789. // Pages invokes f for each page of results.
  59790. // A non-nil error returned from f will halt the iteration.
  59791. // The provided context supersedes any context provided to the Context method.
  59792. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  59793. c.ctx_ = ctx
  59794. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59795. for {
  59796. x, err := c.Do()
  59797. if err != nil {
  59798. return err
  59799. }
  59800. if err := f(x); err != nil {
  59801. return err
  59802. }
  59803. if x.NextPageToken == "" {
  59804. return nil
  59805. }
  59806. c.PageToken(x.NextPageToken)
  59807. }
  59808. }
  59809. // method id "compute.instanceTemplates.setIamPolicy":
  59810. type InstanceTemplatesSetIamPolicyCall struct {
  59811. s *Service
  59812. project string
  59813. resource string
  59814. globalsetpolicyrequest *GlobalSetPolicyRequest
  59815. urlParams_ gensupport.URLParams
  59816. ctx_ context.Context
  59817. header_ http.Header
  59818. }
  59819. // SetIamPolicy: Sets the access control policy on the specified
  59820. // resource. Replaces any existing policy.
  59821. func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall {
  59822. c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59823. c.project = project
  59824. c.resource = resource
  59825. c.globalsetpolicyrequest = globalsetpolicyrequest
  59826. return c
  59827. }
  59828. // Fields allows partial responses to be retrieved. See
  59829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59830. // for more information.
  59831. func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall {
  59832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59833. return c
  59834. }
  59835. // Context sets the context to be used in this call's Do method. Any
  59836. // pending HTTP request will be aborted if the provided context is
  59837. // canceled.
  59838. func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall {
  59839. c.ctx_ = ctx
  59840. return c
  59841. }
  59842. // Header returns an http.Header that can be modified by the caller to
  59843. // add HTTP headers to the request.
  59844. func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header {
  59845. if c.header_ == nil {
  59846. c.header_ = make(http.Header)
  59847. }
  59848. return c.header_
  59849. }
  59850. func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  59851. reqHeaders := make(http.Header)
  59852. for k, v := range c.header_ {
  59853. reqHeaders[k] = v
  59854. }
  59855. reqHeaders.Set("User-Agent", c.s.userAgent())
  59856. var body io.Reader = nil
  59857. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  59858. if err != nil {
  59859. return nil, err
  59860. }
  59861. reqHeaders.Set("Content-Type", "application/json")
  59862. c.urlParams_.Set("alt", alt)
  59863. c.urlParams_.Set("prettyPrint", "false")
  59864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/setIamPolicy")
  59865. urls += "?" + c.urlParams_.Encode()
  59866. req, err := http.NewRequest("POST", urls, body)
  59867. if err != nil {
  59868. return nil, err
  59869. }
  59870. req.Header = reqHeaders
  59871. googleapi.Expand(req.URL, map[string]string{
  59872. "project": c.project,
  59873. "resource": c.resource,
  59874. })
  59875. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59876. }
  59877. // Do executes the "compute.instanceTemplates.setIamPolicy" call.
  59878. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  59879. // code is an error. Response headers are in either
  59880. // *Policy.ServerResponse.Header or (if a response was returned at all)
  59881. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  59882. // check whether the returned error was because http.StatusNotModified
  59883. // was returned.
  59884. func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  59885. gensupport.SetOptions(c.urlParams_, opts...)
  59886. res, err := c.doRequest("json")
  59887. if res != nil && res.StatusCode == http.StatusNotModified {
  59888. if res.Body != nil {
  59889. res.Body.Close()
  59890. }
  59891. return nil, &googleapi.Error{
  59892. Code: res.StatusCode,
  59893. Header: res.Header,
  59894. }
  59895. }
  59896. if err != nil {
  59897. return nil, err
  59898. }
  59899. defer googleapi.CloseBody(res)
  59900. if err := googleapi.CheckResponse(res); err != nil {
  59901. return nil, err
  59902. }
  59903. ret := &Policy{
  59904. ServerResponse: googleapi.ServerResponse{
  59905. Header: res.Header,
  59906. HTTPStatusCode: res.StatusCode,
  59907. },
  59908. }
  59909. target := &ret
  59910. if err := gensupport.DecodeResponse(target, res); err != nil {
  59911. return nil, err
  59912. }
  59913. return ret, nil
  59914. // {
  59915. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  59916. // "httpMethod": "POST",
  59917. // "id": "compute.instanceTemplates.setIamPolicy",
  59918. // "parameterOrder": [
  59919. // "project",
  59920. // "resource"
  59921. // ],
  59922. // "parameters": {
  59923. // "project": {
  59924. // "description": "Project ID for this request.",
  59925. // "location": "path",
  59926. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59927. // "required": true,
  59928. // "type": "string"
  59929. // },
  59930. // "resource": {
  59931. // "description": "Name or id of the resource for this request.",
  59932. // "location": "path",
  59933. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59934. // "required": true,
  59935. // "type": "string"
  59936. // }
  59937. // },
  59938. // "path": "{project}/global/instanceTemplates/{resource}/setIamPolicy",
  59939. // "request": {
  59940. // "$ref": "GlobalSetPolicyRequest"
  59941. // },
  59942. // "response": {
  59943. // "$ref": "Policy"
  59944. // },
  59945. // "scopes": [
  59946. // "https://www.googleapis.com/auth/cloud-platform",
  59947. // "https://www.googleapis.com/auth/compute"
  59948. // ]
  59949. // }
  59950. }
  59951. // method id "compute.instanceTemplates.testIamPermissions":
  59952. type InstanceTemplatesTestIamPermissionsCall struct {
  59953. s *Service
  59954. project string
  59955. resource string
  59956. testpermissionsrequest *TestPermissionsRequest
  59957. urlParams_ gensupport.URLParams
  59958. ctx_ context.Context
  59959. header_ http.Header
  59960. }
  59961. // TestIamPermissions: Returns permissions that a caller has on the
  59962. // specified resource.
  59963. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  59964. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59965. c.project = project
  59966. c.resource = resource
  59967. c.testpermissionsrequest = testpermissionsrequest
  59968. return c
  59969. }
  59970. // Fields allows partial responses to be retrieved. See
  59971. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59972. // for more information.
  59973. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  59974. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59975. return c
  59976. }
  59977. // Context sets the context to be used in this call's Do method. Any
  59978. // pending HTTP request will be aborted if the provided context is
  59979. // canceled.
  59980. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  59981. c.ctx_ = ctx
  59982. return c
  59983. }
  59984. // Header returns an http.Header that can be modified by the caller to
  59985. // add HTTP headers to the request.
  59986. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  59987. if c.header_ == nil {
  59988. c.header_ = make(http.Header)
  59989. }
  59990. return c.header_
  59991. }
  59992. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  59993. reqHeaders := make(http.Header)
  59994. for k, v := range c.header_ {
  59995. reqHeaders[k] = v
  59996. }
  59997. reqHeaders.Set("User-Agent", c.s.userAgent())
  59998. var body io.Reader = nil
  59999. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  60000. if err != nil {
  60001. return nil, err
  60002. }
  60003. reqHeaders.Set("Content-Type", "application/json")
  60004. c.urlParams_.Set("alt", alt)
  60005. c.urlParams_.Set("prettyPrint", "false")
  60006. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  60007. urls += "?" + c.urlParams_.Encode()
  60008. req, err := http.NewRequest("POST", urls, body)
  60009. if err != nil {
  60010. return nil, err
  60011. }
  60012. req.Header = reqHeaders
  60013. googleapi.Expand(req.URL, map[string]string{
  60014. "project": c.project,
  60015. "resource": c.resource,
  60016. })
  60017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60018. }
  60019. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  60020. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  60021. // non-2xx status code is an error. Response headers are in either
  60022. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  60023. // returned at all) in error.(*googleapi.Error).Header. Use
  60024. // googleapi.IsNotModified to check whether the returned error was
  60025. // because http.StatusNotModified was returned.
  60026. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  60027. gensupport.SetOptions(c.urlParams_, opts...)
  60028. res, err := c.doRequest("json")
  60029. if res != nil && res.StatusCode == http.StatusNotModified {
  60030. if res.Body != nil {
  60031. res.Body.Close()
  60032. }
  60033. return nil, &googleapi.Error{
  60034. Code: res.StatusCode,
  60035. Header: res.Header,
  60036. }
  60037. }
  60038. if err != nil {
  60039. return nil, err
  60040. }
  60041. defer googleapi.CloseBody(res)
  60042. if err := googleapi.CheckResponse(res); err != nil {
  60043. return nil, err
  60044. }
  60045. ret := &TestPermissionsResponse{
  60046. ServerResponse: googleapi.ServerResponse{
  60047. Header: res.Header,
  60048. HTTPStatusCode: res.StatusCode,
  60049. },
  60050. }
  60051. target := &ret
  60052. if err := gensupport.DecodeResponse(target, res); err != nil {
  60053. return nil, err
  60054. }
  60055. return ret, nil
  60056. // {
  60057. // "description": "Returns permissions that a caller has on the specified resource.",
  60058. // "httpMethod": "POST",
  60059. // "id": "compute.instanceTemplates.testIamPermissions",
  60060. // "parameterOrder": [
  60061. // "project",
  60062. // "resource"
  60063. // ],
  60064. // "parameters": {
  60065. // "project": {
  60066. // "description": "Project ID for this request.",
  60067. // "location": "path",
  60068. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60069. // "required": true,
  60070. // "type": "string"
  60071. // },
  60072. // "resource": {
  60073. // "description": "Name or id of the resource for this request.",
  60074. // "location": "path",
  60075. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60076. // "required": true,
  60077. // "type": "string"
  60078. // }
  60079. // },
  60080. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  60081. // "request": {
  60082. // "$ref": "TestPermissionsRequest"
  60083. // },
  60084. // "response": {
  60085. // "$ref": "TestPermissionsResponse"
  60086. // },
  60087. // "scopes": [
  60088. // "https://www.googleapis.com/auth/cloud-platform",
  60089. // "https://www.googleapis.com/auth/compute",
  60090. // "https://www.googleapis.com/auth/compute.readonly"
  60091. // ]
  60092. // }
  60093. }
  60094. // method id "compute.instances.addAccessConfig":
  60095. type InstancesAddAccessConfigCall struct {
  60096. s *Service
  60097. project string
  60098. zone string
  60099. instance string
  60100. accessconfig *AccessConfig
  60101. urlParams_ gensupport.URLParams
  60102. ctx_ context.Context
  60103. header_ http.Header
  60104. }
  60105. // AddAccessConfig: Adds an access config to an instance's network
  60106. // interface.
  60107. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  60108. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  60109. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60110. c.project = project
  60111. c.zone = zone
  60112. c.instance = instance
  60113. c.urlParams_.Set("networkInterface", networkInterface)
  60114. c.accessconfig = accessconfig
  60115. return c
  60116. }
  60117. // RequestId sets the optional parameter "requestId": An optional
  60118. // request ID to identify requests. Specify a unique request ID so that
  60119. // if you must retry your request, the server will know to ignore the
  60120. // request if it has already been completed.
  60121. //
  60122. // For example, consider a situation where you make an initial request
  60123. // and the request times out. If you make the request again with the
  60124. // same request ID, the server can check if original operation with the
  60125. // same request ID was received, and if so, will ignore the second
  60126. // request. This prevents clients from accidentally creating duplicate
  60127. // commitments.
  60128. //
  60129. // The request ID must be a valid UUID with the exception that zero UUID
  60130. // is not supported (00000000-0000-0000-0000-000000000000).
  60131. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  60132. c.urlParams_.Set("requestId", requestId)
  60133. return c
  60134. }
  60135. // Fields allows partial responses to be retrieved. See
  60136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60137. // for more information.
  60138. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  60139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60140. return c
  60141. }
  60142. // Context sets the context to be used in this call's Do method. Any
  60143. // pending HTTP request will be aborted if the provided context is
  60144. // canceled.
  60145. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  60146. c.ctx_ = ctx
  60147. return c
  60148. }
  60149. // Header returns an http.Header that can be modified by the caller to
  60150. // add HTTP headers to the request.
  60151. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  60152. if c.header_ == nil {
  60153. c.header_ = make(http.Header)
  60154. }
  60155. return c.header_
  60156. }
  60157. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  60158. reqHeaders := make(http.Header)
  60159. for k, v := range c.header_ {
  60160. reqHeaders[k] = v
  60161. }
  60162. reqHeaders.Set("User-Agent", c.s.userAgent())
  60163. var body io.Reader = nil
  60164. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  60165. if err != nil {
  60166. return nil, err
  60167. }
  60168. reqHeaders.Set("Content-Type", "application/json")
  60169. c.urlParams_.Set("alt", alt)
  60170. c.urlParams_.Set("prettyPrint", "false")
  60171. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  60172. urls += "?" + c.urlParams_.Encode()
  60173. req, err := http.NewRequest("POST", urls, body)
  60174. if err != nil {
  60175. return nil, err
  60176. }
  60177. req.Header = reqHeaders
  60178. googleapi.Expand(req.URL, map[string]string{
  60179. "project": c.project,
  60180. "zone": c.zone,
  60181. "instance": c.instance,
  60182. })
  60183. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60184. }
  60185. // Do executes the "compute.instances.addAccessConfig" call.
  60186. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60187. // status code is an error. Response headers are in either
  60188. // *Operation.ServerResponse.Header or (if a response was returned at
  60189. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60190. // to check whether the returned error was because
  60191. // http.StatusNotModified was returned.
  60192. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60193. gensupport.SetOptions(c.urlParams_, opts...)
  60194. res, err := c.doRequest("json")
  60195. if res != nil && res.StatusCode == http.StatusNotModified {
  60196. if res.Body != nil {
  60197. res.Body.Close()
  60198. }
  60199. return nil, &googleapi.Error{
  60200. Code: res.StatusCode,
  60201. Header: res.Header,
  60202. }
  60203. }
  60204. if err != nil {
  60205. return nil, err
  60206. }
  60207. defer googleapi.CloseBody(res)
  60208. if err := googleapi.CheckResponse(res); err != nil {
  60209. return nil, err
  60210. }
  60211. ret := &Operation{
  60212. ServerResponse: googleapi.ServerResponse{
  60213. Header: res.Header,
  60214. HTTPStatusCode: res.StatusCode,
  60215. },
  60216. }
  60217. target := &ret
  60218. if err := gensupport.DecodeResponse(target, res); err != nil {
  60219. return nil, err
  60220. }
  60221. return ret, nil
  60222. // {
  60223. // "description": "Adds an access config to an instance's network interface.",
  60224. // "httpMethod": "POST",
  60225. // "id": "compute.instances.addAccessConfig",
  60226. // "parameterOrder": [
  60227. // "project",
  60228. // "zone",
  60229. // "instance",
  60230. // "networkInterface"
  60231. // ],
  60232. // "parameters": {
  60233. // "instance": {
  60234. // "description": "The instance name for this request.",
  60235. // "location": "path",
  60236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60237. // "required": true,
  60238. // "type": "string"
  60239. // },
  60240. // "networkInterface": {
  60241. // "description": "The name of the network interface to add to this instance.",
  60242. // "location": "query",
  60243. // "required": true,
  60244. // "type": "string"
  60245. // },
  60246. // "project": {
  60247. // "description": "Project ID for this request.",
  60248. // "location": "path",
  60249. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60250. // "required": true,
  60251. // "type": "string"
  60252. // },
  60253. // "requestId": {
  60254. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60255. // "location": "query",
  60256. // "type": "string"
  60257. // },
  60258. // "zone": {
  60259. // "description": "The name of the zone for this request.",
  60260. // "location": "path",
  60261. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60262. // "required": true,
  60263. // "type": "string"
  60264. // }
  60265. // },
  60266. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  60267. // "request": {
  60268. // "$ref": "AccessConfig"
  60269. // },
  60270. // "response": {
  60271. // "$ref": "Operation"
  60272. // },
  60273. // "scopes": [
  60274. // "https://www.googleapis.com/auth/cloud-platform",
  60275. // "https://www.googleapis.com/auth/compute"
  60276. // ]
  60277. // }
  60278. }
  60279. // method id "compute.instances.aggregatedList":
  60280. type InstancesAggregatedListCall struct {
  60281. s *Service
  60282. project string
  60283. urlParams_ gensupport.URLParams
  60284. ifNoneMatch_ string
  60285. ctx_ context.Context
  60286. header_ http.Header
  60287. }
  60288. // AggregatedList: Retrieves aggregated list of all of the instances in
  60289. // your project across all regions and zones.
  60290. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  60291. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  60292. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60293. c.project = project
  60294. return c
  60295. }
  60296. // Filter sets the optional parameter "filter": A filter expression that
  60297. // filters resources listed in the response. The expression must specify
  60298. // the field name, a comparison operator, and the value that you want to
  60299. // use for filtering. The value must be a string, a number, or a
  60300. // boolean. The comparison operator must be either =, !=, >, or <.
  60301. //
  60302. // For example, if you are filtering Compute Engine instances, you can
  60303. // exclude instances named example-instance by specifying name !=
  60304. // example-instance.
  60305. //
  60306. // You can also filter nested fields. For example, you could specify
  60307. // scheduling.automaticRestart = false to include instances only if they
  60308. // are not scheduled for automatic restarts. You can use filtering on
  60309. // nested fields to filter based on resource labels.
  60310. //
  60311. // To filter on multiple expressions, provide each separate expression
  60312. // within parentheses. For example, (scheduling.automaticRestart = true)
  60313. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60314. // AND expression. However, you can include AND and OR expressions
  60315. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60316. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60317. // true).
  60318. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  60319. c.urlParams_.Set("filter", filter)
  60320. return c
  60321. }
  60322. // MaxResults sets the optional parameter "maxResults": The maximum
  60323. // number of results per page that should be returned. If the number of
  60324. // available results is larger than maxResults, Compute Engine returns a
  60325. // nextPageToken that can be used to get the next page of results in
  60326. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60327. // (Default: 500)
  60328. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  60329. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60330. return c
  60331. }
  60332. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60333. // a certain order. By default, results are returned in alphanumerical
  60334. // order based on the resource name.
  60335. //
  60336. // You can also sort results in descending order based on the creation
  60337. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60338. // based on the creationTimestamp field in reverse chronological order
  60339. // (newest result first). Use this to sort resources like operations so
  60340. // that the newest operation is returned first.
  60341. //
  60342. // Currently, only sorting by name or creationTimestamp desc is
  60343. // supported.
  60344. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  60345. c.urlParams_.Set("orderBy", orderBy)
  60346. return c
  60347. }
  60348. // PageToken sets the optional parameter "pageToken": Specifies a page
  60349. // token to use. Set pageToken to the nextPageToken returned by a
  60350. // previous list request to get the next page of results.
  60351. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  60352. c.urlParams_.Set("pageToken", pageToken)
  60353. return c
  60354. }
  60355. // Fields allows partial responses to be retrieved. See
  60356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60357. // for more information.
  60358. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  60359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60360. return c
  60361. }
  60362. // IfNoneMatch sets the optional parameter which makes the operation
  60363. // fail if the object's ETag matches the given value. This is useful for
  60364. // getting updates only after the object has changed since the last
  60365. // request. Use googleapi.IsNotModified to check whether the response
  60366. // error from Do is the result of In-None-Match.
  60367. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  60368. c.ifNoneMatch_ = entityTag
  60369. return c
  60370. }
  60371. // Context sets the context to be used in this call's Do method. Any
  60372. // pending HTTP request will be aborted if the provided context is
  60373. // canceled.
  60374. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  60375. c.ctx_ = ctx
  60376. return c
  60377. }
  60378. // Header returns an http.Header that can be modified by the caller to
  60379. // add HTTP headers to the request.
  60380. func (c *InstancesAggregatedListCall) Header() http.Header {
  60381. if c.header_ == nil {
  60382. c.header_ = make(http.Header)
  60383. }
  60384. return c.header_
  60385. }
  60386. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  60387. reqHeaders := make(http.Header)
  60388. for k, v := range c.header_ {
  60389. reqHeaders[k] = v
  60390. }
  60391. reqHeaders.Set("User-Agent", c.s.userAgent())
  60392. if c.ifNoneMatch_ != "" {
  60393. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60394. }
  60395. var body io.Reader = nil
  60396. c.urlParams_.Set("alt", alt)
  60397. c.urlParams_.Set("prettyPrint", "false")
  60398. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  60399. urls += "?" + c.urlParams_.Encode()
  60400. req, err := http.NewRequest("GET", urls, body)
  60401. if err != nil {
  60402. return nil, err
  60403. }
  60404. req.Header = reqHeaders
  60405. googleapi.Expand(req.URL, map[string]string{
  60406. "project": c.project,
  60407. })
  60408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60409. }
  60410. // Do executes the "compute.instances.aggregatedList" call.
  60411. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  60412. // non-2xx status code is an error. Response headers are in either
  60413. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  60414. // returned at all) in error.(*googleapi.Error).Header. Use
  60415. // googleapi.IsNotModified to check whether the returned error was
  60416. // because http.StatusNotModified was returned.
  60417. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  60418. gensupport.SetOptions(c.urlParams_, opts...)
  60419. res, err := c.doRequest("json")
  60420. if res != nil && res.StatusCode == http.StatusNotModified {
  60421. if res.Body != nil {
  60422. res.Body.Close()
  60423. }
  60424. return nil, &googleapi.Error{
  60425. Code: res.StatusCode,
  60426. Header: res.Header,
  60427. }
  60428. }
  60429. if err != nil {
  60430. return nil, err
  60431. }
  60432. defer googleapi.CloseBody(res)
  60433. if err := googleapi.CheckResponse(res); err != nil {
  60434. return nil, err
  60435. }
  60436. ret := &InstanceAggregatedList{
  60437. ServerResponse: googleapi.ServerResponse{
  60438. Header: res.Header,
  60439. HTTPStatusCode: res.StatusCode,
  60440. },
  60441. }
  60442. target := &ret
  60443. if err := gensupport.DecodeResponse(target, res); err != nil {
  60444. return nil, err
  60445. }
  60446. return ret, nil
  60447. // {
  60448. // "description": "Retrieves aggregated list of all of the instances in your project across all regions and zones.",
  60449. // "httpMethod": "GET",
  60450. // "id": "compute.instances.aggregatedList",
  60451. // "parameterOrder": [
  60452. // "project"
  60453. // ],
  60454. // "parameters": {
  60455. // "filter": {
  60456. // "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).",
  60457. // "location": "query",
  60458. // "type": "string"
  60459. // },
  60460. // "maxResults": {
  60461. // "default": "500",
  60462. // "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)",
  60463. // "format": "uint32",
  60464. // "location": "query",
  60465. // "minimum": "0",
  60466. // "type": "integer"
  60467. // },
  60468. // "orderBy": {
  60469. // "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.",
  60470. // "location": "query",
  60471. // "type": "string"
  60472. // },
  60473. // "pageToken": {
  60474. // "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.",
  60475. // "location": "query",
  60476. // "type": "string"
  60477. // },
  60478. // "project": {
  60479. // "description": "Project ID for this request.",
  60480. // "location": "path",
  60481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60482. // "required": true,
  60483. // "type": "string"
  60484. // }
  60485. // },
  60486. // "path": "{project}/aggregated/instances",
  60487. // "response": {
  60488. // "$ref": "InstanceAggregatedList"
  60489. // },
  60490. // "scopes": [
  60491. // "https://www.googleapis.com/auth/cloud-platform",
  60492. // "https://www.googleapis.com/auth/compute",
  60493. // "https://www.googleapis.com/auth/compute.readonly"
  60494. // ]
  60495. // }
  60496. }
  60497. // Pages invokes f for each page of results.
  60498. // A non-nil error returned from f will halt the iteration.
  60499. // The provided context supersedes any context provided to the Context method.
  60500. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  60501. c.ctx_ = ctx
  60502. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60503. for {
  60504. x, err := c.Do()
  60505. if err != nil {
  60506. return err
  60507. }
  60508. if err := f(x); err != nil {
  60509. return err
  60510. }
  60511. if x.NextPageToken == "" {
  60512. return nil
  60513. }
  60514. c.PageToken(x.NextPageToken)
  60515. }
  60516. }
  60517. // method id "compute.instances.attachDisk":
  60518. type InstancesAttachDiskCall struct {
  60519. s *Service
  60520. project string
  60521. zone string
  60522. instance string
  60523. attacheddisk *AttachedDisk
  60524. urlParams_ gensupport.URLParams
  60525. ctx_ context.Context
  60526. header_ http.Header
  60527. }
  60528. // AttachDisk: Attaches an existing Disk resource to an instance. You
  60529. // must first create the disk before you can attach it. It is not
  60530. // possible to create and attach a disk at the same time. For more
  60531. // information, read Adding a persistent disk to your instance.
  60532. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  60533. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  60534. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60535. c.project = project
  60536. c.zone = zone
  60537. c.instance = instance
  60538. c.attacheddisk = attacheddisk
  60539. return c
  60540. }
  60541. // ForceAttach sets the optional parameter "forceAttach": Whether to
  60542. // force attach the disk even if it's currently attached to another
  60543. // instance.
  60544. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  60545. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  60546. return c
  60547. }
  60548. // RequestId sets the optional parameter "requestId": An optional
  60549. // request ID to identify requests. Specify a unique request ID so that
  60550. // if you must retry your request, the server will know to ignore the
  60551. // request if it has already been completed.
  60552. //
  60553. // For example, consider a situation where you make an initial request
  60554. // and the request times out. If you make the request again with the
  60555. // same request ID, the server can check if original operation with the
  60556. // same request ID was received, and if so, will ignore the second
  60557. // request. This prevents clients from accidentally creating duplicate
  60558. // commitments.
  60559. //
  60560. // The request ID must be a valid UUID with the exception that zero UUID
  60561. // is not supported (00000000-0000-0000-0000-000000000000).
  60562. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  60563. c.urlParams_.Set("requestId", requestId)
  60564. return c
  60565. }
  60566. // Fields allows partial responses to be retrieved. See
  60567. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60568. // for more information.
  60569. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  60570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60571. return c
  60572. }
  60573. // Context sets the context to be used in this call's Do method. Any
  60574. // pending HTTP request will be aborted if the provided context is
  60575. // canceled.
  60576. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  60577. c.ctx_ = ctx
  60578. return c
  60579. }
  60580. // Header returns an http.Header that can be modified by the caller to
  60581. // add HTTP headers to the request.
  60582. func (c *InstancesAttachDiskCall) Header() http.Header {
  60583. if c.header_ == nil {
  60584. c.header_ = make(http.Header)
  60585. }
  60586. return c.header_
  60587. }
  60588. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  60589. reqHeaders := make(http.Header)
  60590. for k, v := range c.header_ {
  60591. reqHeaders[k] = v
  60592. }
  60593. reqHeaders.Set("User-Agent", c.s.userAgent())
  60594. var body io.Reader = nil
  60595. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  60596. if err != nil {
  60597. return nil, err
  60598. }
  60599. reqHeaders.Set("Content-Type", "application/json")
  60600. c.urlParams_.Set("alt", alt)
  60601. c.urlParams_.Set("prettyPrint", "false")
  60602. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  60603. urls += "?" + c.urlParams_.Encode()
  60604. req, err := http.NewRequest("POST", urls, body)
  60605. if err != nil {
  60606. return nil, err
  60607. }
  60608. req.Header = reqHeaders
  60609. googleapi.Expand(req.URL, map[string]string{
  60610. "project": c.project,
  60611. "zone": c.zone,
  60612. "instance": c.instance,
  60613. })
  60614. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60615. }
  60616. // Do executes the "compute.instances.attachDisk" call.
  60617. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60618. // status code is an error. Response headers are in either
  60619. // *Operation.ServerResponse.Header or (if a response was returned at
  60620. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60621. // to check whether the returned error was because
  60622. // http.StatusNotModified was returned.
  60623. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60624. gensupport.SetOptions(c.urlParams_, opts...)
  60625. res, err := c.doRequest("json")
  60626. if res != nil && res.StatusCode == http.StatusNotModified {
  60627. if res.Body != nil {
  60628. res.Body.Close()
  60629. }
  60630. return nil, &googleapi.Error{
  60631. Code: res.StatusCode,
  60632. Header: res.Header,
  60633. }
  60634. }
  60635. if err != nil {
  60636. return nil, err
  60637. }
  60638. defer googleapi.CloseBody(res)
  60639. if err := googleapi.CheckResponse(res); err != nil {
  60640. return nil, err
  60641. }
  60642. ret := &Operation{
  60643. ServerResponse: googleapi.ServerResponse{
  60644. Header: res.Header,
  60645. HTTPStatusCode: res.StatusCode,
  60646. },
  60647. }
  60648. target := &ret
  60649. if err := gensupport.DecodeResponse(target, res); err != nil {
  60650. return nil, err
  60651. }
  60652. return ret, nil
  60653. // {
  60654. // "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.",
  60655. // "httpMethod": "POST",
  60656. // "id": "compute.instances.attachDisk",
  60657. // "parameterOrder": [
  60658. // "project",
  60659. // "zone",
  60660. // "instance"
  60661. // ],
  60662. // "parameters": {
  60663. // "forceAttach": {
  60664. // "description": "Whether to force attach the disk even if it's currently attached to another instance.",
  60665. // "location": "query",
  60666. // "type": "boolean"
  60667. // },
  60668. // "instance": {
  60669. // "description": "The instance name for this request.",
  60670. // "location": "path",
  60671. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60672. // "required": true,
  60673. // "type": "string"
  60674. // },
  60675. // "project": {
  60676. // "description": "Project ID for this request.",
  60677. // "location": "path",
  60678. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60679. // "required": true,
  60680. // "type": "string"
  60681. // },
  60682. // "requestId": {
  60683. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60684. // "location": "query",
  60685. // "type": "string"
  60686. // },
  60687. // "zone": {
  60688. // "description": "The name of the zone for this request.",
  60689. // "location": "path",
  60690. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60691. // "required": true,
  60692. // "type": "string"
  60693. // }
  60694. // },
  60695. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  60696. // "request": {
  60697. // "$ref": "AttachedDisk"
  60698. // },
  60699. // "response": {
  60700. // "$ref": "Operation"
  60701. // },
  60702. // "scopes": [
  60703. // "https://www.googleapis.com/auth/cloud-platform",
  60704. // "https://www.googleapis.com/auth/compute"
  60705. // ]
  60706. // }
  60707. }
  60708. // method id "compute.instances.delete":
  60709. type InstancesDeleteCall struct {
  60710. s *Service
  60711. project string
  60712. zone string
  60713. instance string
  60714. urlParams_ gensupport.URLParams
  60715. ctx_ context.Context
  60716. header_ http.Header
  60717. }
  60718. // Delete: Deletes the specified Instance resource. For more
  60719. // information, see Stopping or Deleting an Instance.
  60720. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  60721. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  60722. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60723. c.project = project
  60724. c.zone = zone
  60725. c.instance = instance
  60726. return c
  60727. }
  60728. // RequestId sets the optional parameter "requestId": An optional
  60729. // request ID to identify requests. Specify a unique request ID so that
  60730. // if you must retry your request, the server will know to ignore the
  60731. // request if it has already been completed.
  60732. //
  60733. // For example, consider a situation where you make an initial request
  60734. // and the request times out. If you make the request again with the
  60735. // same request ID, the server can check if original operation with the
  60736. // same request ID was received, and if so, will ignore the second
  60737. // request. This prevents clients from accidentally creating duplicate
  60738. // commitments.
  60739. //
  60740. // The request ID must be a valid UUID with the exception that zero UUID
  60741. // is not supported (00000000-0000-0000-0000-000000000000).
  60742. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  60743. c.urlParams_.Set("requestId", requestId)
  60744. return c
  60745. }
  60746. // Fields allows partial responses to be retrieved. See
  60747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60748. // for more information.
  60749. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  60750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60751. return c
  60752. }
  60753. // Context sets the context to be used in this call's Do method. Any
  60754. // pending HTTP request will be aborted if the provided context is
  60755. // canceled.
  60756. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  60757. c.ctx_ = ctx
  60758. return c
  60759. }
  60760. // Header returns an http.Header that can be modified by the caller to
  60761. // add HTTP headers to the request.
  60762. func (c *InstancesDeleteCall) Header() http.Header {
  60763. if c.header_ == nil {
  60764. c.header_ = make(http.Header)
  60765. }
  60766. return c.header_
  60767. }
  60768. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  60769. reqHeaders := make(http.Header)
  60770. for k, v := range c.header_ {
  60771. reqHeaders[k] = v
  60772. }
  60773. reqHeaders.Set("User-Agent", c.s.userAgent())
  60774. var body io.Reader = nil
  60775. c.urlParams_.Set("alt", alt)
  60776. c.urlParams_.Set("prettyPrint", "false")
  60777. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  60778. urls += "?" + c.urlParams_.Encode()
  60779. req, err := http.NewRequest("DELETE", urls, body)
  60780. if err != nil {
  60781. return nil, err
  60782. }
  60783. req.Header = reqHeaders
  60784. googleapi.Expand(req.URL, map[string]string{
  60785. "project": c.project,
  60786. "zone": c.zone,
  60787. "instance": c.instance,
  60788. })
  60789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60790. }
  60791. // Do executes the "compute.instances.delete" call.
  60792. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60793. // status code is an error. Response headers are in either
  60794. // *Operation.ServerResponse.Header or (if a response was returned at
  60795. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60796. // to check whether the returned error was because
  60797. // http.StatusNotModified was returned.
  60798. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60799. gensupport.SetOptions(c.urlParams_, opts...)
  60800. res, err := c.doRequest("json")
  60801. if res != nil && res.StatusCode == http.StatusNotModified {
  60802. if res.Body != nil {
  60803. res.Body.Close()
  60804. }
  60805. return nil, &googleapi.Error{
  60806. Code: res.StatusCode,
  60807. Header: res.Header,
  60808. }
  60809. }
  60810. if err != nil {
  60811. return nil, err
  60812. }
  60813. defer googleapi.CloseBody(res)
  60814. if err := googleapi.CheckResponse(res); err != nil {
  60815. return nil, err
  60816. }
  60817. ret := &Operation{
  60818. ServerResponse: googleapi.ServerResponse{
  60819. Header: res.Header,
  60820. HTTPStatusCode: res.StatusCode,
  60821. },
  60822. }
  60823. target := &ret
  60824. if err := gensupport.DecodeResponse(target, res); err != nil {
  60825. return nil, err
  60826. }
  60827. return ret, nil
  60828. // {
  60829. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  60830. // "httpMethod": "DELETE",
  60831. // "id": "compute.instances.delete",
  60832. // "parameterOrder": [
  60833. // "project",
  60834. // "zone",
  60835. // "instance"
  60836. // ],
  60837. // "parameters": {
  60838. // "instance": {
  60839. // "description": "Name of the instance resource to delete.",
  60840. // "location": "path",
  60841. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60842. // "required": true,
  60843. // "type": "string"
  60844. // },
  60845. // "project": {
  60846. // "description": "Project ID for this request.",
  60847. // "location": "path",
  60848. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60849. // "required": true,
  60850. // "type": "string"
  60851. // },
  60852. // "requestId": {
  60853. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60854. // "location": "query",
  60855. // "type": "string"
  60856. // },
  60857. // "zone": {
  60858. // "description": "The name of the zone for this request.",
  60859. // "location": "path",
  60860. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60861. // "required": true,
  60862. // "type": "string"
  60863. // }
  60864. // },
  60865. // "path": "{project}/zones/{zone}/instances/{instance}",
  60866. // "response": {
  60867. // "$ref": "Operation"
  60868. // },
  60869. // "scopes": [
  60870. // "https://www.googleapis.com/auth/cloud-platform",
  60871. // "https://www.googleapis.com/auth/compute"
  60872. // ]
  60873. // }
  60874. }
  60875. // method id "compute.instances.deleteAccessConfig":
  60876. type InstancesDeleteAccessConfigCall struct {
  60877. s *Service
  60878. project string
  60879. zone string
  60880. instance string
  60881. urlParams_ gensupport.URLParams
  60882. ctx_ context.Context
  60883. header_ http.Header
  60884. }
  60885. // DeleteAccessConfig: Deletes an access config from an instance's
  60886. // network interface.
  60887. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  60888. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  60889. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60890. c.project = project
  60891. c.zone = zone
  60892. c.instance = instance
  60893. c.urlParams_.Set("accessConfig", accessConfig)
  60894. c.urlParams_.Set("networkInterface", networkInterface)
  60895. return c
  60896. }
  60897. // RequestId sets the optional parameter "requestId": An optional
  60898. // request ID to identify requests. Specify a unique request ID so that
  60899. // if you must retry your request, the server will know to ignore the
  60900. // request if it has already been completed.
  60901. //
  60902. // For example, consider a situation where you make an initial request
  60903. // and the request times out. If you make the request again with the
  60904. // same request ID, the server can check if original operation with the
  60905. // same request ID was received, and if so, will ignore the second
  60906. // request. This prevents clients from accidentally creating duplicate
  60907. // commitments.
  60908. //
  60909. // The request ID must be a valid UUID with the exception that zero UUID
  60910. // is not supported (00000000-0000-0000-0000-000000000000).
  60911. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  60912. c.urlParams_.Set("requestId", requestId)
  60913. return c
  60914. }
  60915. // Fields allows partial responses to be retrieved. See
  60916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60917. // for more information.
  60918. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  60919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60920. return c
  60921. }
  60922. // Context sets the context to be used in this call's Do method. Any
  60923. // pending HTTP request will be aborted if the provided context is
  60924. // canceled.
  60925. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  60926. c.ctx_ = ctx
  60927. return c
  60928. }
  60929. // Header returns an http.Header that can be modified by the caller to
  60930. // add HTTP headers to the request.
  60931. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  60932. if c.header_ == nil {
  60933. c.header_ = make(http.Header)
  60934. }
  60935. return c.header_
  60936. }
  60937. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  60938. reqHeaders := make(http.Header)
  60939. for k, v := range c.header_ {
  60940. reqHeaders[k] = v
  60941. }
  60942. reqHeaders.Set("User-Agent", c.s.userAgent())
  60943. var body io.Reader = nil
  60944. c.urlParams_.Set("alt", alt)
  60945. c.urlParams_.Set("prettyPrint", "false")
  60946. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  60947. urls += "?" + c.urlParams_.Encode()
  60948. req, err := http.NewRequest("POST", urls, body)
  60949. if err != nil {
  60950. return nil, err
  60951. }
  60952. req.Header = reqHeaders
  60953. googleapi.Expand(req.URL, map[string]string{
  60954. "project": c.project,
  60955. "zone": c.zone,
  60956. "instance": c.instance,
  60957. })
  60958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60959. }
  60960. // Do executes the "compute.instances.deleteAccessConfig" call.
  60961. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60962. // status code is an error. Response headers are in either
  60963. // *Operation.ServerResponse.Header or (if a response was returned at
  60964. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60965. // to check whether the returned error was because
  60966. // http.StatusNotModified was returned.
  60967. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60968. gensupport.SetOptions(c.urlParams_, opts...)
  60969. res, err := c.doRequest("json")
  60970. if res != nil && res.StatusCode == http.StatusNotModified {
  60971. if res.Body != nil {
  60972. res.Body.Close()
  60973. }
  60974. return nil, &googleapi.Error{
  60975. Code: res.StatusCode,
  60976. Header: res.Header,
  60977. }
  60978. }
  60979. if err != nil {
  60980. return nil, err
  60981. }
  60982. defer googleapi.CloseBody(res)
  60983. if err := googleapi.CheckResponse(res); err != nil {
  60984. return nil, err
  60985. }
  60986. ret := &Operation{
  60987. ServerResponse: googleapi.ServerResponse{
  60988. Header: res.Header,
  60989. HTTPStatusCode: res.StatusCode,
  60990. },
  60991. }
  60992. target := &ret
  60993. if err := gensupport.DecodeResponse(target, res); err != nil {
  60994. return nil, err
  60995. }
  60996. return ret, nil
  60997. // {
  60998. // "description": "Deletes an access config from an instance's network interface.",
  60999. // "httpMethod": "POST",
  61000. // "id": "compute.instances.deleteAccessConfig",
  61001. // "parameterOrder": [
  61002. // "project",
  61003. // "zone",
  61004. // "instance",
  61005. // "accessConfig",
  61006. // "networkInterface"
  61007. // ],
  61008. // "parameters": {
  61009. // "accessConfig": {
  61010. // "description": "The name of the access config to delete.",
  61011. // "location": "query",
  61012. // "required": true,
  61013. // "type": "string"
  61014. // },
  61015. // "instance": {
  61016. // "description": "The instance name for this request.",
  61017. // "location": "path",
  61018. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61019. // "required": true,
  61020. // "type": "string"
  61021. // },
  61022. // "networkInterface": {
  61023. // "description": "The name of the network interface.",
  61024. // "location": "query",
  61025. // "required": true,
  61026. // "type": "string"
  61027. // },
  61028. // "project": {
  61029. // "description": "Project ID for this request.",
  61030. // "location": "path",
  61031. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61032. // "required": true,
  61033. // "type": "string"
  61034. // },
  61035. // "requestId": {
  61036. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61037. // "location": "query",
  61038. // "type": "string"
  61039. // },
  61040. // "zone": {
  61041. // "description": "The name of the zone for this request.",
  61042. // "location": "path",
  61043. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61044. // "required": true,
  61045. // "type": "string"
  61046. // }
  61047. // },
  61048. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  61049. // "response": {
  61050. // "$ref": "Operation"
  61051. // },
  61052. // "scopes": [
  61053. // "https://www.googleapis.com/auth/cloud-platform",
  61054. // "https://www.googleapis.com/auth/compute"
  61055. // ]
  61056. // }
  61057. }
  61058. // method id "compute.instances.detachDisk":
  61059. type InstancesDetachDiskCall struct {
  61060. s *Service
  61061. project string
  61062. zone string
  61063. instance string
  61064. urlParams_ gensupport.URLParams
  61065. ctx_ context.Context
  61066. header_ http.Header
  61067. }
  61068. // DetachDisk: Detaches a disk from an instance.
  61069. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  61070. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  61071. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61072. c.project = project
  61073. c.zone = zone
  61074. c.instance = instance
  61075. c.urlParams_.Set("deviceName", deviceName)
  61076. return c
  61077. }
  61078. // RequestId sets the optional parameter "requestId": An optional
  61079. // request ID to identify requests. Specify a unique request ID so that
  61080. // if you must retry your request, the server will know to ignore the
  61081. // request if it has already been completed.
  61082. //
  61083. // For example, consider a situation where you make an initial request
  61084. // and the request times out. If you make the request again with the
  61085. // same request ID, the server can check if original operation with the
  61086. // same request ID was received, and if so, will ignore the second
  61087. // request. This prevents clients from accidentally creating duplicate
  61088. // commitments.
  61089. //
  61090. // The request ID must be a valid UUID with the exception that zero UUID
  61091. // is not supported (00000000-0000-0000-0000-000000000000).
  61092. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  61093. c.urlParams_.Set("requestId", requestId)
  61094. return c
  61095. }
  61096. // Fields allows partial responses to be retrieved. See
  61097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61098. // for more information.
  61099. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  61100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61101. return c
  61102. }
  61103. // Context sets the context to be used in this call's Do method. Any
  61104. // pending HTTP request will be aborted if the provided context is
  61105. // canceled.
  61106. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  61107. c.ctx_ = ctx
  61108. return c
  61109. }
  61110. // Header returns an http.Header that can be modified by the caller to
  61111. // add HTTP headers to the request.
  61112. func (c *InstancesDetachDiskCall) Header() http.Header {
  61113. if c.header_ == nil {
  61114. c.header_ = make(http.Header)
  61115. }
  61116. return c.header_
  61117. }
  61118. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  61119. reqHeaders := make(http.Header)
  61120. for k, v := range c.header_ {
  61121. reqHeaders[k] = v
  61122. }
  61123. reqHeaders.Set("User-Agent", c.s.userAgent())
  61124. var body io.Reader = nil
  61125. c.urlParams_.Set("alt", alt)
  61126. c.urlParams_.Set("prettyPrint", "false")
  61127. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  61128. urls += "?" + c.urlParams_.Encode()
  61129. req, err := http.NewRequest("POST", urls, body)
  61130. if err != nil {
  61131. return nil, err
  61132. }
  61133. req.Header = reqHeaders
  61134. googleapi.Expand(req.URL, map[string]string{
  61135. "project": c.project,
  61136. "zone": c.zone,
  61137. "instance": c.instance,
  61138. })
  61139. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61140. }
  61141. // Do executes the "compute.instances.detachDisk" call.
  61142. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61143. // status code is an error. Response headers are in either
  61144. // *Operation.ServerResponse.Header or (if a response was returned at
  61145. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61146. // to check whether the returned error was because
  61147. // http.StatusNotModified was returned.
  61148. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61149. gensupport.SetOptions(c.urlParams_, opts...)
  61150. res, err := c.doRequest("json")
  61151. if res != nil && res.StatusCode == http.StatusNotModified {
  61152. if res.Body != nil {
  61153. res.Body.Close()
  61154. }
  61155. return nil, &googleapi.Error{
  61156. Code: res.StatusCode,
  61157. Header: res.Header,
  61158. }
  61159. }
  61160. if err != nil {
  61161. return nil, err
  61162. }
  61163. defer googleapi.CloseBody(res)
  61164. if err := googleapi.CheckResponse(res); err != nil {
  61165. return nil, err
  61166. }
  61167. ret := &Operation{
  61168. ServerResponse: googleapi.ServerResponse{
  61169. Header: res.Header,
  61170. HTTPStatusCode: res.StatusCode,
  61171. },
  61172. }
  61173. target := &ret
  61174. if err := gensupport.DecodeResponse(target, res); err != nil {
  61175. return nil, err
  61176. }
  61177. return ret, nil
  61178. // {
  61179. // "description": "Detaches a disk from an instance.",
  61180. // "httpMethod": "POST",
  61181. // "id": "compute.instances.detachDisk",
  61182. // "parameterOrder": [
  61183. // "project",
  61184. // "zone",
  61185. // "instance",
  61186. // "deviceName"
  61187. // ],
  61188. // "parameters": {
  61189. // "deviceName": {
  61190. // "description": "The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.",
  61191. // "location": "query",
  61192. // "required": true,
  61193. // "type": "string"
  61194. // },
  61195. // "instance": {
  61196. // "description": "Instance name for this request.",
  61197. // "location": "path",
  61198. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61199. // "required": true,
  61200. // "type": "string"
  61201. // },
  61202. // "project": {
  61203. // "description": "Project ID for this request.",
  61204. // "location": "path",
  61205. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61206. // "required": true,
  61207. // "type": "string"
  61208. // },
  61209. // "requestId": {
  61210. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61211. // "location": "query",
  61212. // "type": "string"
  61213. // },
  61214. // "zone": {
  61215. // "description": "The name of the zone for this request.",
  61216. // "location": "path",
  61217. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61218. // "required": true,
  61219. // "type": "string"
  61220. // }
  61221. // },
  61222. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  61223. // "response": {
  61224. // "$ref": "Operation"
  61225. // },
  61226. // "scopes": [
  61227. // "https://www.googleapis.com/auth/cloud-platform",
  61228. // "https://www.googleapis.com/auth/compute"
  61229. // ]
  61230. // }
  61231. }
  61232. // method id "compute.instances.get":
  61233. type InstancesGetCall struct {
  61234. s *Service
  61235. project string
  61236. zone string
  61237. instance string
  61238. urlParams_ gensupport.URLParams
  61239. ifNoneMatch_ string
  61240. ctx_ context.Context
  61241. header_ http.Header
  61242. }
  61243. // Get: Returns the specified Instance resource. Gets a list of
  61244. // available instances by making a list() request.
  61245. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  61246. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  61247. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61248. c.project = project
  61249. c.zone = zone
  61250. c.instance = instance
  61251. return c
  61252. }
  61253. // Fields allows partial responses to be retrieved. See
  61254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61255. // for more information.
  61256. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  61257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61258. return c
  61259. }
  61260. // IfNoneMatch sets the optional parameter which makes the operation
  61261. // fail if the object's ETag matches the given value. This is useful for
  61262. // getting updates only after the object has changed since the last
  61263. // request. Use googleapi.IsNotModified to check whether the response
  61264. // error from Do is the result of In-None-Match.
  61265. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  61266. c.ifNoneMatch_ = entityTag
  61267. return c
  61268. }
  61269. // Context sets the context to be used in this call's Do method. Any
  61270. // pending HTTP request will be aborted if the provided context is
  61271. // canceled.
  61272. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  61273. c.ctx_ = ctx
  61274. return c
  61275. }
  61276. // Header returns an http.Header that can be modified by the caller to
  61277. // add HTTP headers to the request.
  61278. func (c *InstancesGetCall) Header() http.Header {
  61279. if c.header_ == nil {
  61280. c.header_ = make(http.Header)
  61281. }
  61282. return c.header_
  61283. }
  61284. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  61285. reqHeaders := make(http.Header)
  61286. for k, v := range c.header_ {
  61287. reqHeaders[k] = v
  61288. }
  61289. reqHeaders.Set("User-Agent", c.s.userAgent())
  61290. if c.ifNoneMatch_ != "" {
  61291. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61292. }
  61293. var body io.Reader = nil
  61294. c.urlParams_.Set("alt", alt)
  61295. c.urlParams_.Set("prettyPrint", "false")
  61296. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  61297. urls += "?" + c.urlParams_.Encode()
  61298. req, err := http.NewRequest("GET", urls, body)
  61299. if err != nil {
  61300. return nil, err
  61301. }
  61302. req.Header = reqHeaders
  61303. googleapi.Expand(req.URL, map[string]string{
  61304. "project": c.project,
  61305. "zone": c.zone,
  61306. "instance": c.instance,
  61307. })
  61308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61309. }
  61310. // Do executes the "compute.instances.get" call.
  61311. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  61312. // code is an error. Response headers are in either
  61313. // *Instance.ServerResponse.Header or (if a response was returned at
  61314. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61315. // to check whether the returned error was because
  61316. // http.StatusNotModified was returned.
  61317. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  61318. gensupport.SetOptions(c.urlParams_, opts...)
  61319. res, err := c.doRequest("json")
  61320. if res != nil && res.StatusCode == http.StatusNotModified {
  61321. if res.Body != nil {
  61322. res.Body.Close()
  61323. }
  61324. return nil, &googleapi.Error{
  61325. Code: res.StatusCode,
  61326. Header: res.Header,
  61327. }
  61328. }
  61329. if err != nil {
  61330. return nil, err
  61331. }
  61332. defer googleapi.CloseBody(res)
  61333. if err := googleapi.CheckResponse(res); err != nil {
  61334. return nil, err
  61335. }
  61336. ret := &Instance{
  61337. ServerResponse: googleapi.ServerResponse{
  61338. Header: res.Header,
  61339. HTTPStatusCode: res.StatusCode,
  61340. },
  61341. }
  61342. target := &ret
  61343. if err := gensupport.DecodeResponse(target, res); err != nil {
  61344. return nil, err
  61345. }
  61346. return ret, nil
  61347. // {
  61348. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  61349. // "httpMethod": "GET",
  61350. // "id": "compute.instances.get",
  61351. // "parameterOrder": [
  61352. // "project",
  61353. // "zone",
  61354. // "instance"
  61355. // ],
  61356. // "parameters": {
  61357. // "instance": {
  61358. // "description": "Name of the instance resource to return.",
  61359. // "location": "path",
  61360. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61361. // "required": true,
  61362. // "type": "string"
  61363. // },
  61364. // "project": {
  61365. // "description": "Project ID for this request.",
  61366. // "location": "path",
  61367. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61368. // "required": true,
  61369. // "type": "string"
  61370. // },
  61371. // "zone": {
  61372. // "description": "The name of the zone for this request.",
  61373. // "location": "path",
  61374. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61375. // "required": true,
  61376. // "type": "string"
  61377. // }
  61378. // },
  61379. // "path": "{project}/zones/{zone}/instances/{instance}",
  61380. // "response": {
  61381. // "$ref": "Instance"
  61382. // },
  61383. // "scopes": [
  61384. // "https://www.googleapis.com/auth/cloud-platform",
  61385. // "https://www.googleapis.com/auth/compute",
  61386. // "https://www.googleapis.com/auth/compute.readonly"
  61387. // ]
  61388. // }
  61389. }
  61390. // method id "compute.instances.getGuestAttributes":
  61391. type InstancesGetGuestAttributesCall struct {
  61392. s *Service
  61393. project string
  61394. zone string
  61395. instance string
  61396. urlParams_ gensupport.URLParams
  61397. ifNoneMatch_ string
  61398. ctx_ context.Context
  61399. header_ http.Header
  61400. }
  61401. // GetGuestAttributes: Returns the specified guest attributes entry.
  61402. func (r *InstancesService) GetGuestAttributes(project string, zone string, instance string) *InstancesGetGuestAttributesCall {
  61403. c := &InstancesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61404. c.project = project
  61405. c.zone = zone
  61406. c.instance = instance
  61407. return c
  61408. }
  61409. // QueryPath sets the optional parameter "queryPath": Specifies the
  61410. // guest attributes path to be queried.
  61411. func (c *InstancesGetGuestAttributesCall) QueryPath(queryPath string) *InstancesGetGuestAttributesCall {
  61412. c.urlParams_.Set("queryPath", queryPath)
  61413. return c
  61414. }
  61415. // VariableKey sets the optional parameter "variableKey": Specifies the
  61416. // key for the guest attributes entry.
  61417. func (c *InstancesGetGuestAttributesCall) VariableKey(variableKey string) *InstancesGetGuestAttributesCall {
  61418. c.urlParams_.Set("variableKey", variableKey)
  61419. return c
  61420. }
  61421. // Fields allows partial responses to be retrieved. See
  61422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61423. // for more information.
  61424. func (c *InstancesGetGuestAttributesCall) Fields(s ...googleapi.Field) *InstancesGetGuestAttributesCall {
  61425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61426. return c
  61427. }
  61428. // IfNoneMatch sets the optional parameter which makes the operation
  61429. // fail if the object's ETag matches the given value. This is useful for
  61430. // getting updates only after the object has changed since the last
  61431. // request. Use googleapi.IsNotModified to check whether the response
  61432. // error from Do is the result of In-None-Match.
  61433. func (c *InstancesGetGuestAttributesCall) IfNoneMatch(entityTag string) *InstancesGetGuestAttributesCall {
  61434. c.ifNoneMatch_ = entityTag
  61435. return c
  61436. }
  61437. // Context sets the context to be used in this call's Do method. Any
  61438. // pending HTTP request will be aborted if the provided context is
  61439. // canceled.
  61440. func (c *InstancesGetGuestAttributesCall) Context(ctx context.Context) *InstancesGetGuestAttributesCall {
  61441. c.ctx_ = ctx
  61442. return c
  61443. }
  61444. // Header returns an http.Header that can be modified by the caller to
  61445. // add HTTP headers to the request.
  61446. func (c *InstancesGetGuestAttributesCall) Header() http.Header {
  61447. if c.header_ == nil {
  61448. c.header_ = make(http.Header)
  61449. }
  61450. return c.header_
  61451. }
  61452. func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) {
  61453. reqHeaders := make(http.Header)
  61454. for k, v := range c.header_ {
  61455. reqHeaders[k] = v
  61456. }
  61457. reqHeaders.Set("User-Agent", c.s.userAgent())
  61458. if c.ifNoneMatch_ != "" {
  61459. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61460. }
  61461. var body io.Reader = nil
  61462. c.urlParams_.Set("alt", alt)
  61463. c.urlParams_.Set("prettyPrint", "false")
  61464. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getGuestAttributes")
  61465. urls += "?" + c.urlParams_.Encode()
  61466. req, err := http.NewRequest("GET", urls, body)
  61467. if err != nil {
  61468. return nil, err
  61469. }
  61470. req.Header = reqHeaders
  61471. googleapi.Expand(req.URL, map[string]string{
  61472. "project": c.project,
  61473. "zone": c.zone,
  61474. "instance": c.instance,
  61475. })
  61476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61477. }
  61478. // Do executes the "compute.instances.getGuestAttributes" call.
  61479. // Exactly one of *GuestAttributes or error will be non-nil. Any non-2xx
  61480. // status code is an error. Response headers are in either
  61481. // *GuestAttributes.ServerResponse.Header or (if a response was returned
  61482. // at all) in error.(*googleapi.Error).Header. Use
  61483. // googleapi.IsNotModified to check whether the returned error was
  61484. // because http.StatusNotModified was returned.
  61485. func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GuestAttributes, error) {
  61486. gensupport.SetOptions(c.urlParams_, opts...)
  61487. res, err := c.doRequest("json")
  61488. if res != nil && res.StatusCode == http.StatusNotModified {
  61489. if res.Body != nil {
  61490. res.Body.Close()
  61491. }
  61492. return nil, &googleapi.Error{
  61493. Code: res.StatusCode,
  61494. Header: res.Header,
  61495. }
  61496. }
  61497. if err != nil {
  61498. return nil, err
  61499. }
  61500. defer googleapi.CloseBody(res)
  61501. if err := googleapi.CheckResponse(res); err != nil {
  61502. return nil, err
  61503. }
  61504. ret := &GuestAttributes{
  61505. ServerResponse: googleapi.ServerResponse{
  61506. Header: res.Header,
  61507. HTTPStatusCode: res.StatusCode,
  61508. },
  61509. }
  61510. target := &ret
  61511. if err := gensupport.DecodeResponse(target, res); err != nil {
  61512. return nil, err
  61513. }
  61514. return ret, nil
  61515. // {
  61516. // "description": "Returns the specified guest attributes entry.",
  61517. // "httpMethod": "GET",
  61518. // "id": "compute.instances.getGuestAttributes",
  61519. // "parameterOrder": [
  61520. // "project",
  61521. // "zone",
  61522. // "instance"
  61523. // ],
  61524. // "parameters": {
  61525. // "instance": {
  61526. // "description": "Name of the instance scoping this request.",
  61527. // "location": "path",
  61528. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61529. // "required": true,
  61530. // "type": "string"
  61531. // },
  61532. // "project": {
  61533. // "description": "Project ID for this request.",
  61534. // "location": "path",
  61535. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61536. // "required": true,
  61537. // "type": "string"
  61538. // },
  61539. // "queryPath": {
  61540. // "description": "Specifies the guest attributes path to be queried.",
  61541. // "location": "query",
  61542. // "type": "string"
  61543. // },
  61544. // "variableKey": {
  61545. // "description": "Specifies the key for the guest attributes entry.",
  61546. // "location": "query",
  61547. // "type": "string"
  61548. // },
  61549. // "zone": {
  61550. // "description": "The name of the zone for this request.",
  61551. // "location": "path",
  61552. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61553. // "required": true,
  61554. // "type": "string"
  61555. // }
  61556. // },
  61557. // "path": "{project}/zones/{zone}/instances/{instance}/getGuestAttributes",
  61558. // "response": {
  61559. // "$ref": "GuestAttributes"
  61560. // },
  61561. // "scopes": [
  61562. // "https://www.googleapis.com/auth/cloud-platform",
  61563. // "https://www.googleapis.com/auth/compute",
  61564. // "https://www.googleapis.com/auth/compute.readonly"
  61565. // ]
  61566. // }
  61567. }
  61568. // method id "compute.instances.getIamPolicy":
  61569. type InstancesGetIamPolicyCall struct {
  61570. s *Service
  61571. project string
  61572. zone string
  61573. resource string
  61574. urlParams_ gensupport.URLParams
  61575. ifNoneMatch_ string
  61576. ctx_ context.Context
  61577. header_ http.Header
  61578. }
  61579. // GetIamPolicy: Gets the access control policy for a resource. May be
  61580. // empty if no such policy or resource exists.
  61581. func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
  61582. c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61583. c.project = project
  61584. c.zone = zone
  61585. c.resource = resource
  61586. return c
  61587. }
  61588. // Fields allows partial responses to be retrieved. See
  61589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61590. // for more information.
  61591. func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
  61592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61593. return c
  61594. }
  61595. // IfNoneMatch sets the optional parameter which makes the operation
  61596. // fail if the object's ETag matches the given value. This is useful for
  61597. // getting updates only after the object has changed since the last
  61598. // request. Use googleapi.IsNotModified to check whether the response
  61599. // error from Do is the result of In-None-Match.
  61600. func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
  61601. c.ifNoneMatch_ = entityTag
  61602. return c
  61603. }
  61604. // Context sets the context to be used in this call's Do method. Any
  61605. // pending HTTP request will be aborted if the provided context is
  61606. // canceled.
  61607. func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
  61608. c.ctx_ = ctx
  61609. return c
  61610. }
  61611. // Header returns an http.Header that can be modified by the caller to
  61612. // add HTTP headers to the request.
  61613. func (c *InstancesGetIamPolicyCall) Header() http.Header {
  61614. if c.header_ == nil {
  61615. c.header_ = make(http.Header)
  61616. }
  61617. return c.header_
  61618. }
  61619. func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  61620. reqHeaders := make(http.Header)
  61621. for k, v := range c.header_ {
  61622. reqHeaders[k] = v
  61623. }
  61624. reqHeaders.Set("User-Agent", c.s.userAgent())
  61625. if c.ifNoneMatch_ != "" {
  61626. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61627. }
  61628. var body io.Reader = nil
  61629. c.urlParams_.Set("alt", alt)
  61630. c.urlParams_.Set("prettyPrint", "false")
  61631. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/getIamPolicy")
  61632. urls += "?" + c.urlParams_.Encode()
  61633. req, err := http.NewRequest("GET", urls, body)
  61634. if err != nil {
  61635. return nil, err
  61636. }
  61637. req.Header = reqHeaders
  61638. googleapi.Expand(req.URL, map[string]string{
  61639. "project": c.project,
  61640. "zone": c.zone,
  61641. "resource": c.resource,
  61642. })
  61643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61644. }
  61645. // Do executes the "compute.instances.getIamPolicy" call.
  61646. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  61647. // code is an error. Response headers are in either
  61648. // *Policy.ServerResponse.Header or (if a response was returned at all)
  61649. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61650. // check whether the returned error was because http.StatusNotModified
  61651. // was returned.
  61652. func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  61653. gensupport.SetOptions(c.urlParams_, opts...)
  61654. res, err := c.doRequest("json")
  61655. if res != nil && res.StatusCode == http.StatusNotModified {
  61656. if res.Body != nil {
  61657. res.Body.Close()
  61658. }
  61659. return nil, &googleapi.Error{
  61660. Code: res.StatusCode,
  61661. Header: res.Header,
  61662. }
  61663. }
  61664. if err != nil {
  61665. return nil, err
  61666. }
  61667. defer googleapi.CloseBody(res)
  61668. if err := googleapi.CheckResponse(res); err != nil {
  61669. return nil, err
  61670. }
  61671. ret := &Policy{
  61672. ServerResponse: googleapi.ServerResponse{
  61673. Header: res.Header,
  61674. HTTPStatusCode: res.StatusCode,
  61675. },
  61676. }
  61677. target := &ret
  61678. if err := gensupport.DecodeResponse(target, res); err != nil {
  61679. return nil, err
  61680. }
  61681. return ret, nil
  61682. // {
  61683. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  61684. // "httpMethod": "GET",
  61685. // "id": "compute.instances.getIamPolicy",
  61686. // "parameterOrder": [
  61687. // "project",
  61688. // "zone",
  61689. // "resource"
  61690. // ],
  61691. // "parameters": {
  61692. // "project": {
  61693. // "description": "Project ID for this request.",
  61694. // "location": "path",
  61695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61696. // "required": true,
  61697. // "type": "string"
  61698. // },
  61699. // "resource": {
  61700. // "description": "Name or id of the resource for this request.",
  61701. // "location": "path",
  61702. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61703. // "required": true,
  61704. // "type": "string"
  61705. // },
  61706. // "zone": {
  61707. // "description": "The name of the zone for this request.",
  61708. // "location": "path",
  61709. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61710. // "required": true,
  61711. // "type": "string"
  61712. // }
  61713. // },
  61714. // "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy",
  61715. // "response": {
  61716. // "$ref": "Policy"
  61717. // },
  61718. // "scopes": [
  61719. // "https://www.googleapis.com/auth/cloud-platform",
  61720. // "https://www.googleapis.com/auth/compute",
  61721. // "https://www.googleapis.com/auth/compute.readonly"
  61722. // ]
  61723. // }
  61724. }
  61725. // method id "compute.instances.getSerialPortOutput":
  61726. type InstancesGetSerialPortOutputCall struct {
  61727. s *Service
  61728. project string
  61729. zone string
  61730. instance string
  61731. urlParams_ gensupport.URLParams
  61732. ifNoneMatch_ string
  61733. ctx_ context.Context
  61734. header_ http.Header
  61735. }
  61736. // GetSerialPortOutput: Returns the last 1 MB of serial port output from
  61737. // the specified instance.
  61738. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  61739. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  61740. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61741. c.project = project
  61742. c.zone = zone
  61743. c.instance = instance
  61744. return c
  61745. }
  61746. // Port sets the optional parameter "port": Specifies which COM or
  61747. // serial port to retrieve data from.
  61748. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  61749. c.urlParams_.Set("port", fmt.Sprint(port))
  61750. return c
  61751. }
  61752. // Start sets the optional parameter "start": Returns output starting
  61753. // from a specific byte position. Use this to page through output when
  61754. // the output is too large to return in a single request. For the
  61755. // initial request, leave this field unspecified. For subsequent calls,
  61756. // this field should be set to the next value returned in the previous
  61757. // call.
  61758. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  61759. c.urlParams_.Set("start", fmt.Sprint(start))
  61760. return c
  61761. }
  61762. // Fields allows partial responses to be retrieved. See
  61763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61764. // for more information.
  61765. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  61766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61767. return c
  61768. }
  61769. // IfNoneMatch sets the optional parameter which makes the operation
  61770. // fail if the object's ETag matches the given value. This is useful for
  61771. // getting updates only after the object has changed since the last
  61772. // request. Use googleapi.IsNotModified to check whether the response
  61773. // error from Do is the result of In-None-Match.
  61774. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  61775. c.ifNoneMatch_ = entityTag
  61776. return c
  61777. }
  61778. // Context sets the context to be used in this call's Do method. Any
  61779. // pending HTTP request will be aborted if the provided context is
  61780. // canceled.
  61781. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  61782. c.ctx_ = ctx
  61783. return c
  61784. }
  61785. // Header returns an http.Header that can be modified by the caller to
  61786. // add HTTP headers to the request.
  61787. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  61788. if c.header_ == nil {
  61789. c.header_ = make(http.Header)
  61790. }
  61791. return c.header_
  61792. }
  61793. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  61794. reqHeaders := make(http.Header)
  61795. for k, v := range c.header_ {
  61796. reqHeaders[k] = v
  61797. }
  61798. reqHeaders.Set("User-Agent", c.s.userAgent())
  61799. if c.ifNoneMatch_ != "" {
  61800. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61801. }
  61802. var body io.Reader = nil
  61803. c.urlParams_.Set("alt", alt)
  61804. c.urlParams_.Set("prettyPrint", "false")
  61805. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  61806. urls += "?" + c.urlParams_.Encode()
  61807. req, err := http.NewRequest("GET", urls, body)
  61808. if err != nil {
  61809. return nil, err
  61810. }
  61811. req.Header = reqHeaders
  61812. googleapi.Expand(req.URL, map[string]string{
  61813. "project": c.project,
  61814. "zone": c.zone,
  61815. "instance": c.instance,
  61816. })
  61817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61818. }
  61819. // Do executes the "compute.instances.getSerialPortOutput" call.
  61820. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  61821. // non-2xx status code is an error. Response headers are in either
  61822. // *SerialPortOutput.ServerResponse.Header or (if a response was
  61823. // returned at all) in error.(*googleapi.Error).Header. Use
  61824. // googleapi.IsNotModified to check whether the returned error was
  61825. // because http.StatusNotModified was returned.
  61826. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  61827. gensupport.SetOptions(c.urlParams_, opts...)
  61828. res, err := c.doRequest("json")
  61829. if res != nil && res.StatusCode == http.StatusNotModified {
  61830. if res.Body != nil {
  61831. res.Body.Close()
  61832. }
  61833. return nil, &googleapi.Error{
  61834. Code: res.StatusCode,
  61835. Header: res.Header,
  61836. }
  61837. }
  61838. if err != nil {
  61839. return nil, err
  61840. }
  61841. defer googleapi.CloseBody(res)
  61842. if err := googleapi.CheckResponse(res); err != nil {
  61843. return nil, err
  61844. }
  61845. ret := &SerialPortOutput{
  61846. ServerResponse: googleapi.ServerResponse{
  61847. Header: res.Header,
  61848. HTTPStatusCode: res.StatusCode,
  61849. },
  61850. }
  61851. target := &ret
  61852. if err := gensupport.DecodeResponse(target, res); err != nil {
  61853. return nil, err
  61854. }
  61855. return ret, nil
  61856. // {
  61857. // "description": "Returns the last 1 MB of serial port output from the specified instance.",
  61858. // "httpMethod": "GET",
  61859. // "id": "compute.instances.getSerialPortOutput",
  61860. // "parameterOrder": [
  61861. // "project",
  61862. // "zone",
  61863. // "instance"
  61864. // ],
  61865. // "parameters": {
  61866. // "instance": {
  61867. // "description": "Name of the instance scoping this request.",
  61868. // "location": "path",
  61869. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61870. // "required": true,
  61871. // "type": "string"
  61872. // },
  61873. // "port": {
  61874. // "default": "1",
  61875. // "description": "Specifies which COM or serial port to retrieve data from.",
  61876. // "format": "int32",
  61877. // "location": "query",
  61878. // "maximum": "4",
  61879. // "minimum": "1",
  61880. // "type": "integer"
  61881. // },
  61882. // "project": {
  61883. // "description": "Project ID for this request.",
  61884. // "location": "path",
  61885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61886. // "required": true,
  61887. // "type": "string"
  61888. // },
  61889. // "start": {
  61890. // "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.",
  61891. // "format": "int64",
  61892. // "location": "query",
  61893. // "type": "string"
  61894. // },
  61895. // "zone": {
  61896. // "description": "The name of the zone for this request.",
  61897. // "location": "path",
  61898. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61899. // "required": true,
  61900. // "type": "string"
  61901. // }
  61902. // },
  61903. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  61904. // "response": {
  61905. // "$ref": "SerialPortOutput"
  61906. // },
  61907. // "scopes": [
  61908. // "https://www.googleapis.com/auth/cloud-platform",
  61909. // "https://www.googleapis.com/auth/compute",
  61910. // "https://www.googleapis.com/auth/compute.readonly"
  61911. // ]
  61912. // }
  61913. }
  61914. // method id "compute.instances.getShieldedInstanceIdentity":
  61915. type InstancesGetShieldedInstanceIdentityCall struct {
  61916. s *Service
  61917. project string
  61918. zone string
  61919. instance string
  61920. urlParams_ gensupport.URLParams
  61921. ifNoneMatch_ string
  61922. ctx_ context.Context
  61923. header_ http.Header
  61924. }
  61925. // GetShieldedInstanceIdentity: Returns the Shielded Instance Identity
  61926. // of an instance
  61927. func (r *InstancesService) GetShieldedInstanceIdentity(project string, zone string, instance string) *InstancesGetShieldedInstanceIdentityCall {
  61928. c := &InstancesGetShieldedInstanceIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61929. c.project = project
  61930. c.zone = zone
  61931. c.instance = instance
  61932. return c
  61933. }
  61934. // Fields allows partial responses to be retrieved. See
  61935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61936. // for more information.
  61937. func (c *InstancesGetShieldedInstanceIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedInstanceIdentityCall {
  61938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61939. return c
  61940. }
  61941. // IfNoneMatch sets the optional parameter which makes the operation
  61942. // fail if the object's ETag matches the given value. This is useful for
  61943. // getting updates only after the object has changed since the last
  61944. // request. Use googleapi.IsNotModified to check whether the response
  61945. // error from Do is the result of In-None-Match.
  61946. func (c *InstancesGetShieldedInstanceIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedInstanceIdentityCall {
  61947. c.ifNoneMatch_ = entityTag
  61948. return c
  61949. }
  61950. // Context sets the context to be used in this call's Do method. Any
  61951. // pending HTTP request will be aborted if the provided context is
  61952. // canceled.
  61953. func (c *InstancesGetShieldedInstanceIdentityCall) Context(ctx context.Context) *InstancesGetShieldedInstanceIdentityCall {
  61954. c.ctx_ = ctx
  61955. return c
  61956. }
  61957. // Header returns an http.Header that can be modified by the caller to
  61958. // add HTTP headers to the request.
  61959. func (c *InstancesGetShieldedInstanceIdentityCall) Header() http.Header {
  61960. if c.header_ == nil {
  61961. c.header_ = make(http.Header)
  61962. }
  61963. return c.header_
  61964. }
  61965. func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http.Response, error) {
  61966. reqHeaders := make(http.Header)
  61967. for k, v := range c.header_ {
  61968. reqHeaders[k] = v
  61969. }
  61970. reqHeaders.Set("User-Agent", c.s.userAgent())
  61971. if c.ifNoneMatch_ != "" {
  61972. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61973. }
  61974. var body io.Reader = nil
  61975. c.urlParams_.Set("alt", alt)
  61976. c.urlParams_.Set("prettyPrint", "false")
  61977. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity")
  61978. urls += "?" + c.urlParams_.Encode()
  61979. req, err := http.NewRequest("GET", urls, body)
  61980. if err != nil {
  61981. return nil, err
  61982. }
  61983. req.Header = reqHeaders
  61984. googleapi.Expand(req.URL, map[string]string{
  61985. "project": c.project,
  61986. "zone": c.zone,
  61987. "instance": c.instance,
  61988. })
  61989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61990. }
  61991. // Do executes the "compute.instances.getShieldedInstanceIdentity" call.
  61992. // Exactly one of *ShieldedInstanceIdentity or error will be non-nil.
  61993. // Any non-2xx status code is an error. Response headers are in either
  61994. // *ShieldedInstanceIdentity.ServerResponse.Header or (if a response was
  61995. // returned at all) in error.(*googleapi.Error).Header. Use
  61996. // googleapi.IsNotModified to check whether the returned error was
  61997. // because http.StatusNotModified was returned.
  61998. func (c *InstancesGetShieldedInstanceIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedInstanceIdentity, error) {
  61999. gensupport.SetOptions(c.urlParams_, opts...)
  62000. res, err := c.doRequest("json")
  62001. if res != nil && res.StatusCode == http.StatusNotModified {
  62002. if res.Body != nil {
  62003. res.Body.Close()
  62004. }
  62005. return nil, &googleapi.Error{
  62006. Code: res.StatusCode,
  62007. Header: res.Header,
  62008. }
  62009. }
  62010. if err != nil {
  62011. return nil, err
  62012. }
  62013. defer googleapi.CloseBody(res)
  62014. if err := googleapi.CheckResponse(res); err != nil {
  62015. return nil, err
  62016. }
  62017. ret := &ShieldedInstanceIdentity{
  62018. ServerResponse: googleapi.ServerResponse{
  62019. Header: res.Header,
  62020. HTTPStatusCode: res.StatusCode,
  62021. },
  62022. }
  62023. target := &ret
  62024. if err := gensupport.DecodeResponse(target, res); err != nil {
  62025. return nil, err
  62026. }
  62027. return ret, nil
  62028. // {
  62029. // "description": "Returns the Shielded Instance Identity of an instance",
  62030. // "httpMethod": "GET",
  62031. // "id": "compute.instances.getShieldedInstanceIdentity",
  62032. // "parameterOrder": [
  62033. // "project",
  62034. // "zone",
  62035. // "instance"
  62036. // ],
  62037. // "parameters": {
  62038. // "instance": {
  62039. // "description": "Name or id of the instance scoping this request.",
  62040. // "location": "path",
  62041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62042. // "required": true,
  62043. // "type": "string"
  62044. // },
  62045. // "project": {
  62046. // "description": "Project ID for this request.",
  62047. // "location": "path",
  62048. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62049. // "required": true,
  62050. // "type": "string"
  62051. // },
  62052. // "zone": {
  62053. // "description": "The name of the zone for this request.",
  62054. // "location": "path",
  62055. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62056. // "required": true,
  62057. // "type": "string"
  62058. // }
  62059. // },
  62060. // "path": "{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity",
  62061. // "response": {
  62062. // "$ref": "ShieldedInstanceIdentity"
  62063. // },
  62064. // "scopes": [
  62065. // "https://www.googleapis.com/auth/cloud-platform",
  62066. // "https://www.googleapis.com/auth/compute",
  62067. // "https://www.googleapis.com/auth/compute.readonly"
  62068. // ]
  62069. // }
  62070. }
  62071. // method id "compute.instances.getShieldedVmIdentity":
  62072. type InstancesGetShieldedVmIdentityCall struct {
  62073. s *Service
  62074. project string
  62075. zone string
  62076. instance string
  62077. urlParams_ gensupport.URLParams
  62078. ifNoneMatch_ string
  62079. ctx_ context.Context
  62080. header_ http.Header
  62081. }
  62082. // GetShieldedVmIdentity: Returns the Shielded VM Identity of an
  62083. // instance
  62084. func (r *InstancesService) GetShieldedVmIdentity(project string, zone string, instance string) *InstancesGetShieldedVmIdentityCall {
  62085. c := &InstancesGetShieldedVmIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62086. c.project = project
  62087. c.zone = zone
  62088. c.instance = instance
  62089. return c
  62090. }
  62091. // Fields allows partial responses to be retrieved. See
  62092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62093. // for more information.
  62094. func (c *InstancesGetShieldedVmIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedVmIdentityCall {
  62095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62096. return c
  62097. }
  62098. // IfNoneMatch sets the optional parameter which makes the operation
  62099. // fail if the object's ETag matches the given value. This is useful for
  62100. // getting updates only after the object has changed since the last
  62101. // request. Use googleapi.IsNotModified to check whether the response
  62102. // error from Do is the result of In-None-Match.
  62103. func (c *InstancesGetShieldedVmIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedVmIdentityCall {
  62104. c.ifNoneMatch_ = entityTag
  62105. return c
  62106. }
  62107. // Context sets the context to be used in this call's Do method. Any
  62108. // pending HTTP request will be aborted if the provided context is
  62109. // canceled.
  62110. func (c *InstancesGetShieldedVmIdentityCall) Context(ctx context.Context) *InstancesGetShieldedVmIdentityCall {
  62111. c.ctx_ = ctx
  62112. return c
  62113. }
  62114. // Header returns an http.Header that can be modified by the caller to
  62115. // add HTTP headers to the request.
  62116. func (c *InstancesGetShieldedVmIdentityCall) Header() http.Header {
  62117. if c.header_ == nil {
  62118. c.header_ = make(http.Header)
  62119. }
  62120. return c.header_
  62121. }
  62122. func (c *InstancesGetShieldedVmIdentityCall) doRequest(alt string) (*http.Response, error) {
  62123. reqHeaders := make(http.Header)
  62124. for k, v := range c.header_ {
  62125. reqHeaders[k] = v
  62126. }
  62127. reqHeaders.Set("User-Agent", c.s.userAgent())
  62128. if c.ifNoneMatch_ != "" {
  62129. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62130. }
  62131. var body io.Reader = nil
  62132. c.urlParams_.Set("alt", alt)
  62133. c.urlParams_.Set("prettyPrint", "false")
  62134. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity")
  62135. urls += "?" + c.urlParams_.Encode()
  62136. req, err := http.NewRequest("GET", urls, body)
  62137. if err != nil {
  62138. return nil, err
  62139. }
  62140. req.Header = reqHeaders
  62141. googleapi.Expand(req.URL, map[string]string{
  62142. "project": c.project,
  62143. "zone": c.zone,
  62144. "instance": c.instance,
  62145. })
  62146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62147. }
  62148. // Do executes the "compute.instances.getShieldedVmIdentity" call.
  62149. // Exactly one of *ShieldedVmIdentity or error will be non-nil. Any
  62150. // non-2xx status code is an error. Response headers are in either
  62151. // *ShieldedVmIdentity.ServerResponse.Header or (if a response was
  62152. // returned at all) in error.(*googleapi.Error).Header. Use
  62153. // googleapi.IsNotModified to check whether the returned error was
  62154. // because http.StatusNotModified was returned.
  62155. func (c *InstancesGetShieldedVmIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedVmIdentity, error) {
  62156. gensupport.SetOptions(c.urlParams_, opts...)
  62157. res, err := c.doRequest("json")
  62158. if res != nil && res.StatusCode == http.StatusNotModified {
  62159. if res.Body != nil {
  62160. res.Body.Close()
  62161. }
  62162. return nil, &googleapi.Error{
  62163. Code: res.StatusCode,
  62164. Header: res.Header,
  62165. }
  62166. }
  62167. if err != nil {
  62168. return nil, err
  62169. }
  62170. defer googleapi.CloseBody(res)
  62171. if err := googleapi.CheckResponse(res); err != nil {
  62172. return nil, err
  62173. }
  62174. ret := &ShieldedVmIdentity{
  62175. ServerResponse: googleapi.ServerResponse{
  62176. Header: res.Header,
  62177. HTTPStatusCode: res.StatusCode,
  62178. },
  62179. }
  62180. target := &ret
  62181. if err := gensupport.DecodeResponse(target, res); err != nil {
  62182. return nil, err
  62183. }
  62184. return ret, nil
  62185. // {
  62186. // "description": "Returns the Shielded VM Identity of an instance",
  62187. // "httpMethod": "GET",
  62188. // "id": "compute.instances.getShieldedVmIdentity",
  62189. // "parameterOrder": [
  62190. // "project",
  62191. // "zone",
  62192. // "instance"
  62193. // ],
  62194. // "parameters": {
  62195. // "instance": {
  62196. // "description": "Name of the instance scoping this request.",
  62197. // "location": "path",
  62198. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62199. // "required": true,
  62200. // "type": "string"
  62201. // },
  62202. // "project": {
  62203. // "description": "Project ID for this request.",
  62204. // "location": "path",
  62205. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62206. // "required": true,
  62207. // "type": "string"
  62208. // },
  62209. // "zone": {
  62210. // "description": "The name of the zone for this request.",
  62211. // "location": "path",
  62212. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62213. // "required": true,
  62214. // "type": "string"
  62215. // }
  62216. // },
  62217. // "path": "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity",
  62218. // "response": {
  62219. // "$ref": "ShieldedVmIdentity"
  62220. // },
  62221. // "scopes": [
  62222. // "https://www.googleapis.com/auth/cloud-platform",
  62223. // "https://www.googleapis.com/auth/compute",
  62224. // "https://www.googleapis.com/auth/compute.readonly"
  62225. // ]
  62226. // }
  62227. }
  62228. // method id "compute.instances.insert":
  62229. type InstancesInsertCall struct {
  62230. s *Service
  62231. project string
  62232. zone string
  62233. instance *Instance
  62234. urlParams_ gensupport.URLParams
  62235. ctx_ context.Context
  62236. header_ http.Header
  62237. }
  62238. // Insert: Creates an instance resource in the specified project using
  62239. // the data included in the request.
  62240. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  62241. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  62242. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62243. c.project = project
  62244. c.zone = zone
  62245. c.instance = instance
  62246. return c
  62247. }
  62248. // RequestId sets the optional parameter "requestId": An optional
  62249. // request ID to identify requests. Specify a unique request ID so that
  62250. // if you must retry your request, the server will know to ignore the
  62251. // request if it has already been completed.
  62252. //
  62253. // For example, consider a situation where you make an initial request
  62254. // and the request times out. If you make the request again with the
  62255. // same request ID, the server can check if original operation with the
  62256. // same request ID was received, and if so, will ignore the second
  62257. // request. This prevents clients from accidentally creating duplicate
  62258. // commitments.
  62259. //
  62260. // The request ID must be a valid UUID with the exception that zero UUID
  62261. // is not supported (00000000-0000-0000-0000-000000000000).
  62262. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  62263. c.urlParams_.Set("requestId", requestId)
  62264. return c
  62265. }
  62266. // SourceInstanceTemplate sets the optional parameter
  62267. // "sourceInstanceTemplate": Specifies instance template to create the
  62268. // instance.
  62269. //
  62270. // This field is optional. It can be a full or partial URL. For example,
  62271. // the following are all valid URLs to an instance template:
  62272. // -
  62273. // https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  62274. // - projects/project/global/instanceTemplates/instanceTemplate
  62275. // - global/instanceTemplates/instanceTemplate
  62276. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  62277. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  62278. return c
  62279. }
  62280. // Fields allows partial responses to be retrieved. See
  62281. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62282. // for more information.
  62283. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  62284. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62285. return c
  62286. }
  62287. // Context sets the context to be used in this call's Do method. Any
  62288. // pending HTTP request will be aborted if the provided context is
  62289. // canceled.
  62290. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  62291. c.ctx_ = ctx
  62292. return c
  62293. }
  62294. // Header returns an http.Header that can be modified by the caller to
  62295. // add HTTP headers to the request.
  62296. func (c *InstancesInsertCall) Header() http.Header {
  62297. if c.header_ == nil {
  62298. c.header_ = make(http.Header)
  62299. }
  62300. return c.header_
  62301. }
  62302. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  62303. reqHeaders := make(http.Header)
  62304. for k, v := range c.header_ {
  62305. reqHeaders[k] = v
  62306. }
  62307. reqHeaders.Set("User-Agent", c.s.userAgent())
  62308. var body io.Reader = nil
  62309. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  62310. if err != nil {
  62311. return nil, err
  62312. }
  62313. reqHeaders.Set("Content-Type", "application/json")
  62314. c.urlParams_.Set("alt", alt)
  62315. c.urlParams_.Set("prettyPrint", "false")
  62316. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  62317. urls += "?" + c.urlParams_.Encode()
  62318. req, err := http.NewRequest("POST", urls, body)
  62319. if err != nil {
  62320. return nil, err
  62321. }
  62322. req.Header = reqHeaders
  62323. googleapi.Expand(req.URL, map[string]string{
  62324. "project": c.project,
  62325. "zone": c.zone,
  62326. })
  62327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62328. }
  62329. // Do executes the "compute.instances.insert" call.
  62330. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62331. // status code is an error. Response headers are in either
  62332. // *Operation.ServerResponse.Header or (if a response was returned at
  62333. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62334. // to check whether the returned error was because
  62335. // http.StatusNotModified was returned.
  62336. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62337. gensupport.SetOptions(c.urlParams_, opts...)
  62338. res, err := c.doRequest("json")
  62339. if res != nil && res.StatusCode == http.StatusNotModified {
  62340. if res.Body != nil {
  62341. res.Body.Close()
  62342. }
  62343. return nil, &googleapi.Error{
  62344. Code: res.StatusCode,
  62345. Header: res.Header,
  62346. }
  62347. }
  62348. if err != nil {
  62349. return nil, err
  62350. }
  62351. defer googleapi.CloseBody(res)
  62352. if err := googleapi.CheckResponse(res); err != nil {
  62353. return nil, err
  62354. }
  62355. ret := &Operation{
  62356. ServerResponse: googleapi.ServerResponse{
  62357. Header: res.Header,
  62358. HTTPStatusCode: res.StatusCode,
  62359. },
  62360. }
  62361. target := &ret
  62362. if err := gensupport.DecodeResponse(target, res); err != nil {
  62363. return nil, err
  62364. }
  62365. return ret, nil
  62366. // {
  62367. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  62368. // "httpMethod": "POST",
  62369. // "id": "compute.instances.insert",
  62370. // "parameterOrder": [
  62371. // "project",
  62372. // "zone"
  62373. // ],
  62374. // "parameters": {
  62375. // "project": {
  62376. // "description": "Project ID for this request.",
  62377. // "location": "path",
  62378. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62379. // "required": true,
  62380. // "type": "string"
  62381. // },
  62382. // "requestId": {
  62383. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62384. // "location": "query",
  62385. // "type": "string"
  62386. // },
  62387. // "sourceInstanceTemplate": {
  62388. // "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",
  62389. // "location": "query",
  62390. // "type": "string"
  62391. // },
  62392. // "zone": {
  62393. // "description": "The name of the zone for this request.",
  62394. // "location": "path",
  62395. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62396. // "required": true,
  62397. // "type": "string"
  62398. // }
  62399. // },
  62400. // "path": "{project}/zones/{zone}/instances",
  62401. // "request": {
  62402. // "$ref": "Instance"
  62403. // },
  62404. // "response": {
  62405. // "$ref": "Operation"
  62406. // },
  62407. // "scopes": [
  62408. // "https://www.googleapis.com/auth/cloud-platform",
  62409. // "https://www.googleapis.com/auth/compute"
  62410. // ]
  62411. // }
  62412. }
  62413. // method id "compute.instances.list":
  62414. type InstancesListCall struct {
  62415. s *Service
  62416. project string
  62417. zone string
  62418. urlParams_ gensupport.URLParams
  62419. ifNoneMatch_ string
  62420. ctx_ context.Context
  62421. header_ http.Header
  62422. }
  62423. // List: Retrieves the list of instances contained within the specified
  62424. // zone.
  62425. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  62426. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  62427. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62428. c.project = project
  62429. c.zone = zone
  62430. return c
  62431. }
  62432. // Filter sets the optional parameter "filter": A filter expression that
  62433. // filters resources listed in the response. The expression must specify
  62434. // the field name, a comparison operator, and the value that you want to
  62435. // use for filtering. The value must be a string, a number, or a
  62436. // boolean. The comparison operator must be either =, !=, >, or <.
  62437. //
  62438. // For example, if you are filtering Compute Engine instances, you can
  62439. // exclude instances named example-instance by specifying name !=
  62440. // example-instance.
  62441. //
  62442. // You can also filter nested fields. For example, you could specify
  62443. // scheduling.automaticRestart = false to include instances only if they
  62444. // are not scheduled for automatic restarts. You can use filtering on
  62445. // nested fields to filter based on resource labels.
  62446. //
  62447. // To filter on multiple expressions, provide each separate expression
  62448. // within parentheses. For example, (scheduling.automaticRestart = true)
  62449. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62450. // AND expression. However, you can include AND and OR expressions
  62451. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62452. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62453. // true).
  62454. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  62455. c.urlParams_.Set("filter", filter)
  62456. return c
  62457. }
  62458. // MaxResults sets the optional parameter "maxResults": The maximum
  62459. // number of results per page that should be returned. If the number of
  62460. // available results is larger than maxResults, Compute Engine returns a
  62461. // nextPageToken that can be used to get the next page of results in
  62462. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62463. // (Default: 500)
  62464. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  62465. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62466. return c
  62467. }
  62468. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62469. // a certain order. By default, results are returned in alphanumerical
  62470. // order based on the resource name.
  62471. //
  62472. // You can also sort results in descending order based on the creation
  62473. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62474. // based on the creationTimestamp field in reverse chronological order
  62475. // (newest result first). Use this to sort resources like operations so
  62476. // that the newest operation is returned first.
  62477. //
  62478. // Currently, only sorting by name or creationTimestamp desc is
  62479. // supported.
  62480. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  62481. c.urlParams_.Set("orderBy", orderBy)
  62482. return c
  62483. }
  62484. // PageToken sets the optional parameter "pageToken": Specifies a page
  62485. // token to use. Set pageToken to the nextPageToken returned by a
  62486. // previous list request to get the next page of results.
  62487. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  62488. c.urlParams_.Set("pageToken", pageToken)
  62489. return c
  62490. }
  62491. // Fields allows partial responses to be retrieved. See
  62492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62493. // for more information.
  62494. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  62495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62496. return c
  62497. }
  62498. // IfNoneMatch sets the optional parameter which makes the operation
  62499. // fail if the object's ETag matches the given value. This is useful for
  62500. // getting updates only after the object has changed since the last
  62501. // request. Use googleapi.IsNotModified to check whether the response
  62502. // error from Do is the result of In-None-Match.
  62503. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  62504. c.ifNoneMatch_ = entityTag
  62505. return c
  62506. }
  62507. // Context sets the context to be used in this call's Do method. Any
  62508. // pending HTTP request will be aborted if the provided context is
  62509. // canceled.
  62510. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  62511. c.ctx_ = ctx
  62512. return c
  62513. }
  62514. // Header returns an http.Header that can be modified by the caller to
  62515. // add HTTP headers to the request.
  62516. func (c *InstancesListCall) Header() http.Header {
  62517. if c.header_ == nil {
  62518. c.header_ = make(http.Header)
  62519. }
  62520. return c.header_
  62521. }
  62522. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  62523. reqHeaders := make(http.Header)
  62524. for k, v := range c.header_ {
  62525. reqHeaders[k] = v
  62526. }
  62527. reqHeaders.Set("User-Agent", c.s.userAgent())
  62528. if c.ifNoneMatch_ != "" {
  62529. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62530. }
  62531. var body io.Reader = nil
  62532. c.urlParams_.Set("alt", alt)
  62533. c.urlParams_.Set("prettyPrint", "false")
  62534. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  62535. urls += "?" + c.urlParams_.Encode()
  62536. req, err := http.NewRequest("GET", urls, body)
  62537. if err != nil {
  62538. return nil, err
  62539. }
  62540. req.Header = reqHeaders
  62541. googleapi.Expand(req.URL, map[string]string{
  62542. "project": c.project,
  62543. "zone": c.zone,
  62544. })
  62545. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62546. }
  62547. // Do executes the "compute.instances.list" call.
  62548. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  62549. // status code is an error. Response headers are in either
  62550. // *InstanceList.ServerResponse.Header or (if a response was returned at
  62551. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62552. // to check whether the returned error was because
  62553. // http.StatusNotModified was returned.
  62554. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  62555. gensupport.SetOptions(c.urlParams_, opts...)
  62556. res, err := c.doRequest("json")
  62557. if res != nil && res.StatusCode == http.StatusNotModified {
  62558. if res.Body != nil {
  62559. res.Body.Close()
  62560. }
  62561. return nil, &googleapi.Error{
  62562. Code: res.StatusCode,
  62563. Header: res.Header,
  62564. }
  62565. }
  62566. if err != nil {
  62567. return nil, err
  62568. }
  62569. defer googleapi.CloseBody(res)
  62570. if err := googleapi.CheckResponse(res); err != nil {
  62571. return nil, err
  62572. }
  62573. ret := &InstanceList{
  62574. ServerResponse: googleapi.ServerResponse{
  62575. Header: res.Header,
  62576. HTTPStatusCode: res.StatusCode,
  62577. },
  62578. }
  62579. target := &ret
  62580. if err := gensupport.DecodeResponse(target, res); err != nil {
  62581. return nil, err
  62582. }
  62583. return ret, nil
  62584. // {
  62585. // "description": "Retrieves the list of instances contained within the specified zone.",
  62586. // "httpMethod": "GET",
  62587. // "id": "compute.instances.list",
  62588. // "parameterOrder": [
  62589. // "project",
  62590. // "zone"
  62591. // ],
  62592. // "parameters": {
  62593. // "filter": {
  62594. // "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).",
  62595. // "location": "query",
  62596. // "type": "string"
  62597. // },
  62598. // "maxResults": {
  62599. // "default": "500",
  62600. // "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)",
  62601. // "format": "uint32",
  62602. // "location": "query",
  62603. // "minimum": "0",
  62604. // "type": "integer"
  62605. // },
  62606. // "orderBy": {
  62607. // "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.",
  62608. // "location": "query",
  62609. // "type": "string"
  62610. // },
  62611. // "pageToken": {
  62612. // "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.",
  62613. // "location": "query",
  62614. // "type": "string"
  62615. // },
  62616. // "project": {
  62617. // "description": "Project ID for this request.",
  62618. // "location": "path",
  62619. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62620. // "required": true,
  62621. // "type": "string"
  62622. // },
  62623. // "zone": {
  62624. // "description": "The name of the zone for this request.",
  62625. // "location": "path",
  62626. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62627. // "required": true,
  62628. // "type": "string"
  62629. // }
  62630. // },
  62631. // "path": "{project}/zones/{zone}/instances",
  62632. // "response": {
  62633. // "$ref": "InstanceList"
  62634. // },
  62635. // "scopes": [
  62636. // "https://www.googleapis.com/auth/cloud-platform",
  62637. // "https://www.googleapis.com/auth/compute",
  62638. // "https://www.googleapis.com/auth/compute.readonly"
  62639. // ]
  62640. // }
  62641. }
  62642. // Pages invokes f for each page of results.
  62643. // A non-nil error returned from f will halt the iteration.
  62644. // The provided context supersedes any context provided to the Context method.
  62645. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  62646. c.ctx_ = ctx
  62647. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62648. for {
  62649. x, err := c.Do()
  62650. if err != nil {
  62651. return err
  62652. }
  62653. if err := f(x); err != nil {
  62654. return err
  62655. }
  62656. if x.NextPageToken == "" {
  62657. return nil
  62658. }
  62659. c.PageToken(x.NextPageToken)
  62660. }
  62661. }
  62662. // method id "compute.instances.listReferrers":
  62663. type InstancesListReferrersCall struct {
  62664. s *Service
  62665. project string
  62666. zone string
  62667. instance string
  62668. urlParams_ gensupport.URLParams
  62669. ifNoneMatch_ string
  62670. ctx_ context.Context
  62671. header_ http.Header
  62672. }
  62673. // ListReferrers: Retrieves the list of referrers to instances contained
  62674. // within the specified zone. For more information, read Viewing
  62675. // Referrers to VM Instances.
  62676. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  62677. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62678. c.project = project
  62679. c.zone = zone
  62680. c.instance = instance
  62681. return c
  62682. }
  62683. // Filter sets the optional parameter "filter": A filter expression that
  62684. // filters resources listed in the response. The expression must specify
  62685. // the field name, a comparison operator, and the value that you want to
  62686. // use for filtering. The value must be a string, a number, or a
  62687. // boolean. The comparison operator must be either =, !=, >, or <.
  62688. //
  62689. // For example, if you are filtering Compute Engine instances, you can
  62690. // exclude instances named example-instance by specifying name !=
  62691. // example-instance.
  62692. //
  62693. // You can also filter nested fields. For example, you could specify
  62694. // scheduling.automaticRestart = false to include instances only if they
  62695. // are not scheduled for automatic restarts. You can use filtering on
  62696. // nested fields to filter based on resource labels.
  62697. //
  62698. // To filter on multiple expressions, provide each separate expression
  62699. // within parentheses. For example, (scheduling.automaticRestart = true)
  62700. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62701. // AND expression. However, you can include AND and OR expressions
  62702. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62703. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62704. // true).
  62705. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  62706. c.urlParams_.Set("filter", filter)
  62707. return c
  62708. }
  62709. // MaxResults sets the optional parameter "maxResults": The maximum
  62710. // number of results per page that should be returned. If the number of
  62711. // available results is larger than maxResults, Compute Engine returns a
  62712. // nextPageToken that can be used to get the next page of results in
  62713. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62714. // (Default: 500)
  62715. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  62716. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62717. return c
  62718. }
  62719. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62720. // a certain order. By default, results are returned in alphanumerical
  62721. // order based on the resource name.
  62722. //
  62723. // You can also sort results in descending order based on the creation
  62724. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62725. // based on the creationTimestamp field in reverse chronological order
  62726. // (newest result first). Use this to sort resources like operations so
  62727. // that the newest operation is returned first.
  62728. //
  62729. // Currently, only sorting by name or creationTimestamp desc is
  62730. // supported.
  62731. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  62732. c.urlParams_.Set("orderBy", orderBy)
  62733. return c
  62734. }
  62735. // PageToken sets the optional parameter "pageToken": Specifies a page
  62736. // token to use. Set pageToken to the nextPageToken returned by a
  62737. // previous list request to get the next page of results.
  62738. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  62739. c.urlParams_.Set("pageToken", pageToken)
  62740. return c
  62741. }
  62742. // Fields allows partial responses to be retrieved. See
  62743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62744. // for more information.
  62745. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  62746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62747. return c
  62748. }
  62749. // IfNoneMatch sets the optional parameter which makes the operation
  62750. // fail if the object's ETag matches the given value. This is useful for
  62751. // getting updates only after the object has changed since the last
  62752. // request. Use googleapi.IsNotModified to check whether the response
  62753. // error from Do is the result of In-None-Match.
  62754. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  62755. c.ifNoneMatch_ = entityTag
  62756. return c
  62757. }
  62758. // Context sets the context to be used in this call's Do method. Any
  62759. // pending HTTP request will be aborted if the provided context is
  62760. // canceled.
  62761. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  62762. c.ctx_ = ctx
  62763. return c
  62764. }
  62765. // Header returns an http.Header that can be modified by the caller to
  62766. // add HTTP headers to the request.
  62767. func (c *InstancesListReferrersCall) Header() http.Header {
  62768. if c.header_ == nil {
  62769. c.header_ = make(http.Header)
  62770. }
  62771. return c.header_
  62772. }
  62773. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  62774. reqHeaders := make(http.Header)
  62775. for k, v := range c.header_ {
  62776. reqHeaders[k] = v
  62777. }
  62778. reqHeaders.Set("User-Agent", c.s.userAgent())
  62779. if c.ifNoneMatch_ != "" {
  62780. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62781. }
  62782. var body io.Reader = nil
  62783. c.urlParams_.Set("alt", alt)
  62784. c.urlParams_.Set("prettyPrint", "false")
  62785. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  62786. urls += "?" + c.urlParams_.Encode()
  62787. req, err := http.NewRequest("GET", urls, body)
  62788. if err != nil {
  62789. return nil, err
  62790. }
  62791. req.Header = reqHeaders
  62792. googleapi.Expand(req.URL, map[string]string{
  62793. "project": c.project,
  62794. "zone": c.zone,
  62795. "instance": c.instance,
  62796. })
  62797. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62798. }
  62799. // Do executes the "compute.instances.listReferrers" call.
  62800. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  62801. // non-2xx status code is an error. Response headers are in either
  62802. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  62803. // returned at all) in error.(*googleapi.Error).Header. Use
  62804. // googleapi.IsNotModified to check whether the returned error was
  62805. // because http.StatusNotModified was returned.
  62806. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  62807. gensupport.SetOptions(c.urlParams_, opts...)
  62808. res, err := c.doRequest("json")
  62809. if res != nil && res.StatusCode == http.StatusNotModified {
  62810. if res.Body != nil {
  62811. res.Body.Close()
  62812. }
  62813. return nil, &googleapi.Error{
  62814. Code: res.StatusCode,
  62815. Header: res.Header,
  62816. }
  62817. }
  62818. if err != nil {
  62819. return nil, err
  62820. }
  62821. defer googleapi.CloseBody(res)
  62822. if err := googleapi.CheckResponse(res); err != nil {
  62823. return nil, err
  62824. }
  62825. ret := &InstanceListReferrers{
  62826. ServerResponse: googleapi.ServerResponse{
  62827. Header: res.Header,
  62828. HTTPStatusCode: res.StatusCode,
  62829. },
  62830. }
  62831. target := &ret
  62832. if err := gensupport.DecodeResponse(target, res); err != nil {
  62833. return nil, err
  62834. }
  62835. return ret, nil
  62836. // {
  62837. // "description": "Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.",
  62838. // "httpMethod": "GET",
  62839. // "id": "compute.instances.listReferrers",
  62840. // "parameterOrder": [
  62841. // "project",
  62842. // "zone",
  62843. // "instance"
  62844. // ],
  62845. // "parameters": {
  62846. // "filter": {
  62847. // "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).",
  62848. // "location": "query",
  62849. // "type": "string"
  62850. // },
  62851. // "instance": {
  62852. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  62853. // "location": "path",
  62854. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62855. // "required": true,
  62856. // "type": "string"
  62857. // },
  62858. // "maxResults": {
  62859. // "default": "500",
  62860. // "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)",
  62861. // "format": "uint32",
  62862. // "location": "query",
  62863. // "minimum": "0",
  62864. // "type": "integer"
  62865. // },
  62866. // "orderBy": {
  62867. // "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.",
  62868. // "location": "query",
  62869. // "type": "string"
  62870. // },
  62871. // "pageToken": {
  62872. // "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.",
  62873. // "location": "query",
  62874. // "type": "string"
  62875. // },
  62876. // "project": {
  62877. // "description": "Project ID for this request.",
  62878. // "location": "path",
  62879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62880. // "required": true,
  62881. // "type": "string"
  62882. // },
  62883. // "zone": {
  62884. // "description": "The name of the zone for this request.",
  62885. // "location": "path",
  62886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62887. // "required": true,
  62888. // "type": "string"
  62889. // }
  62890. // },
  62891. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  62892. // "response": {
  62893. // "$ref": "InstanceListReferrers"
  62894. // },
  62895. // "scopes": [
  62896. // "https://www.googleapis.com/auth/cloud-platform",
  62897. // "https://www.googleapis.com/auth/compute",
  62898. // "https://www.googleapis.com/auth/compute.readonly"
  62899. // ]
  62900. // }
  62901. }
  62902. // Pages invokes f for each page of results.
  62903. // A non-nil error returned from f will halt the iteration.
  62904. // The provided context supersedes any context provided to the Context method.
  62905. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  62906. c.ctx_ = ctx
  62907. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62908. for {
  62909. x, err := c.Do()
  62910. if err != nil {
  62911. return err
  62912. }
  62913. if err := f(x); err != nil {
  62914. return err
  62915. }
  62916. if x.NextPageToken == "" {
  62917. return nil
  62918. }
  62919. c.PageToken(x.NextPageToken)
  62920. }
  62921. }
  62922. // method id "compute.instances.reset":
  62923. type InstancesResetCall struct {
  62924. s *Service
  62925. project string
  62926. zone string
  62927. instance string
  62928. urlParams_ gensupport.URLParams
  62929. ctx_ context.Context
  62930. header_ http.Header
  62931. }
  62932. // Reset: Performs a reset on the instance. This is a hard reset the VM
  62933. // does not do a graceful shutdown. For more information, see Resetting
  62934. // an instance.
  62935. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  62936. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  62937. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62938. c.project = project
  62939. c.zone = zone
  62940. c.instance = instance
  62941. return c
  62942. }
  62943. // RequestId sets the optional parameter "requestId": An optional
  62944. // request ID to identify requests. Specify a unique request ID so that
  62945. // if you must retry your request, the server will know to ignore the
  62946. // request if it has already been completed.
  62947. //
  62948. // For example, consider a situation where you make an initial request
  62949. // and the request times out. If you make the request again with the
  62950. // same request ID, the server can check if original operation with the
  62951. // same request ID was received, and if so, will ignore the second
  62952. // request. This prevents clients from accidentally creating duplicate
  62953. // commitments.
  62954. //
  62955. // The request ID must be a valid UUID with the exception that zero UUID
  62956. // is not supported (00000000-0000-0000-0000-000000000000).
  62957. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  62958. c.urlParams_.Set("requestId", requestId)
  62959. return c
  62960. }
  62961. // Fields allows partial responses to be retrieved. See
  62962. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62963. // for more information.
  62964. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  62965. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62966. return c
  62967. }
  62968. // Context sets the context to be used in this call's Do method. Any
  62969. // pending HTTP request will be aborted if the provided context is
  62970. // canceled.
  62971. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  62972. c.ctx_ = ctx
  62973. return c
  62974. }
  62975. // Header returns an http.Header that can be modified by the caller to
  62976. // add HTTP headers to the request.
  62977. func (c *InstancesResetCall) Header() http.Header {
  62978. if c.header_ == nil {
  62979. c.header_ = make(http.Header)
  62980. }
  62981. return c.header_
  62982. }
  62983. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  62984. reqHeaders := make(http.Header)
  62985. for k, v := range c.header_ {
  62986. reqHeaders[k] = v
  62987. }
  62988. reqHeaders.Set("User-Agent", c.s.userAgent())
  62989. var body io.Reader = nil
  62990. c.urlParams_.Set("alt", alt)
  62991. c.urlParams_.Set("prettyPrint", "false")
  62992. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  62993. urls += "?" + c.urlParams_.Encode()
  62994. req, err := http.NewRequest("POST", urls, body)
  62995. if err != nil {
  62996. return nil, err
  62997. }
  62998. req.Header = reqHeaders
  62999. googleapi.Expand(req.URL, map[string]string{
  63000. "project": c.project,
  63001. "zone": c.zone,
  63002. "instance": c.instance,
  63003. })
  63004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63005. }
  63006. // Do executes the "compute.instances.reset" call.
  63007. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63008. // status code is an error. Response headers are in either
  63009. // *Operation.ServerResponse.Header or (if a response was returned at
  63010. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63011. // to check whether the returned error was because
  63012. // http.StatusNotModified was returned.
  63013. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63014. gensupport.SetOptions(c.urlParams_, opts...)
  63015. res, err := c.doRequest("json")
  63016. if res != nil && res.StatusCode == http.StatusNotModified {
  63017. if res.Body != nil {
  63018. res.Body.Close()
  63019. }
  63020. return nil, &googleapi.Error{
  63021. Code: res.StatusCode,
  63022. Header: res.Header,
  63023. }
  63024. }
  63025. if err != nil {
  63026. return nil, err
  63027. }
  63028. defer googleapi.CloseBody(res)
  63029. if err := googleapi.CheckResponse(res); err != nil {
  63030. return nil, err
  63031. }
  63032. ret := &Operation{
  63033. ServerResponse: googleapi.ServerResponse{
  63034. Header: res.Header,
  63035. HTTPStatusCode: res.StatusCode,
  63036. },
  63037. }
  63038. target := &ret
  63039. if err := gensupport.DecodeResponse(target, res); err != nil {
  63040. return nil, err
  63041. }
  63042. return ret, nil
  63043. // {
  63044. // "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.",
  63045. // "httpMethod": "POST",
  63046. // "id": "compute.instances.reset",
  63047. // "parameterOrder": [
  63048. // "project",
  63049. // "zone",
  63050. // "instance"
  63051. // ],
  63052. // "parameters": {
  63053. // "instance": {
  63054. // "description": "Name of the instance scoping this request.",
  63055. // "location": "path",
  63056. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63057. // "required": true,
  63058. // "type": "string"
  63059. // },
  63060. // "project": {
  63061. // "description": "Project ID for this request.",
  63062. // "location": "path",
  63063. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63064. // "required": true,
  63065. // "type": "string"
  63066. // },
  63067. // "requestId": {
  63068. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63069. // "location": "query",
  63070. // "type": "string"
  63071. // },
  63072. // "zone": {
  63073. // "description": "The name of the zone for this request.",
  63074. // "location": "path",
  63075. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63076. // "required": true,
  63077. // "type": "string"
  63078. // }
  63079. // },
  63080. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  63081. // "response": {
  63082. // "$ref": "Operation"
  63083. // },
  63084. // "scopes": [
  63085. // "https://www.googleapis.com/auth/cloud-platform",
  63086. // "https://www.googleapis.com/auth/compute"
  63087. // ]
  63088. // }
  63089. }
  63090. // method id "compute.instances.resume":
  63091. type InstancesResumeCall struct {
  63092. s *Service
  63093. project string
  63094. zone string
  63095. instance string
  63096. instancesresumerequest *InstancesResumeRequest
  63097. urlParams_ gensupport.URLParams
  63098. ctx_ context.Context
  63099. header_ http.Header
  63100. }
  63101. // Resume: Resumes an instance that was suspended using the
  63102. // instances().suspend method.
  63103. func (r *InstancesService) Resume(project string, zone string, instance string, instancesresumerequest *InstancesResumeRequest) *InstancesResumeCall {
  63104. c := &InstancesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63105. c.project = project
  63106. c.zone = zone
  63107. c.instance = instance
  63108. c.instancesresumerequest = instancesresumerequest
  63109. return c
  63110. }
  63111. // RequestId sets the optional parameter "requestId": An optional
  63112. // request ID to identify requests. Specify a unique request ID so that
  63113. // if you must retry your request, the server will know to ignore the
  63114. // request if it has already been completed.
  63115. //
  63116. // For example, consider a situation where you make an initial request
  63117. // and the request times out. If you make the request again with the
  63118. // same request ID, the server can check if original operation with the
  63119. // same request ID was received, and if so, will ignore the second
  63120. // request. This prevents clients from accidentally creating duplicate
  63121. // commitments.
  63122. //
  63123. // The request ID must be a valid UUID with the exception that zero UUID
  63124. // is not supported (00000000-0000-0000-0000-000000000000).
  63125. func (c *InstancesResumeCall) RequestId(requestId string) *InstancesResumeCall {
  63126. c.urlParams_.Set("requestId", requestId)
  63127. return c
  63128. }
  63129. // Fields allows partial responses to be retrieved. See
  63130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63131. // for more information.
  63132. func (c *InstancesResumeCall) Fields(s ...googleapi.Field) *InstancesResumeCall {
  63133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63134. return c
  63135. }
  63136. // Context sets the context to be used in this call's Do method. Any
  63137. // pending HTTP request will be aborted if the provided context is
  63138. // canceled.
  63139. func (c *InstancesResumeCall) Context(ctx context.Context) *InstancesResumeCall {
  63140. c.ctx_ = ctx
  63141. return c
  63142. }
  63143. // Header returns an http.Header that can be modified by the caller to
  63144. // add HTTP headers to the request.
  63145. func (c *InstancesResumeCall) Header() http.Header {
  63146. if c.header_ == nil {
  63147. c.header_ = make(http.Header)
  63148. }
  63149. return c.header_
  63150. }
  63151. func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) {
  63152. reqHeaders := make(http.Header)
  63153. for k, v := range c.header_ {
  63154. reqHeaders[k] = v
  63155. }
  63156. reqHeaders.Set("User-Agent", c.s.userAgent())
  63157. var body io.Reader = nil
  63158. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesresumerequest)
  63159. if err != nil {
  63160. return nil, err
  63161. }
  63162. reqHeaders.Set("Content-Type", "application/json")
  63163. c.urlParams_.Set("alt", alt)
  63164. c.urlParams_.Set("prettyPrint", "false")
  63165. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/resume")
  63166. urls += "?" + c.urlParams_.Encode()
  63167. req, err := http.NewRequest("POST", urls, body)
  63168. if err != nil {
  63169. return nil, err
  63170. }
  63171. req.Header = reqHeaders
  63172. googleapi.Expand(req.URL, map[string]string{
  63173. "project": c.project,
  63174. "zone": c.zone,
  63175. "instance": c.instance,
  63176. })
  63177. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63178. }
  63179. // Do executes the "compute.instances.resume" call.
  63180. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63181. // status code is an error. Response headers are in either
  63182. // *Operation.ServerResponse.Header or (if a response was returned at
  63183. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63184. // to check whether the returned error was because
  63185. // http.StatusNotModified was returned.
  63186. func (c *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63187. gensupport.SetOptions(c.urlParams_, opts...)
  63188. res, err := c.doRequest("json")
  63189. if res != nil && res.StatusCode == http.StatusNotModified {
  63190. if res.Body != nil {
  63191. res.Body.Close()
  63192. }
  63193. return nil, &googleapi.Error{
  63194. Code: res.StatusCode,
  63195. Header: res.Header,
  63196. }
  63197. }
  63198. if err != nil {
  63199. return nil, err
  63200. }
  63201. defer googleapi.CloseBody(res)
  63202. if err := googleapi.CheckResponse(res); err != nil {
  63203. return nil, err
  63204. }
  63205. ret := &Operation{
  63206. ServerResponse: googleapi.ServerResponse{
  63207. Header: res.Header,
  63208. HTTPStatusCode: res.StatusCode,
  63209. },
  63210. }
  63211. target := &ret
  63212. if err := gensupport.DecodeResponse(target, res); err != nil {
  63213. return nil, err
  63214. }
  63215. return ret, nil
  63216. // {
  63217. // "description": "Resumes an instance that was suspended using the instances().suspend method.",
  63218. // "httpMethod": "POST",
  63219. // "id": "compute.instances.resume",
  63220. // "parameterOrder": [
  63221. // "project",
  63222. // "zone",
  63223. // "instance"
  63224. // ],
  63225. // "parameters": {
  63226. // "instance": {
  63227. // "description": "Name of the instance resource to resume.",
  63228. // "location": "path",
  63229. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63230. // "required": true,
  63231. // "type": "string"
  63232. // },
  63233. // "project": {
  63234. // "description": "Project ID for this request.",
  63235. // "location": "path",
  63236. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63237. // "required": true,
  63238. // "type": "string"
  63239. // },
  63240. // "requestId": {
  63241. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63242. // "location": "query",
  63243. // "type": "string"
  63244. // },
  63245. // "zone": {
  63246. // "description": "The name of the zone for this request.",
  63247. // "location": "path",
  63248. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63249. // "required": true,
  63250. // "type": "string"
  63251. // }
  63252. // },
  63253. // "path": "{project}/zones/{zone}/instances/{instance}/resume",
  63254. // "request": {
  63255. // "$ref": "InstancesResumeRequest"
  63256. // },
  63257. // "response": {
  63258. // "$ref": "Operation"
  63259. // },
  63260. // "scopes": [
  63261. // "https://www.googleapis.com/auth/cloud-platform",
  63262. // "https://www.googleapis.com/auth/compute"
  63263. // ]
  63264. // }
  63265. }
  63266. // method id "compute.instances.setDeletionProtection":
  63267. type InstancesSetDeletionProtectionCall struct {
  63268. s *Service
  63269. project string
  63270. zone string
  63271. resource string
  63272. urlParams_ gensupport.URLParams
  63273. ctx_ context.Context
  63274. header_ http.Header
  63275. }
  63276. // SetDeletionProtection: Sets deletion protection on the instance.
  63277. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  63278. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63279. c.project = project
  63280. c.zone = zone
  63281. c.resource = resource
  63282. return c
  63283. }
  63284. // DeletionProtection sets the optional parameter "deletionProtection":
  63285. // Whether the resource should be protected against deletion.
  63286. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  63287. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  63288. return c
  63289. }
  63290. // RequestId sets the optional parameter "requestId": An optional
  63291. // request ID to identify requests. Specify a unique request ID so that
  63292. // if you must retry your request, the server will know to ignore the
  63293. // request if it has already been completed.
  63294. //
  63295. // For example, consider a situation where you make an initial request
  63296. // and the request times out. If you make the request again with the
  63297. // same request ID, the server can check if original operation with the
  63298. // same request ID was received, and if so, will ignore the second
  63299. // request. This prevents clients from accidentally creating duplicate
  63300. // commitments.
  63301. //
  63302. // The request ID must be a valid UUID with the exception that zero UUID
  63303. // is not supported (00000000-0000-0000-0000-000000000000).
  63304. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  63305. c.urlParams_.Set("requestId", requestId)
  63306. return c
  63307. }
  63308. // Fields allows partial responses to be retrieved. See
  63309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63310. // for more information.
  63311. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  63312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63313. return c
  63314. }
  63315. // Context sets the context to be used in this call's Do method. Any
  63316. // pending HTTP request will be aborted if the provided context is
  63317. // canceled.
  63318. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  63319. c.ctx_ = ctx
  63320. return c
  63321. }
  63322. // Header returns an http.Header that can be modified by the caller to
  63323. // add HTTP headers to the request.
  63324. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  63325. if c.header_ == nil {
  63326. c.header_ = make(http.Header)
  63327. }
  63328. return c.header_
  63329. }
  63330. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  63331. reqHeaders := make(http.Header)
  63332. for k, v := range c.header_ {
  63333. reqHeaders[k] = v
  63334. }
  63335. reqHeaders.Set("User-Agent", c.s.userAgent())
  63336. var body io.Reader = nil
  63337. c.urlParams_.Set("alt", alt)
  63338. c.urlParams_.Set("prettyPrint", "false")
  63339. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  63340. urls += "?" + c.urlParams_.Encode()
  63341. req, err := http.NewRequest("POST", urls, body)
  63342. if err != nil {
  63343. return nil, err
  63344. }
  63345. req.Header = reqHeaders
  63346. googleapi.Expand(req.URL, map[string]string{
  63347. "project": c.project,
  63348. "zone": c.zone,
  63349. "resource": c.resource,
  63350. })
  63351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63352. }
  63353. // Do executes the "compute.instances.setDeletionProtection" call.
  63354. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63355. // status code is an error. Response headers are in either
  63356. // *Operation.ServerResponse.Header or (if a response was returned at
  63357. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63358. // to check whether the returned error was because
  63359. // http.StatusNotModified was returned.
  63360. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63361. gensupport.SetOptions(c.urlParams_, opts...)
  63362. res, err := c.doRequest("json")
  63363. if res != nil && res.StatusCode == http.StatusNotModified {
  63364. if res.Body != nil {
  63365. res.Body.Close()
  63366. }
  63367. return nil, &googleapi.Error{
  63368. Code: res.StatusCode,
  63369. Header: res.Header,
  63370. }
  63371. }
  63372. if err != nil {
  63373. return nil, err
  63374. }
  63375. defer googleapi.CloseBody(res)
  63376. if err := googleapi.CheckResponse(res); err != nil {
  63377. return nil, err
  63378. }
  63379. ret := &Operation{
  63380. ServerResponse: googleapi.ServerResponse{
  63381. Header: res.Header,
  63382. HTTPStatusCode: res.StatusCode,
  63383. },
  63384. }
  63385. target := &ret
  63386. if err := gensupport.DecodeResponse(target, res); err != nil {
  63387. return nil, err
  63388. }
  63389. return ret, nil
  63390. // {
  63391. // "description": "Sets deletion protection on the instance.",
  63392. // "httpMethod": "POST",
  63393. // "id": "compute.instances.setDeletionProtection",
  63394. // "parameterOrder": [
  63395. // "project",
  63396. // "zone",
  63397. // "resource"
  63398. // ],
  63399. // "parameters": {
  63400. // "deletionProtection": {
  63401. // "default": "true",
  63402. // "description": "Whether the resource should be protected against deletion.",
  63403. // "location": "query",
  63404. // "type": "boolean"
  63405. // },
  63406. // "project": {
  63407. // "description": "Project ID for this request.",
  63408. // "location": "path",
  63409. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63410. // "required": true,
  63411. // "type": "string"
  63412. // },
  63413. // "requestId": {
  63414. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63415. // "location": "query",
  63416. // "type": "string"
  63417. // },
  63418. // "resource": {
  63419. // "description": "Name or id of the resource for this request.",
  63420. // "location": "path",
  63421. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63422. // "required": true,
  63423. // "type": "string"
  63424. // },
  63425. // "zone": {
  63426. // "description": "The name of the zone for this request.",
  63427. // "location": "path",
  63428. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63429. // "required": true,
  63430. // "type": "string"
  63431. // }
  63432. // },
  63433. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  63434. // "response": {
  63435. // "$ref": "Operation"
  63436. // },
  63437. // "scopes": [
  63438. // "https://www.googleapis.com/auth/cloud-platform",
  63439. // "https://www.googleapis.com/auth/compute"
  63440. // ]
  63441. // }
  63442. }
  63443. // method id "compute.instances.setDiskAutoDelete":
  63444. type InstancesSetDiskAutoDeleteCall struct {
  63445. s *Service
  63446. project string
  63447. zone string
  63448. instance string
  63449. urlParams_ gensupport.URLParams
  63450. ctx_ context.Context
  63451. header_ http.Header
  63452. }
  63453. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  63454. // an instance.
  63455. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  63456. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  63457. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63458. c.project = project
  63459. c.zone = zone
  63460. c.instance = instance
  63461. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  63462. c.urlParams_.Set("deviceName", deviceName)
  63463. return c
  63464. }
  63465. // RequestId sets the optional parameter "requestId": An optional
  63466. // request ID to identify requests. Specify a unique request ID so that
  63467. // if you must retry your request, the server will know to ignore the
  63468. // request if it has already been completed.
  63469. //
  63470. // For example, consider a situation where you make an initial request
  63471. // and the request times out. If you make the request again with the
  63472. // same request ID, the server can check if original operation with the
  63473. // same request ID was received, and if so, will ignore the second
  63474. // request. This prevents clients from accidentally creating duplicate
  63475. // commitments.
  63476. //
  63477. // The request ID must be a valid UUID with the exception that zero UUID
  63478. // is not supported (00000000-0000-0000-0000-000000000000).
  63479. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  63480. c.urlParams_.Set("requestId", requestId)
  63481. return c
  63482. }
  63483. // Fields allows partial responses to be retrieved. See
  63484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63485. // for more information.
  63486. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  63487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63488. return c
  63489. }
  63490. // Context sets the context to be used in this call's Do method. Any
  63491. // pending HTTP request will be aborted if the provided context is
  63492. // canceled.
  63493. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  63494. c.ctx_ = ctx
  63495. return c
  63496. }
  63497. // Header returns an http.Header that can be modified by the caller to
  63498. // add HTTP headers to the request.
  63499. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  63500. if c.header_ == nil {
  63501. c.header_ = make(http.Header)
  63502. }
  63503. return c.header_
  63504. }
  63505. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  63506. reqHeaders := make(http.Header)
  63507. for k, v := range c.header_ {
  63508. reqHeaders[k] = v
  63509. }
  63510. reqHeaders.Set("User-Agent", c.s.userAgent())
  63511. var body io.Reader = nil
  63512. c.urlParams_.Set("alt", alt)
  63513. c.urlParams_.Set("prettyPrint", "false")
  63514. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  63515. urls += "?" + c.urlParams_.Encode()
  63516. req, err := http.NewRequest("POST", urls, body)
  63517. if err != nil {
  63518. return nil, err
  63519. }
  63520. req.Header = reqHeaders
  63521. googleapi.Expand(req.URL, map[string]string{
  63522. "project": c.project,
  63523. "zone": c.zone,
  63524. "instance": c.instance,
  63525. })
  63526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63527. }
  63528. // Do executes the "compute.instances.setDiskAutoDelete" call.
  63529. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63530. // status code is an error. Response headers are in either
  63531. // *Operation.ServerResponse.Header or (if a response was returned at
  63532. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63533. // to check whether the returned error was because
  63534. // http.StatusNotModified was returned.
  63535. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63536. gensupport.SetOptions(c.urlParams_, opts...)
  63537. res, err := c.doRequest("json")
  63538. if res != nil && res.StatusCode == http.StatusNotModified {
  63539. if res.Body != nil {
  63540. res.Body.Close()
  63541. }
  63542. return nil, &googleapi.Error{
  63543. Code: res.StatusCode,
  63544. Header: res.Header,
  63545. }
  63546. }
  63547. if err != nil {
  63548. return nil, err
  63549. }
  63550. defer googleapi.CloseBody(res)
  63551. if err := googleapi.CheckResponse(res); err != nil {
  63552. return nil, err
  63553. }
  63554. ret := &Operation{
  63555. ServerResponse: googleapi.ServerResponse{
  63556. Header: res.Header,
  63557. HTTPStatusCode: res.StatusCode,
  63558. },
  63559. }
  63560. target := &ret
  63561. if err := gensupport.DecodeResponse(target, res); err != nil {
  63562. return nil, err
  63563. }
  63564. return ret, nil
  63565. // {
  63566. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  63567. // "httpMethod": "POST",
  63568. // "id": "compute.instances.setDiskAutoDelete",
  63569. // "parameterOrder": [
  63570. // "project",
  63571. // "zone",
  63572. // "instance",
  63573. // "autoDelete",
  63574. // "deviceName"
  63575. // ],
  63576. // "parameters": {
  63577. // "autoDelete": {
  63578. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  63579. // "location": "query",
  63580. // "required": true,
  63581. // "type": "boolean"
  63582. // },
  63583. // "deviceName": {
  63584. // "description": "The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.",
  63585. // "location": "query",
  63586. // "pattern": "\\w[\\w.-]{0,254}",
  63587. // "required": true,
  63588. // "type": "string"
  63589. // },
  63590. // "instance": {
  63591. // "description": "The instance name for this request.",
  63592. // "location": "path",
  63593. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63594. // "required": true,
  63595. // "type": "string"
  63596. // },
  63597. // "project": {
  63598. // "description": "Project ID for this request.",
  63599. // "location": "path",
  63600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63601. // "required": true,
  63602. // "type": "string"
  63603. // },
  63604. // "requestId": {
  63605. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63606. // "location": "query",
  63607. // "type": "string"
  63608. // },
  63609. // "zone": {
  63610. // "description": "The name of the zone for this request.",
  63611. // "location": "path",
  63612. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63613. // "required": true,
  63614. // "type": "string"
  63615. // }
  63616. // },
  63617. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  63618. // "response": {
  63619. // "$ref": "Operation"
  63620. // },
  63621. // "scopes": [
  63622. // "https://www.googleapis.com/auth/cloud-platform",
  63623. // "https://www.googleapis.com/auth/compute"
  63624. // ]
  63625. // }
  63626. }
  63627. // method id "compute.instances.setIamPolicy":
  63628. type InstancesSetIamPolicyCall struct {
  63629. s *Service
  63630. project string
  63631. zone string
  63632. resource string
  63633. zonesetpolicyrequest *ZoneSetPolicyRequest
  63634. urlParams_ gensupport.URLParams
  63635. ctx_ context.Context
  63636. header_ http.Header
  63637. }
  63638. // SetIamPolicy: Sets the access control policy on the specified
  63639. // resource. Replaces any existing policy.
  63640. func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
  63641. c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63642. c.project = project
  63643. c.zone = zone
  63644. c.resource = resource
  63645. c.zonesetpolicyrequest = zonesetpolicyrequest
  63646. return c
  63647. }
  63648. // Fields allows partial responses to be retrieved. See
  63649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63650. // for more information.
  63651. func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
  63652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63653. return c
  63654. }
  63655. // Context sets the context to be used in this call's Do method. Any
  63656. // pending HTTP request will be aborted if the provided context is
  63657. // canceled.
  63658. func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
  63659. c.ctx_ = ctx
  63660. return c
  63661. }
  63662. // Header returns an http.Header that can be modified by the caller to
  63663. // add HTTP headers to the request.
  63664. func (c *InstancesSetIamPolicyCall) Header() http.Header {
  63665. if c.header_ == nil {
  63666. c.header_ = make(http.Header)
  63667. }
  63668. return c.header_
  63669. }
  63670. func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  63671. reqHeaders := make(http.Header)
  63672. for k, v := range c.header_ {
  63673. reqHeaders[k] = v
  63674. }
  63675. reqHeaders.Set("User-Agent", c.s.userAgent())
  63676. var body io.Reader = nil
  63677. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  63678. if err != nil {
  63679. return nil, err
  63680. }
  63681. reqHeaders.Set("Content-Type", "application/json")
  63682. c.urlParams_.Set("alt", alt)
  63683. c.urlParams_.Set("prettyPrint", "false")
  63684. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setIamPolicy")
  63685. urls += "?" + c.urlParams_.Encode()
  63686. req, err := http.NewRequest("POST", urls, body)
  63687. if err != nil {
  63688. return nil, err
  63689. }
  63690. req.Header = reqHeaders
  63691. googleapi.Expand(req.URL, map[string]string{
  63692. "project": c.project,
  63693. "zone": c.zone,
  63694. "resource": c.resource,
  63695. })
  63696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63697. }
  63698. // Do executes the "compute.instances.setIamPolicy" call.
  63699. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  63700. // code is an error. Response headers are in either
  63701. // *Policy.ServerResponse.Header or (if a response was returned at all)
  63702. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  63703. // check whether the returned error was because http.StatusNotModified
  63704. // was returned.
  63705. func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  63706. gensupport.SetOptions(c.urlParams_, opts...)
  63707. res, err := c.doRequest("json")
  63708. if res != nil && res.StatusCode == http.StatusNotModified {
  63709. if res.Body != nil {
  63710. res.Body.Close()
  63711. }
  63712. return nil, &googleapi.Error{
  63713. Code: res.StatusCode,
  63714. Header: res.Header,
  63715. }
  63716. }
  63717. if err != nil {
  63718. return nil, err
  63719. }
  63720. defer googleapi.CloseBody(res)
  63721. if err := googleapi.CheckResponse(res); err != nil {
  63722. return nil, err
  63723. }
  63724. ret := &Policy{
  63725. ServerResponse: googleapi.ServerResponse{
  63726. Header: res.Header,
  63727. HTTPStatusCode: res.StatusCode,
  63728. },
  63729. }
  63730. target := &ret
  63731. if err := gensupport.DecodeResponse(target, res); err != nil {
  63732. return nil, err
  63733. }
  63734. return ret, nil
  63735. // {
  63736. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  63737. // "httpMethod": "POST",
  63738. // "id": "compute.instances.setIamPolicy",
  63739. // "parameterOrder": [
  63740. // "project",
  63741. // "zone",
  63742. // "resource"
  63743. // ],
  63744. // "parameters": {
  63745. // "project": {
  63746. // "description": "Project ID for this request.",
  63747. // "location": "path",
  63748. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63749. // "required": true,
  63750. // "type": "string"
  63751. // },
  63752. // "resource": {
  63753. // "description": "Name or id of the resource for this request.",
  63754. // "location": "path",
  63755. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63756. // "required": true,
  63757. // "type": "string"
  63758. // },
  63759. // "zone": {
  63760. // "description": "The name of the zone for this request.",
  63761. // "location": "path",
  63762. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63763. // "required": true,
  63764. // "type": "string"
  63765. // }
  63766. // },
  63767. // "path": "{project}/zones/{zone}/instances/{resource}/setIamPolicy",
  63768. // "request": {
  63769. // "$ref": "ZoneSetPolicyRequest"
  63770. // },
  63771. // "response": {
  63772. // "$ref": "Policy"
  63773. // },
  63774. // "scopes": [
  63775. // "https://www.googleapis.com/auth/cloud-platform",
  63776. // "https://www.googleapis.com/auth/compute"
  63777. // ]
  63778. // }
  63779. }
  63780. // method id "compute.instances.setLabels":
  63781. type InstancesSetLabelsCall struct {
  63782. s *Service
  63783. project string
  63784. zone string
  63785. instance string
  63786. instancessetlabelsrequest *InstancesSetLabelsRequest
  63787. urlParams_ gensupport.URLParams
  63788. ctx_ context.Context
  63789. header_ http.Header
  63790. }
  63791. // SetLabels: Sets labels on an instance. To learn more about labels,
  63792. // read the Labeling Resources documentation.
  63793. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  63794. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63795. c.project = project
  63796. c.zone = zone
  63797. c.instance = instance
  63798. c.instancessetlabelsrequest = instancessetlabelsrequest
  63799. return c
  63800. }
  63801. // RequestId sets the optional parameter "requestId": An optional
  63802. // request ID to identify requests. Specify a unique request ID so that
  63803. // if you must retry your request, the server will know to ignore the
  63804. // request if it has already been completed.
  63805. //
  63806. // For example, consider a situation where you make an initial request
  63807. // and the request times out. If you make the request again with the
  63808. // same request ID, the server can check if original operation with the
  63809. // same request ID was received, and if so, will ignore the second
  63810. // request. This prevents clients from accidentally creating duplicate
  63811. // commitments.
  63812. //
  63813. // The request ID must be a valid UUID with the exception that zero UUID
  63814. // is not supported (00000000-0000-0000-0000-000000000000).
  63815. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  63816. c.urlParams_.Set("requestId", requestId)
  63817. return c
  63818. }
  63819. // Fields allows partial responses to be retrieved. See
  63820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63821. // for more information.
  63822. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  63823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63824. return c
  63825. }
  63826. // Context sets the context to be used in this call's Do method. Any
  63827. // pending HTTP request will be aborted if the provided context is
  63828. // canceled.
  63829. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  63830. c.ctx_ = ctx
  63831. return c
  63832. }
  63833. // Header returns an http.Header that can be modified by the caller to
  63834. // add HTTP headers to the request.
  63835. func (c *InstancesSetLabelsCall) Header() http.Header {
  63836. if c.header_ == nil {
  63837. c.header_ = make(http.Header)
  63838. }
  63839. return c.header_
  63840. }
  63841. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  63842. reqHeaders := make(http.Header)
  63843. for k, v := range c.header_ {
  63844. reqHeaders[k] = v
  63845. }
  63846. reqHeaders.Set("User-Agent", c.s.userAgent())
  63847. var body io.Reader = nil
  63848. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  63849. if err != nil {
  63850. return nil, err
  63851. }
  63852. reqHeaders.Set("Content-Type", "application/json")
  63853. c.urlParams_.Set("alt", alt)
  63854. c.urlParams_.Set("prettyPrint", "false")
  63855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  63856. urls += "?" + c.urlParams_.Encode()
  63857. req, err := http.NewRequest("POST", urls, body)
  63858. if err != nil {
  63859. return nil, err
  63860. }
  63861. req.Header = reqHeaders
  63862. googleapi.Expand(req.URL, map[string]string{
  63863. "project": c.project,
  63864. "zone": c.zone,
  63865. "instance": c.instance,
  63866. })
  63867. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63868. }
  63869. // Do executes the "compute.instances.setLabels" call.
  63870. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63871. // status code is an error. Response headers are in either
  63872. // *Operation.ServerResponse.Header or (if a response was returned at
  63873. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63874. // to check whether the returned error was because
  63875. // http.StatusNotModified was returned.
  63876. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63877. gensupport.SetOptions(c.urlParams_, opts...)
  63878. res, err := c.doRequest("json")
  63879. if res != nil && res.StatusCode == http.StatusNotModified {
  63880. if res.Body != nil {
  63881. res.Body.Close()
  63882. }
  63883. return nil, &googleapi.Error{
  63884. Code: res.StatusCode,
  63885. Header: res.Header,
  63886. }
  63887. }
  63888. if err != nil {
  63889. return nil, err
  63890. }
  63891. defer googleapi.CloseBody(res)
  63892. if err := googleapi.CheckResponse(res); err != nil {
  63893. return nil, err
  63894. }
  63895. ret := &Operation{
  63896. ServerResponse: googleapi.ServerResponse{
  63897. Header: res.Header,
  63898. HTTPStatusCode: res.StatusCode,
  63899. },
  63900. }
  63901. target := &ret
  63902. if err := gensupport.DecodeResponse(target, res); err != nil {
  63903. return nil, err
  63904. }
  63905. return ret, nil
  63906. // {
  63907. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  63908. // "httpMethod": "POST",
  63909. // "id": "compute.instances.setLabels",
  63910. // "parameterOrder": [
  63911. // "project",
  63912. // "zone",
  63913. // "instance"
  63914. // ],
  63915. // "parameters": {
  63916. // "instance": {
  63917. // "description": "Name of the instance scoping this request.",
  63918. // "location": "path",
  63919. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63920. // "required": true,
  63921. // "type": "string"
  63922. // },
  63923. // "project": {
  63924. // "description": "Project ID for this request.",
  63925. // "location": "path",
  63926. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63927. // "required": true,
  63928. // "type": "string"
  63929. // },
  63930. // "requestId": {
  63931. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63932. // "location": "query",
  63933. // "type": "string"
  63934. // },
  63935. // "zone": {
  63936. // "description": "The name of the zone for this request.",
  63937. // "location": "path",
  63938. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63939. // "required": true,
  63940. // "type": "string"
  63941. // }
  63942. // },
  63943. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  63944. // "request": {
  63945. // "$ref": "InstancesSetLabelsRequest"
  63946. // },
  63947. // "response": {
  63948. // "$ref": "Operation"
  63949. // },
  63950. // "scopes": [
  63951. // "https://www.googleapis.com/auth/cloud-platform",
  63952. // "https://www.googleapis.com/auth/compute"
  63953. // ]
  63954. // }
  63955. }
  63956. // method id "compute.instances.setMachineResources":
  63957. type InstancesSetMachineResourcesCall struct {
  63958. s *Service
  63959. project string
  63960. zone string
  63961. instance string
  63962. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  63963. urlParams_ gensupport.URLParams
  63964. ctx_ context.Context
  63965. header_ http.Header
  63966. }
  63967. // SetMachineResources: Changes the number and/or type of accelerator
  63968. // for a stopped instance to the values specified in the request.
  63969. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  63970. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63971. c.project = project
  63972. c.zone = zone
  63973. c.instance = instance
  63974. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  63975. return c
  63976. }
  63977. // RequestId sets the optional parameter "requestId": An optional
  63978. // request ID to identify requests. Specify a unique request ID so that
  63979. // if you must retry your request, the server will know to ignore the
  63980. // request if it has already been completed.
  63981. //
  63982. // For example, consider a situation where you make an initial request
  63983. // and the request times out. If you make the request again with the
  63984. // same request ID, the server can check if original operation with the
  63985. // same request ID was received, and if so, will ignore the second
  63986. // request. This prevents clients from accidentally creating duplicate
  63987. // commitments.
  63988. //
  63989. // The request ID must be a valid UUID with the exception that zero UUID
  63990. // is not supported (00000000-0000-0000-0000-000000000000).
  63991. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  63992. c.urlParams_.Set("requestId", requestId)
  63993. return c
  63994. }
  63995. // Fields allows partial responses to be retrieved. See
  63996. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63997. // for more information.
  63998. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  63999. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64000. return c
  64001. }
  64002. // Context sets the context to be used in this call's Do method. Any
  64003. // pending HTTP request will be aborted if the provided context is
  64004. // canceled.
  64005. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  64006. c.ctx_ = ctx
  64007. return c
  64008. }
  64009. // Header returns an http.Header that can be modified by the caller to
  64010. // add HTTP headers to the request.
  64011. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  64012. if c.header_ == nil {
  64013. c.header_ = make(http.Header)
  64014. }
  64015. return c.header_
  64016. }
  64017. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  64018. reqHeaders := make(http.Header)
  64019. for k, v := range c.header_ {
  64020. reqHeaders[k] = v
  64021. }
  64022. reqHeaders.Set("User-Agent", c.s.userAgent())
  64023. var body io.Reader = nil
  64024. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  64025. if err != nil {
  64026. return nil, err
  64027. }
  64028. reqHeaders.Set("Content-Type", "application/json")
  64029. c.urlParams_.Set("alt", alt)
  64030. c.urlParams_.Set("prettyPrint", "false")
  64031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  64032. urls += "?" + c.urlParams_.Encode()
  64033. req, err := http.NewRequest("POST", urls, body)
  64034. if err != nil {
  64035. return nil, err
  64036. }
  64037. req.Header = reqHeaders
  64038. googleapi.Expand(req.URL, map[string]string{
  64039. "project": c.project,
  64040. "zone": c.zone,
  64041. "instance": c.instance,
  64042. })
  64043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64044. }
  64045. // Do executes the "compute.instances.setMachineResources" call.
  64046. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64047. // status code is an error. Response headers are in either
  64048. // *Operation.ServerResponse.Header or (if a response was returned at
  64049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64050. // to check whether the returned error was because
  64051. // http.StatusNotModified was returned.
  64052. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64053. gensupport.SetOptions(c.urlParams_, opts...)
  64054. res, err := c.doRequest("json")
  64055. if res != nil && res.StatusCode == http.StatusNotModified {
  64056. if res.Body != nil {
  64057. res.Body.Close()
  64058. }
  64059. return nil, &googleapi.Error{
  64060. Code: res.StatusCode,
  64061. Header: res.Header,
  64062. }
  64063. }
  64064. if err != nil {
  64065. return nil, err
  64066. }
  64067. defer googleapi.CloseBody(res)
  64068. if err := googleapi.CheckResponse(res); err != nil {
  64069. return nil, err
  64070. }
  64071. ret := &Operation{
  64072. ServerResponse: googleapi.ServerResponse{
  64073. Header: res.Header,
  64074. HTTPStatusCode: res.StatusCode,
  64075. },
  64076. }
  64077. target := &ret
  64078. if err := gensupport.DecodeResponse(target, res); err != nil {
  64079. return nil, err
  64080. }
  64081. return ret, nil
  64082. // {
  64083. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  64084. // "httpMethod": "POST",
  64085. // "id": "compute.instances.setMachineResources",
  64086. // "parameterOrder": [
  64087. // "project",
  64088. // "zone",
  64089. // "instance"
  64090. // ],
  64091. // "parameters": {
  64092. // "instance": {
  64093. // "description": "Name of the instance scoping this request.",
  64094. // "location": "path",
  64095. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64096. // "required": true,
  64097. // "type": "string"
  64098. // },
  64099. // "project": {
  64100. // "description": "Project ID for this request.",
  64101. // "location": "path",
  64102. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64103. // "required": true,
  64104. // "type": "string"
  64105. // },
  64106. // "requestId": {
  64107. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64108. // "location": "query",
  64109. // "type": "string"
  64110. // },
  64111. // "zone": {
  64112. // "description": "The name of the zone for this request.",
  64113. // "location": "path",
  64114. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64115. // "required": true,
  64116. // "type": "string"
  64117. // }
  64118. // },
  64119. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  64120. // "request": {
  64121. // "$ref": "InstancesSetMachineResourcesRequest"
  64122. // },
  64123. // "response": {
  64124. // "$ref": "Operation"
  64125. // },
  64126. // "scopes": [
  64127. // "https://www.googleapis.com/auth/cloud-platform",
  64128. // "https://www.googleapis.com/auth/compute"
  64129. // ]
  64130. // }
  64131. }
  64132. // method id "compute.instances.setMachineType":
  64133. type InstancesSetMachineTypeCall struct {
  64134. s *Service
  64135. project string
  64136. zone string
  64137. instance string
  64138. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  64139. urlParams_ gensupport.URLParams
  64140. ctx_ context.Context
  64141. header_ http.Header
  64142. }
  64143. // SetMachineType: Changes the machine type for a stopped instance to
  64144. // the machine type specified in the request.
  64145. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  64146. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64147. c.project = project
  64148. c.zone = zone
  64149. c.instance = instance
  64150. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  64151. return c
  64152. }
  64153. // RequestId sets the optional parameter "requestId": An optional
  64154. // request ID to identify requests. Specify a unique request ID so that
  64155. // if you must retry your request, the server will know to ignore the
  64156. // request if it has already been completed.
  64157. //
  64158. // For example, consider a situation where you make an initial request
  64159. // and the request times out. If you make the request again with the
  64160. // same request ID, the server can check if original operation with the
  64161. // same request ID was received, and if so, will ignore the second
  64162. // request. This prevents clients from accidentally creating duplicate
  64163. // commitments.
  64164. //
  64165. // The request ID must be a valid UUID with the exception that zero UUID
  64166. // is not supported (00000000-0000-0000-0000-000000000000).
  64167. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  64168. c.urlParams_.Set("requestId", requestId)
  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 *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  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 *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  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 *InstancesSetMachineTypeCall) Header() http.Header {
  64188. if c.header_ == nil {
  64189. c.header_ = make(http.Header)
  64190. }
  64191. return c.header_
  64192. }
  64193. func (c *InstancesSetMachineTypeCall) 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. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  64201. if err != nil {
  64202. return nil, err
  64203. }
  64204. reqHeaders.Set("Content-Type", "application/json")
  64205. c.urlParams_.Set("alt", alt)
  64206. c.urlParams_.Set("prettyPrint", "false")
  64207. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  64208. urls += "?" + c.urlParams_.Encode()
  64209. req, err := http.NewRequest("POST", urls, body)
  64210. if err != nil {
  64211. return nil, err
  64212. }
  64213. req.Header = reqHeaders
  64214. googleapi.Expand(req.URL, map[string]string{
  64215. "project": c.project,
  64216. "zone": c.zone,
  64217. "instance": c.instance,
  64218. })
  64219. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64220. }
  64221. // Do executes the "compute.instances.setMachineType" call.
  64222. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64223. // status code is an error. Response headers are in either
  64224. // *Operation.ServerResponse.Header or (if a response was returned at
  64225. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64226. // to check whether the returned error was because
  64227. // http.StatusNotModified was returned.
  64228. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64229. gensupport.SetOptions(c.urlParams_, opts...)
  64230. res, err := c.doRequest("json")
  64231. if res != nil && res.StatusCode == http.StatusNotModified {
  64232. if res.Body != nil {
  64233. res.Body.Close()
  64234. }
  64235. return nil, &googleapi.Error{
  64236. Code: res.StatusCode,
  64237. Header: res.Header,
  64238. }
  64239. }
  64240. if err != nil {
  64241. return nil, err
  64242. }
  64243. defer googleapi.CloseBody(res)
  64244. if err := googleapi.CheckResponse(res); err != nil {
  64245. return nil, err
  64246. }
  64247. ret := &Operation{
  64248. ServerResponse: googleapi.ServerResponse{
  64249. Header: res.Header,
  64250. HTTPStatusCode: res.StatusCode,
  64251. },
  64252. }
  64253. target := &ret
  64254. if err := gensupport.DecodeResponse(target, res); err != nil {
  64255. return nil, err
  64256. }
  64257. return ret, nil
  64258. // {
  64259. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  64260. // "httpMethod": "POST",
  64261. // "id": "compute.instances.setMachineType",
  64262. // "parameterOrder": [
  64263. // "project",
  64264. // "zone",
  64265. // "instance"
  64266. // ],
  64267. // "parameters": {
  64268. // "instance": {
  64269. // "description": "Name of the instance scoping this request.",
  64270. // "location": "path",
  64271. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64272. // "required": true,
  64273. // "type": "string"
  64274. // },
  64275. // "project": {
  64276. // "description": "Project ID for this request.",
  64277. // "location": "path",
  64278. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64279. // "required": true,
  64280. // "type": "string"
  64281. // },
  64282. // "requestId": {
  64283. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64284. // "location": "query",
  64285. // "type": "string"
  64286. // },
  64287. // "zone": {
  64288. // "description": "The name of the zone for this request.",
  64289. // "location": "path",
  64290. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64291. // "required": true,
  64292. // "type": "string"
  64293. // }
  64294. // },
  64295. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  64296. // "request": {
  64297. // "$ref": "InstancesSetMachineTypeRequest"
  64298. // },
  64299. // "response": {
  64300. // "$ref": "Operation"
  64301. // },
  64302. // "scopes": [
  64303. // "https://www.googleapis.com/auth/cloud-platform",
  64304. // "https://www.googleapis.com/auth/compute"
  64305. // ]
  64306. // }
  64307. }
  64308. // method id "compute.instances.setMetadata":
  64309. type InstancesSetMetadataCall struct {
  64310. s *Service
  64311. project string
  64312. zone string
  64313. instance string
  64314. metadata *Metadata
  64315. urlParams_ gensupport.URLParams
  64316. ctx_ context.Context
  64317. header_ http.Header
  64318. }
  64319. // SetMetadata: Sets metadata for the specified instance to the data
  64320. // included in the request.
  64321. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  64322. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  64323. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64324. c.project = project
  64325. c.zone = zone
  64326. c.instance = instance
  64327. c.metadata = metadata
  64328. return c
  64329. }
  64330. // RequestId sets the optional parameter "requestId": An optional
  64331. // request ID to identify requests. Specify a unique request ID so that
  64332. // if you must retry your request, the server will know to ignore the
  64333. // request if it has already been completed.
  64334. //
  64335. // For example, consider a situation where you make an initial request
  64336. // and the request times out. If you make the request again with the
  64337. // same request ID, the server can check if original operation with the
  64338. // same request ID was received, and if so, will ignore the second
  64339. // request. This prevents clients from accidentally creating duplicate
  64340. // commitments.
  64341. //
  64342. // The request ID must be a valid UUID with the exception that zero UUID
  64343. // is not supported (00000000-0000-0000-0000-000000000000).
  64344. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  64345. c.urlParams_.Set("requestId", requestId)
  64346. return c
  64347. }
  64348. // Fields allows partial responses to be retrieved. See
  64349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64350. // for more information.
  64351. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  64352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64353. return c
  64354. }
  64355. // Context sets the context to be used in this call's Do method. Any
  64356. // pending HTTP request will be aborted if the provided context is
  64357. // canceled.
  64358. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  64359. c.ctx_ = ctx
  64360. return c
  64361. }
  64362. // Header returns an http.Header that can be modified by the caller to
  64363. // add HTTP headers to the request.
  64364. func (c *InstancesSetMetadataCall) Header() http.Header {
  64365. if c.header_ == nil {
  64366. c.header_ = make(http.Header)
  64367. }
  64368. return c.header_
  64369. }
  64370. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  64371. reqHeaders := make(http.Header)
  64372. for k, v := range c.header_ {
  64373. reqHeaders[k] = v
  64374. }
  64375. reqHeaders.Set("User-Agent", c.s.userAgent())
  64376. var body io.Reader = nil
  64377. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  64378. if err != nil {
  64379. return nil, err
  64380. }
  64381. reqHeaders.Set("Content-Type", "application/json")
  64382. c.urlParams_.Set("alt", alt)
  64383. c.urlParams_.Set("prettyPrint", "false")
  64384. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  64385. urls += "?" + c.urlParams_.Encode()
  64386. req, err := http.NewRequest("POST", urls, body)
  64387. if err != nil {
  64388. return nil, err
  64389. }
  64390. req.Header = reqHeaders
  64391. googleapi.Expand(req.URL, map[string]string{
  64392. "project": c.project,
  64393. "zone": c.zone,
  64394. "instance": c.instance,
  64395. })
  64396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64397. }
  64398. // Do executes the "compute.instances.setMetadata" call.
  64399. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64400. // status code is an error. Response headers are in either
  64401. // *Operation.ServerResponse.Header or (if a response was returned at
  64402. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64403. // to check whether the returned error was because
  64404. // http.StatusNotModified was returned.
  64405. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64406. gensupport.SetOptions(c.urlParams_, opts...)
  64407. res, err := c.doRequest("json")
  64408. if res != nil && res.StatusCode == http.StatusNotModified {
  64409. if res.Body != nil {
  64410. res.Body.Close()
  64411. }
  64412. return nil, &googleapi.Error{
  64413. Code: res.StatusCode,
  64414. Header: res.Header,
  64415. }
  64416. }
  64417. if err != nil {
  64418. return nil, err
  64419. }
  64420. defer googleapi.CloseBody(res)
  64421. if err := googleapi.CheckResponse(res); err != nil {
  64422. return nil, err
  64423. }
  64424. ret := &Operation{
  64425. ServerResponse: googleapi.ServerResponse{
  64426. Header: res.Header,
  64427. HTTPStatusCode: res.StatusCode,
  64428. },
  64429. }
  64430. target := &ret
  64431. if err := gensupport.DecodeResponse(target, res); err != nil {
  64432. return nil, err
  64433. }
  64434. return ret, nil
  64435. // {
  64436. // "description": "Sets metadata for the specified instance to the data included in the request.",
  64437. // "httpMethod": "POST",
  64438. // "id": "compute.instances.setMetadata",
  64439. // "parameterOrder": [
  64440. // "project",
  64441. // "zone",
  64442. // "instance"
  64443. // ],
  64444. // "parameters": {
  64445. // "instance": {
  64446. // "description": "Name of the instance scoping this request.",
  64447. // "location": "path",
  64448. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64449. // "required": true,
  64450. // "type": "string"
  64451. // },
  64452. // "project": {
  64453. // "description": "Project ID for this request.",
  64454. // "location": "path",
  64455. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64456. // "required": true,
  64457. // "type": "string"
  64458. // },
  64459. // "requestId": {
  64460. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64461. // "location": "query",
  64462. // "type": "string"
  64463. // },
  64464. // "zone": {
  64465. // "description": "The name of the zone for this request.",
  64466. // "location": "path",
  64467. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64468. // "required": true,
  64469. // "type": "string"
  64470. // }
  64471. // },
  64472. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  64473. // "request": {
  64474. // "$ref": "Metadata"
  64475. // },
  64476. // "response": {
  64477. // "$ref": "Operation"
  64478. // },
  64479. // "scopes": [
  64480. // "https://www.googleapis.com/auth/cloud-platform",
  64481. // "https://www.googleapis.com/auth/compute"
  64482. // ]
  64483. // }
  64484. }
  64485. // method id "compute.instances.setMinCpuPlatform":
  64486. type InstancesSetMinCpuPlatformCall struct {
  64487. s *Service
  64488. project string
  64489. zone string
  64490. instance string
  64491. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  64492. urlParams_ gensupport.URLParams
  64493. ctx_ context.Context
  64494. header_ http.Header
  64495. }
  64496. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  64497. // instance should use. This method can only be called on a stopped
  64498. // instance. For more information, read Specifying a Minimum CPU
  64499. // Platform.
  64500. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  64501. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64502. c.project = project
  64503. c.zone = zone
  64504. c.instance = instance
  64505. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  64506. return c
  64507. }
  64508. // RequestId sets the optional parameter "requestId": An optional
  64509. // request ID to identify requests. Specify a unique request ID so that
  64510. // if you must retry your request, the server will know to ignore the
  64511. // request if it has already been completed.
  64512. //
  64513. // For example, consider a situation where you make an initial request
  64514. // and the request times out. If you make the request again with the
  64515. // same request ID, the server can check if original operation with the
  64516. // same request ID was received, and if so, will ignore the second
  64517. // request. This prevents clients from accidentally creating duplicate
  64518. // commitments.
  64519. //
  64520. // The request ID must be a valid UUID with the exception that zero UUID
  64521. // is not supported (00000000-0000-0000-0000-000000000000).
  64522. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  64523. c.urlParams_.Set("requestId", requestId)
  64524. return c
  64525. }
  64526. // Fields allows partial responses to be retrieved. See
  64527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64528. // for more information.
  64529. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  64530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64531. return c
  64532. }
  64533. // Context sets the context to be used in this call's Do method. Any
  64534. // pending HTTP request will be aborted if the provided context is
  64535. // canceled.
  64536. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  64537. c.ctx_ = ctx
  64538. return c
  64539. }
  64540. // Header returns an http.Header that can be modified by the caller to
  64541. // add HTTP headers to the request.
  64542. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  64543. if c.header_ == nil {
  64544. c.header_ = make(http.Header)
  64545. }
  64546. return c.header_
  64547. }
  64548. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  64549. reqHeaders := make(http.Header)
  64550. for k, v := range c.header_ {
  64551. reqHeaders[k] = v
  64552. }
  64553. reqHeaders.Set("User-Agent", c.s.userAgent())
  64554. var body io.Reader = nil
  64555. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  64556. if err != nil {
  64557. return nil, err
  64558. }
  64559. reqHeaders.Set("Content-Type", "application/json")
  64560. c.urlParams_.Set("alt", alt)
  64561. c.urlParams_.Set("prettyPrint", "false")
  64562. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  64563. urls += "?" + c.urlParams_.Encode()
  64564. req, err := http.NewRequest("POST", urls, body)
  64565. if err != nil {
  64566. return nil, err
  64567. }
  64568. req.Header = reqHeaders
  64569. googleapi.Expand(req.URL, map[string]string{
  64570. "project": c.project,
  64571. "zone": c.zone,
  64572. "instance": c.instance,
  64573. })
  64574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64575. }
  64576. // Do executes the "compute.instances.setMinCpuPlatform" call.
  64577. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64578. // status code is an error. Response headers are in either
  64579. // *Operation.ServerResponse.Header or (if a response was returned at
  64580. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64581. // to check whether the returned error was because
  64582. // http.StatusNotModified was returned.
  64583. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64584. gensupport.SetOptions(c.urlParams_, opts...)
  64585. res, err := c.doRequest("json")
  64586. if res != nil && res.StatusCode == http.StatusNotModified {
  64587. if res.Body != nil {
  64588. res.Body.Close()
  64589. }
  64590. return nil, &googleapi.Error{
  64591. Code: res.StatusCode,
  64592. Header: res.Header,
  64593. }
  64594. }
  64595. if err != nil {
  64596. return nil, err
  64597. }
  64598. defer googleapi.CloseBody(res)
  64599. if err := googleapi.CheckResponse(res); err != nil {
  64600. return nil, err
  64601. }
  64602. ret := &Operation{
  64603. ServerResponse: googleapi.ServerResponse{
  64604. Header: res.Header,
  64605. HTTPStatusCode: res.StatusCode,
  64606. },
  64607. }
  64608. target := &ret
  64609. if err := gensupport.DecodeResponse(target, res); err != nil {
  64610. return nil, err
  64611. }
  64612. return ret, nil
  64613. // {
  64614. // "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.",
  64615. // "httpMethod": "POST",
  64616. // "id": "compute.instances.setMinCpuPlatform",
  64617. // "parameterOrder": [
  64618. // "project",
  64619. // "zone",
  64620. // "instance"
  64621. // ],
  64622. // "parameters": {
  64623. // "instance": {
  64624. // "description": "Name of the instance scoping this request.",
  64625. // "location": "path",
  64626. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64627. // "required": true,
  64628. // "type": "string"
  64629. // },
  64630. // "project": {
  64631. // "description": "Project ID for this request.",
  64632. // "location": "path",
  64633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64634. // "required": true,
  64635. // "type": "string"
  64636. // },
  64637. // "requestId": {
  64638. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64639. // "location": "query",
  64640. // "type": "string"
  64641. // },
  64642. // "zone": {
  64643. // "description": "The name of the zone for this request.",
  64644. // "location": "path",
  64645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64646. // "required": true,
  64647. // "type": "string"
  64648. // }
  64649. // },
  64650. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  64651. // "request": {
  64652. // "$ref": "InstancesSetMinCpuPlatformRequest"
  64653. // },
  64654. // "response": {
  64655. // "$ref": "Operation"
  64656. // },
  64657. // "scopes": [
  64658. // "https://www.googleapis.com/auth/cloud-platform",
  64659. // "https://www.googleapis.com/auth/compute"
  64660. // ]
  64661. // }
  64662. }
  64663. // method id "compute.instances.setScheduling":
  64664. type InstancesSetSchedulingCall struct {
  64665. s *Service
  64666. project string
  64667. zone string
  64668. instance string
  64669. scheduling *Scheduling
  64670. urlParams_ gensupport.URLParams
  64671. ctx_ context.Context
  64672. header_ http.Header
  64673. }
  64674. // SetScheduling: Sets an instance's scheduling options.
  64675. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  64676. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  64677. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64678. c.project = project
  64679. c.zone = zone
  64680. c.instance = instance
  64681. c.scheduling = scheduling
  64682. return c
  64683. }
  64684. // RequestId sets the optional parameter "requestId": An optional
  64685. // request ID to identify requests. Specify a unique request ID so that
  64686. // if you must retry your request, the server will know to ignore the
  64687. // request if it has already been completed.
  64688. //
  64689. // For example, consider a situation where you make an initial request
  64690. // and the request times out. If you make the request again with the
  64691. // same request ID, the server can check if original operation with the
  64692. // same request ID was received, and if so, will ignore the second
  64693. // request. This prevents clients from accidentally creating duplicate
  64694. // commitments.
  64695. //
  64696. // The request ID must be a valid UUID with the exception that zero UUID
  64697. // is not supported (00000000-0000-0000-0000-000000000000).
  64698. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  64699. c.urlParams_.Set("requestId", requestId)
  64700. return c
  64701. }
  64702. // Fields allows partial responses to be retrieved. See
  64703. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64704. // for more information.
  64705. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  64706. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64707. return c
  64708. }
  64709. // Context sets the context to be used in this call's Do method. Any
  64710. // pending HTTP request will be aborted if the provided context is
  64711. // canceled.
  64712. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  64713. c.ctx_ = ctx
  64714. return c
  64715. }
  64716. // Header returns an http.Header that can be modified by the caller to
  64717. // add HTTP headers to the request.
  64718. func (c *InstancesSetSchedulingCall) Header() http.Header {
  64719. if c.header_ == nil {
  64720. c.header_ = make(http.Header)
  64721. }
  64722. return c.header_
  64723. }
  64724. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  64725. reqHeaders := make(http.Header)
  64726. for k, v := range c.header_ {
  64727. reqHeaders[k] = v
  64728. }
  64729. reqHeaders.Set("User-Agent", c.s.userAgent())
  64730. var body io.Reader = nil
  64731. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  64732. if err != nil {
  64733. return nil, err
  64734. }
  64735. reqHeaders.Set("Content-Type", "application/json")
  64736. c.urlParams_.Set("alt", alt)
  64737. c.urlParams_.Set("prettyPrint", "false")
  64738. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  64739. urls += "?" + c.urlParams_.Encode()
  64740. req, err := http.NewRequest("POST", urls, body)
  64741. if err != nil {
  64742. return nil, err
  64743. }
  64744. req.Header = reqHeaders
  64745. googleapi.Expand(req.URL, map[string]string{
  64746. "project": c.project,
  64747. "zone": c.zone,
  64748. "instance": c.instance,
  64749. })
  64750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64751. }
  64752. // Do executes the "compute.instances.setScheduling" call.
  64753. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64754. // status code is an error. Response headers are in either
  64755. // *Operation.ServerResponse.Header or (if a response was returned at
  64756. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64757. // to check whether the returned error was because
  64758. // http.StatusNotModified was returned.
  64759. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64760. gensupport.SetOptions(c.urlParams_, opts...)
  64761. res, err := c.doRequest("json")
  64762. if res != nil && res.StatusCode == http.StatusNotModified {
  64763. if res.Body != nil {
  64764. res.Body.Close()
  64765. }
  64766. return nil, &googleapi.Error{
  64767. Code: res.StatusCode,
  64768. Header: res.Header,
  64769. }
  64770. }
  64771. if err != nil {
  64772. return nil, err
  64773. }
  64774. defer googleapi.CloseBody(res)
  64775. if err := googleapi.CheckResponse(res); err != nil {
  64776. return nil, err
  64777. }
  64778. ret := &Operation{
  64779. ServerResponse: googleapi.ServerResponse{
  64780. Header: res.Header,
  64781. HTTPStatusCode: res.StatusCode,
  64782. },
  64783. }
  64784. target := &ret
  64785. if err := gensupport.DecodeResponse(target, res); err != nil {
  64786. return nil, err
  64787. }
  64788. return ret, nil
  64789. // {
  64790. // "description": "Sets an instance's scheduling options.",
  64791. // "httpMethod": "POST",
  64792. // "id": "compute.instances.setScheduling",
  64793. // "parameterOrder": [
  64794. // "project",
  64795. // "zone",
  64796. // "instance"
  64797. // ],
  64798. // "parameters": {
  64799. // "instance": {
  64800. // "description": "Instance name for this request.",
  64801. // "location": "path",
  64802. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64803. // "required": true,
  64804. // "type": "string"
  64805. // },
  64806. // "project": {
  64807. // "description": "Project ID for this request.",
  64808. // "location": "path",
  64809. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64810. // "required": true,
  64811. // "type": "string"
  64812. // },
  64813. // "requestId": {
  64814. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64815. // "location": "query",
  64816. // "type": "string"
  64817. // },
  64818. // "zone": {
  64819. // "description": "The name of the zone for this request.",
  64820. // "location": "path",
  64821. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64822. // "required": true,
  64823. // "type": "string"
  64824. // }
  64825. // },
  64826. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  64827. // "request": {
  64828. // "$ref": "Scheduling"
  64829. // },
  64830. // "response": {
  64831. // "$ref": "Operation"
  64832. // },
  64833. // "scopes": [
  64834. // "https://www.googleapis.com/auth/cloud-platform",
  64835. // "https://www.googleapis.com/auth/compute"
  64836. // ]
  64837. // }
  64838. }
  64839. // method id "compute.instances.setServiceAccount":
  64840. type InstancesSetServiceAccountCall struct {
  64841. s *Service
  64842. project string
  64843. zone string
  64844. instance string
  64845. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  64846. urlParams_ gensupport.URLParams
  64847. ctx_ context.Context
  64848. header_ http.Header
  64849. }
  64850. // SetServiceAccount: Sets the service account on the instance. For more
  64851. // information, read Changing the service account and access scopes for
  64852. // an instance.
  64853. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  64854. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64855. c.project = project
  64856. c.zone = zone
  64857. c.instance = instance
  64858. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  64859. return c
  64860. }
  64861. // RequestId sets the optional parameter "requestId": An optional
  64862. // request ID to identify requests. Specify a unique request ID so that
  64863. // if you must retry your request, the server will know to ignore the
  64864. // request if it has already been completed.
  64865. //
  64866. // For example, consider a situation where you make an initial request
  64867. // and the request times out. If you make the request again with the
  64868. // same request ID, the server can check if original operation with the
  64869. // same request ID was received, and if so, will ignore the second
  64870. // request. This prevents clients from accidentally creating duplicate
  64871. // commitments.
  64872. //
  64873. // The request ID must be a valid UUID with the exception that zero UUID
  64874. // is not supported (00000000-0000-0000-0000-000000000000).
  64875. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  64876. c.urlParams_.Set("requestId", requestId)
  64877. return c
  64878. }
  64879. // Fields allows partial responses to be retrieved. See
  64880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64881. // for more information.
  64882. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  64883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64884. return c
  64885. }
  64886. // Context sets the context to be used in this call's Do method. Any
  64887. // pending HTTP request will be aborted if the provided context is
  64888. // canceled.
  64889. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  64890. c.ctx_ = ctx
  64891. return c
  64892. }
  64893. // Header returns an http.Header that can be modified by the caller to
  64894. // add HTTP headers to the request.
  64895. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  64896. if c.header_ == nil {
  64897. c.header_ = make(http.Header)
  64898. }
  64899. return c.header_
  64900. }
  64901. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  64902. reqHeaders := make(http.Header)
  64903. for k, v := range c.header_ {
  64904. reqHeaders[k] = v
  64905. }
  64906. reqHeaders.Set("User-Agent", c.s.userAgent())
  64907. var body io.Reader = nil
  64908. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  64909. if err != nil {
  64910. return nil, err
  64911. }
  64912. reqHeaders.Set("Content-Type", "application/json")
  64913. c.urlParams_.Set("alt", alt)
  64914. c.urlParams_.Set("prettyPrint", "false")
  64915. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  64916. urls += "?" + c.urlParams_.Encode()
  64917. req, err := http.NewRequest("POST", urls, body)
  64918. if err != nil {
  64919. return nil, err
  64920. }
  64921. req.Header = reqHeaders
  64922. googleapi.Expand(req.URL, map[string]string{
  64923. "project": c.project,
  64924. "zone": c.zone,
  64925. "instance": c.instance,
  64926. })
  64927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64928. }
  64929. // Do executes the "compute.instances.setServiceAccount" call.
  64930. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64931. // status code is an error. Response headers are in either
  64932. // *Operation.ServerResponse.Header or (if a response was returned at
  64933. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64934. // to check whether the returned error was because
  64935. // http.StatusNotModified was returned.
  64936. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64937. gensupport.SetOptions(c.urlParams_, opts...)
  64938. res, err := c.doRequest("json")
  64939. if res != nil && res.StatusCode == http.StatusNotModified {
  64940. if res.Body != nil {
  64941. res.Body.Close()
  64942. }
  64943. return nil, &googleapi.Error{
  64944. Code: res.StatusCode,
  64945. Header: res.Header,
  64946. }
  64947. }
  64948. if err != nil {
  64949. return nil, err
  64950. }
  64951. defer googleapi.CloseBody(res)
  64952. if err := googleapi.CheckResponse(res); err != nil {
  64953. return nil, err
  64954. }
  64955. ret := &Operation{
  64956. ServerResponse: googleapi.ServerResponse{
  64957. Header: res.Header,
  64958. HTTPStatusCode: res.StatusCode,
  64959. },
  64960. }
  64961. target := &ret
  64962. if err := gensupport.DecodeResponse(target, res); err != nil {
  64963. return nil, err
  64964. }
  64965. return ret, nil
  64966. // {
  64967. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  64968. // "httpMethod": "POST",
  64969. // "id": "compute.instances.setServiceAccount",
  64970. // "parameterOrder": [
  64971. // "project",
  64972. // "zone",
  64973. // "instance"
  64974. // ],
  64975. // "parameters": {
  64976. // "instance": {
  64977. // "description": "Name of the instance resource to start.",
  64978. // "location": "path",
  64979. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64980. // "required": true,
  64981. // "type": "string"
  64982. // },
  64983. // "project": {
  64984. // "description": "Project ID for this request.",
  64985. // "location": "path",
  64986. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64987. // "required": true,
  64988. // "type": "string"
  64989. // },
  64990. // "requestId": {
  64991. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64992. // "location": "query",
  64993. // "type": "string"
  64994. // },
  64995. // "zone": {
  64996. // "description": "The name of the zone for this request.",
  64997. // "location": "path",
  64998. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64999. // "required": true,
  65000. // "type": "string"
  65001. // }
  65002. // },
  65003. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  65004. // "request": {
  65005. // "$ref": "InstancesSetServiceAccountRequest"
  65006. // },
  65007. // "response": {
  65008. // "$ref": "Operation"
  65009. // },
  65010. // "scopes": [
  65011. // "https://www.googleapis.com/auth/cloud-platform",
  65012. // "https://www.googleapis.com/auth/compute"
  65013. // ]
  65014. // }
  65015. }
  65016. // method id "compute.instances.setShieldedInstanceIntegrityPolicy":
  65017. type InstancesSetShieldedInstanceIntegrityPolicyCall struct {
  65018. s *Service
  65019. project string
  65020. zone string
  65021. instance string
  65022. shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy
  65023. urlParams_ gensupport.URLParams
  65024. ctx_ context.Context
  65025. header_ http.Header
  65026. }
  65027. // SetShieldedInstanceIntegrityPolicy: Sets the Shielded Instance
  65028. // integrity policy for an instance. You can only use this method on a
  65029. // running instance. This method supports PATCH semantics and uses the
  65030. // JSON merge patch format and processing rules.
  65031. func (r *InstancesService) SetShieldedInstanceIntegrityPolicy(project string, zone string, instance string, shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  65032. c := &InstancesSetShieldedInstanceIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65033. c.project = project
  65034. c.zone = zone
  65035. c.instance = instance
  65036. c.shieldedinstanceintegritypolicy = shieldedinstanceintegritypolicy
  65037. return c
  65038. }
  65039. // RequestId sets the optional parameter "requestId": An optional
  65040. // request ID to identify requests. Specify a unique request ID so that
  65041. // if you must retry your request, the server will know to ignore the
  65042. // request if it has already been completed.
  65043. //
  65044. // For example, consider a situation where you make an initial request
  65045. // and the request times out. If you make the request again with the
  65046. // same request ID, the server can check if original operation with the
  65047. // same request ID was received, and if so, will ignore the second
  65048. // request. This prevents clients from accidentally creating duplicate
  65049. // commitments.
  65050. //
  65051. // The request ID must be a valid UUID with the exception that zero UUID
  65052. // is not supported (00000000-0000-0000-0000-000000000000).
  65053. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  65054. c.urlParams_.Set("requestId", requestId)
  65055. return c
  65056. }
  65057. // Fields allows partial responses to be retrieved. See
  65058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65059. // for more information.
  65060. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  65061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65062. return c
  65063. }
  65064. // Context sets the context to be used in this call's Do method. Any
  65065. // pending HTTP request will be aborted if the provided context is
  65066. // canceled.
  65067. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  65068. c.ctx_ = ctx
  65069. return c
  65070. }
  65071. // Header returns an http.Header that can be modified by the caller to
  65072. // add HTTP headers to the request.
  65073. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header {
  65074. if c.header_ == nil {
  65075. c.header_ = make(http.Header)
  65076. }
  65077. return c.header_
  65078. }
  65079. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  65080. reqHeaders := make(http.Header)
  65081. for k, v := range c.header_ {
  65082. reqHeaders[k] = v
  65083. }
  65084. reqHeaders.Set("User-Agent", c.s.userAgent())
  65085. var body io.Reader = nil
  65086. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy)
  65087. if err != nil {
  65088. return nil, err
  65089. }
  65090. reqHeaders.Set("Content-Type", "application/json")
  65091. c.urlParams_.Set("alt", alt)
  65092. c.urlParams_.Set("prettyPrint", "false")
  65093. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy")
  65094. urls += "?" + c.urlParams_.Encode()
  65095. req, err := http.NewRequest("PATCH", urls, body)
  65096. if err != nil {
  65097. return nil, err
  65098. }
  65099. req.Header = reqHeaders
  65100. googleapi.Expand(req.URL, map[string]string{
  65101. "project": c.project,
  65102. "zone": c.zone,
  65103. "instance": c.instance,
  65104. })
  65105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65106. }
  65107. // Do executes the "compute.instances.setShieldedInstanceIntegrityPolicy" call.
  65108. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65109. // status code is an error. Response headers are in either
  65110. // *Operation.ServerResponse.Header or (if a response was returned at
  65111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65112. // to check whether the returned error was because
  65113. // http.StatusNotModified was returned.
  65114. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65115. gensupport.SetOptions(c.urlParams_, opts...)
  65116. res, err := c.doRequest("json")
  65117. if res != nil && res.StatusCode == http.StatusNotModified {
  65118. if res.Body != nil {
  65119. res.Body.Close()
  65120. }
  65121. return nil, &googleapi.Error{
  65122. Code: res.StatusCode,
  65123. Header: res.Header,
  65124. }
  65125. }
  65126. if err != nil {
  65127. return nil, err
  65128. }
  65129. defer googleapi.CloseBody(res)
  65130. if err := googleapi.CheckResponse(res); err != nil {
  65131. return nil, err
  65132. }
  65133. ret := &Operation{
  65134. ServerResponse: googleapi.ServerResponse{
  65135. Header: res.Header,
  65136. HTTPStatusCode: res.StatusCode,
  65137. },
  65138. }
  65139. target := &ret
  65140. if err := gensupport.DecodeResponse(target, res); err != nil {
  65141. return nil, err
  65142. }
  65143. return ret, nil
  65144. // {
  65145. // "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.",
  65146. // "httpMethod": "PATCH",
  65147. // "id": "compute.instances.setShieldedInstanceIntegrityPolicy",
  65148. // "parameterOrder": [
  65149. // "project",
  65150. // "zone",
  65151. // "instance"
  65152. // ],
  65153. // "parameters": {
  65154. // "instance": {
  65155. // "description": "Name or id of the instance scoping this request.",
  65156. // "location": "path",
  65157. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65158. // "required": true,
  65159. // "type": "string"
  65160. // },
  65161. // "project": {
  65162. // "description": "Project ID for this request.",
  65163. // "location": "path",
  65164. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65165. // "required": true,
  65166. // "type": "string"
  65167. // },
  65168. // "requestId": {
  65169. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65170. // "location": "query",
  65171. // "type": "string"
  65172. // },
  65173. // "zone": {
  65174. // "description": "The name of the zone for this request.",
  65175. // "location": "path",
  65176. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65177. // "required": true,
  65178. // "type": "string"
  65179. // }
  65180. // },
  65181. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy",
  65182. // "request": {
  65183. // "$ref": "ShieldedInstanceIntegrityPolicy"
  65184. // },
  65185. // "response": {
  65186. // "$ref": "Operation"
  65187. // },
  65188. // "scopes": [
  65189. // "https://www.googleapis.com/auth/cloud-platform",
  65190. // "https://www.googleapis.com/auth/compute"
  65191. // ]
  65192. // }
  65193. }
  65194. // method id "compute.instances.setShieldedVmIntegrityPolicy":
  65195. type InstancesSetShieldedVmIntegrityPolicyCall struct {
  65196. s *Service
  65197. project string
  65198. zone string
  65199. instance string
  65200. shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy
  65201. urlParams_ gensupport.URLParams
  65202. ctx_ context.Context
  65203. header_ http.Header
  65204. }
  65205. // SetShieldedVmIntegrityPolicy: Sets the Shielded VM integrity policy
  65206. // for a VM instance. You can only use this method on a running VM
  65207. // instance. This method supports PATCH semantics and uses the JSON
  65208. // merge patch format and processing rules.
  65209. func (r *InstancesService) SetShieldedVmIntegrityPolicy(project string, zone string, instance string, shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy) *InstancesSetShieldedVmIntegrityPolicyCall {
  65210. c := &InstancesSetShieldedVmIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65211. c.project = project
  65212. c.zone = zone
  65213. c.instance = instance
  65214. c.shieldedvmintegritypolicy = shieldedvmintegritypolicy
  65215. return c
  65216. }
  65217. // RequestId sets the optional parameter "requestId": An optional
  65218. // request ID to identify requests. Specify a unique request ID so that
  65219. // if you must retry your request, the server will know to ignore the
  65220. // request if it has already been completed.
  65221. //
  65222. // For example, consider a situation where you make an initial request
  65223. // and the request times out. If you make the request again with the
  65224. // same request ID, the server can check if original operation with the
  65225. // same request ID was received, and if so, will ignore the second
  65226. // request. This prevents clients from accidentally creating duplicate
  65227. // commitments.
  65228. //
  65229. // The request ID must be a valid UUID with the exception that zero UUID
  65230. // is not supported (00000000-0000-0000-0000-000000000000).
  65231. func (c *InstancesSetShieldedVmIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedVmIntegrityPolicyCall {
  65232. c.urlParams_.Set("requestId", requestId)
  65233. return c
  65234. }
  65235. // Fields allows partial responses to be retrieved. See
  65236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65237. // for more information.
  65238. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedVmIntegrityPolicyCall {
  65239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65240. return c
  65241. }
  65242. // Context sets the context to be used in this call's Do method. Any
  65243. // pending HTTP request will be aborted if the provided context is
  65244. // canceled.
  65245. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedVmIntegrityPolicyCall {
  65246. c.ctx_ = ctx
  65247. return c
  65248. }
  65249. // Header returns an http.Header that can be modified by the caller to
  65250. // add HTTP headers to the request.
  65251. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Header() http.Header {
  65252. if c.header_ == nil {
  65253. c.header_ = make(http.Header)
  65254. }
  65255. return c.header_
  65256. }
  65257. func (c *InstancesSetShieldedVmIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  65258. reqHeaders := make(http.Header)
  65259. for k, v := range c.header_ {
  65260. reqHeaders[k] = v
  65261. }
  65262. reqHeaders.Set("User-Agent", c.s.userAgent())
  65263. var body io.Reader = nil
  65264. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmintegritypolicy)
  65265. if err != nil {
  65266. return nil, err
  65267. }
  65268. reqHeaders.Set("Content-Type", "application/json")
  65269. c.urlParams_.Set("alt", alt)
  65270. c.urlParams_.Set("prettyPrint", "false")
  65271. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy")
  65272. urls += "?" + c.urlParams_.Encode()
  65273. req, err := http.NewRequest("PATCH", urls, body)
  65274. if err != nil {
  65275. return nil, err
  65276. }
  65277. req.Header = reqHeaders
  65278. googleapi.Expand(req.URL, map[string]string{
  65279. "project": c.project,
  65280. "zone": c.zone,
  65281. "instance": c.instance,
  65282. })
  65283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65284. }
  65285. // Do executes the "compute.instances.setShieldedVmIntegrityPolicy" call.
  65286. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65287. // status code is an error. Response headers are in either
  65288. // *Operation.ServerResponse.Header or (if a response was returned at
  65289. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65290. // to check whether the returned error was because
  65291. // http.StatusNotModified was returned.
  65292. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65293. gensupport.SetOptions(c.urlParams_, opts...)
  65294. res, err := c.doRequest("json")
  65295. if res != nil && res.StatusCode == http.StatusNotModified {
  65296. if res.Body != nil {
  65297. res.Body.Close()
  65298. }
  65299. return nil, &googleapi.Error{
  65300. Code: res.StatusCode,
  65301. Header: res.Header,
  65302. }
  65303. }
  65304. if err != nil {
  65305. return nil, err
  65306. }
  65307. defer googleapi.CloseBody(res)
  65308. if err := googleapi.CheckResponse(res); err != nil {
  65309. return nil, err
  65310. }
  65311. ret := &Operation{
  65312. ServerResponse: googleapi.ServerResponse{
  65313. Header: res.Header,
  65314. HTTPStatusCode: res.StatusCode,
  65315. },
  65316. }
  65317. target := &ret
  65318. if err := gensupport.DecodeResponse(target, res); err != nil {
  65319. return nil, err
  65320. }
  65321. return ret, nil
  65322. // {
  65323. // "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.",
  65324. // "httpMethod": "PATCH",
  65325. // "id": "compute.instances.setShieldedVmIntegrityPolicy",
  65326. // "parameterOrder": [
  65327. // "project",
  65328. // "zone",
  65329. // "instance"
  65330. // ],
  65331. // "parameters": {
  65332. // "instance": {
  65333. // "description": "Name of the instance scoping this request.",
  65334. // "location": "path",
  65335. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65336. // "required": true,
  65337. // "type": "string"
  65338. // },
  65339. // "project": {
  65340. // "description": "Project ID for this request.",
  65341. // "location": "path",
  65342. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65343. // "required": true,
  65344. // "type": "string"
  65345. // },
  65346. // "requestId": {
  65347. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65348. // "location": "query",
  65349. // "type": "string"
  65350. // },
  65351. // "zone": {
  65352. // "description": "The name of the zone for this request.",
  65353. // "location": "path",
  65354. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65355. // "required": true,
  65356. // "type": "string"
  65357. // }
  65358. // },
  65359. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy",
  65360. // "request": {
  65361. // "$ref": "ShieldedVmIntegrityPolicy"
  65362. // },
  65363. // "response": {
  65364. // "$ref": "Operation"
  65365. // },
  65366. // "scopes": [
  65367. // "https://www.googleapis.com/auth/cloud-platform",
  65368. // "https://www.googleapis.com/auth/compute"
  65369. // ]
  65370. // }
  65371. }
  65372. // method id "compute.instances.setTags":
  65373. type InstancesSetTagsCall struct {
  65374. s *Service
  65375. project string
  65376. zone string
  65377. instance string
  65378. tags *Tags
  65379. urlParams_ gensupport.URLParams
  65380. ctx_ context.Context
  65381. header_ http.Header
  65382. }
  65383. // SetTags: Sets network tags for the specified instance to the data
  65384. // included in the request.
  65385. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  65386. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  65387. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65388. c.project = project
  65389. c.zone = zone
  65390. c.instance = instance
  65391. c.tags = tags
  65392. return c
  65393. }
  65394. // RequestId sets the optional parameter "requestId": An optional
  65395. // request ID to identify requests. Specify a unique request ID so that
  65396. // if you must retry your request, the server will know to ignore the
  65397. // request if it has already been completed.
  65398. //
  65399. // For example, consider a situation where you make an initial request
  65400. // and the request times out. If you make the request again with the
  65401. // same request ID, the server can check if original operation with the
  65402. // same request ID was received, and if so, will ignore the second
  65403. // request. This prevents clients from accidentally creating duplicate
  65404. // commitments.
  65405. //
  65406. // The request ID must be a valid UUID with the exception that zero UUID
  65407. // is not supported (00000000-0000-0000-0000-000000000000).
  65408. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  65409. c.urlParams_.Set("requestId", requestId)
  65410. return c
  65411. }
  65412. // Fields allows partial responses to be retrieved. See
  65413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65414. // for more information.
  65415. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  65416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65417. return c
  65418. }
  65419. // Context sets the context to be used in this call's Do method. Any
  65420. // pending HTTP request will be aborted if the provided context is
  65421. // canceled.
  65422. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  65423. c.ctx_ = ctx
  65424. return c
  65425. }
  65426. // Header returns an http.Header that can be modified by the caller to
  65427. // add HTTP headers to the request.
  65428. func (c *InstancesSetTagsCall) Header() http.Header {
  65429. if c.header_ == nil {
  65430. c.header_ = make(http.Header)
  65431. }
  65432. return c.header_
  65433. }
  65434. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  65435. reqHeaders := make(http.Header)
  65436. for k, v := range c.header_ {
  65437. reqHeaders[k] = v
  65438. }
  65439. reqHeaders.Set("User-Agent", c.s.userAgent())
  65440. var body io.Reader = nil
  65441. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  65442. if err != nil {
  65443. return nil, err
  65444. }
  65445. reqHeaders.Set("Content-Type", "application/json")
  65446. c.urlParams_.Set("alt", alt)
  65447. c.urlParams_.Set("prettyPrint", "false")
  65448. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  65449. urls += "?" + c.urlParams_.Encode()
  65450. req, err := http.NewRequest("POST", urls, body)
  65451. if err != nil {
  65452. return nil, err
  65453. }
  65454. req.Header = reqHeaders
  65455. googleapi.Expand(req.URL, map[string]string{
  65456. "project": c.project,
  65457. "zone": c.zone,
  65458. "instance": c.instance,
  65459. })
  65460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65461. }
  65462. // Do executes the "compute.instances.setTags" call.
  65463. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65464. // status code is an error. Response headers are in either
  65465. // *Operation.ServerResponse.Header or (if a response was returned at
  65466. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65467. // to check whether the returned error was because
  65468. // http.StatusNotModified was returned.
  65469. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65470. gensupport.SetOptions(c.urlParams_, opts...)
  65471. res, err := c.doRequest("json")
  65472. if res != nil && res.StatusCode == http.StatusNotModified {
  65473. if res.Body != nil {
  65474. res.Body.Close()
  65475. }
  65476. return nil, &googleapi.Error{
  65477. Code: res.StatusCode,
  65478. Header: res.Header,
  65479. }
  65480. }
  65481. if err != nil {
  65482. return nil, err
  65483. }
  65484. defer googleapi.CloseBody(res)
  65485. if err := googleapi.CheckResponse(res); err != nil {
  65486. return nil, err
  65487. }
  65488. ret := &Operation{
  65489. ServerResponse: googleapi.ServerResponse{
  65490. Header: res.Header,
  65491. HTTPStatusCode: res.StatusCode,
  65492. },
  65493. }
  65494. target := &ret
  65495. if err := gensupport.DecodeResponse(target, res); err != nil {
  65496. return nil, err
  65497. }
  65498. return ret, nil
  65499. // {
  65500. // "description": "Sets network tags for the specified instance to the data included in the request.",
  65501. // "httpMethod": "POST",
  65502. // "id": "compute.instances.setTags",
  65503. // "parameterOrder": [
  65504. // "project",
  65505. // "zone",
  65506. // "instance"
  65507. // ],
  65508. // "parameters": {
  65509. // "instance": {
  65510. // "description": "Name of the instance scoping this request.",
  65511. // "location": "path",
  65512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65513. // "required": true,
  65514. // "type": "string"
  65515. // },
  65516. // "project": {
  65517. // "description": "Project ID for this request.",
  65518. // "location": "path",
  65519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65520. // "required": true,
  65521. // "type": "string"
  65522. // },
  65523. // "requestId": {
  65524. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65525. // "location": "query",
  65526. // "type": "string"
  65527. // },
  65528. // "zone": {
  65529. // "description": "The name of the zone for this request.",
  65530. // "location": "path",
  65531. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65532. // "required": true,
  65533. // "type": "string"
  65534. // }
  65535. // },
  65536. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  65537. // "request": {
  65538. // "$ref": "Tags"
  65539. // },
  65540. // "response": {
  65541. // "$ref": "Operation"
  65542. // },
  65543. // "scopes": [
  65544. // "https://www.googleapis.com/auth/cloud-platform",
  65545. // "https://www.googleapis.com/auth/compute"
  65546. // ]
  65547. // }
  65548. }
  65549. // method id "compute.instances.simulateMaintenanceEvent":
  65550. type InstancesSimulateMaintenanceEventCall struct {
  65551. s *Service
  65552. project string
  65553. zone string
  65554. instance string
  65555. urlParams_ gensupport.URLParams
  65556. ctx_ context.Context
  65557. header_ http.Header
  65558. }
  65559. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  65560. // instance.
  65561. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  65562. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65563. c.project = project
  65564. c.zone = zone
  65565. c.instance = instance
  65566. return c
  65567. }
  65568. // Fields allows partial responses to be retrieved. See
  65569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65570. // for more information.
  65571. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  65572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65573. return c
  65574. }
  65575. // Context sets the context to be used in this call's Do method. Any
  65576. // pending HTTP request will be aborted if the provided context is
  65577. // canceled.
  65578. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  65579. c.ctx_ = ctx
  65580. return c
  65581. }
  65582. // Header returns an http.Header that can be modified by the caller to
  65583. // add HTTP headers to the request.
  65584. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  65585. if c.header_ == nil {
  65586. c.header_ = make(http.Header)
  65587. }
  65588. return c.header_
  65589. }
  65590. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  65591. reqHeaders := make(http.Header)
  65592. for k, v := range c.header_ {
  65593. reqHeaders[k] = v
  65594. }
  65595. reqHeaders.Set("User-Agent", c.s.userAgent())
  65596. var body io.Reader = nil
  65597. c.urlParams_.Set("alt", alt)
  65598. c.urlParams_.Set("prettyPrint", "false")
  65599. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  65600. urls += "?" + c.urlParams_.Encode()
  65601. req, err := http.NewRequest("POST", urls, body)
  65602. if err != nil {
  65603. return nil, err
  65604. }
  65605. req.Header = reqHeaders
  65606. googleapi.Expand(req.URL, map[string]string{
  65607. "project": c.project,
  65608. "zone": c.zone,
  65609. "instance": c.instance,
  65610. })
  65611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65612. }
  65613. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  65614. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65615. // status code is an error. Response headers are in either
  65616. // *Operation.ServerResponse.Header or (if a response was returned at
  65617. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65618. // to check whether the returned error was because
  65619. // http.StatusNotModified was returned.
  65620. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65621. gensupport.SetOptions(c.urlParams_, opts...)
  65622. res, err := c.doRequest("json")
  65623. if res != nil && res.StatusCode == http.StatusNotModified {
  65624. if res.Body != nil {
  65625. res.Body.Close()
  65626. }
  65627. return nil, &googleapi.Error{
  65628. Code: res.StatusCode,
  65629. Header: res.Header,
  65630. }
  65631. }
  65632. if err != nil {
  65633. return nil, err
  65634. }
  65635. defer googleapi.CloseBody(res)
  65636. if err := googleapi.CheckResponse(res); err != nil {
  65637. return nil, err
  65638. }
  65639. ret := &Operation{
  65640. ServerResponse: googleapi.ServerResponse{
  65641. Header: res.Header,
  65642. HTTPStatusCode: res.StatusCode,
  65643. },
  65644. }
  65645. target := &ret
  65646. if err := gensupport.DecodeResponse(target, res); err != nil {
  65647. return nil, err
  65648. }
  65649. return ret, nil
  65650. // {
  65651. // "description": "Simulates a maintenance event on the instance.",
  65652. // "httpMethod": "POST",
  65653. // "id": "compute.instances.simulateMaintenanceEvent",
  65654. // "parameterOrder": [
  65655. // "project",
  65656. // "zone",
  65657. // "instance"
  65658. // ],
  65659. // "parameters": {
  65660. // "instance": {
  65661. // "description": "Name of the instance scoping this request.",
  65662. // "location": "path",
  65663. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65664. // "required": true,
  65665. // "type": "string"
  65666. // },
  65667. // "project": {
  65668. // "description": "Project ID for this request.",
  65669. // "location": "path",
  65670. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65671. // "required": true,
  65672. // "type": "string"
  65673. // },
  65674. // "zone": {
  65675. // "description": "The name of the zone for this request.",
  65676. // "location": "path",
  65677. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65678. // "required": true,
  65679. // "type": "string"
  65680. // }
  65681. // },
  65682. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  65683. // "response": {
  65684. // "$ref": "Operation"
  65685. // },
  65686. // "scopes": [
  65687. // "https://www.googleapis.com/auth/cloud-platform",
  65688. // "https://www.googleapis.com/auth/compute"
  65689. // ]
  65690. // }
  65691. }
  65692. // method id "compute.instances.start":
  65693. type InstancesStartCall struct {
  65694. s *Service
  65695. project string
  65696. zone string
  65697. instance string
  65698. urlParams_ gensupport.URLParams
  65699. ctx_ context.Context
  65700. header_ http.Header
  65701. }
  65702. // Start: Starts an instance that was stopped using the instances().stop
  65703. // method. For more information, see Restart an instance.
  65704. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  65705. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  65706. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65707. c.project = project
  65708. c.zone = zone
  65709. c.instance = instance
  65710. return c
  65711. }
  65712. // RequestId sets the optional parameter "requestId": An optional
  65713. // request ID to identify requests. Specify a unique request ID so that
  65714. // if you must retry your request, the server will know to ignore the
  65715. // request if it has already been completed.
  65716. //
  65717. // For example, consider a situation where you make an initial request
  65718. // and the request times out. If you make the request again with the
  65719. // same request ID, the server can check if original operation with the
  65720. // same request ID was received, and if so, will ignore the second
  65721. // request. This prevents clients from accidentally creating duplicate
  65722. // commitments.
  65723. //
  65724. // The request ID must be a valid UUID with the exception that zero UUID
  65725. // is not supported (00000000-0000-0000-0000-000000000000).
  65726. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  65727. c.urlParams_.Set("requestId", requestId)
  65728. return c
  65729. }
  65730. // Fields allows partial responses to be retrieved. See
  65731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65732. // for more information.
  65733. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  65734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65735. return c
  65736. }
  65737. // Context sets the context to be used in this call's Do method. Any
  65738. // pending HTTP request will be aborted if the provided context is
  65739. // canceled.
  65740. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  65741. c.ctx_ = ctx
  65742. return c
  65743. }
  65744. // Header returns an http.Header that can be modified by the caller to
  65745. // add HTTP headers to the request.
  65746. func (c *InstancesStartCall) Header() http.Header {
  65747. if c.header_ == nil {
  65748. c.header_ = make(http.Header)
  65749. }
  65750. return c.header_
  65751. }
  65752. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  65753. reqHeaders := make(http.Header)
  65754. for k, v := range c.header_ {
  65755. reqHeaders[k] = v
  65756. }
  65757. reqHeaders.Set("User-Agent", c.s.userAgent())
  65758. var body io.Reader = nil
  65759. c.urlParams_.Set("alt", alt)
  65760. c.urlParams_.Set("prettyPrint", "false")
  65761. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  65762. urls += "?" + c.urlParams_.Encode()
  65763. req, err := http.NewRequest("POST", urls, body)
  65764. if err != nil {
  65765. return nil, err
  65766. }
  65767. req.Header = reqHeaders
  65768. googleapi.Expand(req.URL, map[string]string{
  65769. "project": c.project,
  65770. "zone": c.zone,
  65771. "instance": c.instance,
  65772. })
  65773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65774. }
  65775. // Do executes the "compute.instances.start" call.
  65776. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65777. // status code is an error. Response headers are in either
  65778. // *Operation.ServerResponse.Header or (if a response was returned at
  65779. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65780. // to check whether the returned error was because
  65781. // http.StatusNotModified was returned.
  65782. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65783. gensupport.SetOptions(c.urlParams_, opts...)
  65784. res, err := c.doRequest("json")
  65785. if res != nil && res.StatusCode == http.StatusNotModified {
  65786. if res.Body != nil {
  65787. res.Body.Close()
  65788. }
  65789. return nil, &googleapi.Error{
  65790. Code: res.StatusCode,
  65791. Header: res.Header,
  65792. }
  65793. }
  65794. if err != nil {
  65795. return nil, err
  65796. }
  65797. defer googleapi.CloseBody(res)
  65798. if err := googleapi.CheckResponse(res); err != nil {
  65799. return nil, err
  65800. }
  65801. ret := &Operation{
  65802. ServerResponse: googleapi.ServerResponse{
  65803. Header: res.Header,
  65804. HTTPStatusCode: res.StatusCode,
  65805. },
  65806. }
  65807. target := &ret
  65808. if err := gensupport.DecodeResponse(target, res); err != nil {
  65809. return nil, err
  65810. }
  65811. return ret, nil
  65812. // {
  65813. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  65814. // "httpMethod": "POST",
  65815. // "id": "compute.instances.start",
  65816. // "parameterOrder": [
  65817. // "project",
  65818. // "zone",
  65819. // "instance"
  65820. // ],
  65821. // "parameters": {
  65822. // "instance": {
  65823. // "description": "Name of the instance resource to start.",
  65824. // "location": "path",
  65825. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65826. // "required": true,
  65827. // "type": "string"
  65828. // },
  65829. // "project": {
  65830. // "description": "Project ID for this request.",
  65831. // "location": "path",
  65832. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65833. // "required": true,
  65834. // "type": "string"
  65835. // },
  65836. // "requestId": {
  65837. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65838. // "location": "query",
  65839. // "type": "string"
  65840. // },
  65841. // "zone": {
  65842. // "description": "The name of the zone for this request.",
  65843. // "location": "path",
  65844. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65845. // "required": true,
  65846. // "type": "string"
  65847. // }
  65848. // },
  65849. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  65850. // "response": {
  65851. // "$ref": "Operation"
  65852. // },
  65853. // "scopes": [
  65854. // "https://www.googleapis.com/auth/cloud-platform",
  65855. // "https://www.googleapis.com/auth/compute"
  65856. // ]
  65857. // }
  65858. }
  65859. // method id "compute.instances.startWithEncryptionKey":
  65860. type InstancesStartWithEncryptionKeyCall struct {
  65861. s *Service
  65862. project string
  65863. zone string
  65864. instance string
  65865. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  65866. urlParams_ gensupport.URLParams
  65867. ctx_ context.Context
  65868. header_ http.Header
  65869. }
  65870. // StartWithEncryptionKey: Starts an instance that was stopped using the
  65871. // instances().stop method. For more information, see Restart an
  65872. // instance.
  65873. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  65874. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65875. c.project = project
  65876. c.zone = zone
  65877. c.instance = instance
  65878. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  65879. return c
  65880. }
  65881. // RequestId sets the optional parameter "requestId": An optional
  65882. // request ID to identify requests. Specify a unique request ID so that
  65883. // if you must retry your request, the server will know to ignore the
  65884. // request if it has already been completed.
  65885. //
  65886. // For example, consider a situation where you make an initial request
  65887. // and the request times out. If you make the request again with the
  65888. // same request ID, the server can check if original operation with the
  65889. // same request ID was received, and if so, will ignore the second
  65890. // request. This prevents clients from accidentally creating duplicate
  65891. // commitments.
  65892. //
  65893. // The request ID must be a valid UUID with the exception that zero UUID
  65894. // is not supported (00000000-0000-0000-0000-000000000000).
  65895. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  65896. c.urlParams_.Set("requestId", requestId)
  65897. return c
  65898. }
  65899. // Fields allows partial responses to be retrieved. See
  65900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65901. // for more information.
  65902. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  65903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65904. return c
  65905. }
  65906. // Context sets the context to be used in this call's Do method. Any
  65907. // pending HTTP request will be aborted if the provided context is
  65908. // canceled.
  65909. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  65910. c.ctx_ = ctx
  65911. return c
  65912. }
  65913. // Header returns an http.Header that can be modified by the caller to
  65914. // add HTTP headers to the request.
  65915. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  65916. if c.header_ == nil {
  65917. c.header_ = make(http.Header)
  65918. }
  65919. return c.header_
  65920. }
  65921. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  65922. reqHeaders := make(http.Header)
  65923. for k, v := range c.header_ {
  65924. reqHeaders[k] = v
  65925. }
  65926. reqHeaders.Set("User-Agent", c.s.userAgent())
  65927. var body io.Reader = nil
  65928. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  65929. if err != nil {
  65930. return nil, err
  65931. }
  65932. reqHeaders.Set("Content-Type", "application/json")
  65933. c.urlParams_.Set("alt", alt)
  65934. c.urlParams_.Set("prettyPrint", "false")
  65935. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  65936. urls += "?" + c.urlParams_.Encode()
  65937. req, err := http.NewRequest("POST", urls, body)
  65938. if err != nil {
  65939. return nil, err
  65940. }
  65941. req.Header = reqHeaders
  65942. googleapi.Expand(req.URL, map[string]string{
  65943. "project": c.project,
  65944. "zone": c.zone,
  65945. "instance": c.instance,
  65946. })
  65947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65948. }
  65949. // Do executes the "compute.instances.startWithEncryptionKey" call.
  65950. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65951. // status code is an error. Response headers are in either
  65952. // *Operation.ServerResponse.Header or (if a response was returned at
  65953. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65954. // to check whether the returned error was because
  65955. // http.StatusNotModified was returned.
  65956. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65957. gensupport.SetOptions(c.urlParams_, opts...)
  65958. res, err := c.doRequest("json")
  65959. if res != nil && res.StatusCode == http.StatusNotModified {
  65960. if res.Body != nil {
  65961. res.Body.Close()
  65962. }
  65963. return nil, &googleapi.Error{
  65964. Code: res.StatusCode,
  65965. Header: res.Header,
  65966. }
  65967. }
  65968. if err != nil {
  65969. return nil, err
  65970. }
  65971. defer googleapi.CloseBody(res)
  65972. if err := googleapi.CheckResponse(res); err != nil {
  65973. return nil, err
  65974. }
  65975. ret := &Operation{
  65976. ServerResponse: googleapi.ServerResponse{
  65977. Header: res.Header,
  65978. HTTPStatusCode: res.StatusCode,
  65979. },
  65980. }
  65981. target := &ret
  65982. if err := gensupport.DecodeResponse(target, res); err != nil {
  65983. return nil, err
  65984. }
  65985. return ret, nil
  65986. // {
  65987. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  65988. // "httpMethod": "POST",
  65989. // "id": "compute.instances.startWithEncryptionKey",
  65990. // "parameterOrder": [
  65991. // "project",
  65992. // "zone",
  65993. // "instance"
  65994. // ],
  65995. // "parameters": {
  65996. // "instance": {
  65997. // "description": "Name of the instance resource to start.",
  65998. // "location": "path",
  65999. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66000. // "required": true,
  66001. // "type": "string"
  66002. // },
  66003. // "project": {
  66004. // "description": "Project ID for this request.",
  66005. // "location": "path",
  66006. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66007. // "required": true,
  66008. // "type": "string"
  66009. // },
  66010. // "requestId": {
  66011. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66012. // "location": "query",
  66013. // "type": "string"
  66014. // },
  66015. // "zone": {
  66016. // "description": "The name of the zone for this request.",
  66017. // "location": "path",
  66018. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66019. // "required": true,
  66020. // "type": "string"
  66021. // }
  66022. // },
  66023. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  66024. // "request": {
  66025. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  66026. // },
  66027. // "response": {
  66028. // "$ref": "Operation"
  66029. // },
  66030. // "scopes": [
  66031. // "https://www.googleapis.com/auth/cloud-platform",
  66032. // "https://www.googleapis.com/auth/compute"
  66033. // ]
  66034. // }
  66035. }
  66036. // method id "compute.instances.stop":
  66037. type InstancesStopCall struct {
  66038. s *Service
  66039. project string
  66040. zone string
  66041. instance string
  66042. urlParams_ gensupport.URLParams
  66043. ctx_ context.Context
  66044. header_ http.Header
  66045. }
  66046. // Stop: Stops a running instance, shutting it down cleanly, and allows
  66047. // you to restart the instance at a later time. Stopped instances do not
  66048. // incur VM usage charges while they are stopped. However, resources
  66049. // that the VM is using, such as persistent disks and static IP
  66050. // addresses, will continue to be charged until they are deleted. For
  66051. // more information, see Stopping an instance.
  66052. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  66053. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  66054. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66055. c.project = project
  66056. c.zone = zone
  66057. c.instance = instance
  66058. return c
  66059. }
  66060. // RequestId sets the optional parameter "requestId": An optional
  66061. // request ID to identify requests. Specify a unique request ID so that
  66062. // if you must retry your request, the server will know to ignore the
  66063. // request if it has already been completed.
  66064. //
  66065. // For example, consider a situation where you make an initial request
  66066. // and the request times out. If you make the request again with the
  66067. // same request ID, the server can check if original operation with the
  66068. // same request ID was received, and if so, will ignore the second
  66069. // request. This prevents clients from accidentally creating duplicate
  66070. // commitments.
  66071. //
  66072. // The request ID must be a valid UUID with the exception that zero UUID
  66073. // is not supported (00000000-0000-0000-0000-000000000000).
  66074. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  66075. c.urlParams_.Set("requestId", requestId)
  66076. return c
  66077. }
  66078. // Fields allows partial responses to be retrieved. See
  66079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66080. // for more information.
  66081. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  66082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66083. return c
  66084. }
  66085. // Context sets the context to be used in this call's Do method. Any
  66086. // pending HTTP request will be aborted if the provided context is
  66087. // canceled.
  66088. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  66089. c.ctx_ = ctx
  66090. return c
  66091. }
  66092. // Header returns an http.Header that can be modified by the caller to
  66093. // add HTTP headers to the request.
  66094. func (c *InstancesStopCall) Header() http.Header {
  66095. if c.header_ == nil {
  66096. c.header_ = make(http.Header)
  66097. }
  66098. return c.header_
  66099. }
  66100. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  66101. reqHeaders := make(http.Header)
  66102. for k, v := range c.header_ {
  66103. reqHeaders[k] = v
  66104. }
  66105. reqHeaders.Set("User-Agent", c.s.userAgent())
  66106. var body io.Reader = nil
  66107. c.urlParams_.Set("alt", alt)
  66108. c.urlParams_.Set("prettyPrint", "false")
  66109. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  66110. urls += "?" + c.urlParams_.Encode()
  66111. req, err := http.NewRequest("POST", urls, body)
  66112. if err != nil {
  66113. return nil, err
  66114. }
  66115. req.Header = reqHeaders
  66116. googleapi.Expand(req.URL, map[string]string{
  66117. "project": c.project,
  66118. "zone": c.zone,
  66119. "instance": c.instance,
  66120. })
  66121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66122. }
  66123. // Do executes the "compute.instances.stop" call.
  66124. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66125. // status code is an error. Response headers are in either
  66126. // *Operation.ServerResponse.Header or (if a response was returned at
  66127. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66128. // to check whether the returned error was because
  66129. // http.StatusNotModified was returned.
  66130. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66131. gensupport.SetOptions(c.urlParams_, opts...)
  66132. res, err := c.doRequest("json")
  66133. if res != nil && res.StatusCode == http.StatusNotModified {
  66134. if res.Body != nil {
  66135. res.Body.Close()
  66136. }
  66137. return nil, &googleapi.Error{
  66138. Code: res.StatusCode,
  66139. Header: res.Header,
  66140. }
  66141. }
  66142. if err != nil {
  66143. return nil, err
  66144. }
  66145. defer googleapi.CloseBody(res)
  66146. if err := googleapi.CheckResponse(res); err != nil {
  66147. return nil, err
  66148. }
  66149. ret := &Operation{
  66150. ServerResponse: googleapi.ServerResponse{
  66151. Header: res.Header,
  66152. HTTPStatusCode: res.StatusCode,
  66153. },
  66154. }
  66155. target := &ret
  66156. if err := gensupport.DecodeResponse(target, res); err != nil {
  66157. return nil, err
  66158. }
  66159. return ret, nil
  66160. // {
  66161. // "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.",
  66162. // "httpMethod": "POST",
  66163. // "id": "compute.instances.stop",
  66164. // "parameterOrder": [
  66165. // "project",
  66166. // "zone",
  66167. // "instance"
  66168. // ],
  66169. // "parameters": {
  66170. // "instance": {
  66171. // "description": "Name of the instance resource to stop.",
  66172. // "location": "path",
  66173. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66174. // "required": true,
  66175. // "type": "string"
  66176. // },
  66177. // "project": {
  66178. // "description": "Project ID for this request.",
  66179. // "location": "path",
  66180. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66181. // "required": true,
  66182. // "type": "string"
  66183. // },
  66184. // "requestId": {
  66185. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66186. // "location": "query",
  66187. // "type": "string"
  66188. // },
  66189. // "zone": {
  66190. // "description": "The name of the zone for this request.",
  66191. // "location": "path",
  66192. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66193. // "required": true,
  66194. // "type": "string"
  66195. // }
  66196. // },
  66197. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  66198. // "response": {
  66199. // "$ref": "Operation"
  66200. // },
  66201. // "scopes": [
  66202. // "https://www.googleapis.com/auth/cloud-platform",
  66203. // "https://www.googleapis.com/auth/compute"
  66204. // ]
  66205. // }
  66206. }
  66207. // method id "compute.instances.suspend":
  66208. type InstancesSuspendCall struct {
  66209. s *Service
  66210. project string
  66211. zone string
  66212. instance string
  66213. urlParams_ gensupport.URLParams
  66214. ctx_ context.Context
  66215. header_ http.Header
  66216. }
  66217. // Suspend: This method suspends a running instance, saving its state to
  66218. // persistent storage, and allows you to resume the instance at a later
  66219. // time. Suspended instances incur reduced per-minute, virtual machine
  66220. // usage charges while they are suspended. Any resources the virtual
  66221. // machine is using, such as persistent disks and static IP addresses,
  66222. // will continue to be charged until they are deleted.
  66223. func (r *InstancesService) Suspend(project string, zone string, instance string) *InstancesSuspendCall {
  66224. c := &InstancesSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66225. c.project = project
  66226. c.zone = zone
  66227. c.instance = instance
  66228. return c
  66229. }
  66230. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  66231. // true, discard the contents of any attached localSSD partitions.
  66232. // Default value is false (== preserve localSSD data).
  66233. func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesSuspendCall {
  66234. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  66235. return c
  66236. }
  66237. // RequestId sets the optional parameter "requestId": An optional
  66238. // request ID to identify requests. Specify a unique request ID so that
  66239. // if you must retry your request, the server will know to ignore the
  66240. // request if it has already been completed.
  66241. //
  66242. // For example, consider a situation where you make an initial request
  66243. // and the request times out. If you make the request again with the
  66244. // same request ID, the server can check if original operation with the
  66245. // same request ID was received, and if so, will ignore the second
  66246. // request. This prevents clients from accidentally creating duplicate
  66247. // commitments.
  66248. //
  66249. // The request ID must be a valid UUID with the exception that zero UUID
  66250. // is not supported (00000000-0000-0000-0000-000000000000).
  66251. func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall {
  66252. c.urlParams_.Set("requestId", requestId)
  66253. return c
  66254. }
  66255. // Fields allows partial responses to be retrieved. See
  66256. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66257. // for more information.
  66258. func (c *InstancesSuspendCall) Fields(s ...googleapi.Field) *InstancesSuspendCall {
  66259. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66260. return c
  66261. }
  66262. // Context sets the context to be used in this call's Do method. Any
  66263. // pending HTTP request will be aborted if the provided context is
  66264. // canceled.
  66265. func (c *InstancesSuspendCall) Context(ctx context.Context) *InstancesSuspendCall {
  66266. c.ctx_ = ctx
  66267. return c
  66268. }
  66269. // Header returns an http.Header that can be modified by the caller to
  66270. // add HTTP headers to the request.
  66271. func (c *InstancesSuspendCall) Header() http.Header {
  66272. if c.header_ == nil {
  66273. c.header_ = make(http.Header)
  66274. }
  66275. return c.header_
  66276. }
  66277. func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) {
  66278. reqHeaders := make(http.Header)
  66279. for k, v := range c.header_ {
  66280. reqHeaders[k] = v
  66281. }
  66282. reqHeaders.Set("User-Agent", c.s.userAgent())
  66283. var body io.Reader = nil
  66284. c.urlParams_.Set("alt", alt)
  66285. c.urlParams_.Set("prettyPrint", "false")
  66286. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/suspend")
  66287. urls += "?" + c.urlParams_.Encode()
  66288. req, err := http.NewRequest("POST", urls, body)
  66289. if err != nil {
  66290. return nil, err
  66291. }
  66292. req.Header = reqHeaders
  66293. googleapi.Expand(req.URL, map[string]string{
  66294. "project": c.project,
  66295. "zone": c.zone,
  66296. "instance": c.instance,
  66297. })
  66298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66299. }
  66300. // Do executes the "compute.instances.suspend" call.
  66301. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66302. // status code is an error. Response headers are in either
  66303. // *Operation.ServerResponse.Header or (if a response was returned at
  66304. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66305. // to check whether the returned error was because
  66306. // http.StatusNotModified was returned.
  66307. func (c *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66308. gensupport.SetOptions(c.urlParams_, opts...)
  66309. res, err := c.doRequest("json")
  66310. if res != nil && res.StatusCode == http.StatusNotModified {
  66311. if res.Body != nil {
  66312. res.Body.Close()
  66313. }
  66314. return nil, &googleapi.Error{
  66315. Code: res.StatusCode,
  66316. Header: res.Header,
  66317. }
  66318. }
  66319. if err != nil {
  66320. return nil, err
  66321. }
  66322. defer googleapi.CloseBody(res)
  66323. if err := googleapi.CheckResponse(res); err != nil {
  66324. return nil, err
  66325. }
  66326. ret := &Operation{
  66327. ServerResponse: googleapi.ServerResponse{
  66328. Header: res.Header,
  66329. HTTPStatusCode: res.StatusCode,
  66330. },
  66331. }
  66332. target := &ret
  66333. if err := gensupport.DecodeResponse(target, res); err != nil {
  66334. return nil, err
  66335. }
  66336. return ret, nil
  66337. // {
  66338. // "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.",
  66339. // "httpMethod": "POST",
  66340. // "id": "compute.instances.suspend",
  66341. // "parameterOrder": [
  66342. // "project",
  66343. // "zone",
  66344. // "instance"
  66345. // ],
  66346. // "parameters": {
  66347. // "discardLocalSsd": {
  66348. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  66349. // "location": "query",
  66350. // "type": "boolean"
  66351. // },
  66352. // "instance": {
  66353. // "description": "Name of the instance resource to suspend.",
  66354. // "location": "path",
  66355. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66356. // "required": true,
  66357. // "type": "string"
  66358. // },
  66359. // "project": {
  66360. // "description": "Project ID for this request.",
  66361. // "location": "path",
  66362. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66363. // "required": true,
  66364. // "type": "string"
  66365. // },
  66366. // "requestId": {
  66367. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66368. // "location": "query",
  66369. // "type": "string"
  66370. // },
  66371. // "zone": {
  66372. // "description": "The name of the zone for this request.",
  66373. // "location": "path",
  66374. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66375. // "required": true,
  66376. // "type": "string"
  66377. // }
  66378. // },
  66379. // "path": "{project}/zones/{zone}/instances/{instance}/suspend",
  66380. // "response": {
  66381. // "$ref": "Operation"
  66382. // },
  66383. // "scopes": [
  66384. // "https://www.googleapis.com/auth/cloud-platform",
  66385. // "https://www.googleapis.com/auth/compute"
  66386. // ]
  66387. // }
  66388. }
  66389. // method id "compute.instances.testIamPermissions":
  66390. type InstancesTestIamPermissionsCall struct {
  66391. s *Service
  66392. project string
  66393. zone string
  66394. resource string
  66395. testpermissionsrequest *TestPermissionsRequest
  66396. urlParams_ gensupport.URLParams
  66397. ctx_ context.Context
  66398. header_ http.Header
  66399. }
  66400. // TestIamPermissions: Returns permissions that a caller has on the
  66401. // specified resource.
  66402. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  66403. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66404. c.project = project
  66405. c.zone = zone
  66406. c.resource = resource
  66407. c.testpermissionsrequest = testpermissionsrequest
  66408. return c
  66409. }
  66410. // Fields allows partial responses to be retrieved. See
  66411. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66412. // for more information.
  66413. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  66414. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66415. return c
  66416. }
  66417. // Context sets the context to be used in this call's Do method. Any
  66418. // pending HTTP request will be aborted if the provided context is
  66419. // canceled.
  66420. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  66421. c.ctx_ = ctx
  66422. return c
  66423. }
  66424. // Header returns an http.Header that can be modified by the caller to
  66425. // add HTTP headers to the request.
  66426. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  66427. if c.header_ == nil {
  66428. c.header_ = make(http.Header)
  66429. }
  66430. return c.header_
  66431. }
  66432. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  66433. reqHeaders := make(http.Header)
  66434. for k, v := range c.header_ {
  66435. reqHeaders[k] = v
  66436. }
  66437. reqHeaders.Set("User-Agent", c.s.userAgent())
  66438. var body io.Reader = nil
  66439. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  66440. if err != nil {
  66441. return nil, err
  66442. }
  66443. reqHeaders.Set("Content-Type", "application/json")
  66444. c.urlParams_.Set("alt", alt)
  66445. c.urlParams_.Set("prettyPrint", "false")
  66446. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  66447. urls += "?" + c.urlParams_.Encode()
  66448. req, err := http.NewRequest("POST", urls, body)
  66449. if err != nil {
  66450. return nil, err
  66451. }
  66452. req.Header = reqHeaders
  66453. googleapi.Expand(req.URL, map[string]string{
  66454. "project": c.project,
  66455. "zone": c.zone,
  66456. "resource": c.resource,
  66457. })
  66458. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66459. }
  66460. // Do executes the "compute.instances.testIamPermissions" call.
  66461. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  66462. // non-2xx status code is an error. Response headers are in either
  66463. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  66464. // returned at all) in error.(*googleapi.Error).Header. Use
  66465. // googleapi.IsNotModified to check whether the returned error was
  66466. // because http.StatusNotModified was returned.
  66467. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  66468. gensupport.SetOptions(c.urlParams_, opts...)
  66469. res, err := c.doRequest("json")
  66470. if res != nil && res.StatusCode == http.StatusNotModified {
  66471. if res.Body != nil {
  66472. res.Body.Close()
  66473. }
  66474. return nil, &googleapi.Error{
  66475. Code: res.StatusCode,
  66476. Header: res.Header,
  66477. }
  66478. }
  66479. if err != nil {
  66480. return nil, err
  66481. }
  66482. defer googleapi.CloseBody(res)
  66483. if err := googleapi.CheckResponse(res); err != nil {
  66484. return nil, err
  66485. }
  66486. ret := &TestPermissionsResponse{
  66487. ServerResponse: googleapi.ServerResponse{
  66488. Header: res.Header,
  66489. HTTPStatusCode: res.StatusCode,
  66490. },
  66491. }
  66492. target := &ret
  66493. if err := gensupport.DecodeResponse(target, res); err != nil {
  66494. return nil, err
  66495. }
  66496. return ret, nil
  66497. // {
  66498. // "description": "Returns permissions that a caller has on the specified resource.",
  66499. // "httpMethod": "POST",
  66500. // "id": "compute.instances.testIamPermissions",
  66501. // "parameterOrder": [
  66502. // "project",
  66503. // "zone",
  66504. // "resource"
  66505. // ],
  66506. // "parameters": {
  66507. // "project": {
  66508. // "description": "Project ID for this request.",
  66509. // "location": "path",
  66510. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66511. // "required": true,
  66512. // "type": "string"
  66513. // },
  66514. // "resource": {
  66515. // "description": "Name or id of the resource for this request.",
  66516. // "location": "path",
  66517. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66518. // "required": true,
  66519. // "type": "string"
  66520. // },
  66521. // "zone": {
  66522. // "description": "The name of the zone for this request.",
  66523. // "location": "path",
  66524. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66525. // "required": true,
  66526. // "type": "string"
  66527. // }
  66528. // },
  66529. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  66530. // "request": {
  66531. // "$ref": "TestPermissionsRequest"
  66532. // },
  66533. // "response": {
  66534. // "$ref": "TestPermissionsResponse"
  66535. // },
  66536. // "scopes": [
  66537. // "https://www.googleapis.com/auth/cloud-platform",
  66538. // "https://www.googleapis.com/auth/compute",
  66539. // "https://www.googleapis.com/auth/compute.readonly"
  66540. // ]
  66541. // }
  66542. }
  66543. // method id "compute.instances.updateAccessConfig":
  66544. type InstancesUpdateAccessConfigCall struct {
  66545. s *Service
  66546. project string
  66547. zone string
  66548. instance string
  66549. accessconfig *AccessConfig
  66550. urlParams_ gensupport.URLParams
  66551. ctx_ context.Context
  66552. header_ http.Header
  66553. }
  66554. // UpdateAccessConfig: Updates the specified access config from an
  66555. // instance's network interface with the data included in the request.
  66556. // This method supports PATCH semantics and uses the JSON merge patch
  66557. // format and processing rules.
  66558. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  66559. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66560. c.project = project
  66561. c.zone = zone
  66562. c.instance = instance
  66563. c.urlParams_.Set("networkInterface", networkInterface)
  66564. c.accessconfig = accessconfig
  66565. return c
  66566. }
  66567. // RequestId sets the optional parameter "requestId": An optional
  66568. // request ID to identify requests. Specify a unique request ID so that
  66569. // if you must retry your request, the server will know to ignore the
  66570. // request if it has already been completed.
  66571. //
  66572. // For example, consider a situation where you make an initial request
  66573. // and the request times out. If you make the request again with the
  66574. // same request ID, the server can check if original operation with the
  66575. // same request ID was received, and if so, will ignore the second
  66576. // request. This prevents clients from accidentally creating duplicate
  66577. // commitments.
  66578. //
  66579. // The request ID must be a valid UUID with the exception that zero UUID
  66580. // is not supported (00000000-0000-0000-0000-000000000000).
  66581. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  66582. c.urlParams_.Set("requestId", requestId)
  66583. return c
  66584. }
  66585. // Fields allows partial responses to be retrieved. See
  66586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66587. // for more information.
  66588. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  66589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66590. return c
  66591. }
  66592. // Context sets the context to be used in this call's Do method. Any
  66593. // pending HTTP request will be aborted if the provided context is
  66594. // canceled.
  66595. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  66596. c.ctx_ = ctx
  66597. return c
  66598. }
  66599. // Header returns an http.Header that can be modified by the caller to
  66600. // add HTTP headers to the request.
  66601. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  66602. if c.header_ == nil {
  66603. c.header_ = make(http.Header)
  66604. }
  66605. return c.header_
  66606. }
  66607. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  66608. reqHeaders := make(http.Header)
  66609. for k, v := range c.header_ {
  66610. reqHeaders[k] = v
  66611. }
  66612. reqHeaders.Set("User-Agent", c.s.userAgent())
  66613. var body io.Reader = nil
  66614. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  66615. if err != nil {
  66616. return nil, err
  66617. }
  66618. reqHeaders.Set("Content-Type", "application/json")
  66619. c.urlParams_.Set("alt", alt)
  66620. c.urlParams_.Set("prettyPrint", "false")
  66621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  66622. urls += "?" + c.urlParams_.Encode()
  66623. req, err := http.NewRequest("POST", urls, body)
  66624. if err != nil {
  66625. return nil, err
  66626. }
  66627. req.Header = reqHeaders
  66628. googleapi.Expand(req.URL, map[string]string{
  66629. "project": c.project,
  66630. "zone": c.zone,
  66631. "instance": c.instance,
  66632. })
  66633. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66634. }
  66635. // Do executes the "compute.instances.updateAccessConfig" call.
  66636. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66637. // status code is an error. Response headers are in either
  66638. // *Operation.ServerResponse.Header or (if a response was returned at
  66639. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66640. // to check whether the returned error was because
  66641. // http.StatusNotModified was returned.
  66642. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66643. gensupport.SetOptions(c.urlParams_, opts...)
  66644. res, err := c.doRequest("json")
  66645. if res != nil && res.StatusCode == http.StatusNotModified {
  66646. if res.Body != nil {
  66647. res.Body.Close()
  66648. }
  66649. return nil, &googleapi.Error{
  66650. Code: res.StatusCode,
  66651. Header: res.Header,
  66652. }
  66653. }
  66654. if err != nil {
  66655. return nil, err
  66656. }
  66657. defer googleapi.CloseBody(res)
  66658. if err := googleapi.CheckResponse(res); err != nil {
  66659. return nil, err
  66660. }
  66661. ret := &Operation{
  66662. ServerResponse: googleapi.ServerResponse{
  66663. Header: res.Header,
  66664. HTTPStatusCode: res.StatusCode,
  66665. },
  66666. }
  66667. target := &ret
  66668. if err := gensupport.DecodeResponse(target, res); err != nil {
  66669. return nil, err
  66670. }
  66671. return ret, nil
  66672. // {
  66673. // "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.",
  66674. // "httpMethod": "POST",
  66675. // "id": "compute.instances.updateAccessConfig",
  66676. // "parameterOrder": [
  66677. // "project",
  66678. // "zone",
  66679. // "instance",
  66680. // "networkInterface"
  66681. // ],
  66682. // "parameters": {
  66683. // "instance": {
  66684. // "description": "The instance name for this request.",
  66685. // "location": "path",
  66686. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66687. // "required": true,
  66688. // "type": "string"
  66689. // },
  66690. // "networkInterface": {
  66691. // "description": "The name of the network interface where the access config is attached.",
  66692. // "location": "query",
  66693. // "required": true,
  66694. // "type": "string"
  66695. // },
  66696. // "project": {
  66697. // "description": "Project ID for this request.",
  66698. // "location": "path",
  66699. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66700. // "required": true,
  66701. // "type": "string"
  66702. // },
  66703. // "requestId": {
  66704. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66705. // "location": "query",
  66706. // "type": "string"
  66707. // },
  66708. // "zone": {
  66709. // "description": "The name of the zone for this request.",
  66710. // "location": "path",
  66711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66712. // "required": true,
  66713. // "type": "string"
  66714. // }
  66715. // },
  66716. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  66717. // "request": {
  66718. // "$ref": "AccessConfig"
  66719. // },
  66720. // "response": {
  66721. // "$ref": "Operation"
  66722. // },
  66723. // "scopes": [
  66724. // "https://www.googleapis.com/auth/cloud-platform",
  66725. // "https://www.googleapis.com/auth/compute"
  66726. // ]
  66727. // }
  66728. }
  66729. // method id "compute.instances.updateDisplayDevice":
  66730. type InstancesUpdateDisplayDeviceCall struct {
  66731. s *Service
  66732. project string
  66733. zone string
  66734. instance string
  66735. displaydevice *DisplayDevice
  66736. urlParams_ gensupport.URLParams
  66737. ctx_ context.Context
  66738. header_ http.Header
  66739. }
  66740. // UpdateDisplayDevice: Updates the Display config for a VM instance.
  66741. // You can only use this method on a stopped VM instance. This method
  66742. // supports PATCH semantics and uses the JSON merge patch format and
  66743. // processing rules.
  66744. func (r *InstancesService) UpdateDisplayDevice(project string, zone string, instance string, displaydevice *DisplayDevice) *InstancesUpdateDisplayDeviceCall {
  66745. c := &InstancesUpdateDisplayDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66746. c.project = project
  66747. c.zone = zone
  66748. c.instance = instance
  66749. c.displaydevice = displaydevice
  66750. return c
  66751. }
  66752. // RequestId sets the optional parameter "requestId": An optional
  66753. // request ID to identify requests. Specify a unique request ID so that
  66754. // if you must retry your request, the server will know to ignore the
  66755. // request if it has already been completed.
  66756. //
  66757. // For example, consider a situation where you make an initial request
  66758. // and the request times out. If you make the request again with the
  66759. // same request ID, the server can check if original operation with the
  66760. // same request ID was received, and if so, will ignore the second
  66761. // request. This prevents clients from accidentally creating duplicate
  66762. // commitments.
  66763. //
  66764. // The request ID must be a valid UUID with the exception that zero UUID
  66765. // is not supported (00000000-0000-0000-0000-000000000000).
  66766. func (c *InstancesUpdateDisplayDeviceCall) RequestId(requestId string) *InstancesUpdateDisplayDeviceCall {
  66767. c.urlParams_.Set("requestId", requestId)
  66768. return c
  66769. }
  66770. // Fields allows partial responses to be retrieved. See
  66771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66772. // for more information.
  66773. func (c *InstancesUpdateDisplayDeviceCall) Fields(s ...googleapi.Field) *InstancesUpdateDisplayDeviceCall {
  66774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66775. return c
  66776. }
  66777. // Context sets the context to be used in this call's Do method. Any
  66778. // pending HTTP request will be aborted if the provided context is
  66779. // canceled.
  66780. func (c *InstancesUpdateDisplayDeviceCall) Context(ctx context.Context) *InstancesUpdateDisplayDeviceCall {
  66781. c.ctx_ = ctx
  66782. return c
  66783. }
  66784. // Header returns an http.Header that can be modified by the caller to
  66785. // add HTTP headers to the request.
  66786. func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header {
  66787. if c.header_ == nil {
  66788. c.header_ = make(http.Header)
  66789. }
  66790. return c.header_
  66791. }
  66792. func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) {
  66793. reqHeaders := make(http.Header)
  66794. for k, v := range c.header_ {
  66795. reqHeaders[k] = v
  66796. }
  66797. reqHeaders.Set("User-Agent", c.s.userAgent())
  66798. var body io.Reader = nil
  66799. body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice)
  66800. if err != nil {
  66801. return nil, err
  66802. }
  66803. reqHeaders.Set("Content-Type", "application/json")
  66804. c.urlParams_.Set("alt", alt)
  66805. c.urlParams_.Set("prettyPrint", "false")
  66806. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice")
  66807. urls += "?" + c.urlParams_.Encode()
  66808. req, err := http.NewRequest("PATCH", urls, body)
  66809. if err != nil {
  66810. return nil, err
  66811. }
  66812. req.Header = reqHeaders
  66813. googleapi.Expand(req.URL, map[string]string{
  66814. "project": c.project,
  66815. "zone": c.zone,
  66816. "instance": c.instance,
  66817. })
  66818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66819. }
  66820. // Do executes the "compute.instances.updateDisplayDevice" call.
  66821. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66822. // status code is an error. Response headers are in either
  66823. // *Operation.ServerResponse.Header or (if a response was returned at
  66824. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66825. // to check whether the returned error was because
  66826. // http.StatusNotModified was returned.
  66827. func (c *InstancesUpdateDisplayDeviceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66828. gensupport.SetOptions(c.urlParams_, opts...)
  66829. res, err := c.doRequest("json")
  66830. if res != nil && res.StatusCode == http.StatusNotModified {
  66831. if res.Body != nil {
  66832. res.Body.Close()
  66833. }
  66834. return nil, &googleapi.Error{
  66835. Code: res.StatusCode,
  66836. Header: res.Header,
  66837. }
  66838. }
  66839. if err != nil {
  66840. return nil, err
  66841. }
  66842. defer googleapi.CloseBody(res)
  66843. if err := googleapi.CheckResponse(res); err != nil {
  66844. return nil, err
  66845. }
  66846. ret := &Operation{
  66847. ServerResponse: googleapi.ServerResponse{
  66848. Header: res.Header,
  66849. HTTPStatusCode: res.StatusCode,
  66850. },
  66851. }
  66852. target := &ret
  66853. if err := gensupport.DecodeResponse(target, res); err != nil {
  66854. return nil, err
  66855. }
  66856. return ret, nil
  66857. // {
  66858. // "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.",
  66859. // "httpMethod": "PATCH",
  66860. // "id": "compute.instances.updateDisplayDevice",
  66861. // "parameterOrder": [
  66862. // "project",
  66863. // "zone",
  66864. // "instance"
  66865. // ],
  66866. // "parameters": {
  66867. // "instance": {
  66868. // "description": "Name of the instance scoping this request.",
  66869. // "location": "path",
  66870. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66871. // "required": true,
  66872. // "type": "string"
  66873. // },
  66874. // "project": {
  66875. // "description": "Project ID for this request.",
  66876. // "location": "path",
  66877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66878. // "required": true,
  66879. // "type": "string"
  66880. // },
  66881. // "requestId": {
  66882. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66883. // "location": "query",
  66884. // "type": "string"
  66885. // },
  66886. // "zone": {
  66887. // "description": "The name of the zone for this request.",
  66888. // "location": "path",
  66889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66890. // "required": true,
  66891. // "type": "string"
  66892. // }
  66893. // },
  66894. // "path": "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice",
  66895. // "request": {
  66896. // "$ref": "DisplayDevice"
  66897. // },
  66898. // "response": {
  66899. // "$ref": "Operation"
  66900. // },
  66901. // "scopes": [
  66902. // "https://www.googleapis.com/auth/cloud-platform",
  66903. // "https://www.googleapis.com/auth/compute"
  66904. // ]
  66905. // }
  66906. }
  66907. // method id "compute.instances.updateNetworkInterface":
  66908. type InstancesUpdateNetworkInterfaceCall struct {
  66909. s *Service
  66910. project string
  66911. zone string
  66912. instance string
  66913. networkinterface *NetworkInterface
  66914. urlParams_ gensupport.URLParams
  66915. ctx_ context.Context
  66916. header_ http.Header
  66917. }
  66918. // UpdateNetworkInterface: Updates an instance's network interface. This
  66919. // method follows PATCH semantics.
  66920. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  66921. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66922. c.project = project
  66923. c.zone = zone
  66924. c.instance = instance
  66925. c.urlParams_.Set("networkInterface", networkInterface)
  66926. c.networkinterface = networkinterface
  66927. return c
  66928. }
  66929. // RequestId sets the optional parameter "requestId": An optional
  66930. // request ID to identify requests. Specify a unique request ID so that
  66931. // if you must retry your request, the server will know to ignore the
  66932. // request if it has already been completed.
  66933. //
  66934. // For example, consider a situation where you make an initial request
  66935. // and the request times out. If you make the request again with the
  66936. // same request ID, the server can check if original operation with the
  66937. // same request ID was received, and if so, will ignore the second
  66938. // request. This prevents clients from accidentally creating duplicate
  66939. // commitments.
  66940. //
  66941. // The request ID must be a valid UUID with the exception that zero UUID
  66942. // is not supported (00000000-0000-0000-0000-000000000000).
  66943. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  66944. c.urlParams_.Set("requestId", requestId)
  66945. return c
  66946. }
  66947. // Fields allows partial responses to be retrieved. See
  66948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66949. // for more information.
  66950. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  66951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66952. return c
  66953. }
  66954. // Context sets the context to be used in this call's Do method. Any
  66955. // pending HTTP request will be aborted if the provided context is
  66956. // canceled.
  66957. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  66958. c.ctx_ = ctx
  66959. return c
  66960. }
  66961. // Header returns an http.Header that can be modified by the caller to
  66962. // add HTTP headers to the request.
  66963. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  66964. if c.header_ == nil {
  66965. c.header_ = make(http.Header)
  66966. }
  66967. return c.header_
  66968. }
  66969. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  66970. reqHeaders := make(http.Header)
  66971. for k, v := range c.header_ {
  66972. reqHeaders[k] = v
  66973. }
  66974. reqHeaders.Set("User-Agent", c.s.userAgent())
  66975. var body io.Reader = nil
  66976. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  66977. if err != nil {
  66978. return nil, err
  66979. }
  66980. reqHeaders.Set("Content-Type", "application/json")
  66981. c.urlParams_.Set("alt", alt)
  66982. c.urlParams_.Set("prettyPrint", "false")
  66983. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  66984. urls += "?" + c.urlParams_.Encode()
  66985. req, err := http.NewRequest("PATCH", urls, body)
  66986. if err != nil {
  66987. return nil, err
  66988. }
  66989. req.Header = reqHeaders
  66990. googleapi.Expand(req.URL, map[string]string{
  66991. "project": c.project,
  66992. "zone": c.zone,
  66993. "instance": c.instance,
  66994. })
  66995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66996. }
  66997. // Do executes the "compute.instances.updateNetworkInterface" call.
  66998. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66999. // status code is an error. Response headers are in either
  67000. // *Operation.ServerResponse.Header or (if a response was returned at
  67001. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67002. // to check whether the returned error was because
  67003. // http.StatusNotModified was returned.
  67004. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67005. gensupport.SetOptions(c.urlParams_, opts...)
  67006. res, err := c.doRequest("json")
  67007. if res != nil && res.StatusCode == http.StatusNotModified {
  67008. if res.Body != nil {
  67009. res.Body.Close()
  67010. }
  67011. return nil, &googleapi.Error{
  67012. Code: res.StatusCode,
  67013. Header: res.Header,
  67014. }
  67015. }
  67016. if err != nil {
  67017. return nil, err
  67018. }
  67019. defer googleapi.CloseBody(res)
  67020. if err := googleapi.CheckResponse(res); err != nil {
  67021. return nil, err
  67022. }
  67023. ret := &Operation{
  67024. ServerResponse: googleapi.ServerResponse{
  67025. Header: res.Header,
  67026. HTTPStatusCode: res.StatusCode,
  67027. },
  67028. }
  67029. target := &ret
  67030. if err := gensupport.DecodeResponse(target, res); err != nil {
  67031. return nil, err
  67032. }
  67033. return ret, nil
  67034. // {
  67035. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  67036. // "httpMethod": "PATCH",
  67037. // "id": "compute.instances.updateNetworkInterface",
  67038. // "parameterOrder": [
  67039. // "project",
  67040. // "zone",
  67041. // "instance",
  67042. // "networkInterface"
  67043. // ],
  67044. // "parameters": {
  67045. // "instance": {
  67046. // "description": "The instance name for this request.",
  67047. // "location": "path",
  67048. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67049. // "required": true,
  67050. // "type": "string"
  67051. // },
  67052. // "networkInterface": {
  67053. // "description": "The name of the network interface to update.",
  67054. // "location": "query",
  67055. // "required": true,
  67056. // "type": "string"
  67057. // },
  67058. // "project": {
  67059. // "description": "Project ID for this request.",
  67060. // "location": "path",
  67061. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67062. // "required": true,
  67063. // "type": "string"
  67064. // },
  67065. // "requestId": {
  67066. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67067. // "location": "query",
  67068. // "type": "string"
  67069. // },
  67070. // "zone": {
  67071. // "description": "The name of the zone for this request.",
  67072. // "location": "path",
  67073. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67074. // "required": true,
  67075. // "type": "string"
  67076. // }
  67077. // },
  67078. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  67079. // "request": {
  67080. // "$ref": "NetworkInterface"
  67081. // },
  67082. // "response": {
  67083. // "$ref": "Operation"
  67084. // },
  67085. // "scopes": [
  67086. // "https://www.googleapis.com/auth/cloud-platform",
  67087. // "https://www.googleapis.com/auth/compute"
  67088. // ]
  67089. // }
  67090. }
  67091. // method id "compute.instances.updateShieldedInstanceConfig":
  67092. type InstancesUpdateShieldedInstanceConfigCall struct {
  67093. s *Service
  67094. project string
  67095. zone string
  67096. instance string
  67097. shieldedinstanceconfig *ShieldedInstanceConfig
  67098. urlParams_ gensupport.URLParams
  67099. ctx_ context.Context
  67100. header_ http.Header
  67101. }
  67102. // UpdateShieldedInstanceConfig: Updates the Shielded Instance config
  67103. // for an instance. You can only use this method on a stopped instance.
  67104. // This method supports PATCH semantics and uses the JSON merge patch
  67105. // format and processing rules.
  67106. func (r *InstancesService) UpdateShieldedInstanceConfig(project string, zone string, instance string, shieldedinstanceconfig *ShieldedInstanceConfig) *InstancesUpdateShieldedInstanceConfigCall {
  67107. c := &InstancesUpdateShieldedInstanceConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67108. c.project = project
  67109. c.zone = zone
  67110. c.instance = instance
  67111. c.shieldedinstanceconfig = shieldedinstanceconfig
  67112. return c
  67113. }
  67114. // RequestId sets the optional parameter "requestId": An optional
  67115. // request ID to identify requests. Specify a unique request ID so that
  67116. // if you must retry your request, the server will know to ignore the
  67117. // request if it has already been completed.
  67118. //
  67119. // For example, consider a situation where you make an initial request
  67120. // and the request times out. If you make the request again with the
  67121. // same request ID, the server can check if original operation with the
  67122. // same request ID was received, and if so, will ignore the second
  67123. // request. This prevents clients from accidentally creating duplicate
  67124. // commitments.
  67125. //
  67126. // The request ID must be a valid UUID with the exception that zero UUID
  67127. // is not supported (00000000-0000-0000-0000-000000000000).
  67128. func (c *InstancesUpdateShieldedInstanceConfigCall) RequestId(requestId string) *InstancesUpdateShieldedInstanceConfigCall {
  67129. c.urlParams_.Set("requestId", requestId)
  67130. return c
  67131. }
  67132. // Fields allows partial responses to be retrieved. See
  67133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67134. // for more information.
  67135. func (c *InstancesUpdateShieldedInstanceConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedInstanceConfigCall {
  67136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67137. return c
  67138. }
  67139. // Context sets the context to be used in this call's Do method. Any
  67140. // pending HTTP request will be aborted if the provided context is
  67141. // canceled.
  67142. func (c *InstancesUpdateShieldedInstanceConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedInstanceConfigCall {
  67143. c.ctx_ = ctx
  67144. return c
  67145. }
  67146. // Header returns an http.Header that can be modified by the caller to
  67147. // add HTTP headers to the request.
  67148. func (c *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header {
  67149. if c.header_ == nil {
  67150. c.header_ = make(http.Header)
  67151. }
  67152. return c.header_
  67153. }
  67154. func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) {
  67155. reqHeaders := make(http.Header)
  67156. for k, v := range c.header_ {
  67157. reqHeaders[k] = v
  67158. }
  67159. reqHeaders.Set("User-Agent", c.s.userAgent())
  67160. var body io.Reader = nil
  67161. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig)
  67162. if err != nil {
  67163. return nil, err
  67164. }
  67165. reqHeaders.Set("Content-Type", "application/json")
  67166. c.urlParams_.Set("alt", alt)
  67167. c.urlParams_.Set("prettyPrint", "false")
  67168. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig")
  67169. urls += "?" + c.urlParams_.Encode()
  67170. req, err := http.NewRequest("PATCH", urls, body)
  67171. if err != nil {
  67172. return nil, err
  67173. }
  67174. req.Header = reqHeaders
  67175. googleapi.Expand(req.URL, map[string]string{
  67176. "project": c.project,
  67177. "zone": c.zone,
  67178. "instance": c.instance,
  67179. })
  67180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67181. }
  67182. // Do executes the "compute.instances.updateShieldedInstanceConfig" call.
  67183. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67184. // status code is an error. Response headers are in either
  67185. // *Operation.ServerResponse.Header or (if a response was returned at
  67186. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67187. // to check whether the returned error was because
  67188. // http.StatusNotModified was returned.
  67189. func (c *InstancesUpdateShieldedInstanceConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67190. gensupport.SetOptions(c.urlParams_, opts...)
  67191. res, err := c.doRequest("json")
  67192. if res != nil && res.StatusCode == http.StatusNotModified {
  67193. if res.Body != nil {
  67194. res.Body.Close()
  67195. }
  67196. return nil, &googleapi.Error{
  67197. Code: res.StatusCode,
  67198. Header: res.Header,
  67199. }
  67200. }
  67201. if err != nil {
  67202. return nil, err
  67203. }
  67204. defer googleapi.CloseBody(res)
  67205. if err := googleapi.CheckResponse(res); err != nil {
  67206. return nil, err
  67207. }
  67208. ret := &Operation{
  67209. ServerResponse: googleapi.ServerResponse{
  67210. Header: res.Header,
  67211. HTTPStatusCode: res.StatusCode,
  67212. },
  67213. }
  67214. target := &ret
  67215. if err := gensupport.DecodeResponse(target, res); err != nil {
  67216. return nil, err
  67217. }
  67218. return ret, nil
  67219. // {
  67220. // "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.",
  67221. // "httpMethod": "PATCH",
  67222. // "id": "compute.instances.updateShieldedInstanceConfig",
  67223. // "parameterOrder": [
  67224. // "project",
  67225. // "zone",
  67226. // "instance"
  67227. // ],
  67228. // "parameters": {
  67229. // "instance": {
  67230. // "description": "Name or id of the instance scoping this request.",
  67231. // "location": "path",
  67232. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67233. // "required": true,
  67234. // "type": "string"
  67235. // },
  67236. // "project": {
  67237. // "description": "Project ID for this request.",
  67238. // "location": "path",
  67239. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67240. // "required": true,
  67241. // "type": "string"
  67242. // },
  67243. // "requestId": {
  67244. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67245. // "location": "query",
  67246. // "type": "string"
  67247. // },
  67248. // "zone": {
  67249. // "description": "The name of the zone for this request.",
  67250. // "location": "path",
  67251. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67252. // "required": true,
  67253. // "type": "string"
  67254. // }
  67255. // },
  67256. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig",
  67257. // "request": {
  67258. // "$ref": "ShieldedInstanceConfig"
  67259. // },
  67260. // "response": {
  67261. // "$ref": "Operation"
  67262. // },
  67263. // "scopes": [
  67264. // "https://www.googleapis.com/auth/cloud-platform",
  67265. // "https://www.googleapis.com/auth/compute"
  67266. // ]
  67267. // }
  67268. }
  67269. // method id "compute.instances.updateShieldedVmConfig":
  67270. type InstancesUpdateShieldedVmConfigCall struct {
  67271. s *Service
  67272. project string
  67273. zone string
  67274. instance string
  67275. shieldedvmconfig *ShieldedVmConfig
  67276. urlParams_ gensupport.URLParams
  67277. ctx_ context.Context
  67278. header_ http.Header
  67279. }
  67280. // UpdateShieldedVmConfig: Updates the Shielded VM config for a VM
  67281. // instance. You can only use this method on a stopped VM instance. This
  67282. // method supports PATCH semantics and uses the JSON merge patch format
  67283. // and processing rules.
  67284. func (r *InstancesService) UpdateShieldedVmConfig(project string, zone string, instance string, shieldedvmconfig *ShieldedVmConfig) *InstancesUpdateShieldedVmConfigCall {
  67285. c := &InstancesUpdateShieldedVmConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67286. c.project = project
  67287. c.zone = zone
  67288. c.instance = instance
  67289. c.shieldedvmconfig = shieldedvmconfig
  67290. return c
  67291. }
  67292. // RequestId sets the optional parameter "requestId": An optional
  67293. // request ID to identify requests. Specify a unique request ID so that
  67294. // if you must retry your request, the server will know to ignore the
  67295. // request if it has already been completed.
  67296. //
  67297. // For example, consider a situation where you make an initial request
  67298. // and the request times out. If you make the request again with the
  67299. // same request ID, the server can check if original operation with the
  67300. // same request ID was received, and if so, will ignore the second
  67301. // request. This prevents clients from accidentally creating duplicate
  67302. // commitments.
  67303. //
  67304. // The request ID must be a valid UUID with the exception that zero UUID
  67305. // is not supported (00000000-0000-0000-0000-000000000000).
  67306. func (c *InstancesUpdateShieldedVmConfigCall) RequestId(requestId string) *InstancesUpdateShieldedVmConfigCall {
  67307. c.urlParams_.Set("requestId", requestId)
  67308. return c
  67309. }
  67310. // Fields allows partial responses to be retrieved. See
  67311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67312. // for more information.
  67313. func (c *InstancesUpdateShieldedVmConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedVmConfigCall {
  67314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67315. return c
  67316. }
  67317. // Context sets the context to be used in this call's Do method. Any
  67318. // pending HTTP request will be aborted if the provided context is
  67319. // canceled.
  67320. func (c *InstancesUpdateShieldedVmConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedVmConfigCall {
  67321. c.ctx_ = ctx
  67322. return c
  67323. }
  67324. // Header returns an http.Header that can be modified by the caller to
  67325. // add HTTP headers to the request.
  67326. func (c *InstancesUpdateShieldedVmConfigCall) Header() http.Header {
  67327. if c.header_ == nil {
  67328. c.header_ = make(http.Header)
  67329. }
  67330. return c.header_
  67331. }
  67332. func (c *InstancesUpdateShieldedVmConfigCall) doRequest(alt string) (*http.Response, error) {
  67333. reqHeaders := make(http.Header)
  67334. for k, v := range c.header_ {
  67335. reqHeaders[k] = v
  67336. }
  67337. reqHeaders.Set("User-Agent", c.s.userAgent())
  67338. var body io.Reader = nil
  67339. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmconfig)
  67340. if err != nil {
  67341. return nil, err
  67342. }
  67343. reqHeaders.Set("Content-Type", "application/json")
  67344. c.urlParams_.Set("alt", alt)
  67345. c.urlParams_.Set("prettyPrint", "false")
  67346. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig")
  67347. urls += "?" + c.urlParams_.Encode()
  67348. req, err := http.NewRequest("PATCH", urls, body)
  67349. if err != nil {
  67350. return nil, err
  67351. }
  67352. req.Header = reqHeaders
  67353. googleapi.Expand(req.URL, map[string]string{
  67354. "project": c.project,
  67355. "zone": c.zone,
  67356. "instance": c.instance,
  67357. })
  67358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67359. }
  67360. // Do executes the "compute.instances.updateShieldedVmConfig" call.
  67361. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67362. // status code is an error. Response headers are in either
  67363. // *Operation.ServerResponse.Header or (if a response was returned at
  67364. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67365. // to check whether the returned error was because
  67366. // http.StatusNotModified was returned.
  67367. func (c *InstancesUpdateShieldedVmConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67368. gensupport.SetOptions(c.urlParams_, opts...)
  67369. res, err := c.doRequest("json")
  67370. if res != nil && res.StatusCode == http.StatusNotModified {
  67371. if res.Body != nil {
  67372. res.Body.Close()
  67373. }
  67374. return nil, &googleapi.Error{
  67375. Code: res.StatusCode,
  67376. Header: res.Header,
  67377. }
  67378. }
  67379. if err != nil {
  67380. return nil, err
  67381. }
  67382. defer googleapi.CloseBody(res)
  67383. if err := googleapi.CheckResponse(res); err != nil {
  67384. return nil, err
  67385. }
  67386. ret := &Operation{
  67387. ServerResponse: googleapi.ServerResponse{
  67388. Header: res.Header,
  67389. HTTPStatusCode: res.StatusCode,
  67390. },
  67391. }
  67392. target := &ret
  67393. if err := gensupport.DecodeResponse(target, res); err != nil {
  67394. return nil, err
  67395. }
  67396. return ret, nil
  67397. // {
  67398. // "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.",
  67399. // "httpMethod": "PATCH",
  67400. // "id": "compute.instances.updateShieldedVmConfig",
  67401. // "parameterOrder": [
  67402. // "project",
  67403. // "zone",
  67404. // "instance"
  67405. // ],
  67406. // "parameters": {
  67407. // "instance": {
  67408. // "description": "Name of the instance scoping this request.",
  67409. // "location": "path",
  67410. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67411. // "required": true,
  67412. // "type": "string"
  67413. // },
  67414. // "project": {
  67415. // "description": "Project ID for this request.",
  67416. // "location": "path",
  67417. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67418. // "required": true,
  67419. // "type": "string"
  67420. // },
  67421. // "requestId": {
  67422. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67423. // "location": "query",
  67424. // "type": "string"
  67425. // },
  67426. // "zone": {
  67427. // "description": "The name of the zone for this request.",
  67428. // "location": "path",
  67429. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67430. // "required": true,
  67431. // "type": "string"
  67432. // }
  67433. // },
  67434. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig",
  67435. // "request": {
  67436. // "$ref": "ShieldedVmConfig"
  67437. // },
  67438. // "response": {
  67439. // "$ref": "Operation"
  67440. // },
  67441. // "scopes": [
  67442. // "https://www.googleapis.com/auth/cloud-platform",
  67443. // "https://www.googleapis.com/auth/compute"
  67444. // ]
  67445. // }
  67446. }
  67447. // method id "compute.interconnectAttachments.aggregatedList":
  67448. type InterconnectAttachmentsAggregatedListCall struct {
  67449. s *Service
  67450. project string
  67451. urlParams_ gensupport.URLParams
  67452. ifNoneMatch_ string
  67453. ctx_ context.Context
  67454. header_ http.Header
  67455. }
  67456. // AggregatedList: Retrieves an aggregated list of interconnect
  67457. // attachments.
  67458. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  67459. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67460. c.project = project
  67461. return c
  67462. }
  67463. // Filter sets the optional parameter "filter": A filter expression that
  67464. // filters resources listed in the response. The expression must specify
  67465. // the field name, a comparison operator, and the value that you want to
  67466. // use for filtering. The value must be a string, a number, or a
  67467. // boolean. The comparison operator must be either =, !=, >, or <.
  67468. //
  67469. // For example, if you are filtering Compute Engine instances, you can
  67470. // exclude instances named example-instance by specifying name !=
  67471. // example-instance.
  67472. //
  67473. // You can also filter nested fields. For example, you could specify
  67474. // scheduling.automaticRestart = false to include instances only if they
  67475. // are not scheduled for automatic restarts. You can use filtering on
  67476. // nested fields to filter based on resource labels.
  67477. //
  67478. // To filter on multiple expressions, provide each separate expression
  67479. // within parentheses. For example, (scheduling.automaticRestart = true)
  67480. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67481. // AND expression. However, you can include AND and OR expressions
  67482. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67483. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67484. // true).
  67485. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  67486. c.urlParams_.Set("filter", filter)
  67487. return c
  67488. }
  67489. // MaxResults sets the optional parameter "maxResults": The maximum
  67490. // number of results per page that should be returned. If the number of
  67491. // available results is larger than maxResults, Compute Engine returns a
  67492. // nextPageToken that can be used to get the next page of results in
  67493. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67494. // (Default: 500)
  67495. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  67496. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67497. return c
  67498. }
  67499. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67500. // a certain order. By default, results are returned in alphanumerical
  67501. // order based on the resource name.
  67502. //
  67503. // You can also sort results in descending order based on the creation
  67504. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67505. // based on the creationTimestamp field in reverse chronological order
  67506. // (newest result first). Use this to sort resources like operations so
  67507. // that the newest operation is returned first.
  67508. //
  67509. // Currently, only sorting by name or creationTimestamp desc is
  67510. // supported.
  67511. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  67512. c.urlParams_.Set("orderBy", orderBy)
  67513. return c
  67514. }
  67515. // PageToken sets the optional parameter "pageToken": Specifies a page
  67516. // token to use. Set pageToken to the nextPageToken returned by a
  67517. // previous list request to get the next page of results.
  67518. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  67519. c.urlParams_.Set("pageToken", pageToken)
  67520. return c
  67521. }
  67522. // Fields allows partial responses to be retrieved. See
  67523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67524. // for more information.
  67525. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  67526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67527. return c
  67528. }
  67529. // IfNoneMatch sets the optional parameter which makes the operation
  67530. // fail if the object's ETag matches the given value. This is useful for
  67531. // getting updates only after the object has changed since the last
  67532. // request. Use googleapi.IsNotModified to check whether the response
  67533. // error from Do is the result of In-None-Match.
  67534. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  67535. c.ifNoneMatch_ = entityTag
  67536. return c
  67537. }
  67538. // Context sets the context to be used in this call's Do method. Any
  67539. // pending HTTP request will be aborted if the provided context is
  67540. // canceled.
  67541. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  67542. c.ctx_ = ctx
  67543. return c
  67544. }
  67545. // Header returns an http.Header that can be modified by the caller to
  67546. // add HTTP headers to the request.
  67547. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  67548. if c.header_ == nil {
  67549. c.header_ = make(http.Header)
  67550. }
  67551. return c.header_
  67552. }
  67553. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  67554. reqHeaders := make(http.Header)
  67555. for k, v := range c.header_ {
  67556. reqHeaders[k] = v
  67557. }
  67558. reqHeaders.Set("User-Agent", c.s.userAgent())
  67559. if c.ifNoneMatch_ != "" {
  67560. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67561. }
  67562. var body io.Reader = nil
  67563. c.urlParams_.Set("alt", alt)
  67564. c.urlParams_.Set("prettyPrint", "false")
  67565. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  67566. urls += "?" + c.urlParams_.Encode()
  67567. req, err := http.NewRequest("GET", urls, body)
  67568. if err != nil {
  67569. return nil, err
  67570. }
  67571. req.Header = reqHeaders
  67572. googleapi.Expand(req.URL, map[string]string{
  67573. "project": c.project,
  67574. })
  67575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67576. }
  67577. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  67578. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  67579. // non-nil. Any non-2xx status code is an error. Response headers are in
  67580. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  67581. // (if a response was returned at all) in
  67582. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  67583. // whether the returned error was because http.StatusNotModified was
  67584. // returned.
  67585. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  67586. gensupport.SetOptions(c.urlParams_, opts...)
  67587. res, err := c.doRequest("json")
  67588. if res != nil && res.StatusCode == http.StatusNotModified {
  67589. if res.Body != nil {
  67590. res.Body.Close()
  67591. }
  67592. return nil, &googleapi.Error{
  67593. Code: res.StatusCode,
  67594. Header: res.Header,
  67595. }
  67596. }
  67597. if err != nil {
  67598. return nil, err
  67599. }
  67600. defer googleapi.CloseBody(res)
  67601. if err := googleapi.CheckResponse(res); err != nil {
  67602. return nil, err
  67603. }
  67604. ret := &InterconnectAttachmentAggregatedList{
  67605. ServerResponse: googleapi.ServerResponse{
  67606. Header: res.Header,
  67607. HTTPStatusCode: res.StatusCode,
  67608. },
  67609. }
  67610. target := &ret
  67611. if err := gensupport.DecodeResponse(target, res); err != nil {
  67612. return nil, err
  67613. }
  67614. return ret, nil
  67615. // {
  67616. // "description": "Retrieves an aggregated list of interconnect attachments.",
  67617. // "httpMethod": "GET",
  67618. // "id": "compute.interconnectAttachments.aggregatedList",
  67619. // "parameterOrder": [
  67620. // "project"
  67621. // ],
  67622. // "parameters": {
  67623. // "filter": {
  67624. // "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).",
  67625. // "location": "query",
  67626. // "type": "string"
  67627. // },
  67628. // "maxResults": {
  67629. // "default": "500",
  67630. // "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)",
  67631. // "format": "uint32",
  67632. // "location": "query",
  67633. // "minimum": "0",
  67634. // "type": "integer"
  67635. // },
  67636. // "orderBy": {
  67637. // "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.",
  67638. // "location": "query",
  67639. // "type": "string"
  67640. // },
  67641. // "pageToken": {
  67642. // "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.",
  67643. // "location": "query",
  67644. // "type": "string"
  67645. // },
  67646. // "project": {
  67647. // "description": "Project ID for this request.",
  67648. // "location": "path",
  67649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67650. // "required": true,
  67651. // "type": "string"
  67652. // }
  67653. // },
  67654. // "path": "{project}/aggregated/interconnectAttachments",
  67655. // "response": {
  67656. // "$ref": "InterconnectAttachmentAggregatedList"
  67657. // },
  67658. // "scopes": [
  67659. // "https://www.googleapis.com/auth/cloud-platform",
  67660. // "https://www.googleapis.com/auth/compute",
  67661. // "https://www.googleapis.com/auth/compute.readonly"
  67662. // ]
  67663. // }
  67664. }
  67665. // Pages invokes f for each page of results.
  67666. // A non-nil error returned from f will halt the iteration.
  67667. // The provided context supersedes any context provided to the Context method.
  67668. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  67669. c.ctx_ = ctx
  67670. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67671. for {
  67672. x, err := c.Do()
  67673. if err != nil {
  67674. return err
  67675. }
  67676. if err := f(x); err != nil {
  67677. return err
  67678. }
  67679. if x.NextPageToken == "" {
  67680. return nil
  67681. }
  67682. c.PageToken(x.NextPageToken)
  67683. }
  67684. }
  67685. // method id "compute.interconnectAttachments.delete":
  67686. type InterconnectAttachmentsDeleteCall struct {
  67687. s *Service
  67688. project string
  67689. region string
  67690. interconnectAttachment string
  67691. urlParams_ gensupport.URLParams
  67692. ctx_ context.Context
  67693. header_ http.Header
  67694. }
  67695. // Delete: Deletes the specified interconnect attachment.
  67696. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  67697. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67698. c.project = project
  67699. c.region = region
  67700. c.interconnectAttachment = interconnectAttachment
  67701. return c
  67702. }
  67703. // RequestId sets the optional parameter "requestId": An optional
  67704. // request ID to identify requests. Specify a unique request ID so that
  67705. // if you must retry your request, the server will know to ignore the
  67706. // request if it has already been completed.
  67707. //
  67708. // For example, consider a situation where you make an initial request
  67709. // and the request times out. If you make the request again with the
  67710. // same request ID, the server can check if original operation with the
  67711. // same request ID was received, and if so, will ignore the second
  67712. // request. This prevents clients from accidentally creating duplicate
  67713. // commitments.
  67714. //
  67715. // The request ID must be a valid UUID with the exception that zero UUID
  67716. // is not supported (00000000-0000-0000-0000-000000000000).
  67717. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  67718. c.urlParams_.Set("requestId", requestId)
  67719. return c
  67720. }
  67721. // Fields allows partial responses to be retrieved. See
  67722. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67723. // for more information.
  67724. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  67725. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67726. return c
  67727. }
  67728. // Context sets the context to be used in this call's Do method. Any
  67729. // pending HTTP request will be aborted if the provided context is
  67730. // canceled.
  67731. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  67732. c.ctx_ = ctx
  67733. return c
  67734. }
  67735. // Header returns an http.Header that can be modified by the caller to
  67736. // add HTTP headers to the request.
  67737. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  67738. if c.header_ == nil {
  67739. c.header_ = make(http.Header)
  67740. }
  67741. return c.header_
  67742. }
  67743. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  67744. reqHeaders := make(http.Header)
  67745. for k, v := range c.header_ {
  67746. reqHeaders[k] = v
  67747. }
  67748. reqHeaders.Set("User-Agent", c.s.userAgent())
  67749. var body io.Reader = nil
  67750. c.urlParams_.Set("alt", alt)
  67751. c.urlParams_.Set("prettyPrint", "false")
  67752. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  67753. urls += "?" + c.urlParams_.Encode()
  67754. req, err := http.NewRequest("DELETE", urls, body)
  67755. if err != nil {
  67756. return nil, err
  67757. }
  67758. req.Header = reqHeaders
  67759. googleapi.Expand(req.URL, map[string]string{
  67760. "project": c.project,
  67761. "region": c.region,
  67762. "interconnectAttachment": c.interconnectAttachment,
  67763. })
  67764. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67765. }
  67766. // Do executes the "compute.interconnectAttachments.delete" call.
  67767. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67768. // status code is an error. Response headers are in either
  67769. // *Operation.ServerResponse.Header or (if a response was returned at
  67770. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67771. // to check whether the returned error was because
  67772. // http.StatusNotModified was returned.
  67773. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67774. gensupport.SetOptions(c.urlParams_, opts...)
  67775. res, err := c.doRequest("json")
  67776. if res != nil && res.StatusCode == http.StatusNotModified {
  67777. if res.Body != nil {
  67778. res.Body.Close()
  67779. }
  67780. return nil, &googleapi.Error{
  67781. Code: res.StatusCode,
  67782. Header: res.Header,
  67783. }
  67784. }
  67785. if err != nil {
  67786. return nil, err
  67787. }
  67788. defer googleapi.CloseBody(res)
  67789. if err := googleapi.CheckResponse(res); err != nil {
  67790. return nil, err
  67791. }
  67792. ret := &Operation{
  67793. ServerResponse: googleapi.ServerResponse{
  67794. Header: res.Header,
  67795. HTTPStatusCode: res.StatusCode,
  67796. },
  67797. }
  67798. target := &ret
  67799. if err := gensupport.DecodeResponse(target, res); err != nil {
  67800. return nil, err
  67801. }
  67802. return ret, nil
  67803. // {
  67804. // "description": "Deletes the specified interconnect attachment.",
  67805. // "httpMethod": "DELETE",
  67806. // "id": "compute.interconnectAttachments.delete",
  67807. // "parameterOrder": [
  67808. // "project",
  67809. // "region",
  67810. // "interconnectAttachment"
  67811. // ],
  67812. // "parameters": {
  67813. // "interconnectAttachment": {
  67814. // "description": "Name of the interconnect attachment to delete.",
  67815. // "location": "path",
  67816. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67817. // "required": true,
  67818. // "type": "string"
  67819. // },
  67820. // "project": {
  67821. // "description": "Project ID for this request.",
  67822. // "location": "path",
  67823. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67824. // "required": true,
  67825. // "type": "string"
  67826. // },
  67827. // "region": {
  67828. // "description": "Name of the region for this request.",
  67829. // "location": "path",
  67830. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67831. // "required": true,
  67832. // "type": "string"
  67833. // },
  67834. // "requestId": {
  67835. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67836. // "location": "query",
  67837. // "type": "string"
  67838. // }
  67839. // },
  67840. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  67841. // "response": {
  67842. // "$ref": "Operation"
  67843. // },
  67844. // "scopes": [
  67845. // "https://www.googleapis.com/auth/cloud-platform",
  67846. // "https://www.googleapis.com/auth/compute"
  67847. // ]
  67848. // }
  67849. }
  67850. // method id "compute.interconnectAttachments.get":
  67851. type InterconnectAttachmentsGetCall struct {
  67852. s *Service
  67853. project string
  67854. region string
  67855. interconnectAttachment string
  67856. urlParams_ gensupport.URLParams
  67857. ifNoneMatch_ string
  67858. ctx_ context.Context
  67859. header_ http.Header
  67860. }
  67861. // Get: Returns the specified interconnect attachment.
  67862. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  67863. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67864. c.project = project
  67865. c.region = region
  67866. c.interconnectAttachment = interconnectAttachment
  67867. return c
  67868. }
  67869. // Fields allows partial responses to be retrieved. See
  67870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67871. // for more information.
  67872. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  67873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67874. return c
  67875. }
  67876. // IfNoneMatch sets the optional parameter which makes the operation
  67877. // fail if the object's ETag matches the given value. This is useful for
  67878. // getting updates only after the object has changed since the last
  67879. // request. Use googleapi.IsNotModified to check whether the response
  67880. // error from Do is the result of In-None-Match.
  67881. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  67882. c.ifNoneMatch_ = entityTag
  67883. return c
  67884. }
  67885. // Context sets the context to be used in this call's Do method. Any
  67886. // pending HTTP request will be aborted if the provided context is
  67887. // canceled.
  67888. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  67889. c.ctx_ = ctx
  67890. return c
  67891. }
  67892. // Header returns an http.Header that can be modified by the caller to
  67893. // add HTTP headers to the request.
  67894. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  67895. if c.header_ == nil {
  67896. c.header_ = make(http.Header)
  67897. }
  67898. return c.header_
  67899. }
  67900. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  67901. reqHeaders := make(http.Header)
  67902. for k, v := range c.header_ {
  67903. reqHeaders[k] = v
  67904. }
  67905. reqHeaders.Set("User-Agent", c.s.userAgent())
  67906. if c.ifNoneMatch_ != "" {
  67907. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67908. }
  67909. var body io.Reader = nil
  67910. c.urlParams_.Set("alt", alt)
  67911. c.urlParams_.Set("prettyPrint", "false")
  67912. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  67913. urls += "?" + c.urlParams_.Encode()
  67914. req, err := http.NewRequest("GET", urls, body)
  67915. if err != nil {
  67916. return nil, err
  67917. }
  67918. req.Header = reqHeaders
  67919. googleapi.Expand(req.URL, map[string]string{
  67920. "project": c.project,
  67921. "region": c.region,
  67922. "interconnectAttachment": c.interconnectAttachment,
  67923. })
  67924. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67925. }
  67926. // Do executes the "compute.interconnectAttachments.get" call.
  67927. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  67928. // non-2xx status code is an error. Response headers are in either
  67929. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  67930. // returned at all) in error.(*googleapi.Error).Header. Use
  67931. // googleapi.IsNotModified to check whether the returned error was
  67932. // because http.StatusNotModified was returned.
  67933. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  67934. gensupport.SetOptions(c.urlParams_, opts...)
  67935. res, err := c.doRequest("json")
  67936. if res != nil && res.StatusCode == http.StatusNotModified {
  67937. if res.Body != nil {
  67938. res.Body.Close()
  67939. }
  67940. return nil, &googleapi.Error{
  67941. Code: res.StatusCode,
  67942. Header: res.Header,
  67943. }
  67944. }
  67945. if err != nil {
  67946. return nil, err
  67947. }
  67948. defer googleapi.CloseBody(res)
  67949. if err := googleapi.CheckResponse(res); err != nil {
  67950. return nil, err
  67951. }
  67952. ret := &InterconnectAttachment{
  67953. ServerResponse: googleapi.ServerResponse{
  67954. Header: res.Header,
  67955. HTTPStatusCode: res.StatusCode,
  67956. },
  67957. }
  67958. target := &ret
  67959. if err := gensupport.DecodeResponse(target, res); err != nil {
  67960. return nil, err
  67961. }
  67962. return ret, nil
  67963. // {
  67964. // "description": "Returns the specified interconnect attachment.",
  67965. // "httpMethod": "GET",
  67966. // "id": "compute.interconnectAttachments.get",
  67967. // "parameterOrder": [
  67968. // "project",
  67969. // "region",
  67970. // "interconnectAttachment"
  67971. // ],
  67972. // "parameters": {
  67973. // "interconnectAttachment": {
  67974. // "description": "Name of the interconnect attachment to return.",
  67975. // "location": "path",
  67976. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67977. // "required": true,
  67978. // "type": "string"
  67979. // },
  67980. // "project": {
  67981. // "description": "Project ID for this request.",
  67982. // "location": "path",
  67983. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67984. // "required": true,
  67985. // "type": "string"
  67986. // },
  67987. // "region": {
  67988. // "description": "Name of the region for this request.",
  67989. // "location": "path",
  67990. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67991. // "required": true,
  67992. // "type": "string"
  67993. // }
  67994. // },
  67995. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  67996. // "response": {
  67997. // "$ref": "InterconnectAttachment"
  67998. // },
  67999. // "scopes": [
  68000. // "https://www.googleapis.com/auth/cloud-platform",
  68001. // "https://www.googleapis.com/auth/compute",
  68002. // "https://www.googleapis.com/auth/compute.readonly"
  68003. // ]
  68004. // }
  68005. }
  68006. // method id "compute.interconnectAttachments.insert":
  68007. type InterconnectAttachmentsInsertCall struct {
  68008. s *Service
  68009. project string
  68010. region string
  68011. interconnectattachment *InterconnectAttachment
  68012. urlParams_ gensupport.URLParams
  68013. ctx_ context.Context
  68014. header_ http.Header
  68015. }
  68016. // Insert: Creates an InterconnectAttachment in the specified project
  68017. // using the data included in the request.
  68018. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  68019. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68020. c.project = project
  68021. c.region = region
  68022. c.interconnectattachment = interconnectattachment
  68023. return c
  68024. }
  68025. // RequestId sets the optional parameter "requestId": An optional
  68026. // request ID to identify requests. Specify a unique request ID so that
  68027. // if you must retry your request, the server will know to ignore the
  68028. // request if it has already been completed.
  68029. //
  68030. // For example, consider a situation where you make an initial request
  68031. // and the request times out. If you make the request again with the
  68032. // same request ID, the server can check if original operation with the
  68033. // same request ID was received, and if so, will ignore the second
  68034. // request. This prevents clients from accidentally creating duplicate
  68035. // commitments.
  68036. //
  68037. // The request ID must be a valid UUID with the exception that zero UUID
  68038. // is not supported (00000000-0000-0000-0000-000000000000).
  68039. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  68040. c.urlParams_.Set("requestId", requestId)
  68041. return c
  68042. }
  68043. // Fields allows partial responses to be retrieved. See
  68044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68045. // for more information.
  68046. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  68047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68048. return c
  68049. }
  68050. // Context sets the context to be used in this call's Do method. Any
  68051. // pending HTTP request will be aborted if the provided context is
  68052. // canceled.
  68053. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  68054. c.ctx_ = ctx
  68055. return c
  68056. }
  68057. // Header returns an http.Header that can be modified by the caller to
  68058. // add HTTP headers to the request.
  68059. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  68060. if c.header_ == nil {
  68061. c.header_ = make(http.Header)
  68062. }
  68063. return c.header_
  68064. }
  68065. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  68066. reqHeaders := make(http.Header)
  68067. for k, v := range c.header_ {
  68068. reqHeaders[k] = v
  68069. }
  68070. reqHeaders.Set("User-Agent", c.s.userAgent())
  68071. var body io.Reader = nil
  68072. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  68073. if err != nil {
  68074. return nil, err
  68075. }
  68076. reqHeaders.Set("Content-Type", "application/json")
  68077. c.urlParams_.Set("alt", alt)
  68078. c.urlParams_.Set("prettyPrint", "false")
  68079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  68080. urls += "?" + c.urlParams_.Encode()
  68081. req, err := http.NewRequest("POST", urls, body)
  68082. if err != nil {
  68083. return nil, err
  68084. }
  68085. req.Header = reqHeaders
  68086. googleapi.Expand(req.URL, map[string]string{
  68087. "project": c.project,
  68088. "region": c.region,
  68089. })
  68090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68091. }
  68092. // Do executes the "compute.interconnectAttachments.insert" call.
  68093. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68094. // status code is an error. Response headers are in either
  68095. // *Operation.ServerResponse.Header or (if a response was returned at
  68096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68097. // to check whether the returned error was because
  68098. // http.StatusNotModified was returned.
  68099. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68100. gensupport.SetOptions(c.urlParams_, opts...)
  68101. res, err := c.doRequest("json")
  68102. if res != nil && res.StatusCode == http.StatusNotModified {
  68103. if res.Body != nil {
  68104. res.Body.Close()
  68105. }
  68106. return nil, &googleapi.Error{
  68107. Code: res.StatusCode,
  68108. Header: res.Header,
  68109. }
  68110. }
  68111. if err != nil {
  68112. return nil, err
  68113. }
  68114. defer googleapi.CloseBody(res)
  68115. if err := googleapi.CheckResponse(res); err != nil {
  68116. return nil, err
  68117. }
  68118. ret := &Operation{
  68119. ServerResponse: googleapi.ServerResponse{
  68120. Header: res.Header,
  68121. HTTPStatusCode: res.StatusCode,
  68122. },
  68123. }
  68124. target := &ret
  68125. if err := gensupport.DecodeResponse(target, res); err != nil {
  68126. return nil, err
  68127. }
  68128. return ret, nil
  68129. // {
  68130. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  68131. // "httpMethod": "POST",
  68132. // "id": "compute.interconnectAttachments.insert",
  68133. // "parameterOrder": [
  68134. // "project",
  68135. // "region"
  68136. // ],
  68137. // "parameters": {
  68138. // "project": {
  68139. // "description": "Project ID for this request.",
  68140. // "location": "path",
  68141. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68142. // "required": true,
  68143. // "type": "string"
  68144. // },
  68145. // "region": {
  68146. // "description": "Name of the region for this request.",
  68147. // "location": "path",
  68148. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68149. // "required": true,
  68150. // "type": "string"
  68151. // },
  68152. // "requestId": {
  68153. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68154. // "location": "query",
  68155. // "type": "string"
  68156. // }
  68157. // },
  68158. // "path": "{project}/regions/{region}/interconnectAttachments",
  68159. // "request": {
  68160. // "$ref": "InterconnectAttachment"
  68161. // },
  68162. // "response": {
  68163. // "$ref": "Operation"
  68164. // },
  68165. // "scopes": [
  68166. // "https://www.googleapis.com/auth/cloud-platform",
  68167. // "https://www.googleapis.com/auth/compute"
  68168. // ]
  68169. // }
  68170. }
  68171. // method id "compute.interconnectAttachments.list":
  68172. type InterconnectAttachmentsListCall struct {
  68173. s *Service
  68174. project string
  68175. region string
  68176. urlParams_ gensupport.URLParams
  68177. ifNoneMatch_ string
  68178. ctx_ context.Context
  68179. header_ http.Header
  68180. }
  68181. // List: Retrieves the list of interconnect attachments contained within
  68182. // the specified region.
  68183. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  68184. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68185. c.project = project
  68186. c.region = region
  68187. return c
  68188. }
  68189. // Filter sets the optional parameter "filter": A filter expression that
  68190. // filters resources listed in the response. The expression must specify
  68191. // the field name, a comparison operator, and the value that you want to
  68192. // use for filtering. The value must be a string, a number, or a
  68193. // boolean. The comparison operator must be either =, !=, >, or <.
  68194. //
  68195. // For example, if you are filtering Compute Engine instances, you can
  68196. // exclude instances named example-instance by specifying name !=
  68197. // example-instance.
  68198. //
  68199. // You can also filter nested fields. For example, you could specify
  68200. // scheduling.automaticRestart = false to include instances only if they
  68201. // are not scheduled for automatic restarts. You can use filtering on
  68202. // nested fields to filter based on resource labels.
  68203. //
  68204. // To filter on multiple expressions, provide each separate expression
  68205. // within parentheses. For example, (scheduling.automaticRestart = true)
  68206. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68207. // AND expression. However, you can include AND and OR expressions
  68208. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68209. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68210. // true).
  68211. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  68212. c.urlParams_.Set("filter", filter)
  68213. return c
  68214. }
  68215. // MaxResults sets the optional parameter "maxResults": The maximum
  68216. // number of results per page that should be returned. If the number of
  68217. // available results is larger than maxResults, Compute Engine returns a
  68218. // nextPageToken that can be used to get the next page of results in
  68219. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68220. // (Default: 500)
  68221. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  68222. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68223. return c
  68224. }
  68225. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68226. // a certain order. By default, results are returned in alphanumerical
  68227. // order based on the resource name.
  68228. //
  68229. // You can also sort results in descending order based on the creation
  68230. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68231. // based on the creationTimestamp field in reverse chronological order
  68232. // (newest result first). Use this to sort resources like operations so
  68233. // that the newest operation is returned first.
  68234. //
  68235. // Currently, only sorting by name or creationTimestamp desc is
  68236. // supported.
  68237. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  68238. c.urlParams_.Set("orderBy", orderBy)
  68239. return c
  68240. }
  68241. // PageToken sets the optional parameter "pageToken": Specifies a page
  68242. // token to use. Set pageToken to the nextPageToken returned by a
  68243. // previous list request to get the next page of results.
  68244. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  68245. c.urlParams_.Set("pageToken", pageToken)
  68246. return c
  68247. }
  68248. // Fields allows partial responses to be retrieved. See
  68249. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68250. // for more information.
  68251. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  68252. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68253. return c
  68254. }
  68255. // IfNoneMatch sets the optional parameter which makes the operation
  68256. // fail if the object's ETag matches the given value. This is useful for
  68257. // getting updates only after the object has changed since the last
  68258. // request. Use googleapi.IsNotModified to check whether the response
  68259. // error from Do is the result of In-None-Match.
  68260. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  68261. c.ifNoneMatch_ = entityTag
  68262. return c
  68263. }
  68264. // Context sets the context to be used in this call's Do method. Any
  68265. // pending HTTP request will be aborted if the provided context is
  68266. // canceled.
  68267. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  68268. c.ctx_ = ctx
  68269. return c
  68270. }
  68271. // Header returns an http.Header that can be modified by the caller to
  68272. // add HTTP headers to the request.
  68273. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  68274. if c.header_ == nil {
  68275. c.header_ = make(http.Header)
  68276. }
  68277. return c.header_
  68278. }
  68279. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  68280. reqHeaders := make(http.Header)
  68281. for k, v := range c.header_ {
  68282. reqHeaders[k] = v
  68283. }
  68284. reqHeaders.Set("User-Agent", c.s.userAgent())
  68285. if c.ifNoneMatch_ != "" {
  68286. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68287. }
  68288. var body io.Reader = nil
  68289. c.urlParams_.Set("alt", alt)
  68290. c.urlParams_.Set("prettyPrint", "false")
  68291. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  68292. urls += "?" + c.urlParams_.Encode()
  68293. req, err := http.NewRequest("GET", urls, body)
  68294. if err != nil {
  68295. return nil, err
  68296. }
  68297. req.Header = reqHeaders
  68298. googleapi.Expand(req.URL, map[string]string{
  68299. "project": c.project,
  68300. "region": c.region,
  68301. })
  68302. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68303. }
  68304. // Do executes the "compute.interconnectAttachments.list" call.
  68305. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  68306. // Any non-2xx status code is an error. Response headers are in either
  68307. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  68308. // was returned at all) in error.(*googleapi.Error).Header. Use
  68309. // googleapi.IsNotModified to check whether the returned error was
  68310. // because http.StatusNotModified was returned.
  68311. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  68312. gensupport.SetOptions(c.urlParams_, opts...)
  68313. res, err := c.doRequest("json")
  68314. if res != nil && res.StatusCode == http.StatusNotModified {
  68315. if res.Body != nil {
  68316. res.Body.Close()
  68317. }
  68318. return nil, &googleapi.Error{
  68319. Code: res.StatusCode,
  68320. Header: res.Header,
  68321. }
  68322. }
  68323. if err != nil {
  68324. return nil, err
  68325. }
  68326. defer googleapi.CloseBody(res)
  68327. if err := googleapi.CheckResponse(res); err != nil {
  68328. return nil, err
  68329. }
  68330. ret := &InterconnectAttachmentList{
  68331. ServerResponse: googleapi.ServerResponse{
  68332. Header: res.Header,
  68333. HTTPStatusCode: res.StatusCode,
  68334. },
  68335. }
  68336. target := &ret
  68337. if err := gensupport.DecodeResponse(target, res); err != nil {
  68338. return nil, err
  68339. }
  68340. return ret, nil
  68341. // {
  68342. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  68343. // "httpMethod": "GET",
  68344. // "id": "compute.interconnectAttachments.list",
  68345. // "parameterOrder": [
  68346. // "project",
  68347. // "region"
  68348. // ],
  68349. // "parameters": {
  68350. // "filter": {
  68351. // "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).",
  68352. // "location": "query",
  68353. // "type": "string"
  68354. // },
  68355. // "maxResults": {
  68356. // "default": "500",
  68357. // "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)",
  68358. // "format": "uint32",
  68359. // "location": "query",
  68360. // "minimum": "0",
  68361. // "type": "integer"
  68362. // },
  68363. // "orderBy": {
  68364. // "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.",
  68365. // "location": "query",
  68366. // "type": "string"
  68367. // },
  68368. // "pageToken": {
  68369. // "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.",
  68370. // "location": "query",
  68371. // "type": "string"
  68372. // },
  68373. // "project": {
  68374. // "description": "Project ID for this request.",
  68375. // "location": "path",
  68376. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68377. // "required": true,
  68378. // "type": "string"
  68379. // },
  68380. // "region": {
  68381. // "description": "Name of the region for this request.",
  68382. // "location": "path",
  68383. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68384. // "required": true,
  68385. // "type": "string"
  68386. // }
  68387. // },
  68388. // "path": "{project}/regions/{region}/interconnectAttachments",
  68389. // "response": {
  68390. // "$ref": "InterconnectAttachmentList"
  68391. // },
  68392. // "scopes": [
  68393. // "https://www.googleapis.com/auth/cloud-platform",
  68394. // "https://www.googleapis.com/auth/compute",
  68395. // "https://www.googleapis.com/auth/compute.readonly"
  68396. // ]
  68397. // }
  68398. }
  68399. // Pages invokes f for each page of results.
  68400. // A non-nil error returned from f will halt the iteration.
  68401. // The provided context supersedes any context provided to the Context method.
  68402. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  68403. c.ctx_ = ctx
  68404. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68405. for {
  68406. x, err := c.Do()
  68407. if err != nil {
  68408. return err
  68409. }
  68410. if err := f(x); err != nil {
  68411. return err
  68412. }
  68413. if x.NextPageToken == "" {
  68414. return nil
  68415. }
  68416. c.PageToken(x.NextPageToken)
  68417. }
  68418. }
  68419. // method id "compute.interconnectAttachments.patch":
  68420. type InterconnectAttachmentsPatchCall struct {
  68421. s *Service
  68422. project string
  68423. region string
  68424. interconnectAttachment string
  68425. interconnectattachment *InterconnectAttachment
  68426. urlParams_ gensupport.URLParams
  68427. ctx_ context.Context
  68428. header_ http.Header
  68429. }
  68430. // Patch: Updates the specified interconnect attachment with the data
  68431. // included in the request. This method supports PATCH semantics and
  68432. // uses the JSON merge patch format and processing rules.
  68433. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  68434. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68435. c.project = project
  68436. c.region = region
  68437. c.interconnectAttachment = interconnectAttachment
  68438. c.interconnectattachment = interconnectattachment
  68439. return c
  68440. }
  68441. // RequestId sets the optional parameter "requestId": An optional
  68442. // request ID to identify requests. Specify a unique request ID so that
  68443. // if you must retry your request, the server will know to ignore the
  68444. // request if it has already been completed.
  68445. //
  68446. // For example, consider a situation where you make an initial request
  68447. // and the request times out. If you make the request again with the
  68448. // same request ID, the server can check if original operation with the
  68449. // same request ID was received, and if so, will ignore the second
  68450. // request. This prevents clients from accidentally creating duplicate
  68451. // commitments.
  68452. //
  68453. // The request ID must be a valid UUID with the exception that zero UUID
  68454. // is not supported (00000000-0000-0000-0000-000000000000).
  68455. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  68456. c.urlParams_.Set("requestId", requestId)
  68457. return c
  68458. }
  68459. // Fields allows partial responses to be retrieved. See
  68460. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68461. // for more information.
  68462. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  68463. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68464. return c
  68465. }
  68466. // Context sets the context to be used in this call's Do method. Any
  68467. // pending HTTP request will be aborted if the provided context is
  68468. // canceled.
  68469. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  68470. c.ctx_ = ctx
  68471. return c
  68472. }
  68473. // Header returns an http.Header that can be modified by the caller to
  68474. // add HTTP headers to the request.
  68475. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  68476. if c.header_ == nil {
  68477. c.header_ = make(http.Header)
  68478. }
  68479. return c.header_
  68480. }
  68481. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  68482. reqHeaders := make(http.Header)
  68483. for k, v := range c.header_ {
  68484. reqHeaders[k] = v
  68485. }
  68486. reqHeaders.Set("User-Agent", c.s.userAgent())
  68487. var body io.Reader = nil
  68488. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  68489. if err != nil {
  68490. return nil, err
  68491. }
  68492. reqHeaders.Set("Content-Type", "application/json")
  68493. c.urlParams_.Set("alt", alt)
  68494. c.urlParams_.Set("prettyPrint", "false")
  68495. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  68496. urls += "?" + c.urlParams_.Encode()
  68497. req, err := http.NewRequest("PATCH", urls, body)
  68498. if err != nil {
  68499. return nil, err
  68500. }
  68501. req.Header = reqHeaders
  68502. googleapi.Expand(req.URL, map[string]string{
  68503. "project": c.project,
  68504. "region": c.region,
  68505. "interconnectAttachment": c.interconnectAttachment,
  68506. })
  68507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68508. }
  68509. // Do executes the "compute.interconnectAttachments.patch" call.
  68510. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68511. // status code is an error. Response headers are in either
  68512. // *Operation.ServerResponse.Header or (if a response was returned at
  68513. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68514. // to check whether the returned error was because
  68515. // http.StatusNotModified was returned.
  68516. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68517. gensupport.SetOptions(c.urlParams_, opts...)
  68518. res, err := c.doRequest("json")
  68519. if res != nil && res.StatusCode == http.StatusNotModified {
  68520. if res.Body != nil {
  68521. res.Body.Close()
  68522. }
  68523. return nil, &googleapi.Error{
  68524. Code: res.StatusCode,
  68525. Header: res.Header,
  68526. }
  68527. }
  68528. if err != nil {
  68529. return nil, err
  68530. }
  68531. defer googleapi.CloseBody(res)
  68532. if err := googleapi.CheckResponse(res); err != nil {
  68533. return nil, err
  68534. }
  68535. ret := &Operation{
  68536. ServerResponse: googleapi.ServerResponse{
  68537. Header: res.Header,
  68538. HTTPStatusCode: res.StatusCode,
  68539. },
  68540. }
  68541. target := &ret
  68542. if err := gensupport.DecodeResponse(target, res); err != nil {
  68543. return nil, err
  68544. }
  68545. return ret, nil
  68546. // {
  68547. // "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.",
  68548. // "httpMethod": "PATCH",
  68549. // "id": "compute.interconnectAttachments.patch",
  68550. // "parameterOrder": [
  68551. // "project",
  68552. // "region",
  68553. // "interconnectAttachment"
  68554. // ],
  68555. // "parameters": {
  68556. // "interconnectAttachment": {
  68557. // "description": "Name of the interconnect attachment to patch.",
  68558. // "location": "path",
  68559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68560. // "required": true,
  68561. // "type": "string"
  68562. // },
  68563. // "project": {
  68564. // "description": "Project ID for this request.",
  68565. // "location": "path",
  68566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68567. // "required": true,
  68568. // "type": "string"
  68569. // },
  68570. // "region": {
  68571. // "description": "Name of the region scoping this request.",
  68572. // "location": "path",
  68573. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68574. // "required": true,
  68575. // "type": "string"
  68576. // },
  68577. // "requestId": {
  68578. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68579. // "location": "query",
  68580. // "type": "string"
  68581. // }
  68582. // },
  68583. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  68584. // "request": {
  68585. // "$ref": "InterconnectAttachment"
  68586. // },
  68587. // "response": {
  68588. // "$ref": "Operation"
  68589. // },
  68590. // "scopes": [
  68591. // "https://www.googleapis.com/auth/cloud-platform",
  68592. // "https://www.googleapis.com/auth/compute"
  68593. // ]
  68594. // }
  68595. }
  68596. // method id "compute.interconnectAttachments.setLabels":
  68597. type InterconnectAttachmentsSetLabelsCall struct {
  68598. s *Service
  68599. project string
  68600. region string
  68601. resource string
  68602. regionsetlabelsrequest *RegionSetLabelsRequest
  68603. urlParams_ gensupport.URLParams
  68604. ctx_ context.Context
  68605. header_ http.Header
  68606. }
  68607. // SetLabels: Sets the labels on an InterconnectAttachment. To learn
  68608. // more about labels, read the Labeling Resources documentation.
  68609. func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall {
  68610. c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68611. c.project = project
  68612. c.region = region
  68613. c.resource = resource
  68614. c.regionsetlabelsrequest = regionsetlabelsrequest
  68615. return c
  68616. }
  68617. // RequestId sets the optional parameter "requestId": An optional
  68618. // request ID to identify requests. Specify a unique request ID so that
  68619. // if you must retry your request, the server will know to ignore the
  68620. // request if it has already been completed.
  68621. //
  68622. // For example, consider a situation where you make an initial request
  68623. // and the request times out. If you make the request again with the
  68624. // same request ID, the server can check if original operation with the
  68625. // same request ID was received, and if so, will ignore the second
  68626. // request. This prevents clients from accidentally creating duplicate
  68627. // commitments.
  68628. //
  68629. // The request ID must be a valid UUID with the exception that zero UUID
  68630. // is not supported (00000000-0000-0000-0000-000000000000).
  68631. func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall {
  68632. c.urlParams_.Set("requestId", requestId)
  68633. return c
  68634. }
  68635. // Fields allows partial responses to be retrieved. See
  68636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68637. // for more information.
  68638. func (c *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall {
  68639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68640. return c
  68641. }
  68642. // Context sets the context to be used in this call's Do method. Any
  68643. // pending HTTP request will be aborted if the provided context is
  68644. // canceled.
  68645. func (c *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall {
  68646. c.ctx_ = ctx
  68647. return c
  68648. }
  68649. // Header returns an http.Header that can be modified by the caller to
  68650. // add HTTP headers to the request.
  68651. func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header {
  68652. if c.header_ == nil {
  68653. c.header_ = make(http.Header)
  68654. }
  68655. return c.header_
  68656. }
  68657. func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  68658. reqHeaders := make(http.Header)
  68659. for k, v := range c.header_ {
  68660. reqHeaders[k] = v
  68661. }
  68662. reqHeaders.Set("User-Agent", c.s.userAgent())
  68663. var body io.Reader = nil
  68664. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  68665. if err != nil {
  68666. return nil, err
  68667. }
  68668. reqHeaders.Set("Content-Type", "application/json")
  68669. c.urlParams_.Set("alt", alt)
  68670. c.urlParams_.Set("prettyPrint", "false")
  68671. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels")
  68672. urls += "?" + c.urlParams_.Encode()
  68673. req, err := http.NewRequest("POST", urls, body)
  68674. if err != nil {
  68675. return nil, err
  68676. }
  68677. req.Header = reqHeaders
  68678. googleapi.Expand(req.URL, map[string]string{
  68679. "project": c.project,
  68680. "region": c.region,
  68681. "resource": c.resource,
  68682. })
  68683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68684. }
  68685. // Do executes the "compute.interconnectAttachments.setLabels" call.
  68686. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68687. // status code is an error. Response headers are in either
  68688. // *Operation.ServerResponse.Header or (if a response was returned at
  68689. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68690. // to check whether the returned error was because
  68691. // http.StatusNotModified was returned.
  68692. func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68693. gensupport.SetOptions(c.urlParams_, opts...)
  68694. res, err := c.doRequest("json")
  68695. if res != nil && res.StatusCode == http.StatusNotModified {
  68696. if res.Body != nil {
  68697. res.Body.Close()
  68698. }
  68699. return nil, &googleapi.Error{
  68700. Code: res.StatusCode,
  68701. Header: res.Header,
  68702. }
  68703. }
  68704. if err != nil {
  68705. return nil, err
  68706. }
  68707. defer googleapi.CloseBody(res)
  68708. if err := googleapi.CheckResponse(res); err != nil {
  68709. return nil, err
  68710. }
  68711. ret := &Operation{
  68712. ServerResponse: googleapi.ServerResponse{
  68713. Header: res.Header,
  68714. HTTPStatusCode: res.StatusCode,
  68715. },
  68716. }
  68717. target := &ret
  68718. if err := gensupport.DecodeResponse(target, res); err != nil {
  68719. return nil, err
  68720. }
  68721. return ret, nil
  68722. // {
  68723. // "description": "Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.",
  68724. // "httpMethod": "POST",
  68725. // "id": "compute.interconnectAttachments.setLabels",
  68726. // "parameterOrder": [
  68727. // "project",
  68728. // "region",
  68729. // "resource"
  68730. // ],
  68731. // "parameters": {
  68732. // "project": {
  68733. // "description": "Project ID for this request.",
  68734. // "location": "path",
  68735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68736. // "required": true,
  68737. // "type": "string"
  68738. // },
  68739. // "region": {
  68740. // "description": "The region for this request.",
  68741. // "location": "path",
  68742. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68743. // "required": true,
  68744. // "type": "string"
  68745. // },
  68746. // "requestId": {
  68747. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68748. // "location": "query",
  68749. // "type": "string"
  68750. // },
  68751. // "resource": {
  68752. // "description": "Name or id of the resource for this request.",
  68753. // "location": "path",
  68754. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68755. // "required": true,
  68756. // "type": "string"
  68757. // }
  68758. // },
  68759. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
  68760. // "request": {
  68761. // "$ref": "RegionSetLabelsRequest"
  68762. // },
  68763. // "response": {
  68764. // "$ref": "Operation"
  68765. // },
  68766. // "scopes": [
  68767. // "https://www.googleapis.com/auth/cloud-platform",
  68768. // "https://www.googleapis.com/auth/compute"
  68769. // ]
  68770. // }
  68771. }
  68772. // method id "compute.interconnectAttachments.testIamPermissions":
  68773. type InterconnectAttachmentsTestIamPermissionsCall struct {
  68774. s *Service
  68775. project string
  68776. region string
  68777. resource string
  68778. testpermissionsrequest *TestPermissionsRequest
  68779. urlParams_ gensupport.URLParams
  68780. ctx_ context.Context
  68781. header_ http.Header
  68782. }
  68783. // TestIamPermissions: Returns permissions that a caller has on the
  68784. // specified resource.
  68785. func (r *InterconnectAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectAttachmentsTestIamPermissionsCall {
  68786. c := &InterconnectAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68787. c.project = project
  68788. c.region = region
  68789. c.resource = resource
  68790. c.testpermissionsrequest = testpermissionsrequest
  68791. return c
  68792. }
  68793. // Fields allows partial responses to be retrieved. See
  68794. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68795. // for more information.
  68796. func (c *InterconnectAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsTestIamPermissionsCall {
  68797. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68798. return c
  68799. }
  68800. // Context sets the context to be used in this call's Do method. Any
  68801. // pending HTTP request will be aborted if the provided context is
  68802. // canceled.
  68803. func (c *InterconnectAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectAttachmentsTestIamPermissionsCall {
  68804. c.ctx_ = ctx
  68805. return c
  68806. }
  68807. // Header returns an http.Header that can be modified by the caller to
  68808. // add HTTP headers to the request.
  68809. func (c *InterconnectAttachmentsTestIamPermissionsCall) Header() http.Header {
  68810. if c.header_ == nil {
  68811. c.header_ = make(http.Header)
  68812. }
  68813. return c.header_
  68814. }
  68815. func (c *InterconnectAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  68816. reqHeaders := make(http.Header)
  68817. for k, v := range c.header_ {
  68818. reqHeaders[k] = v
  68819. }
  68820. reqHeaders.Set("User-Agent", c.s.userAgent())
  68821. var body io.Reader = nil
  68822. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  68823. if err != nil {
  68824. return nil, err
  68825. }
  68826. reqHeaders.Set("Content-Type", "application/json")
  68827. c.urlParams_.Set("alt", alt)
  68828. c.urlParams_.Set("prettyPrint", "false")
  68829. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions")
  68830. urls += "?" + c.urlParams_.Encode()
  68831. req, err := http.NewRequest("POST", urls, body)
  68832. if err != nil {
  68833. return nil, err
  68834. }
  68835. req.Header = reqHeaders
  68836. googleapi.Expand(req.URL, map[string]string{
  68837. "project": c.project,
  68838. "region": c.region,
  68839. "resource": c.resource,
  68840. })
  68841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68842. }
  68843. // Do executes the "compute.interconnectAttachments.testIamPermissions" call.
  68844. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  68845. // non-2xx status code is an error. Response headers are in either
  68846. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  68847. // returned at all) in error.(*googleapi.Error).Header. Use
  68848. // googleapi.IsNotModified to check whether the returned error was
  68849. // because http.StatusNotModified was returned.
  68850. func (c *InterconnectAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  68851. gensupport.SetOptions(c.urlParams_, opts...)
  68852. res, err := c.doRequest("json")
  68853. if res != nil && res.StatusCode == http.StatusNotModified {
  68854. if res.Body != nil {
  68855. res.Body.Close()
  68856. }
  68857. return nil, &googleapi.Error{
  68858. Code: res.StatusCode,
  68859. Header: res.Header,
  68860. }
  68861. }
  68862. if err != nil {
  68863. return nil, err
  68864. }
  68865. defer googleapi.CloseBody(res)
  68866. if err := googleapi.CheckResponse(res); err != nil {
  68867. return nil, err
  68868. }
  68869. ret := &TestPermissionsResponse{
  68870. ServerResponse: googleapi.ServerResponse{
  68871. Header: res.Header,
  68872. HTTPStatusCode: res.StatusCode,
  68873. },
  68874. }
  68875. target := &ret
  68876. if err := gensupport.DecodeResponse(target, res); err != nil {
  68877. return nil, err
  68878. }
  68879. return ret, nil
  68880. // {
  68881. // "description": "Returns permissions that a caller has on the specified resource.",
  68882. // "httpMethod": "POST",
  68883. // "id": "compute.interconnectAttachments.testIamPermissions",
  68884. // "parameterOrder": [
  68885. // "project",
  68886. // "region",
  68887. // "resource"
  68888. // ],
  68889. // "parameters": {
  68890. // "project": {
  68891. // "description": "Project ID for this request.",
  68892. // "location": "path",
  68893. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68894. // "required": true,
  68895. // "type": "string"
  68896. // },
  68897. // "region": {
  68898. // "description": "The name of the region for this request.",
  68899. // "location": "path",
  68900. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68901. // "required": true,
  68902. // "type": "string"
  68903. // },
  68904. // "resource": {
  68905. // "description": "Name or id of the resource for this request.",
  68906. // "location": "path",
  68907. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68908. // "required": true,
  68909. // "type": "string"
  68910. // }
  68911. // },
  68912. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions",
  68913. // "request": {
  68914. // "$ref": "TestPermissionsRequest"
  68915. // },
  68916. // "response": {
  68917. // "$ref": "TestPermissionsResponse"
  68918. // },
  68919. // "scopes": [
  68920. // "https://www.googleapis.com/auth/cloud-platform",
  68921. // "https://www.googleapis.com/auth/compute",
  68922. // "https://www.googleapis.com/auth/compute.readonly"
  68923. // ]
  68924. // }
  68925. }
  68926. // method id "compute.interconnectLocations.get":
  68927. type InterconnectLocationsGetCall struct {
  68928. s *Service
  68929. project string
  68930. interconnectLocation string
  68931. urlParams_ gensupport.URLParams
  68932. ifNoneMatch_ string
  68933. ctx_ context.Context
  68934. header_ http.Header
  68935. }
  68936. // Get: Returns the details for the specified interconnect location.
  68937. // Gets a list of available interconnect locations by making a list()
  68938. // request.
  68939. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  68940. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68941. c.project = project
  68942. c.interconnectLocation = interconnectLocation
  68943. return c
  68944. }
  68945. // Fields allows partial responses to be retrieved. See
  68946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68947. // for more information.
  68948. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  68949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68950. return c
  68951. }
  68952. // IfNoneMatch sets the optional parameter which makes the operation
  68953. // fail if the object's ETag matches the given value. This is useful for
  68954. // getting updates only after the object has changed since the last
  68955. // request. Use googleapi.IsNotModified to check whether the response
  68956. // error from Do is the result of In-None-Match.
  68957. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  68958. c.ifNoneMatch_ = entityTag
  68959. return c
  68960. }
  68961. // Context sets the context to be used in this call's Do method. Any
  68962. // pending HTTP request will be aborted if the provided context is
  68963. // canceled.
  68964. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  68965. c.ctx_ = ctx
  68966. return c
  68967. }
  68968. // Header returns an http.Header that can be modified by the caller to
  68969. // add HTTP headers to the request.
  68970. func (c *InterconnectLocationsGetCall) Header() http.Header {
  68971. if c.header_ == nil {
  68972. c.header_ = make(http.Header)
  68973. }
  68974. return c.header_
  68975. }
  68976. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  68977. reqHeaders := make(http.Header)
  68978. for k, v := range c.header_ {
  68979. reqHeaders[k] = v
  68980. }
  68981. reqHeaders.Set("User-Agent", c.s.userAgent())
  68982. if c.ifNoneMatch_ != "" {
  68983. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68984. }
  68985. var body io.Reader = nil
  68986. c.urlParams_.Set("alt", alt)
  68987. c.urlParams_.Set("prettyPrint", "false")
  68988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  68989. urls += "?" + c.urlParams_.Encode()
  68990. req, err := http.NewRequest("GET", urls, body)
  68991. if err != nil {
  68992. return nil, err
  68993. }
  68994. req.Header = reqHeaders
  68995. googleapi.Expand(req.URL, map[string]string{
  68996. "project": c.project,
  68997. "interconnectLocation": c.interconnectLocation,
  68998. })
  68999. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69000. }
  69001. // Do executes the "compute.interconnectLocations.get" call.
  69002. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  69003. // non-2xx status code is an error. Response headers are in either
  69004. // *InterconnectLocation.ServerResponse.Header or (if a response was
  69005. // returned at all) in error.(*googleapi.Error).Header. Use
  69006. // googleapi.IsNotModified to check whether the returned error was
  69007. // because http.StatusNotModified was returned.
  69008. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  69009. gensupport.SetOptions(c.urlParams_, opts...)
  69010. res, err := c.doRequest("json")
  69011. if res != nil && res.StatusCode == http.StatusNotModified {
  69012. if res.Body != nil {
  69013. res.Body.Close()
  69014. }
  69015. return nil, &googleapi.Error{
  69016. Code: res.StatusCode,
  69017. Header: res.Header,
  69018. }
  69019. }
  69020. if err != nil {
  69021. return nil, err
  69022. }
  69023. defer googleapi.CloseBody(res)
  69024. if err := googleapi.CheckResponse(res); err != nil {
  69025. return nil, err
  69026. }
  69027. ret := &InterconnectLocation{
  69028. ServerResponse: googleapi.ServerResponse{
  69029. Header: res.Header,
  69030. HTTPStatusCode: res.StatusCode,
  69031. },
  69032. }
  69033. target := &ret
  69034. if err := gensupport.DecodeResponse(target, res); err != nil {
  69035. return nil, err
  69036. }
  69037. return ret, nil
  69038. // {
  69039. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  69040. // "httpMethod": "GET",
  69041. // "id": "compute.interconnectLocations.get",
  69042. // "parameterOrder": [
  69043. // "project",
  69044. // "interconnectLocation"
  69045. // ],
  69046. // "parameters": {
  69047. // "interconnectLocation": {
  69048. // "description": "Name of the interconnect location to return.",
  69049. // "location": "path",
  69050. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69051. // "required": true,
  69052. // "type": "string"
  69053. // },
  69054. // "project": {
  69055. // "description": "Project ID for this request.",
  69056. // "location": "path",
  69057. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69058. // "required": true,
  69059. // "type": "string"
  69060. // }
  69061. // },
  69062. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  69063. // "response": {
  69064. // "$ref": "InterconnectLocation"
  69065. // },
  69066. // "scopes": [
  69067. // "https://www.googleapis.com/auth/cloud-platform",
  69068. // "https://www.googleapis.com/auth/compute",
  69069. // "https://www.googleapis.com/auth/compute.readonly"
  69070. // ]
  69071. // }
  69072. }
  69073. // method id "compute.interconnectLocations.list":
  69074. type InterconnectLocationsListCall struct {
  69075. s *Service
  69076. project string
  69077. urlParams_ gensupport.URLParams
  69078. ifNoneMatch_ string
  69079. ctx_ context.Context
  69080. header_ http.Header
  69081. }
  69082. // List: Retrieves the list of interconnect locations available to the
  69083. // specified project.
  69084. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  69085. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69086. c.project = project
  69087. return c
  69088. }
  69089. // Filter sets the optional parameter "filter": A filter expression that
  69090. // filters resources listed in the response. The expression must specify
  69091. // the field name, a comparison operator, and the value that you want to
  69092. // use for filtering. The value must be a string, a number, or a
  69093. // boolean. The comparison operator must be either =, !=, >, or <.
  69094. //
  69095. // For example, if you are filtering Compute Engine instances, you can
  69096. // exclude instances named example-instance by specifying name !=
  69097. // example-instance.
  69098. //
  69099. // You can also filter nested fields. For example, you could specify
  69100. // scheduling.automaticRestart = false to include instances only if they
  69101. // are not scheduled for automatic restarts. You can use filtering on
  69102. // nested fields to filter based on resource labels.
  69103. //
  69104. // To filter on multiple expressions, provide each separate expression
  69105. // within parentheses. For example, (scheduling.automaticRestart = true)
  69106. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69107. // AND expression. However, you can include AND and OR expressions
  69108. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69109. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69110. // true).
  69111. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  69112. c.urlParams_.Set("filter", filter)
  69113. return c
  69114. }
  69115. // MaxResults sets the optional parameter "maxResults": The maximum
  69116. // number of results per page that should be returned. If the number of
  69117. // available results is larger than maxResults, Compute Engine returns a
  69118. // nextPageToken that can be used to get the next page of results in
  69119. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69120. // (Default: 500)
  69121. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  69122. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69123. return c
  69124. }
  69125. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  69126. // a certain order. By default, results are returned in alphanumerical
  69127. // order based on the resource name.
  69128. //
  69129. // You can also sort results in descending order based on the creation
  69130. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69131. // based on the creationTimestamp field in reverse chronological order
  69132. // (newest result first). Use this to sort resources like operations so
  69133. // that the newest operation is returned first.
  69134. //
  69135. // Currently, only sorting by name or creationTimestamp desc is
  69136. // supported.
  69137. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  69138. c.urlParams_.Set("orderBy", orderBy)
  69139. return c
  69140. }
  69141. // PageToken sets the optional parameter "pageToken": Specifies a page
  69142. // token to use. Set pageToken to the nextPageToken returned by a
  69143. // previous list request to get the next page of results.
  69144. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  69145. c.urlParams_.Set("pageToken", pageToken)
  69146. return c
  69147. }
  69148. // Fields allows partial responses to be retrieved. See
  69149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69150. // for more information.
  69151. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  69152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69153. return c
  69154. }
  69155. // IfNoneMatch sets the optional parameter which makes the operation
  69156. // fail if the object's ETag matches the given value. This is useful for
  69157. // getting updates only after the object has changed since the last
  69158. // request. Use googleapi.IsNotModified to check whether the response
  69159. // error from Do is the result of In-None-Match.
  69160. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  69161. c.ifNoneMatch_ = entityTag
  69162. return c
  69163. }
  69164. // Context sets the context to be used in this call's Do method. Any
  69165. // pending HTTP request will be aborted if the provided context is
  69166. // canceled.
  69167. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  69168. c.ctx_ = ctx
  69169. return c
  69170. }
  69171. // Header returns an http.Header that can be modified by the caller to
  69172. // add HTTP headers to the request.
  69173. func (c *InterconnectLocationsListCall) Header() http.Header {
  69174. if c.header_ == nil {
  69175. c.header_ = make(http.Header)
  69176. }
  69177. return c.header_
  69178. }
  69179. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  69180. reqHeaders := make(http.Header)
  69181. for k, v := range c.header_ {
  69182. reqHeaders[k] = v
  69183. }
  69184. reqHeaders.Set("User-Agent", c.s.userAgent())
  69185. if c.ifNoneMatch_ != "" {
  69186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69187. }
  69188. var body io.Reader = nil
  69189. c.urlParams_.Set("alt", alt)
  69190. c.urlParams_.Set("prettyPrint", "false")
  69191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  69192. urls += "?" + c.urlParams_.Encode()
  69193. req, err := http.NewRequest("GET", urls, body)
  69194. if err != nil {
  69195. return nil, err
  69196. }
  69197. req.Header = reqHeaders
  69198. googleapi.Expand(req.URL, map[string]string{
  69199. "project": c.project,
  69200. })
  69201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69202. }
  69203. // Do executes the "compute.interconnectLocations.list" call.
  69204. // Exactly one of *InterconnectLocationList or error will be non-nil.
  69205. // Any non-2xx status code is an error. Response headers are in either
  69206. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  69207. // returned at all) in error.(*googleapi.Error).Header. Use
  69208. // googleapi.IsNotModified to check whether the returned error was
  69209. // because http.StatusNotModified was returned.
  69210. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  69211. gensupport.SetOptions(c.urlParams_, opts...)
  69212. res, err := c.doRequest("json")
  69213. if res != nil && res.StatusCode == http.StatusNotModified {
  69214. if res.Body != nil {
  69215. res.Body.Close()
  69216. }
  69217. return nil, &googleapi.Error{
  69218. Code: res.StatusCode,
  69219. Header: res.Header,
  69220. }
  69221. }
  69222. if err != nil {
  69223. return nil, err
  69224. }
  69225. defer googleapi.CloseBody(res)
  69226. if err := googleapi.CheckResponse(res); err != nil {
  69227. return nil, err
  69228. }
  69229. ret := &InterconnectLocationList{
  69230. ServerResponse: googleapi.ServerResponse{
  69231. Header: res.Header,
  69232. HTTPStatusCode: res.StatusCode,
  69233. },
  69234. }
  69235. target := &ret
  69236. if err := gensupport.DecodeResponse(target, res); err != nil {
  69237. return nil, err
  69238. }
  69239. return ret, nil
  69240. // {
  69241. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  69242. // "httpMethod": "GET",
  69243. // "id": "compute.interconnectLocations.list",
  69244. // "parameterOrder": [
  69245. // "project"
  69246. // ],
  69247. // "parameters": {
  69248. // "filter": {
  69249. // "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).",
  69250. // "location": "query",
  69251. // "type": "string"
  69252. // },
  69253. // "maxResults": {
  69254. // "default": "500",
  69255. // "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)",
  69256. // "format": "uint32",
  69257. // "location": "query",
  69258. // "minimum": "0",
  69259. // "type": "integer"
  69260. // },
  69261. // "orderBy": {
  69262. // "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.",
  69263. // "location": "query",
  69264. // "type": "string"
  69265. // },
  69266. // "pageToken": {
  69267. // "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.",
  69268. // "location": "query",
  69269. // "type": "string"
  69270. // },
  69271. // "project": {
  69272. // "description": "Project ID for this request.",
  69273. // "location": "path",
  69274. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69275. // "required": true,
  69276. // "type": "string"
  69277. // }
  69278. // },
  69279. // "path": "{project}/global/interconnectLocations",
  69280. // "response": {
  69281. // "$ref": "InterconnectLocationList"
  69282. // },
  69283. // "scopes": [
  69284. // "https://www.googleapis.com/auth/cloud-platform",
  69285. // "https://www.googleapis.com/auth/compute",
  69286. // "https://www.googleapis.com/auth/compute.readonly"
  69287. // ]
  69288. // }
  69289. }
  69290. // Pages invokes f for each page of results.
  69291. // A non-nil error returned from f will halt the iteration.
  69292. // The provided context supersedes any context provided to the Context method.
  69293. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  69294. c.ctx_ = ctx
  69295. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69296. for {
  69297. x, err := c.Do()
  69298. if err != nil {
  69299. return err
  69300. }
  69301. if err := f(x); err != nil {
  69302. return err
  69303. }
  69304. if x.NextPageToken == "" {
  69305. return nil
  69306. }
  69307. c.PageToken(x.NextPageToken)
  69308. }
  69309. }
  69310. // method id "compute.interconnects.delete":
  69311. type InterconnectsDeleteCall struct {
  69312. s *Service
  69313. project string
  69314. interconnect string
  69315. urlParams_ gensupport.URLParams
  69316. ctx_ context.Context
  69317. header_ http.Header
  69318. }
  69319. // Delete: Deletes the specified interconnect.
  69320. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  69321. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69322. c.project = project
  69323. c.interconnect = interconnect
  69324. return c
  69325. }
  69326. // RequestId sets the optional parameter "requestId": An optional
  69327. // request ID to identify requests. Specify a unique request ID so that
  69328. // if you must retry your request, the server will know to ignore the
  69329. // request if it has already been completed.
  69330. //
  69331. // For example, consider a situation where you make an initial request
  69332. // and the request times out. If you make the request again with the
  69333. // same request ID, the server can check if original operation with the
  69334. // same request ID was received, and if so, will ignore the second
  69335. // request. This prevents clients from accidentally creating duplicate
  69336. // commitments.
  69337. //
  69338. // The request ID must be a valid UUID with the exception that zero UUID
  69339. // is not supported (00000000-0000-0000-0000-000000000000).
  69340. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  69341. c.urlParams_.Set("requestId", requestId)
  69342. return c
  69343. }
  69344. // Fields allows partial responses to be retrieved. See
  69345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69346. // for more information.
  69347. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  69348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69349. return c
  69350. }
  69351. // Context sets the context to be used in this call's Do method. Any
  69352. // pending HTTP request will be aborted if the provided context is
  69353. // canceled.
  69354. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  69355. c.ctx_ = ctx
  69356. return c
  69357. }
  69358. // Header returns an http.Header that can be modified by the caller to
  69359. // add HTTP headers to the request.
  69360. func (c *InterconnectsDeleteCall) Header() http.Header {
  69361. if c.header_ == nil {
  69362. c.header_ = make(http.Header)
  69363. }
  69364. return c.header_
  69365. }
  69366. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  69367. reqHeaders := make(http.Header)
  69368. for k, v := range c.header_ {
  69369. reqHeaders[k] = v
  69370. }
  69371. reqHeaders.Set("User-Agent", c.s.userAgent())
  69372. var body io.Reader = nil
  69373. c.urlParams_.Set("alt", alt)
  69374. c.urlParams_.Set("prettyPrint", "false")
  69375. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  69376. urls += "?" + c.urlParams_.Encode()
  69377. req, err := http.NewRequest("DELETE", urls, body)
  69378. if err != nil {
  69379. return nil, err
  69380. }
  69381. req.Header = reqHeaders
  69382. googleapi.Expand(req.URL, map[string]string{
  69383. "project": c.project,
  69384. "interconnect": c.interconnect,
  69385. })
  69386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69387. }
  69388. // Do executes the "compute.interconnects.delete" call.
  69389. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69390. // status code is an error. Response headers are in either
  69391. // *Operation.ServerResponse.Header or (if a response was returned at
  69392. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69393. // to check whether the returned error was because
  69394. // http.StatusNotModified was returned.
  69395. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69396. gensupport.SetOptions(c.urlParams_, opts...)
  69397. res, err := c.doRequest("json")
  69398. if res != nil && res.StatusCode == http.StatusNotModified {
  69399. if res.Body != nil {
  69400. res.Body.Close()
  69401. }
  69402. return nil, &googleapi.Error{
  69403. Code: res.StatusCode,
  69404. Header: res.Header,
  69405. }
  69406. }
  69407. if err != nil {
  69408. return nil, err
  69409. }
  69410. defer googleapi.CloseBody(res)
  69411. if err := googleapi.CheckResponse(res); err != nil {
  69412. return nil, err
  69413. }
  69414. ret := &Operation{
  69415. ServerResponse: googleapi.ServerResponse{
  69416. Header: res.Header,
  69417. HTTPStatusCode: res.StatusCode,
  69418. },
  69419. }
  69420. target := &ret
  69421. if err := gensupport.DecodeResponse(target, res); err != nil {
  69422. return nil, err
  69423. }
  69424. return ret, nil
  69425. // {
  69426. // "description": "Deletes the specified interconnect.",
  69427. // "httpMethod": "DELETE",
  69428. // "id": "compute.interconnects.delete",
  69429. // "parameterOrder": [
  69430. // "project",
  69431. // "interconnect"
  69432. // ],
  69433. // "parameters": {
  69434. // "interconnect": {
  69435. // "description": "Name of the interconnect to delete.",
  69436. // "location": "path",
  69437. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69438. // "required": true,
  69439. // "type": "string"
  69440. // },
  69441. // "project": {
  69442. // "description": "Project ID for this request.",
  69443. // "location": "path",
  69444. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69445. // "required": true,
  69446. // "type": "string"
  69447. // },
  69448. // "requestId": {
  69449. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69450. // "location": "query",
  69451. // "type": "string"
  69452. // }
  69453. // },
  69454. // "path": "{project}/global/interconnects/{interconnect}",
  69455. // "response": {
  69456. // "$ref": "Operation"
  69457. // },
  69458. // "scopes": [
  69459. // "https://www.googleapis.com/auth/cloud-platform",
  69460. // "https://www.googleapis.com/auth/compute"
  69461. // ]
  69462. // }
  69463. }
  69464. // method id "compute.interconnects.get":
  69465. type InterconnectsGetCall struct {
  69466. s *Service
  69467. project string
  69468. interconnect string
  69469. urlParams_ gensupport.URLParams
  69470. ifNoneMatch_ string
  69471. ctx_ context.Context
  69472. header_ http.Header
  69473. }
  69474. // Get: Returns the specified interconnect. Get a list of available
  69475. // interconnects by making a list() request.
  69476. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  69477. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69478. c.project = project
  69479. c.interconnect = interconnect
  69480. return c
  69481. }
  69482. // Fields allows partial responses to be retrieved. See
  69483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69484. // for more information.
  69485. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  69486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69487. return c
  69488. }
  69489. // IfNoneMatch sets the optional parameter which makes the operation
  69490. // fail if the object's ETag matches the given value. This is useful for
  69491. // getting updates only after the object has changed since the last
  69492. // request. Use googleapi.IsNotModified to check whether the response
  69493. // error from Do is the result of In-None-Match.
  69494. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  69495. c.ifNoneMatch_ = entityTag
  69496. return c
  69497. }
  69498. // Context sets the context to be used in this call's Do method. Any
  69499. // pending HTTP request will be aborted if the provided context is
  69500. // canceled.
  69501. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  69502. c.ctx_ = ctx
  69503. return c
  69504. }
  69505. // Header returns an http.Header that can be modified by the caller to
  69506. // add HTTP headers to the request.
  69507. func (c *InterconnectsGetCall) Header() http.Header {
  69508. if c.header_ == nil {
  69509. c.header_ = make(http.Header)
  69510. }
  69511. return c.header_
  69512. }
  69513. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  69514. reqHeaders := make(http.Header)
  69515. for k, v := range c.header_ {
  69516. reqHeaders[k] = v
  69517. }
  69518. reqHeaders.Set("User-Agent", c.s.userAgent())
  69519. if c.ifNoneMatch_ != "" {
  69520. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69521. }
  69522. var body io.Reader = nil
  69523. c.urlParams_.Set("alt", alt)
  69524. c.urlParams_.Set("prettyPrint", "false")
  69525. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  69526. urls += "?" + c.urlParams_.Encode()
  69527. req, err := http.NewRequest("GET", urls, body)
  69528. if err != nil {
  69529. return nil, err
  69530. }
  69531. req.Header = reqHeaders
  69532. googleapi.Expand(req.URL, map[string]string{
  69533. "project": c.project,
  69534. "interconnect": c.interconnect,
  69535. })
  69536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69537. }
  69538. // Do executes the "compute.interconnects.get" call.
  69539. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  69540. // status code is an error. Response headers are in either
  69541. // *Interconnect.ServerResponse.Header or (if a response was returned at
  69542. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69543. // to check whether the returned error was because
  69544. // http.StatusNotModified was returned.
  69545. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  69546. gensupport.SetOptions(c.urlParams_, opts...)
  69547. res, err := c.doRequest("json")
  69548. if res != nil && res.StatusCode == http.StatusNotModified {
  69549. if res.Body != nil {
  69550. res.Body.Close()
  69551. }
  69552. return nil, &googleapi.Error{
  69553. Code: res.StatusCode,
  69554. Header: res.Header,
  69555. }
  69556. }
  69557. if err != nil {
  69558. return nil, err
  69559. }
  69560. defer googleapi.CloseBody(res)
  69561. if err := googleapi.CheckResponse(res); err != nil {
  69562. return nil, err
  69563. }
  69564. ret := &Interconnect{
  69565. ServerResponse: googleapi.ServerResponse{
  69566. Header: res.Header,
  69567. HTTPStatusCode: res.StatusCode,
  69568. },
  69569. }
  69570. target := &ret
  69571. if err := gensupport.DecodeResponse(target, res); err != nil {
  69572. return nil, err
  69573. }
  69574. return ret, nil
  69575. // {
  69576. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  69577. // "httpMethod": "GET",
  69578. // "id": "compute.interconnects.get",
  69579. // "parameterOrder": [
  69580. // "project",
  69581. // "interconnect"
  69582. // ],
  69583. // "parameters": {
  69584. // "interconnect": {
  69585. // "description": "Name of the interconnect to return.",
  69586. // "location": "path",
  69587. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69588. // "required": true,
  69589. // "type": "string"
  69590. // },
  69591. // "project": {
  69592. // "description": "Project ID for this request.",
  69593. // "location": "path",
  69594. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69595. // "required": true,
  69596. // "type": "string"
  69597. // }
  69598. // },
  69599. // "path": "{project}/global/interconnects/{interconnect}",
  69600. // "response": {
  69601. // "$ref": "Interconnect"
  69602. // },
  69603. // "scopes": [
  69604. // "https://www.googleapis.com/auth/cloud-platform",
  69605. // "https://www.googleapis.com/auth/compute",
  69606. // "https://www.googleapis.com/auth/compute.readonly"
  69607. // ]
  69608. // }
  69609. }
  69610. // method id "compute.interconnects.getDiagnostics":
  69611. type InterconnectsGetDiagnosticsCall struct {
  69612. s *Service
  69613. project string
  69614. interconnect string
  69615. urlParams_ gensupport.URLParams
  69616. ifNoneMatch_ string
  69617. ctx_ context.Context
  69618. header_ http.Header
  69619. }
  69620. // GetDiagnostics: Returns the interconnectDiagnostics for the specified
  69621. // interconnect.
  69622. func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall {
  69623. c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69624. c.project = project
  69625. c.interconnect = interconnect
  69626. return c
  69627. }
  69628. // Fields allows partial responses to be retrieved. See
  69629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69630. // for more information.
  69631. func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall {
  69632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69633. return c
  69634. }
  69635. // IfNoneMatch sets the optional parameter which makes the operation
  69636. // fail if the object's ETag matches the given value. This is useful for
  69637. // getting updates only after the object has changed since the last
  69638. // request. Use googleapi.IsNotModified to check whether the response
  69639. // error from Do is the result of In-None-Match.
  69640. func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall {
  69641. c.ifNoneMatch_ = entityTag
  69642. return c
  69643. }
  69644. // Context sets the context to be used in this call's Do method. Any
  69645. // pending HTTP request will be aborted if the provided context is
  69646. // canceled.
  69647. func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall {
  69648. c.ctx_ = ctx
  69649. return c
  69650. }
  69651. // Header returns an http.Header that can be modified by the caller to
  69652. // add HTTP headers to the request.
  69653. func (c *InterconnectsGetDiagnosticsCall) Header() http.Header {
  69654. if c.header_ == nil {
  69655. c.header_ = make(http.Header)
  69656. }
  69657. return c.header_
  69658. }
  69659. func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) {
  69660. reqHeaders := make(http.Header)
  69661. for k, v := range c.header_ {
  69662. reqHeaders[k] = v
  69663. }
  69664. reqHeaders.Set("User-Agent", c.s.userAgent())
  69665. if c.ifNoneMatch_ != "" {
  69666. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69667. }
  69668. var body io.Reader = nil
  69669. c.urlParams_.Set("alt", alt)
  69670. c.urlParams_.Set("prettyPrint", "false")
  69671. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}/getDiagnostics")
  69672. urls += "?" + c.urlParams_.Encode()
  69673. req, err := http.NewRequest("GET", urls, body)
  69674. if err != nil {
  69675. return nil, err
  69676. }
  69677. req.Header = reqHeaders
  69678. googleapi.Expand(req.URL, map[string]string{
  69679. "project": c.project,
  69680. "interconnect": c.interconnect,
  69681. })
  69682. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69683. }
  69684. // Do executes the "compute.interconnects.getDiagnostics" call.
  69685. // Exactly one of *InterconnectsGetDiagnosticsResponse or error will be
  69686. // non-nil. Any non-2xx status code is an error. Response headers are in
  69687. // either *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or
  69688. // (if a response was returned at all) in
  69689. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  69690. // whether the returned error was because http.StatusNotModified was
  69691. // returned.
  69692. func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) {
  69693. gensupport.SetOptions(c.urlParams_, opts...)
  69694. res, err := c.doRequest("json")
  69695. if res != nil && res.StatusCode == http.StatusNotModified {
  69696. if res.Body != nil {
  69697. res.Body.Close()
  69698. }
  69699. return nil, &googleapi.Error{
  69700. Code: res.StatusCode,
  69701. Header: res.Header,
  69702. }
  69703. }
  69704. if err != nil {
  69705. return nil, err
  69706. }
  69707. defer googleapi.CloseBody(res)
  69708. if err := googleapi.CheckResponse(res); err != nil {
  69709. return nil, err
  69710. }
  69711. ret := &InterconnectsGetDiagnosticsResponse{
  69712. ServerResponse: googleapi.ServerResponse{
  69713. Header: res.Header,
  69714. HTTPStatusCode: res.StatusCode,
  69715. },
  69716. }
  69717. target := &ret
  69718. if err := gensupport.DecodeResponse(target, res); err != nil {
  69719. return nil, err
  69720. }
  69721. return ret, nil
  69722. // {
  69723. // "description": "Returns the interconnectDiagnostics for the specified interconnect.",
  69724. // "httpMethod": "GET",
  69725. // "id": "compute.interconnects.getDiagnostics",
  69726. // "parameterOrder": [
  69727. // "project",
  69728. // "interconnect"
  69729. // ],
  69730. // "parameters": {
  69731. // "interconnect": {
  69732. // "description": "Name of the interconnect resource to query.",
  69733. // "location": "path",
  69734. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69735. // "required": true,
  69736. // "type": "string"
  69737. // },
  69738. // "project": {
  69739. // "description": "Project ID for this request.",
  69740. // "location": "path",
  69741. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69742. // "required": true,
  69743. // "type": "string"
  69744. // }
  69745. // },
  69746. // "path": "{project}/global/interconnects/{interconnect}/getDiagnostics",
  69747. // "response": {
  69748. // "$ref": "InterconnectsGetDiagnosticsResponse"
  69749. // },
  69750. // "scopes": [
  69751. // "https://www.googleapis.com/auth/cloud-platform",
  69752. // "https://www.googleapis.com/auth/compute",
  69753. // "https://www.googleapis.com/auth/compute.readonly"
  69754. // ]
  69755. // }
  69756. }
  69757. // method id "compute.interconnects.insert":
  69758. type InterconnectsInsertCall struct {
  69759. s *Service
  69760. project string
  69761. interconnect *Interconnect
  69762. urlParams_ gensupport.URLParams
  69763. ctx_ context.Context
  69764. header_ http.Header
  69765. }
  69766. // Insert: Creates a Interconnect in the specified project using the
  69767. // data included in the request.
  69768. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  69769. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69770. c.project = project
  69771. c.interconnect = interconnect
  69772. return c
  69773. }
  69774. // RequestId sets the optional parameter "requestId": An optional
  69775. // request ID to identify requests. Specify a unique request ID so that
  69776. // if you must retry your request, the server will know to ignore the
  69777. // request if it has already been completed.
  69778. //
  69779. // For example, consider a situation where you make an initial request
  69780. // and the request times out. If you make the request again with the
  69781. // same request ID, the server can check if original operation with the
  69782. // same request ID was received, and if so, will ignore the second
  69783. // request. This prevents clients from accidentally creating duplicate
  69784. // commitments.
  69785. //
  69786. // The request ID must be a valid UUID with the exception that zero UUID
  69787. // is not supported (00000000-0000-0000-0000-000000000000).
  69788. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  69789. c.urlParams_.Set("requestId", requestId)
  69790. return c
  69791. }
  69792. // Fields allows partial responses to be retrieved. See
  69793. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69794. // for more information.
  69795. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  69796. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69797. return c
  69798. }
  69799. // Context sets the context to be used in this call's Do method. Any
  69800. // pending HTTP request will be aborted if the provided context is
  69801. // canceled.
  69802. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  69803. c.ctx_ = ctx
  69804. return c
  69805. }
  69806. // Header returns an http.Header that can be modified by the caller to
  69807. // add HTTP headers to the request.
  69808. func (c *InterconnectsInsertCall) Header() http.Header {
  69809. if c.header_ == nil {
  69810. c.header_ = make(http.Header)
  69811. }
  69812. return c.header_
  69813. }
  69814. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  69815. reqHeaders := make(http.Header)
  69816. for k, v := range c.header_ {
  69817. reqHeaders[k] = v
  69818. }
  69819. reqHeaders.Set("User-Agent", c.s.userAgent())
  69820. var body io.Reader = nil
  69821. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  69822. if err != nil {
  69823. return nil, err
  69824. }
  69825. reqHeaders.Set("Content-Type", "application/json")
  69826. c.urlParams_.Set("alt", alt)
  69827. c.urlParams_.Set("prettyPrint", "false")
  69828. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  69829. urls += "?" + c.urlParams_.Encode()
  69830. req, err := http.NewRequest("POST", urls, body)
  69831. if err != nil {
  69832. return nil, err
  69833. }
  69834. req.Header = reqHeaders
  69835. googleapi.Expand(req.URL, map[string]string{
  69836. "project": c.project,
  69837. })
  69838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69839. }
  69840. // Do executes the "compute.interconnects.insert" call.
  69841. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69842. // status code is an error. Response headers are in either
  69843. // *Operation.ServerResponse.Header or (if a response was returned at
  69844. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69845. // to check whether the returned error was because
  69846. // http.StatusNotModified was returned.
  69847. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69848. gensupport.SetOptions(c.urlParams_, opts...)
  69849. res, err := c.doRequest("json")
  69850. if res != nil && res.StatusCode == http.StatusNotModified {
  69851. if res.Body != nil {
  69852. res.Body.Close()
  69853. }
  69854. return nil, &googleapi.Error{
  69855. Code: res.StatusCode,
  69856. Header: res.Header,
  69857. }
  69858. }
  69859. if err != nil {
  69860. return nil, err
  69861. }
  69862. defer googleapi.CloseBody(res)
  69863. if err := googleapi.CheckResponse(res); err != nil {
  69864. return nil, err
  69865. }
  69866. ret := &Operation{
  69867. ServerResponse: googleapi.ServerResponse{
  69868. Header: res.Header,
  69869. HTTPStatusCode: res.StatusCode,
  69870. },
  69871. }
  69872. target := &ret
  69873. if err := gensupport.DecodeResponse(target, res); err != nil {
  69874. return nil, err
  69875. }
  69876. return ret, nil
  69877. // {
  69878. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  69879. // "httpMethod": "POST",
  69880. // "id": "compute.interconnects.insert",
  69881. // "parameterOrder": [
  69882. // "project"
  69883. // ],
  69884. // "parameters": {
  69885. // "project": {
  69886. // "description": "Project ID for this request.",
  69887. // "location": "path",
  69888. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69889. // "required": true,
  69890. // "type": "string"
  69891. // },
  69892. // "requestId": {
  69893. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69894. // "location": "query",
  69895. // "type": "string"
  69896. // }
  69897. // },
  69898. // "path": "{project}/global/interconnects",
  69899. // "request": {
  69900. // "$ref": "Interconnect"
  69901. // },
  69902. // "response": {
  69903. // "$ref": "Operation"
  69904. // },
  69905. // "scopes": [
  69906. // "https://www.googleapis.com/auth/cloud-platform",
  69907. // "https://www.googleapis.com/auth/compute"
  69908. // ]
  69909. // }
  69910. }
  69911. // method id "compute.interconnects.list":
  69912. type InterconnectsListCall struct {
  69913. s *Service
  69914. project string
  69915. urlParams_ gensupport.URLParams
  69916. ifNoneMatch_ string
  69917. ctx_ context.Context
  69918. header_ http.Header
  69919. }
  69920. // List: Retrieves the list of interconnect available to the specified
  69921. // project.
  69922. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  69923. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69924. c.project = project
  69925. return c
  69926. }
  69927. // Filter sets the optional parameter "filter": A filter expression that
  69928. // filters resources listed in the response. The expression must specify
  69929. // the field name, a comparison operator, and the value that you want to
  69930. // use for filtering. The value must be a string, a number, or a
  69931. // boolean. The comparison operator must be either =, !=, >, or <.
  69932. //
  69933. // For example, if you are filtering Compute Engine instances, you can
  69934. // exclude instances named example-instance by specifying name !=
  69935. // example-instance.
  69936. //
  69937. // You can also filter nested fields. For example, you could specify
  69938. // scheduling.automaticRestart = false to include instances only if they
  69939. // are not scheduled for automatic restarts. You can use filtering on
  69940. // nested fields to filter based on resource labels.
  69941. //
  69942. // To filter on multiple expressions, provide each separate expression
  69943. // within parentheses. For example, (scheduling.automaticRestart = true)
  69944. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69945. // AND expression. However, you can include AND and OR expressions
  69946. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69947. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69948. // true).
  69949. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  69950. c.urlParams_.Set("filter", filter)
  69951. return c
  69952. }
  69953. // MaxResults sets the optional parameter "maxResults": The maximum
  69954. // number of results per page that should be returned. If the number of
  69955. // available results is larger than maxResults, Compute Engine returns a
  69956. // nextPageToken that can be used to get the next page of results in
  69957. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69958. // (Default: 500)
  69959. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  69960. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69961. return c
  69962. }
  69963. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  69964. // a certain order. By default, results are returned in alphanumerical
  69965. // order based on the resource name.
  69966. //
  69967. // You can also sort results in descending order based on the creation
  69968. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69969. // based on the creationTimestamp field in reverse chronological order
  69970. // (newest result first). Use this to sort resources like operations so
  69971. // that the newest operation is returned first.
  69972. //
  69973. // Currently, only sorting by name or creationTimestamp desc is
  69974. // supported.
  69975. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  69976. c.urlParams_.Set("orderBy", orderBy)
  69977. return c
  69978. }
  69979. // PageToken sets the optional parameter "pageToken": Specifies a page
  69980. // token to use. Set pageToken to the nextPageToken returned by a
  69981. // previous list request to get the next page of results.
  69982. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  69983. c.urlParams_.Set("pageToken", pageToken)
  69984. return c
  69985. }
  69986. // Fields allows partial responses to be retrieved. See
  69987. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69988. // for more information.
  69989. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  69990. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69991. return c
  69992. }
  69993. // IfNoneMatch sets the optional parameter which makes the operation
  69994. // fail if the object's ETag matches the given value. This is useful for
  69995. // getting updates only after the object has changed since the last
  69996. // request. Use googleapi.IsNotModified to check whether the response
  69997. // error from Do is the result of In-None-Match.
  69998. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  69999. c.ifNoneMatch_ = entityTag
  70000. return c
  70001. }
  70002. // Context sets the context to be used in this call's Do method. Any
  70003. // pending HTTP request will be aborted if the provided context is
  70004. // canceled.
  70005. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  70006. c.ctx_ = ctx
  70007. return c
  70008. }
  70009. // Header returns an http.Header that can be modified by the caller to
  70010. // add HTTP headers to the request.
  70011. func (c *InterconnectsListCall) Header() http.Header {
  70012. if c.header_ == nil {
  70013. c.header_ = make(http.Header)
  70014. }
  70015. return c.header_
  70016. }
  70017. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  70018. reqHeaders := make(http.Header)
  70019. for k, v := range c.header_ {
  70020. reqHeaders[k] = v
  70021. }
  70022. reqHeaders.Set("User-Agent", c.s.userAgent())
  70023. if c.ifNoneMatch_ != "" {
  70024. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70025. }
  70026. var body io.Reader = nil
  70027. c.urlParams_.Set("alt", alt)
  70028. c.urlParams_.Set("prettyPrint", "false")
  70029. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  70030. urls += "?" + c.urlParams_.Encode()
  70031. req, err := http.NewRequest("GET", urls, body)
  70032. if err != nil {
  70033. return nil, err
  70034. }
  70035. req.Header = reqHeaders
  70036. googleapi.Expand(req.URL, map[string]string{
  70037. "project": c.project,
  70038. })
  70039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70040. }
  70041. // Do executes the "compute.interconnects.list" call.
  70042. // Exactly one of *InterconnectList or error will be non-nil. Any
  70043. // non-2xx status code is an error. Response headers are in either
  70044. // *InterconnectList.ServerResponse.Header or (if a response was
  70045. // returned at all) in error.(*googleapi.Error).Header. Use
  70046. // googleapi.IsNotModified to check whether the returned error was
  70047. // because http.StatusNotModified was returned.
  70048. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  70049. gensupport.SetOptions(c.urlParams_, opts...)
  70050. res, err := c.doRequest("json")
  70051. if res != nil && res.StatusCode == http.StatusNotModified {
  70052. if res.Body != nil {
  70053. res.Body.Close()
  70054. }
  70055. return nil, &googleapi.Error{
  70056. Code: res.StatusCode,
  70057. Header: res.Header,
  70058. }
  70059. }
  70060. if err != nil {
  70061. return nil, err
  70062. }
  70063. defer googleapi.CloseBody(res)
  70064. if err := googleapi.CheckResponse(res); err != nil {
  70065. return nil, err
  70066. }
  70067. ret := &InterconnectList{
  70068. ServerResponse: googleapi.ServerResponse{
  70069. Header: res.Header,
  70070. HTTPStatusCode: res.StatusCode,
  70071. },
  70072. }
  70073. target := &ret
  70074. if err := gensupport.DecodeResponse(target, res); err != nil {
  70075. return nil, err
  70076. }
  70077. return ret, nil
  70078. // {
  70079. // "description": "Retrieves the list of interconnect available to the specified project.",
  70080. // "httpMethod": "GET",
  70081. // "id": "compute.interconnects.list",
  70082. // "parameterOrder": [
  70083. // "project"
  70084. // ],
  70085. // "parameters": {
  70086. // "filter": {
  70087. // "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).",
  70088. // "location": "query",
  70089. // "type": "string"
  70090. // },
  70091. // "maxResults": {
  70092. // "default": "500",
  70093. // "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)",
  70094. // "format": "uint32",
  70095. // "location": "query",
  70096. // "minimum": "0",
  70097. // "type": "integer"
  70098. // },
  70099. // "orderBy": {
  70100. // "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.",
  70101. // "location": "query",
  70102. // "type": "string"
  70103. // },
  70104. // "pageToken": {
  70105. // "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.",
  70106. // "location": "query",
  70107. // "type": "string"
  70108. // },
  70109. // "project": {
  70110. // "description": "Project ID for this request.",
  70111. // "location": "path",
  70112. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70113. // "required": true,
  70114. // "type": "string"
  70115. // }
  70116. // },
  70117. // "path": "{project}/global/interconnects",
  70118. // "response": {
  70119. // "$ref": "InterconnectList"
  70120. // },
  70121. // "scopes": [
  70122. // "https://www.googleapis.com/auth/cloud-platform",
  70123. // "https://www.googleapis.com/auth/compute",
  70124. // "https://www.googleapis.com/auth/compute.readonly"
  70125. // ]
  70126. // }
  70127. }
  70128. // Pages invokes f for each page of results.
  70129. // A non-nil error returned from f will halt the iteration.
  70130. // The provided context supersedes any context provided to the Context method.
  70131. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  70132. c.ctx_ = ctx
  70133. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70134. for {
  70135. x, err := c.Do()
  70136. if err != nil {
  70137. return err
  70138. }
  70139. if err := f(x); err != nil {
  70140. return err
  70141. }
  70142. if x.NextPageToken == "" {
  70143. return nil
  70144. }
  70145. c.PageToken(x.NextPageToken)
  70146. }
  70147. }
  70148. // method id "compute.interconnects.patch":
  70149. type InterconnectsPatchCall struct {
  70150. s *Service
  70151. project string
  70152. interconnect string
  70153. interconnect2 *Interconnect
  70154. urlParams_ gensupport.URLParams
  70155. ctx_ context.Context
  70156. header_ http.Header
  70157. }
  70158. // Patch: Updates the specified interconnect with the data included in
  70159. // the request. This method supports PATCH semantics and uses the JSON
  70160. // merge patch format and processing rules.
  70161. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  70162. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70163. c.project = project
  70164. c.interconnect = interconnect
  70165. c.interconnect2 = interconnect2
  70166. return c
  70167. }
  70168. // RequestId sets the optional parameter "requestId": An optional
  70169. // request ID to identify requests. Specify a unique request ID so that
  70170. // if you must retry your request, the server will know to ignore the
  70171. // request if it has already been completed.
  70172. //
  70173. // For example, consider a situation where you make an initial request
  70174. // and the request times out. If you make the request again with the
  70175. // same request ID, the server can check if original operation with the
  70176. // same request ID was received, and if so, will ignore the second
  70177. // request. This prevents clients from accidentally creating duplicate
  70178. // commitments.
  70179. //
  70180. // The request ID must be a valid UUID with the exception that zero UUID
  70181. // is not supported (00000000-0000-0000-0000-000000000000).
  70182. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  70183. c.urlParams_.Set("requestId", requestId)
  70184. return c
  70185. }
  70186. // Fields allows partial responses to be retrieved. See
  70187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70188. // for more information.
  70189. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  70190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70191. return c
  70192. }
  70193. // Context sets the context to be used in this call's Do method. Any
  70194. // pending HTTP request will be aborted if the provided context is
  70195. // canceled.
  70196. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  70197. c.ctx_ = ctx
  70198. return c
  70199. }
  70200. // Header returns an http.Header that can be modified by the caller to
  70201. // add HTTP headers to the request.
  70202. func (c *InterconnectsPatchCall) Header() http.Header {
  70203. if c.header_ == nil {
  70204. c.header_ = make(http.Header)
  70205. }
  70206. return c.header_
  70207. }
  70208. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  70209. reqHeaders := make(http.Header)
  70210. for k, v := range c.header_ {
  70211. reqHeaders[k] = v
  70212. }
  70213. reqHeaders.Set("User-Agent", c.s.userAgent())
  70214. var body io.Reader = nil
  70215. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  70216. if err != nil {
  70217. return nil, err
  70218. }
  70219. reqHeaders.Set("Content-Type", "application/json")
  70220. c.urlParams_.Set("alt", alt)
  70221. c.urlParams_.Set("prettyPrint", "false")
  70222. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  70223. urls += "?" + c.urlParams_.Encode()
  70224. req, err := http.NewRequest("PATCH", urls, body)
  70225. if err != nil {
  70226. return nil, err
  70227. }
  70228. req.Header = reqHeaders
  70229. googleapi.Expand(req.URL, map[string]string{
  70230. "project": c.project,
  70231. "interconnect": c.interconnect,
  70232. })
  70233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70234. }
  70235. // Do executes the "compute.interconnects.patch" call.
  70236. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70237. // status code is an error. Response headers are in either
  70238. // *Operation.ServerResponse.Header or (if a response was returned at
  70239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70240. // to check whether the returned error was because
  70241. // http.StatusNotModified was returned.
  70242. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70243. gensupport.SetOptions(c.urlParams_, opts...)
  70244. res, err := c.doRequest("json")
  70245. if res != nil && res.StatusCode == http.StatusNotModified {
  70246. if res.Body != nil {
  70247. res.Body.Close()
  70248. }
  70249. return nil, &googleapi.Error{
  70250. Code: res.StatusCode,
  70251. Header: res.Header,
  70252. }
  70253. }
  70254. if err != nil {
  70255. return nil, err
  70256. }
  70257. defer googleapi.CloseBody(res)
  70258. if err := googleapi.CheckResponse(res); err != nil {
  70259. return nil, err
  70260. }
  70261. ret := &Operation{
  70262. ServerResponse: googleapi.ServerResponse{
  70263. Header: res.Header,
  70264. HTTPStatusCode: res.StatusCode,
  70265. },
  70266. }
  70267. target := &ret
  70268. if err := gensupport.DecodeResponse(target, res); err != nil {
  70269. return nil, err
  70270. }
  70271. return ret, nil
  70272. // {
  70273. // "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.",
  70274. // "httpMethod": "PATCH",
  70275. // "id": "compute.interconnects.patch",
  70276. // "parameterOrder": [
  70277. // "project",
  70278. // "interconnect"
  70279. // ],
  70280. // "parameters": {
  70281. // "interconnect": {
  70282. // "description": "Name of the interconnect to update.",
  70283. // "location": "path",
  70284. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70285. // "required": true,
  70286. // "type": "string"
  70287. // },
  70288. // "project": {
  70289. // "description": "Project ID for this request.",
  70290. // "location": "path",
  70291. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70292. // "required": true,
  70293. // "type": "string"
  70294. // },
  70295. // "requestId": {
  70296. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70297. // "location": "query",
  70298. // "type": "string"
  70299. // }
  70300. // },
  70301. // "path": "{project}/global/interconnects/{interconnect}",
  70302. // "request": {
  70303. // "$ref": "Interconnect"
  70304. // },
  70305. // "response": {
  70306. // "$ref": "Operation"
  70307. // },
  70308. // "scopes": [
  70309. // "https://www.googleapis.com/auth/cloud-platform",
  70310. // "https://www.googleapis.com/auth/compute"
  70311. // ]
  70312. // }
  70313. }
  70314. // method id "compute.interconnects.setLabels":
  70315. type InterconnectsSetLabelsCall struct {
  70316. s *Service
  70317. project string
  70318. resource string
  70319. globalsetlabelsrequest *GlobalSetLabelsRequest
  70320. urlParams_ gensupport.URLParams
  70321. ctx_ context.Context
  70322. header_ http.Header
  70323. }
  70324. // SetLabels: Sets the labels on an Interconnect. To learn more about
  70325. // labels, read the Labeling Resources documentation.
  70326. func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall {
  70327. c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70328. c.project = project
  70329. c.resource = resource
  70330. c.globalsetlabelsrequest = globalsetlabelsrequest
  70331. return c
  70332. }
  70333. // Fields allows partial responses to be retrieved. See
  70334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70335. // for more information.
  70336. func (c *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall {
  70337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70338. return c
  70339. }
  70340. // Context sets the context to be used in this call's Do method. Any
  70341. // pending HTTP request will be aborted if the provided context is
  70342. // canceled.
  70343. func (c *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall {
  70344. c.ctx_ = ctx
  70345. return c
  70346. }
  70347. // Header returns an http.Header that can be modified by the caller to
  70348. // add HTTP headers to the request.
  70349. func (c *InterconnectsSetLabelsCall) Header() http.Header {
  70350. if c.header_ == nil {
  70351. c.header_ = make(http.Header)
  70352. }
  70353. return c.header_
  70354. }
  70355. func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  70356. reqHeaders := make(http.Header)
  70357. for k, v := range c.header_ {
  70358. reqHeaders[k] = v
  70359. }
  70360. reqHeaders.Set("User-Agent", c.s.userAgent())
  70361. var body io.Reader = nil
  70362. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  70363. if err != nil {
  70364. return nil, err
  70365. }
  70366. reqHeaders.Set("Content-Type", "application/json")
  70367. c.urlParams_.Set("alt", alt)
  70368. c.urlParams_.Set("prettyPrint", "false")
  70369. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setLabels")
  70370. urls += "?" + c.urlParams_.Encode()
  70371. req, err := http.NewRequest("POST", urls, body)
  70372. if err != nil {
  70373. return nil, err
  70374. }
  70375. req.Header = reqHeaders
  70376. googleapi.Expand(req.URL, map[string]string{
  70377. "project": c.project,
  70378. "resource": c.resource,
  70379. })
  70380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70381. }
  70382. // Do executes the "compute.interconnects.setLabels" call.
  70383. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70384. // status code is an error. Response headers are in either
  70385. // *Operation.ServerResponse.Header or (if a response was returned at
  70386. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70387. // to check whether the returned error was because
  70388. // http.StatusNotModified was returned.
  70389. func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70390. gensupport.SetOptions(c.urlParams_, opts...)
  70391. res, err := c.doRequest("json")
  70392. if res != nil && res.StatusCode == http.StatusNotModified {
  70393. if res.Body != nil {
  70394. res.Body.Close()
  70395. }
  70396. return nil, &googleapi.Error{
  70397. Code: res.StatusCode,
  70398. Header: res.Header,
  70399. }
  70400. }
  70401. if err != nil {
  70402. return nil, err
  70403. }
  70404. defer googleapi.CloseBody(res)
  70405. if err := googleapi.CheckResponse(res); err != nil {
  70406. return nil, err
  70407. }
  70408. ret := &Operation{
  70409. ServerResponse: googleapi.ServerResponse{
  70410. Header: res.Header,
  70411. HTTPStatusCode: res.StatusCode,
  70412. },
  70413. }
  70414. target := &ret
  70415. if err := gensupport.DecodeResponse(target, res); err != nil {
  70416. return nil, err
  70417. }
  70418. return ret, nil
  70419. // {
  70420. // "description": "Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.",
  70421. // "httpMethod": "POST",
  70422. // "id": "compute.interconnects.setLabels",
  70423. // "parameterOrder": [
  70424. // "project",
  70425. // "resource"
  70426. // ],
  70427. // "parameters": {
  70428. // "project": {
  70429. // "description": "Project ID for this request.",
  70430. // "location": "path",
  70431. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70432. // "required": true,
  70433. // "type": "string"
  70434. // },
  70435. // "resource": {
  70436. // "description": "Name or id of the resource for this request.",
  70437. // "location": "path",
  70438. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70439. // "required": true,
  70440. // "type": "string"
  70441. // }
  70442. // },
  70443. // "path": "{project}/global/interconnects/{resource}/setLabels",
  70444. // "request": {
  70445. // "$ref": "GlobalSetLabelsRequest"
  70446. // },
  70447. // "response": {
  70448. // "$ref": "Operation"
  70449. // },
  70450. // "scopes": [
  70451. // "https://www.googleapis.com/auth/cloud-platform",
  70452. // "https://www.googleapis.com/auth/compute"
  70453. // ]
  70454. // }
  70455. }
  70456. // method id "compute.interconnects.testIamPermissions":
  70457. type InterconnectsTestIamPermissionsCall struct {
  70458. s *Service
  70459. project string
  70460. resource string
  70461. testpermissionsrequest *TestPermissionsRequest
  70462. urlParams_ gensupport.URLParams
  70463. ctx_ context.Context
  70464. header_ http.Header
  70465. }
  70466. // TestIamPermissions: Returns permissions that a caller has on the
  70467. // specified resource.
  70468. func (r *InterconnectsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectsTestIamPermissionsCall {
  70469. c := &InterconnectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70470. c.project = project
  70471. c.resource = resource
  70472. c.testpermissionsrequest = testpermissionsrequest
  70473. return c
  70474. }
  70475. // Fields allows partial responses to be retrieved. See
  70476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70477. // for more information.
  70478. func (c *InterconnectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectsTestIamPermissionsCall {
  70479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70480. return c
  70481. }
  70482. // Context sets the context to be used in this call's Do method. Any
  70483. // pending HTTP request will be aborted if the provided context is
  70484. // canceled.
  70485. func (c *InterconnectsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectsTestIamPermissionsCall {
  70486. c.ctx_ = ctx
  70487. return c
  70488. }
  70489. // Header returns an http.Header that can be modified by the caller to
  70490. // add HTTP headers to the request.
  70491. func (c *InterconnectsTestIamPermissionsCall) Header() http.Header {
  70492. if c.header_ == nil {
  70493. c.header_ = make(http.Header)
  70494. }
  70495. return c.header_
  70496. }
  70497. func (c *InterconnectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  70498. reqHeaders := make(http.Header)
  70499. for k, v := range c.header_ {
  70500. reqHeaders[k] = v
  70501. }
  70502. reqHeaders.Set("User-Agent", c.s.userAgent())
  70503. var body io.Reader = nil
  70504. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  70505. if err != nil {
  70506. return nil, err
  70507. }
  70508. reqHeaders.Set("Content-Type", "application/json")
  70509. c.urlParams_.Set("alt", alt)
  70510. c.urlParams_.Set("prettyPrint", "false")
  70511. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/testIamPermissions")
  70512. urls += "?" + c.urlParams_.Encode()
  70513. req, err := http.NewRequest("POST", urls, body)
  70514. if err != nil {
  70515. return nil, err
  70516. }
  70517. req.Header = reqHeaders
  70518. googleapi.Expand(req.URL, map[string]string{
  70519. "project": c.project,
  70520. "resource": c.resource,
  70521. })
  70522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70523. }
  70524. // Do executes the "compute.interconnects.testIamPermissions" call.
  70525. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  70526. // non-2xx status code is an error. Response headers are in either
  70527. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  70528. // returned at all) in error.(*googleapi.Error).Header. Use
  70529. // googleapi.IsNotModified to check whether the returned error was
  70530. // because http.StatusNotModified was returned.
  70531. func (c *InterconnectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  70532. gensupport.SetOptions(c.urlParams_, opts...)
  70533. res, err := c.doRequest("json")
  70534. if res != nil && res.StatusCode == http.StatusNotModified {
  70535. if res.Body != nil {
  70536. res.Body.Close()
  70537. }
  70538. return nil, &googleapi.Error{
  70539. Code: res.StatusCode,
  70540. Header: res.Header,
  70541. }
  70542. }
  70543. if err != nil {
  70544. return nil, err
  70545. }
  70546. defer googleapi.CloseBody(res)
  70547. if err := googleapi.CheckResponse(res); err != nil {
  70548. return nil, err
  70549. }
  70550. ret := &TestPermissionsResponse{
  70551. ServerResponse: googleapi.ServerResponse{
  70552. Header: res.Header,
  70553. HTTPStatusCode: res.StatusCode,
  70554. },
  70555. }
  70556. target := &ret
  70557. if err := gensupport.DecodeResponse(target, res); err != nil {
  70558. return nil, err
  70559. }
  70560. return ret, nil
  70561. // {
  70562. // "description": "Returns permissions that a caller has on the specified resource.",
  70563. // "httpMethod": "POST",
  70564. // "id": "compute.interconnects.testIamPermissions",
  70565. // "parameterOrder": [
  70566. // "project",
  70567. // "resource"
  70568. // ],
  70569. // "parameters": {
  70570. // "project": {
  70571. // "description": "Project ID for this request.",
  70572. // "location": "path",
  70573. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70574. // "required": true,
  70575. // "type": "string"
  70576. // },
  70577. // "resource": {
  70578. // "description": "Name or id of the resource for this request.",
  70579. // "location": "path",
  70580. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70581. // "required": true,
  70582. // "type": "string"
  70583. // }
  70584. // },
  70585. // "path": "{project}/global/interconnects/{resource}/testIamPermissions",
  70586. // "request": {
  70587. // "$ref": "TestPermissionsRequest"
  70588. // },
  70589. // "response": {
  70590. // "$ref": "TestPermissionsResponse"
  70591. // },
  70592. // "scopes": [
  70593. // "https://www.googleapis.com/auth/cloud-platform",
  70594. // "https://www.googleapis.com/auth/compute",
  70595. // "https://www.googleapis.com/auth/compute.readonly"
  70596. // ]
  70597. // }
  70598. }
  70599. // method id "compute.licenseCodes.get":
  70600. type LicenseCodesGetCall struct {
  70601. s *Service
  70602. project string
  70603. licenseCode string
  70604. urlParams_ gensupport.URLParams
  70605. ifNoneMatch_ string
  70606. ctx_ context.Context
  70607. header_ http.Header
  70608. }
  70609. // Get: Return a specified license code. License codes are mirrored
  70610. // across all projects that have permissions to read the License Code.
  70611. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  70612. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70613. c.project = project
  70614. c.licenseCode = licenseCode
  70615. return c
  70616. }
  70617. // Fields allows partial responses to be retrieved. See
  70618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70619. // for more information.
  70620. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  70621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70622. return c
  70623. }
  70624. // IfNoneMatch sets the optional parameter which makes the operation
  70625. // fail if the object's ETag matches the given value. This is useful for
  70626. // getting updates only after the object has changed since the last
  70627. // request. Use googleapi.IsNotModified to check whether the response
  70628. // error from Do is the result of In-None-Match.
  70629. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  70630. c.ifNoneMatch_ = entityTag
  70631. return c
  70632. }
  70633. // Context sets the context to be used in this call's Do method. Any
  70634. // pending HTTP request will be aborted if the provided context is
  70635. // canceled.
  70636. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  70637. c.ctx_ = ctx
  70638. return c
  70639. }
  70640. // Header returns an http.Header that can be modified by the caller to
  70641. // add HTTP headers to the request.
  70642. func (c *LicenseCodesGetCall) Header() http.Header {
  70643. if c.header_ == nil {
  70644. c.header_ = make(http.Header)
  70645. }
  70646. return c.header_
  70647. }
  70648. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  70649. reqHeaders := make(http.Header)
  70650. for k, v := range c.header_ {
  70651. reqHeaders[k] = v
  70652. }
  70653. reqHeaders.Set("User-Agent", c.s.userAgent())
  70654. if c.ifNoneMatch_ != "" {
  70655. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70656. }
  70657. var body io.Reader = nil
  70658. c.urlParams_.Set("alt", alt)
  70659. c.urlParams_.Set("prettyPrint", "false")
  70660. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  70661. urls += "?" + c.urlParams_.Encode()
  70662. req, err := http.NewRequest("GET", urls, body)
  70663. if err != nil {
  70664. return nil, err
  70665. }
  70666. req.Header = reqHeaders
  70667. googleapi.Expand(req.URL, map[string]string{
  70668. "project": c.project,
  70669. "licenseCode": c.licenseCode,
  70670. })
  70671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70672. }
  70673. // Do executes the "compute.licenseCodes.get" call.
  70674. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  70675. // status code is an error. Response headers are in either
  70676. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  70677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70678. // to check whether the returned error was because
  70679. // http.StatusNotModified was returned.
  70680. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  70681. gensupport.SetOptions(c.urlParams_, opts...)
  70682. res, err := c.doRequest("json")
  70683. if res != nil && res.StatusCode == http.StatusNotModified {
  70684. if res.Body != nil {
  70685. res.Body.Close()
  70686. }
  70687. return nil, &googleapi.Error{
  70688. Code: res.StatusCode,
  70689. Header: res.Header,
  70690. }
  70691. }
  70692. if err != nil {
  70693. return nil, err
  70694. }
  70695. defer googleapi.CloseBody(res)
  70696. if err := googleapi.CheckResponse(res); err != nil {
  70697. return nil, err
  70698. }
  70699. ret := &LicenseCode{
  70700. ServerResponse: googleapi.ServerResponse{
  70701. Header: res.Header,
  70702. HTTPStatusCode: res.StatusCode,
  70703. },
  70704. }
  70705. target := &ret
  70706. if err := gensupport.DecodeResponse(target, res); err != nil {
  70707. return nil, err
  70708. }
  70709. return ret, nil
  70710. // {
  70711. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  70712. // "httpMethod": "GET",
  70713. // "id": "compute.licenseCodes.get",
  70714. // "parameterOrder": [
  70715. // "project",
  70716. // "licenseCode"
  70717. // ],
  70718. // "parameters": {
  70719. // "licenseCode": {
  70720. // "description": "Number corresponding to the License code resource to return.",
  70721. // "location": "path",
  70722. // "pattern": "[0-9]{0,61}?",
  70723. // "required": true,
  70724. // "type": "string"
  70725. // },
  70726. // "project": {
  70727. // "description": "Project ID for this request.",
  70728. // "location": "path",
  70729. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70730. // "required": true,
  70731. // "type": "string"
  70732. // }
  70733. // },
  70734. // "path": "{project}/global/licenseCodes/{licenseCode}",
  70735. // "response": {
  70736. // "$ref": "LicenseCode"
  70737. // },
  70738. // "scopes": [
  70739. // "https://www.googleapis.com/auth/cloud-platform",
  70740. // "https://www.googleapis.com/auth/compute",
  70741. // "https://www.googleapis.com/auth/compute.readonly"
  70742. // ]
  70743. // }
  70744. }
  70745. // method id "compute.licenses.delete":
  70746. type LicensesDeleteCall struct {
  70747. s *Service
  70748. project string
  70749. license string
  70750. urlParams_ gensupport.URLParams
  70751. ctx_ context.Context
  70752. header_ http.Header
  70753. }
  70754. // Delete: Deletes the specified license.
  70755. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  70756. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70757. c.project = project
  70758. c.license = license
  70759. return c
  70760. }
  70761. // RequestId sets the optional parameter "requestId": An optional
  70762. // request ID to identify requests. Specify a unique request ID so that
  70763. // if you must retry your request, the server will know to ignore the
  70764. // request if it has already been completed.
  70765. //
  70766. // For example, consider a situation where you make an initial request
  70767. // and the request times out. If you make the request again with the
  70768. // same request ID, the server can check if original operation with the
  70769. // same request ID was received, and if so, will ignore the second
  70770. // request. This prevents clients from accidentally creating duplicate
  70771. // commitments.
  70772. //
  70773. // The request ID must be a valid UUID with the exception that zero UUID
  70774. // is not supported (00000000-0000-0000-0000-000000000000).
  70775. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  70776. c.urlParams_.Set("requestId", requestId)
  70777. return c
  70778. }
  70779. // Fields allows partial responses to be retrieved. See
  70780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70781. // for more information.
  70782. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  70783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70784. return c
  70785. }
  70786. // Context sets the context to be used in this call's Do method. Any
  70787. // pending HTTP request will be aborted if the provided context is
  70788. // canceled.
  70789. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  70790. c.ctx_ = ctx
  70791. return c
  70792. }
  70793. // Header returns an http.Header that can be modified by the caller to
  70794. // add HTTP headers to the request.
  70795. func (c *LicensesDeleteCall) Header() http.Header {
  70796. if c.header_ == nil {
  70797. c.header_ = make(http.Header)
  70798. }
  70799. return c.header_
  70800. }
  70801. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  70802. reqHeaders := make(http.Header)
  70803. for k, v := range c.header_ {
  70804. reqHeaders[k] = v
  70805. }
  70806. reqHeaders.Set("User-Agent", c.s.userAgent())
  70807. var body io.Reader = nil
  70808. c.urlParams_.Set("alt", alt)
  70809. c.urlParams_.Set("prettyPrint", "false")
  70810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  70811. urls += "?" + c.urlParams_.Encode()
  70812. req, err := http.NewRequest("DELETE", urls, body)
  70813. if err != nil {
  70814. return nil, err
  70815. }
  70816. req.Header = reqHeaders
  70817. googleapi.Expand(req.URL, map[string]string{
  70818. "project": c.project,
  70819. "license": c.license,
  70820. })
  70821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70822. }
  70823. // Do executes the "compute.licenses.delete" call.
  70824. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70825. // status code is an error. Response headers are in either
  70826. // *Operation.ServerResponse.Header or (if a response was returned at
  70827. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70828. // to check whether the returned error was because
  70829. // http.StatusNotModified was returned.
  70830. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70831. gensupport.SetOptions(c.urlParams_, opts...)
  70832. res, err := c.doRequest("json")
  70833. if res != nil && res.StatusCode == http.StatusNotModified {
  70834. if res.Body != nil {
  70835. res.Body.Close()
  70836. }
  70837. return nil, &googleapi.Error{
  70838. Code: res.StatusCode,
  70839. Header: res.Header,
  70840. }
  70841. }
  70842. if err != nil {
  70843. return nil, err
  70844. }
  70845. defer googleapi.CloseBody(res)
  70846. if err := googleapi.CheckResponse(res); err != nil {
  70847. return nil, err
  70848. }
  70849. ret := &Operation{
  70850. ServerResponse: googleapi.ServerResponse{
  70851. Header: res.Header,
  70852. HTTPStatusCode: res.StatusCode,
  70853. },
  70854. }
  70855. target := &ret
  70856. if err := gensupport.DecodeResponse(target, res); err != nil {
  70857. return nil, err
  70858. }
  70859. return ret, nil
  70860. // {
  70861. // "description": "Deletes the specified license.",
  70862. // "httpMethod": "DELETE",
  70863. // "id": "compute.licenses.delete",
  70864. // "parameterOrder": [
  70865. // "project",
  70866. // "license"
  70867. // ],
  70868. // "parameters": {
  70869. // "license": {
  70870. // "description": "Name of the license resource to delete.",
  70871. // "location": "path",
  70872. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70873. // "required": true,
  70874. // "type": "string"
  70875. // },
  70876. // "project": {
  70877. // "description": "Project ID for this request.",
  70878. // "location": "path",
  70879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70880. // "required": true,
  70881. // "type": "string"
  70882. // },
  70883. // "requestId": {
  70884. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70885. // "location": "query",
  70886. // "type": "string"
  70887. // }
  70888. // },
  70889. // "path": "{project}/global/licenses/{license}",
  70890. // "response": {
  70891. // "$ref": "Operation"
  70892. // },
  70893. // "scopes": [
  70894. // "https://www.googleapis.com/auth/cloud-platform",
  70895. // "https://www.googleapis.com/auth/compute"
  70896. // ]
  70897. // }
  70898. }
  70899. // method id "compute.licenses.get":
  70900. type LicensesGetCall struct {
  70901. s *Service
  70902. project string
  70903. license string
  70904. urlParams_ gensupport.URLParams
  70905. ifNoneMatch_ string
  70906. ctx_ context.Context
  70907. header_ http.Header
  70908. }
  70909. // Get: Returns the specified License resource.
  70910. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  70911. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  70912. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70913. c.project = project
  70914. c.license = license
  70915. return c
  70916. }
  70917. // Fields allows partial responses to be retrieved. See
  70918. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70919. // for more information.
  70920. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  70921. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70922. return c
  70923. }
  70924. // IfNoneMatch sets the optional parameter which makes the operation
  70925. // fail if the object's ETag matches the given value. This is useful for
  70926. // getting updates only after the object has changed since the last
  70927. // request. Use googleapi.IsNotModified to check whether the response
  70928. // error from Do is the result of In-None-Match.
  70929. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  70930. c.ifNoneMatch_ = entityTag
  70931. return c
  70932. }
  70933. // Context sets the context to be used in this call's Do method. Any
  70934. // pending HTTP request will be aborted if the provided context is
  70935. // canceled.
  70936. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  70937. c.ctx_ = ctx
  70938. return c
  70939. }
  70940. // Header returns an http.Header that can be modified by the caller to
  70941. // add HTTP headers to the request.
  70942. func (c *LicensesGetCall) Header() http.Header {
  70943. if c.header_ == nil {
  70944. c.header_ = make(http.Header)
  70945. }
  70946. return c.header_
  70947. }
  70948. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  70949. reqHeaders := make(http.Header)
  70950. for k, v := range c.header_ {
  70951. reqHeaders[k] = v
  70952. }
  70953. reqHeaders.Set("User-Agent", c.s.userAgent())
  70954. if c.ifNoneMatch_ != "" {
  70955. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70956. }
  70957. var body io.Reader = nil
  70958. c.urlParams_.Set("alt", alt)
  70959. c.urlParams_.Set("prettyPrint", "false")
  70960. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  70961. urls += "?" + c.urlParams_.Encode()
  70962. req, err := http.NewRequest("GET", urls, body)
  70963. if err != nil {
  70964. return nil, err
  70965. }
  70966. req.Header = reqHeaders
  70967. googleapi.Expand(req.URL, map[string]string{
  70968. "project": c.project,
  70969. "license": c.license,
  70970. })
  70971. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70972. }
  70973. // Do executes the "compute.licenses.get" call.
  70974. // Exactly one of *License or error will be non-nil. Any non-2xx status
  70975. // code is an error. Response headers are in either
  70976. // *License.ServerResponse.Header or (if a response was returned at all)
  70977. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  70978. // check whether the returned error was because http.StatusNotModified
  70979. // was returned.
  70980. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  70981. gensupport.SetOptions(c.urlParams_, opts...)
  70982. res, err := c.doRequest("json")
  70983. if res != nil && res.StatusCode == http.StatusNotModified {
  70984. if res.Body != nil {
  70985. res.Body.Close()
  70986. }
  70987. return nil, &googleapi.Error{
  70988. Code: res.StatusCode,
  70989. Header: res.Header,
  70990. }
  70991. }
  70992. if err != nil {
  70993. return nil, err
  70994. }
  70995. defer googleapi.CloseBody(res)
  70996. if err := googleapi.CheckResponse(res); err != nil {
  70997. return nil, err
  70998. }
  70999. ret := &License{
  71000. ServerResponse: googleapi.ServerResponse{
  71001. Header: res.Header,
  71002. HTTPStatusCode: res.StatusCode,
  71003. },
  71004. }
  71005. target := &ret
  71006. if err := gensupport.DecodeResponse(target, res); err != nil {
  71007. return nil, err
  71008. }
  71009. return ret, nil
  71010. // {
  71011. // "description": "Returns the specified License resource.",
  71012. // "httpMethod": "GET",
  71013. // "id": "compute.licenses.get",
  71014. // "parameterOrder": [
  71015. // "project",
  71016. // "license"
  71017. // ],
  71018. // "parameters": {
  71019. // "license": {
  71020. // "description": "Name of the License resource to return.",
  71021. // "location": "path",
  71022. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71023. // "required": true,
  71024. // "type": "string"
  71025. // },
  71026. // "project": {
  71027. // "description": "Project ID for this request.",
  71028. // "location": "path",
  71029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71030. // "required": true,
  71031. // "type": "string"
  71032. // }
  71033. // },
  71034. // "path": "{project}/global/licenses/{license}",
  71035. // "response": {
  71036. // "$ref": "License"
  71037. // },
  71038. // "scopes": [
  71039. // "https://www.googleapis.com/auth/cloud-platform",
  71040. // "https://www.googleapis.com/auth/compute",
  71041. // "https://www.googleapis.com/auth/compute.readonly"
  71042. // ]
  71043. // }
  71044. }
  71045. // method id "compute.licenses.getIamPolicy":
  71046. type LicensesGetIamPolicyCall struct {
  71047. s *Service
  71048. project string
  71049. resource string
  71050. urlParams_ gensupport.URLParams
  71051. ifNoneMatch_ string
  71052. ctx_ context.Context
  71053. header_ http.Header
  71054. }
  71055. // GetIamPolicy: Gets the access control policy for a resource. May be
  71056. // empty if no such policy or resource exists.
  71057. func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall {
  71058. c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71059. c.project = project
  71060. c.resource = resource
  71061. return c
  71062. }
  71063. // Fields allows partial responses to be retrieved. See
  71064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71065. // for more information.
  71066. func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall {
  71067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71068. return c
  71069. }
  71070. // IfNoneMatch sets the optional parameter which makes the operation
  71071. // fail if the object's ETag matches the given value. This is useful for
  71072. // getting updates only after the object has changed since the last
  71073. // request. Use googleapi.IsNotModified to check whether the response
  71074. // error from Do is the result of In-None-Match.
  71075. func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall {
  71076. c.ifNoneMatch_ = entityTag
  71077. return c
  71078. }
  71079. // Context sets the context to be used in this call's Do method. Any
  71080. // pending HTTP request will be aborted if the provided context is
  71081. // canceled.
  71082. func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall {
  71083. c.ctx_ = ctx
  71084. return c
  71085. }
  71086. // Header returns an http.Header that can be modified by the caller to
  71087. // add HTTP headers to the request.
  71088. func (c *LicensesGetIamPolicyCall) Header() http.Header {
  71089. if c.header_ == nil {
  71090. c.header_ = make(http.Header)
  71091. }
  71092. return c.header_
  71093. }
  71094. func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  71095. reqHeaders := make(http.Header)
  71096. for k, v := range c.header_ {
  71097. reqHeaders[k] = v
  71098. }
  71099. reqHeaders.Set("User-Agent", c.s.userAgent())
  71100. if c.ifNoneMatch_ != "" {
  71101. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71102. }
  71103. var body io.Reader = nil
  71104. c.urlParams_.Set("alt", alt)
  71105. c.urlParams_.Set("prettyPrint", "false")
  71106. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/getIamPolicy")
  71107. urls += "?" + c.urlParams_.Encode()
  71108. req, err := http.NewRequest("GET", urls, body)
  71109. if err != nil {
  71110. return nil, err
  71111. }
  71112. req.Header = reqHeaders
  71113. googleapi.Expand(req.URL, map[string]string{
  71114. "project": c.project,
  71115. "resource": c.resource,
  71116. })
  71117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71118. }
  71119. // Do executes the "compute.licenses.getIamPolicy" call.
  71120. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  71121. // code is an error. Response headers are in either
  71122. // *Policy.ServerResponse.Header or (if a response was returned at all)
  71123. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  71124. // check whether the returned error was because http.StatusNotModified
  71125. // was returned.
  71126. func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  71127. gensupport.SetOptions(c.urlParams_, opts...)
  71128. res, err := c.doRequest("json")
  71129. if res != nil && res.StatusCode == http.StatusNotModified {
  71130. if res.Body != nil {
  71131. res.Body.Close()
  71132. }
  71133. return nil, &googleapi.Error{
  71134. Code: res.StatusCode,
  71135. Header: res.Header,
  71136. }
  71137. }
  71138. if err != nil {
  71139. return nil, err
  71140. }
  71141. defer googleapi.CloseBody(res)
  71142. if err := googleapi.CheckResponse(res); err != nil {
  71143. return nil, err
  71144. }
  71145. ret := &Policy{
  71146. ServerResponse: googleapi.ServerResponse{
  71147. Header: res.Header,
  71148. HTTPStatusCode: res.StatusCode,
  71149. },
  71150. }
  71151. target := &ret
  71152. if err := gensupport.DecodeResponse(target, res); err != nil {
  71153. return nil, err
  71154. }
  71155. return ret, nil
  71156. // {
  71157. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  71158. // "httpMethod": "GET",
  71159. // "id": "compute.licenses.getIamPolicy",
  71160. // "parameterOrder": [
  71161. // "project",
  71162. // "resource"
  71163. // ],
  71164. // "parameters": {
  71165. // "project": {
  71166. // "description": "Project ID for this request.",
  71167. // "location": "path",
  71168. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71169. // "required": true,
  71170. // "type": "string"
  71171. // },
  71172. // "resource": {
  71173. // "description": "Name or id of the resource for this request.",
  71174. // "location": "path",
  71175. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71176. // "required": true,
  71177. // "type": "string"
  71178. // }
  71179. // },
  71180. // "path": "{project}/global/licenses/{resource}/getIamPolicy",
  71181. // "response": {
  71182. // "$ref": "Policy"
  71183. // },
  71184. // "scopes": [
  71185. // "https://www.googleapis.com/auth/cloud-platform",
  71186. // "https://www.googleapis.com/auth/compute",
  71187. // "https://www.googleapis.com/auth/compute.readonly"
  71188. // ]
  71189. // }
  71190. }
  71191. // method id "compute.licenses.insert":
  71192. type LicensesInsertCall struct {
  71193. s *Service
  71194. project string
  71195. license *License
  71196. urlParams_ gensupport.URLParams
  71197. ctx_ context.Context
  71198. header_ http.Header
  71199. }
  71200. // Insert: Create a License resource in the specified project.
  71201. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  71202. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71203. c.project = project
  71204. c.license = license
  71205. return c
  71206. }
  71207. // RequestId sets the optional parameter "requestId": An optional
  71208. // request ID to identify requests. Specify a unique request ID so that
  71209. // if you must retry your request, the server will know to ignore the
  71210. // request if it has already been completed.
  71211. //
  71212. // For example, consider a situation where you make an initial request
  71213. // and the request times out. If you make the request again with the
  71214. // same request ID, the server can check if original operation with the
  71215. // same request ID was received, and if so, will ignore the second
  71216. // request. This prevents clients from accidentally creating duplicate
  71217. // commitments.
  71218. //
  71219. // The request ID must be a valid UUID with the exception that zero UUID
  71220. // is not supported (00000000-0000-0000-0000-000000000000).
  71221. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  71222. c.urlParams_.Set("requestId", requestId)
  71223. return c
  71224. }
  71225. // Fields allows partial responses to be retrieved. See
  71226. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71227. // for more information.
  71228. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  71229. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71230. return c
  71231. }
  71232. // Context sets the context to be used in this call's Do method. Any
  71233. // pending HTTP request will be aborted if the provided context is
  71234. // canceled.
  71235. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  71236. c.ctx_ = ctx
  71237. return c
  71238. }
  71239. // Header returns an http.Header that can be modified by the caller to
  71240. // add HTTP headers to the request.
  71241. func (c *LicensesInsertCall) Header() http.Header {
  71242. if c.header_ == nil {
  71243. c.header_ = make(http.Header)
  71244. }
  71245. return c.header_
  71246. }
  71247. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  71248. reqHeaders := make(http.Header)
  71249. for k, v := range c.header_ {
  71250. reqHeaders[k] = v
  71251. }
  71252. reqHeaders.Set("User-Agent", c.s.userAgent())
  71253. var body io.Reader = nil
  71254. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  71255. if err != nil {
  71256. return nil, err
  71257. }
  71258. reqHeaders.Set("Content-Type", "application/json")
  71259. c.urlParams_.Set("alt", alt)
  71260. c.urlParams_.Set("prettyPrint", "false")
  71261. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  71262. urls += "?" + c.urlParams_.Encode()
  71263. req, err := http.NewRequest("POST", urls, body)
  71264. if err != nil {
  71265. return nil, err
  71266. }
  71267. req.Header = reqHeaders
  71268. googleapi.Expand(req.URL, map[string]string{
  71269. "project": c.project,
  71270. })
  71271. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71272. }
  71273. // Do executes the "compute.licenses.insert" call.
  71274. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71275. // status code is an error. Response headers are in either
  71276. // *Operation.ServerResponse.Header or (if a response was returned at
  71277. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71278. // to check whether the returned error was because
  71279. // http.StatusNotModified was returned.
  71280. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71281. gensupport.SetOptions(c.urlParams_, opts...)
  71282. res, err := c.doRequest("json")
  71283. if res != nil && res.StatusCode == http.StatusNotModified {
  71284. if res.Body != nil {
  71285. res.Body.Close()
  71286. }
  71287. return nil, &googleapi.Error{
  71288. Code: res.StatusCode,
  71289. Header: res.Header,
  71290. }
  71291. }
  71292. if err != nil {
  71293. return nil, err
  71294. }
  71295. defer googleapi.CloseBody(res)
  71296. if err := googleapi.CheckResponse(res); err != nil {
  71297. return nil, err
  71298. }
  71299. ret := &Operation{
  71300. ServerResponse: googleapi.ServerResponse{
  71301. Header: res.Header,
  71302. HTTPStatusCode: res.StatusCode,
  71303. },
  71304. }
  71305. target := &ret
  71306. if err := gensupport.DecodeResponse(target, res); err != nil {
  71307. return nil, err
  71308. }
  71309. return ret, nil
  71310. // {
  71311. // "description": "Create a License resource in the specified project.",
  71312. // "httpMethod": "POST",
  71313. // "id": "compute.licenses.insert",
  71314. // "parameterOrder": [
  71315. // "project"
  71316. // ],
  71317. // "parameters": {
  71318. // "project": {
  71319. // "description": "Project ID for this request.",
  71320. // "location": "path",
  71321. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71322. // "required": true,
  71323. // "type": "string"
  71324. // },
  71325. // "requestId": {
  71326. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71327. // "location": "query",
  71328. // "type": "string"
  71329. // }
  71330. // },
  71331. // "path": "{project}/global/licenses",
  71332. // "request": {
  71333. // "$ref": "License"
  71334. // },
  71335. // "response": {
  71336. // "$ref": "Operation"
  71337. // },
  71338. // "scopes": [
  71339. // "https://www.googleapis.com/auth/cloud-platform",
  71340. // "https://www.googleapis.com/auth/compute",
  71341. // "https://www.googleapis.com/auth/devstorage.full_control",
  71342. // "https://www.googleapis.com/auth/devstorage.read_only",
  71343. // "https://www.googleapis.com/auth/devstorage.read_write"
  71344. // ]
  71345. // }
  71346. }
  71347. // method id "compute.licenses.list":
  71348. type LicensesListCall struct {
  71349. s *Service
  71350. project string
  71351. urlParams_ gensupport.URLParams
  71352. ifNoneMatch_ string
  71353. ctx_ context.Context
  71354. header_ http.Header
  71355. }
  71356. // List: Retrieves the list of licenses available in the specified
  71357. // project. This method does not get any licenses that belong to other
  71358. // projects, including licenses attached to publicly-available images,
  71359. // like Debian 9. If you want to get a list of publicly-available
  71360. // licenses, use this method to make a request to the respective image
  71361. // project, such as debian-cloud or windows-cloud.
  71362. func (r *LicensesService) List(project string) *LicensesListCall {
  71363. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71364. c.project = project
  71365. return c
  71366. }
  71367. // Filter sets the optional parameter "filter": A filter expression that
  71368. // filters resources listed in the response. The expression must specify
  71369. // the field name, a comparison operator, and the value that you want to
  71370. // use for filtering. The value must be a string, a number, or a
  71371. // boolean. The comparison operator must be either =, !=, >, or <.
  71372. //
  71373. // For example, if you are filtering Compute Engine instances, you can
  71374. // exclude instances named example-instance by specifying name !=
  71375. // example-instance.
  71376. //
  71377. // You can also filter nested fields. For example, you could specify
  71378. // scheduling.automaticRestart = false to include instances only if they
  71379. // are not scheduled for automatic restarts. You can use filtering on
  71380. // nested fields to filter based on resource labels.
  71381. //
  71382. // To filter on multiple expressions, provide each separate expression
  71383. // within parentheses. For example, (scheduling.automaticRestart = true)
  71384. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71385. // AND expression. However, you can include AND and OR expressions
  71386. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71387. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71388. // true).
  71389. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  71390. c.urlParams_.Set("filter", filter)
  71391. return c
  71392. }
  71393. // MaxResults sets the optional parameter "maxResults": The maximum
  71394. // number of results per page that should be returned. If the number of
  71395. // available results is larger than maxResults, Compute Engine returns a
  71396. // nextPageToken that can be used to get the next page of results in
  71397. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71398. // (Default: 500)
  71399. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  71400. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71401. return c
  71402. }
  71403. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71404. // a certain order. By default, results are returned in alphanumerical
  71405. // order based on the resource name.
  71406. //
  71407. // You can also sort results in descending order based on the creation
  71408. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71409. // based on the creationTimestamp field in reverse chronological order
  71410. // (newest result first). Use this to sort resources like operations so
  71411. // that the newest operation is returned first.
  71412. //
  71413. // Currently, only sorting by name or creationTimestamp desc is
  71414. // supported.
  71415. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  71416. c.urlParams_.Set("orderBy", orderBy)
  71417. return c
  71418. }
  71419. // PageToken sets the optional parameter "pageToken": Specifies a page
  71420. // token to use. Set pageToken to the nextPageToken returned by a
  71421. // previous list request to get the next page of results.
  71422. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  71423. c.urlParams_.Set("pageToken", pageToken)
  71424. return c
  71425. }
  71426. // Fields allows partial responses to be retrieved. See
  71427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71428. // for more information.
  71429. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  71430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71431. return c
  71432. }
  71433. // IfNoneMatch sets the optional parameter which makes the operation
  71434. // fail if the object's ETag matches the given value. This is useful for
  71435. // getting updates only after the object has changed since the last
  71436. // request. Use googleapi.IsNotModified to check whether the response
  71437. // error from Do is the result of In-None-Match.
  71438. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  71439. c.ifNoneMatch_ = entityTag
  71440. return c
  71441. }
  71442. // Context sets the context to be used in this call's Do method. Any
  71443. // pending HTTP request will be aborted if the provided context is
  71444. // canceled.
  71445. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  71446. c.ctx_ = ctx
  71447. return c
  71448. }
  71449. // Header returns an http.Header that can be modified by the caller to
  71450. // add HTTP headers to the request.
  71451. func (c *LicensesListCall) Header() http.Header {
  71452. if c.header_ == nil {
  71453. c.header_ = make(http.Header)
  71454. }
  71455. return c.header_
  71456. }
  71457. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  71458. reqHeaders := make(http.Header)
  71459. for k, v := range c.header_ {
  71460. reqHeaders[k] = v
  71461. }
  71462. reqHeaders.Set("User-Agent", c.s.userAgent())
  71463. if c.ifNoneMatch_ != "" {
  71464. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71465. }
  71466. var body io.Reader = nil
  71467. c.urlParams_.Set("alt", alt)
  71468. c.urlParams_.Set("prettyPrint", "false")
  71469. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  71470. urls += "?" + c.urlParams_.Encode()
  71471. req, err := http.NewRequest("GET", urls, body)
  71472. if err != nil {
  71473. return nil, err
  71474. }
  71475. req.Header = reqHeaders
  71476. googleapi.Expand(req.URL, map[string]string{
  71477. "project": c.project,
  71478. })
  71479. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71480. }
  71481. // Do executes the "compute.licenses.list" call.
  71482. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  71483. // non-2xx status code is an error. Response headers are in either
  71484. // *LicensesListResponse.ServerResponse.Header or (if a response was
  71485. // returned at all) in error.(*googleapi.Error).Header. Use
  71486. // googleapi.IsNotModified to check whether the returned error was
  71487. // because http.StatusNotModified was returned.
  71488. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  71489. gensupport.SetOptions(c.urlParams_, opts...)
  71490. res, err := c.doRequest("json")
  71491. if res != nil && res.StatusCode == http.StatusNotModified {
  71492. if res.Body != nil {
  71493. res.Body.Close()
  71494. }
  71495. return nil, &googleapi.Error{
  71496. Code: res.StatusCode,
  71497. Header: res.Header,
  71498. }
  71499. }
  71500. if err != nil {
  71501. return nil, err
  71502. }
  71503. defer googleapi.CloseBody(res)
  71504. if err := googleapi.CheckResponse(res); err != nil {
  71505. return nil, err
  71506. }
  71507. ret := &LicensesListResponse{
  71508. ServerResponse: googleapi.ServerResponse{
  71509. Header: res.Header,
  71510. HTTPStatusCode: res.StatusCode,
  71511. },
  71512. }
  71513. target := &ret
  71514. if err := gensupport.DecodeResponse(target, res); err != nil {
  71515. return nil, err
  71516. }
  71517. return ret, nil
  71518. // {
  71519. // "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.",
  71520. // "httpMethod": "GET",
  71521. // "id": "compute.licenses.list",
  71522. // "parameterOrder": [
  71523. // "project"
  71524. // ],
  71525. // "parameters": {
  71526. // "filter": {
  71527. // "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).",
  71528. // "location": "query",
  71529. // "type": "string"
  71530. // },
  71531. // "maxResults": {
  71532. // "default": "500",
  71533. // "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)",
  71534. // "format": "uint32",
  71535. // "location": "query",
  71536. // "minimum": "0",
  71537. // "type": "integer"
  71538. // },
  71539. // "orderBy": {
  71540. // "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.",
  71541. // "location": "query",
  71542. // "type": "string"
  71543. // },
  71544. // "pageToken": {
  71545. // "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.",
  71546. // "location": "query",
  71547. // "type": "string"
  71548. // },
  71549. // "project": {
  71550. // "description": "Project ID for this request.",
  71551. // "location": "path",
  71552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71553. // "required": true,
  71554. // "type": "string"
  71555. // }
  71556. // },
  71557. // "path": "{project}/global/licenses",
  71558. // "response": {
  71559. // "$ref": "LicensesListResponse"
  71560. // },
  71561. // "scopes": [
  71562. // "https://www.googleapis.com/auth/cloud-platform",
  71563. // "https://www.googleapis.com/auth/compute",
  71564. // "https://www.googleapis.com/auth/compute.readonly"
  71565. // ]
  71566. // }
  71567. }
  71568. // Pages invokes f for each page of results.
  71569. // A non-nil error returned from f will halt the iteration.
  71570. // The provided context supersedes any context provided to the Context method.
  71571. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  71572. c.ctx_ = ctx
  71573. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  71574. for {
  71575. x, err := c.Do()
  71576. if err != nil {
  71577. return err
  71578. }
  71579. if err := f(x); err != nil {
  71580. return err
  71581. }
  71582. if x.NextPageToken == "" {
  71583. return nil
  71584. }
  71585. c.PageToken(x.NextPageToken)
  71586. }
  71587. }
  71588. // method id "compute.licenses.setIamPolicy":
  71589. type LicensesSetIamPolicyCall struct {
  71590. s *Service
  71591. project string
  71592. resource string
  71593. globalsetpolicyrequest *GlobalSetPolicyRequest
  71594. urlParams_ gensupport.URLParams
  71595. ctx_ context.Context
  71596. header_ http.Header
  71597. }
  71598. // SetIamPolicy: Sets the access control policy on the specified
  71599. // resource. Replaces any existing policy.
  71600. func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
  71601. c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71602. c.project = project
  71603. c.resource = resource
  71604. c.globalsetpolicyrequest = globalsetpolicyrequest
  71605. return c
  71606. }
  71607. // Fields allows partial responses to be retrieved. See
  71608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71609. // for more information.
  71610. func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
  71611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71612. return c
  71613. }
  71614. // Context sets the context to be used in this call's Do method. Any
  71615. // pending HTTP request will be aborted if the provided context is
  71616. // canceled.
  71617. func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
  71618. c.ctx_ = ctx
  71619. return c
  71620. }
  71621. // Header returns an http.Header that can be modified by the caller to
  71622. // add HTTP headers to the request.
  71623. func (c *LicensesSetIamPolicyCall) Header() http.Header {
  71624. if c.header_ == nil {
  71625. c.header_ = make(http.Header)
  71626. }
  71627. return c.header_
  71628. }
  71629. func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  71630. reqHeaders := make(http.Header)
  71631. for k, v := range c.header_ {
  71632. reqHeaders[k] = v
  71633. }
  71634. reqHeaders.Set("User-Agent", c.s.userAgent())
  71635. var body io.Reader = nil
  71636. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  71637. if err != nil {
  71638. return nil, err
  71639. }
  71640. reqHeaders.Set("Content-Type", "application/json")
  71641. c.urlParams_.Set("alt", alt)
  71642. c.urlParams_.Set("prettyPrint", "false")
  71643. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/setIamPolicy")
  71644. urls += "?" + c.urlParams_.Encode()
  71645. req, err := http.NewRequest("POST", urls, body)
  71646. if err != nil {
  71647. return nil, err
  71648. }
  71649. req.Header = reqHeaders
  71650. googleapi.Expand(req.URL, map[string]string{
  71651. "project": c.project,
  71652. "resource": c.resource,
  71653. })
  71654. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71655. }
  71656. // Do executes the "compute.licenses.setIamPolicy" call.
  71657. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  71658. // code is an error. Response headers are in either
  71659. // *Policy.ServerResponse.Header or (if a response was returned at all)
  71660. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  71661. // check whether the returned error was because http.StatusNotModified
  71662. // was returned.
  71663. func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  71664. gensupport.SetOptions(c.urlParams_, opts...)
  71665. res, err := c.doRequest("json")
  71666. if res != nil && res.StatusCode == http.StatusNotModified {
  71667. if res.Body != nil {
  71668. res.Body.Close()
  71669. }
  71670. return nil, &googleapi.Error{
  71671. Code: res.StatusCode,
  71672. Header: res.Header,
  71673. }
  71674. }
  71675. if err != nil {
  71676. return nil, err
  71677. }
  71678. defer googleapi.CloseBody(res)
  71679. if err := googleapi.CheckResponse(res); err != nil {
  71680. return nil, err
  71681. }
  71682. ret := &Policy{
  71683. ServerResponse: googleapi.ServerResponse{
  71684. Header: res.Header,
  71685. HTTPStatusCode: res.StatusCode,
  71686. },
  71687. }
  71688. target := &ret
  71689. if err := gensupport.DecodeResponse(target, res); err != nil {
  71690. return nil, err
  71691. }
  71692. return ret, nil
  71693. // {
  71694. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  71695. // "httpMethod": "POST",
  71696. // "id": "compute.licenses.setIamPolicy",
  71697. // "parameterOrder": [
  71698. // "project",
  71699. // "resource"
  71700. // ],
  71701. // "parameters": {
  71702. // "project": {
  71703. // "description": "Project ID for this request.",
  71704. // "location": "path",
  71705. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71706. // "required": true,
  71707. // "type": "string"
  71708. // },
  71709. // "resource": {
  71710. // "description": "Name or id of the resource for this request.",
  71711. // "location": "path",
  71712. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71713. // "required": true,
  71714. // "type": "string"
  71715. // }
  71716. // },
  71717. // "path": "{project}/global/licenses/{resource}/setIamPolicy",
  71718. // "request": {
  71719. // "$ref": "GlobalSetPolicyRequest"
  71720. // },
  71721. // "response": {
  71722. // "$ref": "Policy"
  71723. // },
  71724. // "scopes": [
  71725. // "https://www.googleapis.com/auth/cloud-platform",
  71726. // "https://www.googleapis.com/auth/compute"
  71727. // ]
  71728. // }
  71729. }
  71730. // method id "compute.machineTypes.aggregatedList":
  71731. type MachineTypesAggregatedListCall struct {
  71732. s *Service
  71733. project string
  71734. urlParams_ gensupport.URLParams
  71735. ifNoneMatch_ string
  71736. ctx_ context.Context
  71737. header_ http.Header
  71738. }
  71739. // AggregatedList: Retrieves an aggregated list of machine types.
  71740. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  71741. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  71742. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71743. c.project = project
  71744. return c
  71745. }
  71746. // Filter sets the optional parameter "filter": A filter expression that
  71747. // filters resources listed in the response. The expression must specify
  71748. // the field name, a comparison operator, and the value that you want to
  71749. // use for filtering. The value must be a string, a number, or a
  71750. // boolean. The comparison operator must be either =, !=, >, or <.
  71751. //
  71752. // For example, if you are filtering Compute Engine instances, you can
  71753. // exclude instances named example-instance by specifying name !=
  71754. // example-instance.
  71755. //
  71756. // You can also filter nested fields. For example, you could specify
  71757. // scheduling.automaticRestart = false to include instances only if they
  71758. // are not scheduled for automatic restarts. You can use filtering on
  71759. // nested fields to filter based on resource labels.
  71760. //
  71761. // To filter on multiple expressions, provide each separate expression
  71762. // within parentheses. For example, (scheduling.automaticRestart = true)
  71763. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71764. // AND expression. However, you can include AND and OR expressions
  71765. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71766. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71767. // true).
  71768. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  71769. c.urlParams_.Set("filter", filter)
  71770. return c
  71771. }
  71772. // MaxResults sets the optional parameter "maxResults": The maximum
  71773. // number of results per page that should be returned. If the number of
  71774. // available results is larger than maxResults, Compute Engine returns a
  71775. // nextPageToken that can be used to get the next page of results in
  71776. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71777. // (Default: 500)
  71778. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  71779. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71780. return c
  71781. }
  71782. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71783. // a certain order. By default, results are returned in alphanumerical
  71784. // order based on the resource name.
  71785. //
  71786. // You can also sort results in descending order based on the creation
  71787. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71788. // based on the creationTimestamp field in reverse chronological order
  71789. // (newest result first). Use this to sort resources like operations so
  71790. // that the newest operation is returned first.
  71791. //
  71792. // Currently, only sorting by name or creationTimestamp desc is
  71793. // supported.
  71794. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  71795. c.urlParams_.Set("orderBy", orderBy)
  71796. return c
  71797. }
  71798. // PageToken sets the optional parameter "pageToken": Specifies a page
  71799. // token to use. Set pageToken to the nextPageToken returned by a
  71800. // previous list request to get the next page of results.
  71801. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  71802. c.urlParams_.Set("pageToken", pageToken)
  71803. return c
  71804. }
  71805. // Fields allows partial responses to be retrieved. See
  71806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71807. // for more information.
  71808. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  71809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71810. return c
  71811. }
  71812. // IfNoneMatch sets the optional parameter which makes the operation
  71813. // fail if the object's ETag matches the given value. This is useful for
  71814. // getting updates only after the object has changed since the last
  71815. // request. Use googleapi.IsNotModified to check whether the response
  71816. // error from Do is the result of In-None-Match.
  71817. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  71818. c.ifNoneMatch_ = entityTag
  71819. return c
  71820. }
  71821. // Context sets the context to be used in this call's Do method. Any
  71822. // pending HTTP request will be aborted if the provided context is
  71823. // canceled.
  71824. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  71825. c.ctx_ = ctx
  71826. return c
  71827. }
  71828. // Header returns an http.Header that can be modified by the caller to
  71829. // add HTTP headers to the request.
  71830. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  71831. if c.header_ == nil {
  71832. c.header_ = make(http.Header)
  71833. }
  71834. return c.header_
  71835. }
  71836. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  71837. reqHeaders := make(http.Header)
  71838. for k, v := range c.header_ {
  71839. reqHeaders[k] = v
  71840. }
  71841. reqHeaders.Set("User-Agent", c.s.userAgent())
  71842. if c.ifNoneMatch_ != "" {
  71843. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71844. }
  71845. var body io.Reader = nil
  71846. c.urlParams_.Set("alt", alt)
  71847. c.urlParams_.Set("prettyPrint", "false")
  71848. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  71849. urls += "?" + c.urlParams_.Encode()
  71850. req, err := http.NewRequest("GET", urls, body)
  71851. if err != nil {
  71852. return nil, err
  71853. }
  71854. req.Header = reqHeaders
  71855. googleapi.Expand(req.URL, map[string]string{
  71856. "project": c.project,
  71857. })
  71858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71859. }
  71860. // Do executes the "compute.machineTypes.aggregatedList" call.
  71861. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  71862. // Any non-2xx status code is an error. Response headers are in either
  71863. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  71864. // was returned at all) in error.(*googleapi.Error).Header. Use
  71865. // googleapi.IsNotModified to check whether the returned error was
  71866. // because http.StatusNotModified was returned.
  71867. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  71868. gensupport.SetOptions(c.urlParams_, opts...)
  71869. res, err := c.doRequest("json")
  71870. if res != nil && res.StatusCode == http.StatusNotModified {
  71871. if res.Body != nil {
  71872. res.Body.Close()
  71873. }
  71874. return nil, &googleapi.Error{
  71875. Code: res.StatusCode,
  71876. Header: res.Header,
  71877. }
  71878. }
  71879. if err != nil {
  71880. return nil, err
  71881. }
  71882. defer googleapi.CloseBody(res)
  71883. if err := googleapi.CheckResponse(res); err != nil {
  71884. return nil, err
  71885. }
  71886. ret := &MachineTypeAggregatedList{
  71887. ServerResponse: googleapi.ServerResponse{
  71888. Header: res.Header,
  71889. HTTPStatusCode: res.StatusCode,
  71890. },
  71891. }
  71892. target := &ret
  71893. if err := gensupport.DecodeResponse(target, res); err != nil {
  71894. return nil, err
  71895. }
  71896. return ret, nil
  71897. // {
  71898. // "description": "Retrieves an aggregated list of machine types.",
  71899. // "httpMethod": "GET",
  71900. // "id": "compute.machineTypes.aggregatedList",
  71901. // "parameterOrder": [
  71902. // "project"
  71903. // ],
  71904. // "parameters": {
  71905. // "filter": {
  71906. // "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).",
  71907. // "location": "query",
  71908. // "type": "string"
  71909. // },
  71910. // "maxResults": {
  71911. // "default": "500",
  71912. // "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)",
  71913. // "format": "uint32",
  71914. // "location": "query",
  71915. // "minimum": "0",
  71916. // "type": "integer"
  71917. // },
  71918. // "orderBy": {
  71919. // "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.",
  71920. // "location": "query",
  71921. // "type": "string"
  71922. // },
  71923. // "pageToken": {
  71924. // "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.",
  71925. // "location": "query",
  71926. // "type": "string"
  71927. // },
  71928. // "project": {
  71929. // "description": "Project ID for this request.",
  71930. // "location": "path",
  71931. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71932. // "required": true,
  71933. // "type": "string"
  71934. // }
  71935. // },
  71936. // "path": "{project}/aggregated/machineTypes",
  71937. // "response": {
  71938. // "$ref": "MachineTypeAggregatedList"
  71939. // },
  71940. // "scopes": [
  71941. // "https://www.googleapis.com/auth/cloud-platform",
  71942. // "https://www.googleapis.com/auth/compute",
  71943. // "https://www.googleapis.com/auth/compute.readonly"
  71944. // ]
  71945. // }
  71946. }
  71947. // Pages invokes f for each page of results.
  71948. // A non-nil error returned from f will halt the iteration.
  71949. // The provided context supersedes any context provided to the Context method.
  71950. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  71951. c.ctx_ = ctx
  71952. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  71953. for {
  71954. x, err := c.Do()
  71955. if err != nil {
  71956. return err
  71957. }
  71958. if err := f(x); err != nil {
  71959. return err
  71960. }
  71961. if x.NextPageToken == "" {
  71962. return nil
  71963. }
  71964. c.PageToken(x.NextPageToken)
  71965. }
  71966. }
  71967. // method id "compute.machineTypes.get":
  71968. type MachineTypesGetCall struct {
  71969. s *Service
  71970. project string
  71971. zone string
  71972. machineType string
  71973. urlParams_ gensupport.URLParams
  71974. ifNoneMatch_ string
  71975. ctx_ context.Context
  71976. header_ http.Header
  71977. }
  71978. // Get: Returns the specified machine type. Gets a list of available
  71979. // machine types by making a list() request.
  71980. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  71981. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  71982. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71983. c.project = project
  71984. c.zone = zone
  71985. c.machineType = machineType
  71986. return c
  71987. }
  71988. // Fields allows partial responses to be retrieved. See
  71989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71990. // for more information.
  71991. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  71992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71993. return c
  71994. }
  71995. // IfNoneMatch sets the optional parameter which makes the operation
  71996. // fail if the object's ETag matches the given value. This is useful for
  71997. // getting updates only after the object has changed since the last
  71998. // request. Use googleapi.IsNotModified to check whether the response
  71999. // error from Do is the result of In-None-Match.
  72000. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  72001. c.ifNoneMatch_ = entityTag
  72002. return c
  72003. }
  72004. // Context sets the context to be used in this call's Do method. Any
  72005. // pending HTTP request will be aborted if the provided context is
  72006. // canceled.
  72007. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  72008. c.ctx_ = ctx
  72009. return c
  72010. }
  72011. // Header returns an http.Header that can be modified by the caller to
  72012. // add HTTP headers to the request.
  72013. func (c *MachineTypesGetCall) Header() http.Header {
  72014. if c.header_ == nil {
  72015. c.header_ = make(http.Header)
  72016. }
  72017. return c.header_
  72018. }
  72019. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  72020. reqHeaders := make(http.Header)
  72021. for k, v := range c.header_ {
  72022. reqHeaders[k] = v
  72023. }
  72024. reqHeaders.Set("User-Agent", c.s.userAgent())
  72025. if c.ifNoneMatch_ != "" {
  72026. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72027. }
  72028. var body io.Reader = nil
  72029. c.urlParams_.Set("alt", alt)
  72030. c.urlParams_.Set("prettyPrint", "false")
  72031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  72032. urls += "?" + c.urlParams_.Encode()
  72033. req, err := http.NewRequest("GET", urls, body)
  72034. if err != nil {
  72035. return nil, err
  72036. }
  72037. req.Header = reqHeaders
  72038. googleapi.Expand(req.URL, map[string]string{
  72039. "project": c.project,
  72040. "zone": c.zone,
  72041. "machineType": c.machineType,
  72042. })
  72043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72044. }
  72045. // Do executes the "compute.machineTypes.get" call.
  72046. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  72047. // status code is an error. Response headers are in either
  72048. // *MachineType.ServerResponse.Header or (if a response was returned at
  72049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72050. // to check whether the returned error was because
  72051. // http.StatusNotModified was returned.
  72052. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  72053. gensupport.SetOptions(c.urlParams_, opts...)
  72054. res, err := c.doRequest("json")
  72055. if res != nil && res.StatusCode == http.StatusNotModified {
  72056. if res.Body != nil {
  72057. res.Body.Close()
  72058. }
  72059. return nil, &googleapi.Error{
  72060. Code: res.StatusCode,
  72061. Header: res.Header,
  72062. }
  72063. }
  72064. if err != nil {
  72065. return nil, err
  72066. }
  72067. defer googleapi.CloseBody(res)
  72068. if err := googleapi.CheckResponse(res); err != nil {
  72069. return nil, err
  72070. }
  72071. ret := &MachineType{
  72072. ServerResponse: googleapi.ServerResponse{
  72073. Header: res.Header,
  72074. HTTPStatusCode: res.StatusCode,
  72075. },
  72076. }
  72077. target := &ret
  72078. if err := gensupport.DecodeResponse(target, res); err != nil {
  72079. return nil, err
  72080. }
  72081. return ret, nil
  72082. // {
  72083. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  72084. // "httpMethod": "GET",
  72085. // "id": "compute.machineTypes.get",
  72086. // "parameterOrder": [
  72087. // "project",
  72088. // "zone",
  72089. // "machineType"
  72090. // ],
  72091. // "parameters": {
  72092. // "machineType": {
  72093. // "description": "Name of the machine type to return.",
  72094. // "location": "path",
  72095. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72096. // "required": true,
  72097. // "type": "string"
  72098. // },
  72099. // "project": {
  72100. // "description": "Project ID for this request.",
  72101. // "location": "path",
  72102. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72103. // "required": true,
  72104. // "type": "string"
  72105. // },
  72106. // "zone": {
  72107. // "description": "The name of the zone for this request.",
  72108. // "location": "path",
  72109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72110. // "required": true,
  72111. // "type": "string"
  72112. // }
  72113. // },
  72114. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  72115. // "response": {
  72116. // "$ref": "MachineType"
  72117. // },
  72118. // "scopes": [
  72119. // "https://www.googleapis.com/auth/cloud-platform",
  72120. // "https://www.googleapis.com/auth/compute",
  72121. // "https://www.googleapis.com/auth/compute.readonly"
  72122. // ]
  72123. // }
  72124. }
  72125. // method id "compute.machineTypes.list":
  72126. type MachineTypesListCall struct {
  72127. s *Service
  72128. project string
  72129. zone string
  72130. urlParams_ gensupport.URLParams
  72131. ifNoneMatch_ string
  72132. ctx_ context.Context
  72133. header_ http.Header
  72134. }
  72135. // List: Retrieves a list of machine types available to the specified
  72136. // project.
  72137. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  72138. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  72139. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72140. c.project = project
  72141. c.zone = zone
  72142. return c
  72143. }
  72144. // Filter sets the optional parameter "filter": A filter expression that
  72145. // filters resources listed in the response. The expression must specify
  72146. // the field name, a comparison operator, and the value that you want to
  72147. // use for filtering. The value must be a string, a number, or a
  72148. // boolean. The comparison operator must be either =, !=, >, or <.
  72149. //
  72150. // For example, if you are filtering Compute Engine instances, you can
  72151. // exclude instances named example-instance by specifying name !=
  72152. // example-instance.
  72153. //
  72154. // You can also filter nested fields. For example, you could specify
  72155. // scheduling.automaticRestart = false to include instances only if they
  72156. // are not scheduled for automatic restarts. You can use filtering on
  72157. // nested fields to filter based on resource labels.
  72158. //
  72159. // To filter on multiple expressions, provide each separate expression
  72160. // within parentheses. For example, (scheduling.automaticRestart = true)
  72161. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72162. // AND expression. However, you can include AND and OR expressions
  72163. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72164. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72165. // true).
  72166. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  72167. c.urlParams_.Set("filter", filter)
  72168. return c
  72169. }
  72170. // MaxResults sets the optional parameter "maxResults": The maximum
  72171. // number of results per page that should be returned. If the number of
  72172. // available results is larger than maxResults, Compute Engine returns a
  72173. // nextPageToken that can be used to get the next page of results in
  72174. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72175. // (Default: 500)
  72176. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  72177. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72178. return c
  72179. }
  72180. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72181. // a certain order. By default, results are returned in alphanumerical
  72182. // order based on the resource name.
  72183. //
  72184. // You can also sort results in descending order based on the creation
  72185. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72186. // based on the creationTimestamp field in reverse chronological order
  72187. // (newest result first). Use this to sort resources like operations so
  72188. // that the newest operation is returned first.
  72189. //
  72190. // Currently, only sorting by name or creationTimestamp desc is
  72191. // supported.
  72192. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  72193. c.urlParams_.Set("orderBy", orderBy)
  72194. return c
  72195. }
  72196. // PageToken sets the optional parameter "pageToken": Specifies a page
  72197. // token to use. Set pageToken to the nextPageToken returned by a
  72198. // previous list request to get the next page of results.
  72199. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  72200. c.urlParams_.Set("pageToken", pageToken)
  72201. return c
  72202. }
  72203. // Fields allows partial responses to be retrieved. See
  72204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72205. // for more information.
  72206. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  72207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72208. return c
  72209. }
  72210. // IfNoneMatch sets the optional parameter which makes the operation
  72211. // fail if the object's ETag matches the given value. This is useful for
  72212. // getting updates only after the object has changed since the last
  72213. // request. Use googleapi.IsNotModified to check whether the response
  72214. // error from Do is the result of In-None-Match.
  72215. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  72216. c.ifNoneMatch_ = entityTag
  72217. return c
  72218. }
  72219. // Context sets the context to be used in this call's Do method. Any
  72220. // pending HTTP request will be aborted if the provided context is
  72221. // canceled.
  72222. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  72223. c.ctx_ = ctx
  72224. return c
  72225. }
  72226. // Header returns an http.Header that can be modified by the caller to
  72227. // add HTTP headers to the request.
  72228. func (c *MachineTypesListCall) Header() http.Header {
  72229. if c.header_ == nil {
  72230. c.header_ = make(http.Header)
  72231. }
  72232. return c.header_
  72233. }
  72234. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  72235. reqHeaders := make(http.Header)
  72236. for k, v := range c.header_ {
  72237. reqHeaders[k] = v
  72238. }
  72239. reqHeaders.Set("User-Agent", c.s.userAgent())
  72240. if c.ifNoneMatch_ != "" {
  72241. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72242. }
  72243. var body io.Reader = nil
  72244. c.urlParams_.Set("alt", alt)
  72245. c.urlParams_.Set("prettyPrint", "false")
  72246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  72247. urls += "?" + c.urlParams_.Encode()
  72248. req, err := http.NewRequest("GET", urls, body)
  72249. if err != nil {
  72250. return nil, err
  72251. }
  72252. req.Header = reqHeaders
  72253. googleapi.Expand(req.URL, map[string]string{
  72254. "project": c.project,
  72255. "zone": c.zone,
  72256. })
  72257. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72258. }
  72259. // Do executes the "compute.machineTypes.list" call.
  72260. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  72261. // status code is an error. Response headers are in either
  72262. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  72263. // at all) in error.(*googleapi.Error).Header. Use
  72264. // googleapi.IsNotModified to check whether the returned error was
  72265. // because http.StatusNotModified was returned.
  72266. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  72267. gensupport.SetOptions(c.urlParams_, opts...)
  72268. res, err := c.doRequest("json")
  72269. if res != nil && res.StatusCode == http.StatusNotModified {
  72270. if res.Body != nil {
  72271. res.Body.Close()
  72272. }
  72273. return nil, &googleapi.Error{
  72274. Code: res.StatusCode,
  72275. Header: res.Header,
  72276. }
  72277. }
  72278. if err != nil {
  72279. return nil, err
  72280. }
  72281. defer googleapi.CloseBody(res)
  72282. if err := googleapi.CheckResponse(res); err != nil {
  72283. return nil, err
  72284. }
  72285. ret := &MachineTypeList{
  72286. ServerResponse: googleapi.ServerResponse{
  72287. Header: res.Header,
  72288. HTTPStatusCode: res.StatusCode,
  72289. },
  72290. }
  72291. target := &ret
  72292. if err := gensupport.DecodeResponse(target, res); err != nil {
  72293. return nil, err
  72294. }
  72295. return ret, nil
  72296. // {
  72297. // "description": "Retrieves a list of machine types available to the specified project.",
  72298. // "httpMethod": "GET",
  72299. // "id": "compute.machineTypes.list",
  72300. // "parameterOrder": [
  72301. // "project",
  72302. // "zone"
  72303. // ],
  72304. // "parameters": {
  72305. // "filter": {
  72306. // "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).",
  72307. // "location": "query",
  72308. // "type": "string"
  72309. // },
  72310. // "maxResults": {
  72311. // "default": "500",
  72312. // "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)",
  72313. // "format": "uint32",
  72314. // "location": "query",
  72315. // "minimum": "0",
  72316. // "type": "integer"
  72317. // },
  72318. // "orderBy": {
  72319. // "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.",
  72320. // "location": "query",
  72321. // "type": "string"
  72322. // },
  72323. // "pageToken": {
  72324. // "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.",
  72325. // "location": "query",
  72326. // "type": "string"
  72327. // },
  72328. // "project": {
  72329. // "description": "Project ID for this request.",
  72330. // "location": "path",
  72331. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72332. // "required": true,
  72333. // "type": "string"
  72334. // },
  72335. // "zone": {
  72336. // "description": "The name of the zone for this request.",
  72337. // "location": "path",
  72338. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72339. // "required": true,
  72340. // "type": "string"
  72341. // }
  72342. // },
  72343. // "path": "{project}/zones/{zone}/machineTypes",
  72344. // "response": {
  72345. // "$ref": "MachineTypeList"
  72346. // },
  72347. // "scopes": [
  72348. // "https://www.googleapis.com/auth/cloud-platform",
  72349. // "https://www.googleapis.com/auth/compute",
  72350. // "https://www.googleapis.com/auth/compute.readonly"
  72351. // ]
  72352. // }
  72353. }
  72354. // Pages invokes f for each page of results.
  72355. // A non-nil error returned from f will halt the iteration.
  72356. // The provided context supersedes any context provided to the Context method.
  72357. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  72358. c.ctx_ = ctx
  72359. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72360. for {
  72361. x, err := c.Do()
  72362. if err != nil {
  72363. return err
  72364. }
  72365. if err := f(x); err != nil {
  72366. return err
  72367. }
  72368. if x.NextPageToken == "" {
  72369. return nil
  72370. }
  72371. c.PageToken(x.NextPageToken)
  72372. }
  72373. }
  72374. // method id "compute.networkEndpointGroups.aggregatedList":
  72375. type NetworkEndpointGroupsAggregatedListCall struct {
  72376. s *Service
  72377. project string
  72378. urlParams_ gensupport.URLParams
  72379. ifNoneMatch_ string
  72380. ctx_ context.Context
  72381. header_ http.Header
  72382. }
  72383. // AggregatedList: Retrieves the list of network endpoint groups and
  72384. // sorts them by zone.
  72385. func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {
  72386. c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72387. c.project = project
  72388. return c
  72389. }
  72390. // Filter sets the optional parameter "filter": A filter expression that
  72391. // filters resources listed in the response. The expression must specify
  72392. // the field name, a comparison operator, and the value that you want to
  72393. // use for filtering. The value must be a string, a number, or a
  72394. // boolean. The comparison operator must be either =, !=, >, or <.
  72395. //
  72396. // For example, if you are filtering Compute Engine instances, you can
  72397. // exclude instances named example-instance by specifying name !=
  72398. // example-instance.
  72399. //
  72400. // You can also filter nested fields. For example, you could specify
  72401. // scheduling.automaticRestart = false to include instances only if they
  72402. // are not scheduled for automatic restarts. You can use filtering on
  72403. // nested fields to filter based on resource labels.
  72404. //
  72405. // To filter on multiple expressions, provide each separate expression
  72406. // within parentheses. For example, (scheduling.automaticRestart = true)
  72407. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72408. // AND expression. However, you can include AND and OR expressions
  72409. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72410. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72411. // true).
  72412. func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall {
  72413. c.urlParams_.Set("filter", filter)
  72414. return c
  72415. }
  72416. // MaxResults sets the optional parameter "maxResults": The maximum
  72417. // number of results per page that should be returned. If the number of
  72418. // available results is larger than maxResults, Compute Engine returns a
  72419. // nextPageToken that can be used to get the next page of results in
  72420. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72421. // (Default: 500)
  72422. func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall {
  72423. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72424. return c
  72425. }
  72426. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72427. // a certain order. By default, results are returned in alphanumerical
  72428. // order based on the resource name.
  72429. //
  72430. // You can also sort results in descending order based on the creation
  72431. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72432. // based on the creationTimestamp field in reverse chronological order
  72433. // (newest result first). Use this to sort resources like operations so
  72434. // that the newest operation is returned first.
  72435. //
  72436. // Currently, only sorting by name or creationTimestamp desc is
  72437. // supported.
  72438. func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall {
  72439. c.urlParams_.Set("orderBy", orderBy)
  72440. return c
  72441. }
  72442. // PageToken sets the optional parameter "pageToken": Specifies a page
  72443. // token to use. Set pageToken to the nextPageToken returned by a
  72444. // previous list request to get the next page of results.
  72445. func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall {
  72446. c.urlParams_.Set("pageToken", pageToken)
  72447. return c
  72448. }
  72449. // Fields allows partial responses to be retrieved. See
  72450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72451. // for more information.
  72452. func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall {
  72453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72454. return c
  72455. }
  72456. // IfNoneMatch sets the optional parameter which makes the operation
  72457. // fail if the object's ETag matches the given value. This is useful for
  72458. // getting updates only after the object has changed since the last
  72459. // request. Use googleapi.IsNotModified to check whether the response
  72460. // error from Do is the result of In-None-Match.
  72461. func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall {
  72462. c.ifNoneMatch_ = entityTag
  72463. return c
  72464. }
  72465. // Context sets the context to be used in this call's Do method. Any
  72466. // pending HTTP request will be aborted if the provided context is
  72467. // canceled.
  72468. func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall {
  72469. c.ctx_ = ctx
  72470. return c
  72471. }
  72472. // Header returns an http.Header that can be modified by the caller to
  72473. // add HTTP headers to the request.
  72474. func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header {
  72475. if c.header_ == nil {
  72476. c.header_ = make(http.Header)
  72477. }
  72478. return c.header_
  72479. }
  72480. func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  72481. reqHeaders := make(http.Header)
  72482. for k, v := range c.header_ {
  72483. reqHeaders[k] = v
  72484. }
  72485. reqHeaders.Set("User-Agent", c.s.userAgent())
  72486. if c.ifNoneMatch_ != "" {
  72487. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72488. }
  72489. var body io.Reader = nil
  72490. c.urlParams_.Set("alt", alt)
  72491. c.urlParams_.Set("prettyPrint", "false")
  72492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/networkEndpointGroups")
  72493. urls += "?" + c.urlParams_.Encode()
  72494. req, err := http.NewRequest("GET", urls, body)
  72495. if err != nil {
  72496. return nil, err
  72497. }
  72498. req.Header = reqHeaders
  72499. googleapi.Expand(req.URL, map[string]string{
  72500. "project": c.project,
  72501. })
  72502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72503. }
  72504. // Do executes the "compute.networkEndpointGroups.aggregatedList" call.
  72505. // Exactly one of *NetworkEndpointGroupAggregatedList or error will be
  72506. // non-nil. Any non-2xx status code is an error. Response headers are in
  72507. // either *NetworkEndpointGroupAggregatedList.ServerResponse.Header or
  72508. // (if a response was returned at all) in
  72509. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  72510. // whether the returned error was because http.StatusNotModified was
  72511. // returned.
  72512. func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) {
  72513. gensupport.SetOptions(c.urlParams_, opts...)
  72514. res, err := c.doRequest("json")
  72515. if res != nil && res.StatusCode == http.StatusNotModified {
  72516. if res.Body != nil {
  72517. res.Body.Close()
  72518. }
  72519. return nil, &googleapi.Error{
  72520. Code: res.StatusCode,
  72521. Header: res.Header,
  72522. }
  72523. }
  72524. if err != nil {
  72525. return nil, err
  72526. }
  72527. defer googleapi.CloseBody(res)
  72528. if err := googleapi.CheckResponse(res); err != nil {
  72529. return nil, err
  72530. }
  72531. ret := &NetworkEndpointGroupAggregatedList{
  72532. ServerResponse: googleapi.ServerResponse{
  72533. Header: res.Header,
  72534. HTTPStatusCode: res.StatusCode,
  72535. },
  72536. }
  72537. target := &ret
  72538. if err := gensupport.DecodeResponse(target, res); err != nil {
  72539. return nil, err
  72540. }
  72541. return ret, nil
  72542. // {
  72543. // "description": "Retrieves the list of network endpoint groups and sorts them by zone.",
  72544. // "httpMethod": "GET",
  72545. // "id": "compute.networkEndpointGroups.aggregatedList",
  72546. // "parameterOrder": [
  72547. // "project"
  72548. // ],
  72549. // "parameters": {
  72550. // "filter": {
  72551. // "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).",
  72552. // "location": "query",
  72553. // "type": "string"
  72554. // },
  72555. // "maxResults": {
  72556. // "default": "500",
  72557. // "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)",
  72558. // "format": "uint32",
  72559. // "location": "query",
  72560. // "minimum": "0",
  72561. // "type": "integer"
  72562. // },
  72563. // "orderBy": {
  72564. // "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.",
  72565. // "location": "query",
  72566. // "type": "string"
  72567. // },
  72568. // "pageToken": {
  72569. // "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.",
  72570. // "location": "query",
  72571. // "type": "string"
  72572. // },
  72573. // "project": {
  72574. // "description": "Project ID for this request.",
  72575. // "location": "path",
  72576. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72577. // "required": true,
  72578. // "type": "string"
  72579. // }
  72580. // },
  72581. // "path": "{project}/aggregated/networkEndpointGroups",
  72582. // "response": {
  72583. // "$ref": "NetworkEndpointGroupAggregatedList"
  72584. // },
  72585. // "scopes": [
  72586. // "https://www.googleapis.com/auth/cloud-platform",
  72587. // "https://www.googleapis.com/auth/compute",
  72588. // "https://www.googleapis.com/auth/compute.readonly"
  72589. // ]
  72590. // }
  72591. }
  72592. // Pages invokes f for each page of results.
  72593. // A non-nil error returned from f will halt the iteration.
  72594. // The provided context supersedes any context provided to the Context method.
  72595. func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error {
  72596. c.ctx_ = ctx
  72597. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72598. for {
  72599. x, err := c.Do()
  72600. if err != nil {
  72601. return err
  72602. }
  72603. if err := f(x); err != nil {
  72604. return err
  72605. }
  72606. if x.NextPageToken == "" {
  72607. return nil
  72608. }
  72609. c.PageToken(x.NextPageToken)
  72610. }
  72611. }
  72612. // method id "compute.networkEndpointGroups.attachNetworkEndpoints":
  72613. type NetworkEndpointGroupsAttachNetworkEndpointsCall struct {
  72614. s *Service
  72615. project string
  72616. zone string
  72617. networkEndpointGroup string
  72618. networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest
  72619. urlParams_ gensupport.URLParams
  72620. ctx_ context.Context
  72621. header_ http.Header
  72622. }
  72623. // AttachNetworkEndpoints: Attach a list of network endpoints to the
  72624. // specified network endpoint group.
  72625. func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  72626. c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72627. c.project = project
  72628. c.zone = zone
  72629. c.networkEndpointGroup = networkEndpointGroup
  72630. c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest
  72631. return c
  72632. }
  72633. // RequestId sets the optional parameter "requestId": An optional
  72634. // request ID to identify requests. Specify a unique request ID so that
  72635. // if you must retry your request, the server will know to ignore the
  72636. // request if it has already been completed.
  72637. //
  72638. // For example, consider a situation where you make an initial request
  72639. // and the request times out. If you make the request again with the
  72640. // same request ID, the server can check if original operation with the
  72641. // same request ID was received, and if so, will ignore the second
  72642. // request. This prevents clients from accidentally creating duplicate
  72643. // commitments.
  72644. //
  72645. // The request ID must be a valid UUID with the exception that zero UUID
  72646. // is not supported (00000000-0000-0000-0000-000000000000).
  72647. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  72648. c.urlParams_.Set("requestId", requestId)
  72649. return c
  72650. }
  72651. // Fields allows partial responses to be retrieved. See
  72652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72653. // for more information.
  72654. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  72655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72656. return c
  72657. }
  72658. // Context sets the context to be used in this call's Do method. Any
  72659. // pending HTTP request will be aborted if the provided context is
  72660. // canceled.
  72661. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  72662. c.ctx_ = ctx
  72663. return c
  72664. }
  72665. // Header returns an http.Header that can be modified by the caller to
  72666. // add HTTP headers to the request.
  72667. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
  72668. if c.header_ == nil {
  72669. c.header_ = make(http.Header)
  72670. }
  72671. return c.header_
  72672. }
  72673. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  72674. reqHeaders := make(http.Header)
  72675. for k, v := range c.header_ {
  72676. reqHeaders[k] = v
  72677. }
  72678. reqHeaders.Set("User-Agent", c.s.userAgent())
  72679. var body io.Reader = nil
  72680. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest)
  72681. if err != nil {
  72682. return nil, err
  72683. }
  72684. reqHeaders.Set("Content-Type", "application/json")
  72685. c.urlParams_.Set("alt", alt)
  72686. c.urlParams_.Set("prettyPrint", "false")
  72687. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
  72688. urls += "?" + c.urlParams_.Encode()
  72689. req, err := http.NewRequest("POST", urls, body)
  72690. if err != nil {
  72691. return nil, err
  72692. }
  72693. req.Header = reqHeaders
  72694. googleapi.Expand(req.URL, map[string]string{
  72695. "project": c.project,
  72696. "zone": c.zone,
  72697. "networkEndpointGroup": c.networkEndpointGroup,
  72698. })
  72699. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72700. }
  72701. // Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call.
  72702. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72703. // status code is an error. Response headers are in either
  72704. // *Operation.ServerResponse.Header or (if a response was returned at
  72705. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72706. // to check whether the returned error was because
  72707. // http.StatusNotModified was returned.
  72708. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72709. gensupport.SetOptions(c.urlParams_, opts...)
  72710. res, err := c.doRequest("json")
  72711. if res != nil && res.StatusCode == http.StatusNotModified {
  72712. if res.Body != nil {
  72713. res.Body.Close()
  72714. }
  72715. return nil, &googleapi.Error{
  72716. Code: res.StatusCode,
  72717. Header: res.Header,
  72718. }
  72719. }
  72720. if err != nil {
  72721. return nil, err
  72722. }
  72723. defer googleapi.CloseBody(res)
  72724. if err := googleapi.CheckResponse(res); err != nil {
  72725. return nil, err
  72726. }
  72727. ret := &Operation{
  72728. ServerResponse: googleapi.ServerResponse{
  72729. Header: res.Header,
  72730. HTTPStatusCode: res.StatusCode,
  72731. },
  72732. }
  72733. target := &ret
  72734. if err := gensupport.DecodeResponse(target, res); err != nil {
  72735. return nil, err
  72736. }
  72737. return ret, nil
  72738. // {
  72739. // "description": "Attach a list of network endpoints to the specified network endpoint group.",
  72740. // "httpMethod": "POST",
  72741. // "id": "compute.networkEndpointGroups.attachNetworkEndpoints",
  72742. // "parameterOrder": [
  72743. // "project",
  72744. // "zone",
  72745. // "networkEndpointGroup"
  72746. // ],
  72747. // "parameters": {
  72748. // "networkEndpointGroup": {
  72749. // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
  72750. // "location": "path",
  72751. // "required": true,
  72752. // "type": "string"
  72753. // },
  72754. // "project": {
  72755. // "description": "Project ID for this request.",
  72756. // "location": "path",
  72757. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72758. // "required": true,
  72759. // "type": "string"
  72760. // },
  72761. // "requestId": {
  72762. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72763. // "location": "query",
  72764. // "type": "string"
  72765. // },
  72766. // "zone": {
  72767. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  72768. // "location": "path",
  72769. // "required": true,
  72770. // "type": "string"
  72771. // }
  72772. // },
  72773. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
  72774. // "request": {
  72775. // "$ref": "NetworkEndpointGroupsAttachEndpointsRequest"
  72776. // },
  72777. // "response": {
  72778. // "$ref": "Operation"
  72779. // },
  72780. // "scopes": [
  72781. // "https://www.googleapis.com/auth/cloud-platform",
  72782. // "https://www.googleapis.com/auth/compute"
  72783. // ]
  72784. // }
  72785. }
  72786. // method id "compute.networkEndpointGroups.delete":
  72787. type NetworkEndpointGroupsDeleteCall struct {
  72788. s *Service
  72789. project string
  72790. zone string
  72791. networkEndpointGroup string
  72792. urlParams_ gensupport.URLParams
  72793. ctx_ context.Context
  72794. header_ http.Header
  72795. }
  72796. // Delete: Deletes the specified network endpoint group. The network
  72797. // endpoints in the NEG and the VM instances they belong to are not
  72798. // terminated when the NEG is deleted. Note that the NEG cannot be
  72799. // deleted if there are backend services referencing it.
  72800. func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall {
  72801. c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72802. c.project = project
  72803. c.zone = zone
  72804. c.networkEndpointGroup = networkEndpointGroup
  72805. return c
  72806. }
  72807. // RequestId sets the optional parameter "requestId": An optional
  72808. // request ID to identify requests. Specify a unique request ID so that
  72809. // if you must retry your request, the server will know to ignore the
  72810. // request if it has already been completed.
  72811. //
  72812. // For example, consider a situation where you make an initial request
  72813. // and the request times out. If you make the request again with the
  72814. // same request ID, the server can check if original operation with the
  72815. // same request ID was received, and if so, will ignore the second
  72816. // request. This prevents clients from accidentally creating duplicate
  72817. // commitments.
  72818. //
  72819. // The request ID must be a valid UUID with the exception that zero UUID
  72820. // is not supported (00000000-0000-0000-0000-000000000000).
  72821. func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall {
  72822. c.urlParams_.Set("requestId", requestId)
  72823. return c
  72824. }
  72825. // Fields allows partial responses to be retrieved. See
  72826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72827. // for more information.
  72828. func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall {
  72829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72830. return c
  72831. }
  72832. // Context sets the context to be used in this call's Do method. Any
  72833. // pending HTTP request will be aborted if the provided context is
  72834. // canceled.
  72835. func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall {
  72836. c.ctx_ = ctx
  72837. return c
  72838. }
  72839. // Header returns an http.Header that can be modified by the caller to
  72840. // add HTTP headers to the request.
  72841. func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header {
  72842. if c.header_ == nil {
  72843. c.header_ = make(http.Header)
  72844. }
  72845. return c.header_
  72846. }
  72847. func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  72848. reqHeaders := make(http.Header)
  72849. for k, v := range c.header_ {
  72850. reqHeaders[k] = v
  72851. }
  72852. reqHeaders.Set("User-Agent", c.s.userAgent())
  72853. var body io.Reader = nil
  72854. c.urlParams_.Set("alt", alt)
  72855. c.urlParams_.Set("prettyPrint", "false")
  72856. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  72857. urls += "?" + c.urlParams_.Encode()
  72858. req, err := http.NewRequest("DELETE", urls, body)
  72859. if err != nil {
  72860. return nil, err
  72861. }
  72862. req.Header = reqHeaders
  72863. googleapi.Expand(req.URL, map[string]string{
  72864. "project": c.project,
  72865. "zone": c.zone,
  72866. "networkEndpointGroup": c.networkEndpointGroup,
  72867. })
  72868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72869. }
  72870. // Do executes the "compute.networkEndpointGroups.delete" call.
  72871. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72872. // status code is an error. Response headers are in either
  72873. // *Operation.ServerResponse.Header or (if a response was returned at
  72874. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72875. // to check whether the returned error was because
  72876. // http.StatusNotModified was returned.
  72877. func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72878. gensupport.SetOptions(c.urlParams_, opts...)
  72879. res, err := c.doRequest("json")
  72880. if res != nil && res.StatusCode == http.StatusNotModified {
  72881. if res.Body != nil {
  72882. res.Body.Close()
  72883. }
  72884. return nil, &googleapi.Error{
  72885. Code: res.StatusCode,
  72886. Header: res.Header,
  72887. }
  72888. }
  72889. if err != nil {
  72890. return nil, err
  72891. }
  72892. defer googleapi.CloseBody(res)
  72893. if err := googleapi.CheckResponse(res); err != nil {
  72894. return nil, err
  72895. }
  72896. ret := &Operation{
  72897. ServerResponse: googleapi.ServerResponse{
  72898. Header: res.Header,
  72899. HTTPStatusCode: res.StatusCode,
  72900. },
  72901. }
  72902. target := &ret
  72903. if err := gensupport.DecodeResponse(target, res); err != nil {
  72904. return nil, err
  72905. }
  72906. return ret, nil
  72907. // {
  72908. // "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.",
  72909. // "httpMethod": "DELETE",
  72910. // "id": "compute.networkEndpointGroups.delete",
  72911. // "parameterOrder": [
  72912. // "project",
  72913. // "zone",
  72914. // "networkEndpointGroup"
  72915. // ],
  72916. // "parameters": {
  72917. // "networkEndpointGroup": {
  72918. // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
  72919. // "location": "path",
  72920. // "required": true,
  72921. // "type": "string"
  72922. // },
  72923. // "project": {
  72924. // "description": "Project ID for this request.",
  72925. // "location": "path",
  72926. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72927. // "required": true,
  72928. // "type": "string"
  72929. // },
  72930. // "requestId": {
  72931. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72932. // "location": "query",
  72933. // "type": "string"
  72934. // },
  72935. // "zone": {
  72936. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  72937. // "location": "path",
  72938. // "required": true,
  72939. // "type": "string"
  72940. // }
  72941. // },
  72942. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  72943. // "response": {
  72944. // "$ref": "Operation"
  72945. // },
  72946. // "scopes": [
  72947. // "https://www.googleapis.com/auth/cloud-platform",
  72948. // "https://www.googleapis.com/auth/compute"
  72949. // ]
  72950. // }
  72951. }
  72952. // method id "compute.networkEndpointGroups.detachNetworkEndpoints":
  72953. type NetworkEndpointGroupsDetachNetworkEndpointsCall struct {
  72954. s *Service
  72955. project string
  72956. zone string
  72957. networkEndpointGroup string
  72958. networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest
  72959. urlParams_ gensupport.URLParams
  72960. ctx_ context.Context
  72961. header_ http.Header
  72962. }
  72963. // DetachNetworkEndpoints: Detach a list of network endpoints from the
  72964. // specified network endpoint group.
  72965. func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  72966. c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72967. c.project = project
  72968. c.zone = zone
  72969. c.networkEndpointGroup = networkEndpointGroup
  72970. c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest
  72971. return c
  72972. }
  72973. // RequestId sets the optional parameter "requestId": An optional
  72974. // request ID to identify requests. Specify a unique request ID so that
  72975. // if you must retry your request, the server will know to ignore the
  72976. // request if it has already been completed.
  72977. //
  72978. // For example, consider a situation where you make an initial request
  72979. // and the request times out. If you make the request again with the
  72980. // same request ID, the server can check if original operation with the
  72981. // same request ID was received, and if so, will ignore the second
  72982. // request. This prevents clients from accidentally creating duplicate
  72983. // commitments.
  72984. //
  72985. // The request ID must be a valid UUID with the exception that zero UUID
  72986. // is not supported (00000000-0000-0000-0000-000000000000).
  72987. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  72988. c.urlParams_.Set("requestId", requestId)
  72989. return c
  72990. }
  72991. // Fields allows partial responses to be retrieved. See
  72992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72993. // for more information.
  72994. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  72995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72996. return c
  72997. }
  72998. // Context sets the context to be used in this call's Do method. Any
  72999. // pending HTTP request will be aborted if the provided context is
  73000. // canceled.
  73001. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  73002. c.ctx_ = ctx
  73003. return c
  73004. }
  73005. // Header returns an http.Header that can be modified by the caller to
  73006. // add HTTP headers to the request.
  73007. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
  73008. if c.header_ == nil {
  73009. c.header_ = make(http.Header)
  73010. }
  73011. return c.header_
  73012. }
  73013. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  73014. reqHeaders := make(http.Header)
  73015. for k, v := range c.header_ {
  73016. reqHeaders[k] = v
  73017. }
  73018. reqHeaders.Set("User-Agent", c.s.userAgent())
  73019. var body io.Reader = nil
  73020. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest)
  73021. if err != nil {
  73022. return nil, err
  73023. }
  73024. reqHeaders.Set("Content-Type", "application/json")
  73025. c.urlParams_.Set("alt", alt)
  73026. c.urlParams_.Set("prettyPrint", "false")
  73027. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
  73028. urls += "?" + c.urlParams_.Encode()
  73029. req, err := http.NewRequest("POST", urls, body)
  73030. if err != nil {
  73031. return nil, err
  73032. }
  73033. req.Header = reqHeaders
  73034. googleapi.Expand(req.URL, map[string]string{
  73035. "project": c.project,
  73036. "zone": c.zone,
  73037. "networkEndpointGroup": c.networkEndpointGroup,
  73038. })
  73039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73040. }
  73041. // Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call.
  73042. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73043. // status code is an error. Response headers are in either
  73044. // *Operation.ServerResponse.Header or (if a response was returned at
  73045. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73046. // to check whether the returned error was because
  73047. // http.StatusNotModified was returned.
  73048. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73049. gensupport.SetOptions(c.urlParams_, opts...)
  73050. res, err := c.doRequest("json")
  73051. if res != nil && res.StatusCode == http.StatusNotModified {
  73052. if res.Body != nil {
  73053. res.Body.Close()
  73054. }
  73055. return nil, &googleapi.Error{
  73056. Code: res.StatusCode,
  73057. Header: res.Header,
  73058. }
  73059. }
  73060. if err != nil {
  73061. return nil, err
  73062. }
  73063. defer googleapi.CloseBody(res)
  73064. if err := googleapi.CheckResponse(res); err != nil {
  73065. return nil, err
  73066. }
  73067. ret := &Operation{
  73068. ServerResponse: googleapi.ServerResponse{
  73069. Header: res.Header,
  73070. HTTPStatusCode: res.StatusCode,
  73071. },
  73072. }
  73073. target := &ret
  73074. if err := gensupport.DecodeResponse(target, res); err != nil {
  73075. return nil, err
  73076. }
  73077. return ret, nil
  73078. // {
  73079. // "description": "Detach a list of network endpoints from the specified network endpoint group.",
  73080. // "httpMethod": "POST",
  73081. // "id": "compute.networkEndpointGroups.detachNetworkEndpoints",
  73082. // "parameterOrder": [
  73083. // "project",
  73084. // "zone",
  73085. // "networkEndpointGroup"
  73086. // ],
  73087. // "parameters": {
  73088. // "networkEndpointGroup": {
  73089. // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
  73090. // "location": "path",
  73091. // "required": true,
  73092. // "type": "string"
  73093. // },
  73094. // "project": {
  73095. // "description": "Project ID for this request.",
  73096. // "location": "path",
  73097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73098. // "required": true,
  73099. // "type": "string"
  73100. // },
  73101. // "requestId": {
  73102. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73103. // "location": "query",
  73104. // "type": "string"
  73105. // },
  73106. // "zone": {
  73107. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  73108. // "location": "path",
  73109. // "required": true,
  73110. // "type": "string"
  73111. // }
  73112. // },
  73113. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
  73114. // "request": {
  73115. // "$ref": "NetworkEndpointGroupsDetachEndpointsRequest"
  73116. // },
  73117. // "response": {
  73118. // "$ref": "Operation"
  73119. // },
  73120. // "scopes": [
  73121. // "https://www.googleapis.com/auth/cloud-platform",
  73122. // "https://www.googleapis.com/auth/compute"
  73123. // ]
  73124. // }
  73125. }
  73126. // method id "compute.networkEndpointGroups.get":
  73127. type NetworkEndpointGroupsGetCall struct {
  73128. s *Service
  73129. project string
  73130. zone string
  73131. networkEndpointGroup string
  73132. urlParams_ gensupport.URLParams
  73133. ifNoneMatch_ string
  73134. ctx_ context.Context
  73135. header_ http.Header
  73136. }
  73137. // Get: Returns the specified network endpoint group. Gets a list of
  73138. // available network endpoint groups by making a list() request.
  73139. func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall {
  73140. c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73141. c.project = project
  73142. c.zone = zone
  73143. c.networkEndpointGroup = networkEndpointGroup
  73144. return c
  73145. }
  73146. // Fields allows partial responses to be retrieved. See
  73147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73148. // for more information.
  73149. func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall {
  73150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73151. return c
  73152. }
  73153. // IfNoneMatch sets the optional parameter which makes the operation
  73154. // fail if the object's ETag matches the given value. This is useful for
  73155. // getting updates only after the object has changed since the last
  73156. // request. Use googleapi.IsNotModified to check whether the response
  73157. // error from Do is the result of In-None-Match.
  73158. func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall {
  73159. c.ifNoneMatch_ = entityTag
  73160. return c
  73161. }
  73162. // Context sets the context to be used in this call's Do method. Any
  73163. // pending HTTP request will be aborted if the provided context is
  73164. // canceled.
  73165. func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall {
  73166. c.ctx_ = ctx
  73167. return c
  73168. }
  73169. // Header returns an http.Header that can be modified by the caller to
  73170. // add HTTP headers to the request.
  73171. func (c *NetworkEndpointGroupsGetCall) Header() http.Header {
  73172. if c.header_ == nil {
  73173. c.header_ = make(http.Header)
  73174. }
  73175. return c.header_
  73176. }
  73177. func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  73178. reqHeaders := make(http.Header)
  73179. for k, v := range c.header_ {
  73180. reqHeaders[k] = v
  73181. }
  73182. reqHeaders.Set("User-Agent", c.s.userAgent())
  73183. if c.ifNoneMatch_ != "" {
  73184. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73185. }
  73186. var body io.Reader = nil
  73187. c.urlParams_.Set("alt", alt)
  73188. c.urlParams_.Set("prettyPrint", "false")
  73189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  73190. urls += "?" + c.urlParams_.Encode()
  73191. req, err := http.NewRequest("GET", urls, body)
  73192. if err != nil {
  73193. return nil, err
  73194. }
  73195. req.Header = reqHeaders
  73196. googleapi.Expand(req.URL, map[string]string{
  73197. "project": c.project,
  73198. "zone": c.zone,
  73199. "networkEndpointGroup": c.networkEndpointGroup,
  73200. })
  73201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73202. }
  73203. // Do executes the "compute.networkEndpointGroups.get" call.
  73204. // Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
  73205. // non-2xx status code is an error. Response headers are in either
  73206. // *NetworkEndpointGroup.ServerResponse.Header or (if a response was
  73207. // returned at all) in error.(*googleapi.Error).Header. Use
  73208. // googleapi.IsNotModified to check whether the returned error was
  73209. // because http.StatusNotModified was returned.
  73210. func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) {
  73211. gensupport.SetOptions(c.urlParams_, opts...)
  73212. res, err := c.doRequest("json")
  73213. if res != nil && res.StatusCode == http.StatusNotModified {
  73214. if res.Body != nil {
  73215. res.Body.Close()
  73216. }
  73217. return nil, &googleapi.Error{
  73218. Code: res.StatusCode,
  73219. Header: res.Header,
  73220. }
  73221. }
  73222. if err != nil {
  73223. return nil, err
  73224. }
  73225. defer googleapi.CloseBody(res)
  73226. if err := googleapi.CheckResponse(res); err != nil {
  73227. return nil, err
  73228. }
  73229. ret := &NetworkEndpointGroup{
  73230. ServerResponse: googleapi.ServerResponse{
  73231. Header: res.Header,
  73232. HTTPStatusCode: res.StatusCode,
  73233. },
  73234. }
  73235. target := &ret
  73236. if err := gensupport.DecodeResponse(target, res); err != nil {
  73237. return nil, err
  73238. }
  73239. return ret, nil
  73240. // {
  73241. // "description": "Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.",
  73242. // "httpMethod": "GET",
  73243. // "id": "compute.networkEndpointGroups.get",
  73244. // "parameterOrder": [
  73245. // "project",
  73246. // "zone",
  73247. // "networkEndpointGroup"
  73248. // ],
  73249. // "parameters": {
  73250. // "networkEndpointGroup": {
  73251. // "description": "The name of the network endpoint group. It should comply with RFC1035.",
  73252. // "location": "path",
  73253. // "required": true,
  73254. // "type": "string"
  73255. // },
  73256. // "project": {
  73257. // "description": "Project ID for this request.",
  73258. // "location": "path",
  73259. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73260. // "required": true,
  73261. // "type": "string"
  73262. // },
  73263. // "zone": {
  73264. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  73265. // "location": "path",
  73266. // "required": true,
  73267. // "type": "string"
  73268. // }
  73269. // },
  73270. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  73271. // "response": {
  73272. // "$ref": "NetworkEndpointGroup"
  73273. // },
  73274. // "scopes": [
  73275. // "https://www.googleapis.com/auth/cloud-platform",
  73276. // "https://www.googleapis.com/auth/compute",
  73277. // "https://www.googleapis.com/auth/compute.readonly"
  73278. // ]
  73279. // }
  73280. }
  73281. // method id "compute.networkEndpointGroups.insert":
  73282. type NetworkEndpointGroupsInsertCall struct {
  73283. s *Service
  73284. project string
  73285. zone string
  73286. networkendpointgroup *NetworkEndpointGroup
  73287. urlParams_ gensupport.URLParams
  73288. ctx_ context.Context
  73289. header_ http.Header
  73290. }
  73291. // Insert: Creates a network endpoint group in the specified project
  73292. // using the parameters that are included in the request.
  73293. func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall {
  73294. c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73295. c.project = project
  73296. c.zone = zone
  73297. c.networkendpointgroup = networkendpointgroup
  73298. return c
  73299. }
  73300. // RequestId sets the optional parameter "requestId": An optional
  73301. // request ID to identify requests. Specify a unique request ID so that
  73302. // if you must retry your request, the server will know to ignore the
  73303. // request if it has already been completed.
  73304. //
  73305. // For example, consider a situation where you make an initial request
  73306. // and the request times out. If you make the request again with the
  73307. // same request ID, the server can check if original operation with the
  73308. // same request ID was received, and if so, will ignore the second
  73309. // request. This prevents clients from accidentally creating duplicate
  73310. // commitments.
  73311. //
  73312. // The request ID must be a valid UUID with the exception that zero UUID
  73313. // is not supported (00000000-0000-0000-0000-000000000000).
  73314. func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall {
  73315. c.urlParams_.Set("requestId", requestId)
  73316. return c
  73317. }
  73318. // Fields allows partial responses to be retrieved. See
  73319. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73320. // for more information.
  73321. func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall {
  73322. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73323. return c
  73324. }
  73325. // Context sets the context to be used in this call's Do method. Any
  73326. // pending HTTP request will be aborted if the provided context is
  73327. // canceled.
  73328. func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall {
  73329. c.ctx_ = ctx
  73330. return c
  73331. }
  73332. // Header returns an http.Header that can be modified by the caller to
  73333. // add HTTP headers to the request.
  73334. func (c *NetworkEndpointGroupsInsertCall) Header() http.Header {
  73335. if c.header_ == nil {
  73336. c.header_ = make(http.Header)
  73337. }
  73338. return c.header_
  73339. }
  73340. func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  73341. reqHeaders := make(http.Header)
  73342. for k, v := range c.header_ {
  73343. reqHeaders[k] = v
  73344. }
  73345. reqHeaders.Set("User-Agent", c.s.userAgent())
  73346. var body io.Reader = nil
  73347. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
  73348. if err != nil {
  73349. return nil, err
  73350. }
  73351. reqHeaders.Set("Content-Type", "application/json")
  73352. c.urlParams_.Set("alt", alt)
  73353. c.urlParams_.Set("prettyPrint", "false")
  73354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  73355. urls += "?" + c.urlParams_.Encode()
  73356. req, err := http.NewRequest("POST", urls, body)
  73357. if err != nil {
  73358. return nil, err
  73359. }
  73360. req.Header = reqHeaders
  73361. googleapi.Expand(req.URL, map[string]string{
  73362. "project": c.project,
  73363. "zone": c.zone,
  73364. })
  73365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73366. }
  73367. // Do executes the "compute.networkEndpointGroups.insert" call.
  73368. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73369. // status code is an error. Response headers are in either
  73370. // *Operation.ServerResponse.Header or (if a response was returned at
  73371. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73372. // to check whether the returned error was because
  73373. // http.StatusNotModified was returned.
  73374. func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73375. gensupport.SetOptions(c.urlParams_, opts...)
  73376. res, err := c.doRequest("json")
  73377. if res != nil && res.StatusCode == http.StatusNotModified {
  73378. if res.Body != nil {
  73379. res.Body.Close()
  73380. }
  73381. return nil, &googleapi.Error{
  73382. Code: res.StatusCode,
  73383. Header: res.Header,
  73384. }
  73385. }
  73386. if err != nil {
  73387. return nil, err
  73388. }
  73389. defer googleapi.CloseBody(res)
  73390. if err := googleapi.CheckResponse(res); err != nil {
  73391. return nil, err
  73392. }
  73393. ret := &Operation{
  73394. ServerResponse: googleapi.ServerResponse{
  73395. Header: res.Header,
  73396. HTTPStatusCode: res.StatusCode,
  73397. },
  73398. }
  73399. target := &ret
  73400. if err := gensupport.DecodeResponse(target, res); err != nil {
  73401. return nil, err
  73402. }
  73403. return ret, nil
  73404. // {
  73405. // "description": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
  73406. // "httpMethod": "POST",
  73407. // "id": "compute.networkEndpointGroups.insert",
  73408. // "parameterOrder": [
  73409. // "project",
  73410. // "zone"
  73411. // ],
  73412. // "parameters": {
  73413. // "project": {
  73414. // "description": "Project ID for this request.",
  73415. // "location": "path",
  73416. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73417. // "required": true,
  73418. // "type": "string"
  73419. // },
  73420. // "requestId": {
  73421. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73422. // "location": "query",
  73423. // "type": "string"
  73424. // },
  73425. // "zone": {
  73426. // "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.",
  73427. // "location": "path",
  73428. // "required": true,
  73429. // "type": "string"
  73430. // }
  73431. // },
  73432. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  73433. // "request": {
  73434. // "$ref": "NetworkEndpointGroup"
  73435. // },
  73436. // "response": {
  73437. // "$ref": "Operation"
  73438. // },
  73439. // "scopes": [
  73440. // "https://www.googleapis.com/auth/cloud-platform",
  73441. // "https://www.googleapis.com/auth/compute"
  73442. // ]
  73443. // }
  73444. }
  73445. // method id "compute.networkEndpointGroups.list":
  73446. type NetworkEndpointGroupsListCall struct {
  73447. s *Service
  73448. project string
  73449. zone string
  73450. urlParams_ gensupport.URLParams
  73451. ifNoneMatch_ string
  73452. ctx_ context.Context
  73453. header_ http.Header
  73454. }
  73455. // List: Retrieves the list of network endpoint groups that are located
  73456. // in the specified project and zone.
  73457. func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall {
  73458. c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73459. c.project = project
  73460. c.zone = zone
  73461. return c
  73462. }
  73463. // Filter sets the optional parameter "filter": A filter expression that
  73464. // filters resources listed in the response. The expression must specify
  73465. // the field name, a comparison operator, and the value that you want to
  73466. // use for filtering. The value must be a string, a number, or a
  73467. // boolean. The comparison operator must be either =, !=, >, or <.
  73468. //
  73469. // For example, if you are filtering Compute Engine instances, you can
  73470. // exclude instances named example-instance by specifying name !=
  73471. // example-instance.
  73472. //
  73473. // You can also filter nested fields. For example, you could specify
  73474. // scheduling.automaticRestart = false to include instances only if they
  73475. // are not scheduled for automatic restarts. You can use filtering on
  73476. // nested fields to filter based on resource labels.
  73477. //
  73478. // To filter on multiple expressions, provide each separate expression
  73479. // within parentheses. For example, (scheduling.automaticRestart = true)
  73480. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73481. // AND expression. However, you can include AND and OR expressions
  73482. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73483. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73484. // true).
  73485. func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall {
  73486. c.urlParams_.Set("filter", filter)
  73487. return c
  73488. }
  73489. // MaxResults sets the optional parameter "maxResults": The maximum
  73490. // number of results per page that should be returned. If the number of
  73491. // available results is larger than maxResults, Compute Engine returns a
  73492. // nextPageToken that can be used to get the next page of results in
  73493. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73494. // (Default: 500)
  73495. func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall {
  73496. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73497. return c
  73498. }
  73499. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73500. // a certain order. By default, results are returned in alphanumerical
  73501. // order based on the resource name.
  73502. //
  73503. // You can also sort results in descending order based on the creation
  73504. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73505. // based on the creationTimestamp field in reverse chronological order
  73506. // (newest result first). Use this to sort resources like operations so
  73507. // that the newest operation is returned first.
  73508. //
  73509. // Currently, only sorting by name or creationTimestamp desc is
  73510. // supported.
  73511. func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall {
  73512. c.urlParams_.Set("orderBy", orderBy)
  73513. return c
  73514. }
  73515. // PageToken sets the optional parameter "pageToken": Specifies a page
  73516. // token to use. Set pageToken to the nextPageToken returned by a
  73517. // previous list request to get the next page of results.
  73518. func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall {
  73519. c.urlParams_.Set("pageToken", pageToken)
  73520. return c
  73521. }
  73522. // Fields allows partial responses to be retrieved. See
  73523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73524. // for more information.
  73525. func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall {
  73526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73527. return c
  73528. }
  73529. // IfNoneMatch sets the optional parameter which makes the operation
  73530. // fail if the object's ETag matches the given value. This is useful for
  73531. // getting updates only after the object has changed since the last
  73532. // request. Use googleapi.IsNotModified to check whether the response
  73533. // error from Do is the result of In-None-Match.
  73534. func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall {
  73535. c.ifNoneMatch_ = entityTag
  73536. return c
  73537. }
  73538. // Context sets the context to be used in this call's Do method. Any
  73539. // pending HTTP request will be aborted if the provided context is
  73540. // canceled.
  73541. func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall {
  73542. c.ctx_ = ctx
  73543. return c
  73544. }
  73545. // Header returns an http.Header that can be modified by the caller to
  73546. // add HTTP headers to the request.
  73547. func (c *NetworkEndpointGroupsListCall) Header() http.Header {
  73548. if c.header_ == nil {
  73549. c.header_ = make(http.Header)
  73550. }
  73551. return c.header_
  73552. }
  73553. func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
  73554. reqHeaders := make(http.Header)
  73555. for k, v := range c.header_ {
  73556. reqHeaders[k] = v
  73557. }
  73558. reqHeaders.Set("User-Agent", c.s.userAgent())
  73559. if c.ifNoneMatch_ != "" {
  73560. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73561. }
  73562. var body io.Reader = nil
  73563. c.urlParams_.Set("alt", alt)
  73564. c.urlParams_.Set("prettyPrint", "false")
  73565. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  73566. urls += "?" + c.urlParams_.Encode()
  73567. req, err := http.NewRequest("GET", urls, body)
  73568. if err != nil {
  73569. return nil, err
  73570. }
  73571. req.Header = reqHeaders
  73572. googleapi.Expand(req.URL, map[string]string{
  73573. "project": c.project,
  73574. "zone": c.zone,
  73575. })
  73576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73577. }
  73578. // Do executes the "compute.networkEndpointGroups.list" call.
  73579. // Exactly one of *NetworkEndpointGroupList or error will be non-nil.
  73580. // Any non-2xx status code is an error. Response headers are in either
  73581. // *NetworkEndpointGroupList.ServerResponse.Header or (if a response was
  73582. // returned at all) in error.(*googleapi.Error).Header. Use
  73583. // googleapi.IsNotModified to check whether the returned error was
  73584. // because http.StatusNotModified was returned.
  73585. func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) {
  73586. gensupport.SetOptions(c.urlParams_, opts...)
  73587. res, err := c.doRequest("json")
  73588. if res != nil && res.StatusCode == http.StatusNotModified {
  73589. if res.Body != nil {
  73590. res.Body.Close()
  73591. }
  73592. return nil, &googleapi.Error{
  73593. Code: res.StatusCode,
  73594. Header: res.Header,
  73595. }
  73596. }
  73597. if err != nil {
  73598. return nil, err
  73599. }
  73600. defer googleapi.CloseBody(res)
  73601. if err := googleapi.CheckResponse(res); err != nil {
  73602. return nil, err
  73603. }
  73604. ret := &NetworkEndpointGroupList{
  73605. ServerResponse: googleapi.ServerResponse{
  73606. Header: res.Header,
  73607. HTTPStatusCode: res.StatusCode,
  73608. },
  73609. }
  73610. target := &ret
  73611. if err := gensupport.DecodeResponse(target, res); err != nil {
  73612. return nil, err
  73613. }
  73614. return ret, nil
  73615. // {
  73616. // "description": "Retrieves the list of network endpoint groups that are located in the specified project and zone.",
  73617. // "httpMethod": "GET",
  73618. // "id": "compute.networkEndpointGroups.list",
  73619. // "parameterOrder": [
  73620. // "project",
  73621. // "zone"
  73622. // ],
  73623. // "parameters": {
  73624. // "filter": {
  73625. // "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).",
  73626. // "location": "query",
  73627. // "type": "string"
  73628. // },
  73629. // "maxResults": {
  73630. // "default": "500",
  73631. // "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)",
  73632. // "format": "uint32",
  73633. // "location": "query",
  73634. // "minimum": "0",
  73635. // "type": "integer"
  73636. // },
  73637. // "orderBy": {
  73638. // "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.",
  73639. // "location": "query",
  73640. // "type": "string"
  73641. // },
  73642. // "pageToken": {
  73643. // "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.",
  73644. // "location": "query",
  73645. // "type": "string"
  73646. // },
  73647. // "project": {
  73648. // "description": "Project ID for this request.",
  73649. // "location": "path",
  73650. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73651. // "required": true,
  73652. // "type": "string"
  73653. // },
  73654. // "zone": {
  73655. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  73656. // "location": "path",
  73657. // "required": true,
  73658. // "type": "string"
  73659. // }
  73660. // },
  73661. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  73662. // "response": {
  73663. // "$ref": "NetworkEndpointGroupList"
  73664. // },
  73665. // "scopes": [
  73666. // "https://www.googleapis.com/auth/cloud-platform",
  73667. // "https://www.googleapis.com/auth/compute",
  73668. // "https://www.googleapis.com/auth/compute.readonly"
  73669. // ]
  73670. // }
  73671. }
  73672. // Pages invokes f for each page of results.
  73673. // A non-nil error returned from f will halt the iteration.
  73674. // The provided context supersedes any context provided to the Context method.
  73675. func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
  73676. c.ctx_ = ctx
  73677. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73678. for {
  73679. x, err := c.Do()
  73680. if err != nil {
  73681. return err
  73682. }
  73683. if err := f(x); err != nil {
  73684. return err
  73685. }
  73686. if x.NextPageToken == "" {
  73687. return nil
  73688. }
  73689. c.PageToken(x.NextPageToken)
  73690. }
  73691. }
  73692. // method id "compute.networkEndpointGroups.listNetworkEndpoints":
  73693. type NetworkEndpointGroupsListNetworkEndpointsCall struct {
  73694. s *Service
  73695. project string
  73696. zone string
  73697. networkEndpointGroup string
  73698. networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest
  73699. urlParams_ gensupport.URLParams
  73700. ctx_ context.Context
  73701. header_ http.Header
  73702. }
  73703. // ListNetworkEndpoints: Lists the network endpoints in the specified
  73704. // network endpoint group.
  73705. func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall {
  73706. c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73707. c.project = project
  73708. c.zone = zone
  73709. c.networkEndpointGroup = networkEndpointGroup
  73710. c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest
  73711. return c
  73712. }
  73713. // Filter sets the optional parameter "filter": A filter expression that
  73714. // filters resources listed in the response. The expression must specify
  73715. // the field name, a comparison operator, and the value that you want to
  73716. // use for filtering. The value must be a string, a number, or a
  73717. // boolean. The comparison operator must be either =, !=, >, or <.
  73718. //
  73719. // For example, if you are filtering Compute Engine instances, you can
  73720. // exclude instances named example-instance by specifying name !=
  73721. // example-instance.
  73722. //
  73723. // You can also filter nested fields. For example, you could specify
  73724. // scheduling.automaticRestart = false to include instances only if they
  73725. // are not scheduled for automatic restarts. You can use filtering on
  73726. // nested fields to filter based on resource labels.
  73727. //
  73728. // To filter on multiple expressions, provide each separate expression
  73729. // within parentheses. For example, (scheduling.automaticRestart = true)
  73730. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73731. // AND expression. However, you can include AND and OR expressions
  73732. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73733. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73734. // true).
  73735. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  73736. c.urlParams_.Set("filter", filter)
  73737. return c
  73738. }
  73739. // MaxResults sets the optional parameter "maxResults": The maximum
  73740. // number of results per page that should be returned. If the number of
  73741. // available results is larger than maxResults, Compute Engine returns a
  73742. // nextPageToken that can be used to get the next page of results in
  73743. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73744. // (Default: 500)
  73745. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall {
  73746. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73747. return c
  73748. }
  73749. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73750. // a certain order. By default, results are returned in alphanumerical
  73751. // order based on the resource name.
  73752. //
  73753. // You can also sort results in descending order based on the creation
  73754. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73755. // based on the creationTimestamp field in reverse chronological order
  73756. // (newest result first). Use this to sort resources like operations so
  73757. // that the newest operation is returned first.
  73758. //
  73759. // Currently, only sorting by name or creationTimestamp desc is
  73760. // supported.
  73761. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  73762. c.urlParams_.Set("orderBy", orderBy)
  73763. return c
  73764. }
  73765. // PageToken sets the optional parameter "pageToken": Specifies a page
  73766. // token to use. Set pageToken to the nextPageToken returned by a
  73767. // previous list request to get the next page of results.
  73768. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  73769. c.urlParams_.Set("pageToken", pageToken)
  73770. return c
  73771. }
  73772. // Fields allows partial responses to be retrieved. See
  73773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73774. // for more information.
  73775. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall {
  73776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73777. return c
  73778. }
  73779. // Context sets the context to be used in this call's Do method. Any
  73780. // pending HTTP request will be aborted if the provided context is
  73781. // canceled.
  73782. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall {
  73783. c.ctx_ = ctx
  73784. return c
  73785. }
  73786. // Header returns an http.Header that can be modified by the caller to
  73787. // add HTTP headers to the request.
  73788. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
  73789. if c.header_ == nil {
  73790. c.header_ = make(http.Header)
  73791. }
  73792. return c.header_
  73793. }
  73794. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  73795. reqHeaders := make(http.Header)
  73796. for k, v := range c.header_ {
  73797. reqHeaders[k] = v
  73798. }
  73799. reqHeaders.Set("User-Agent", c.s.userAgent())
  73800. var body io.Reader = nil
  73801. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest)
  73802. if err != nil {
  73803. return nil, err
  73804. }
  73805. reqHeaders.Set("Content-Type", "application/json")
  73806. c.urlParams_.Set("alt", alt)
  73807. c.urlParams_.Set("prettyPrint", "false")
  73808. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
  73809. urls += "?" + c.urlParams_.Encode()
  73810. req, err := http.NewRequest("POST", urls, body)
  73811. if err != nil {
  73812. return nil, err
  73813. }
  73814. req.Header = reqHeaders
  73815. googleapi.Expand(req.URL, map[string]string{
  73816. "project": c.project,
  73817. "zone": c.zone,
  73818. "networkEndpointGroup": c.networkEndpointGroup,
  73819. })
  73820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73821. }
  73822. // Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call.
  73823. // Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
  73824. // will be non-nil. Any non-2xx status code is an error. Response
  73825. // headers are in either
  73826. // *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or
  73827. // (if a response was returned at all) in
  73828. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  73829. // whether the returned error was because http.StatusNotModified was
  73830. // returned.
  73831. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) {
  73832. gensupport.SetOptions(c.urlParams_, opts...)
  73833. res, err := c.doRequest("json")
  73834. if res != nil && res.StatusCode == http.StatusNotModified {
  73835. if res.Body != nil {
  73836. res.Body.Close()
  73837. }
  73838. return nil, &googleapi.Error{
  73839. Code: res.StatusCode,
  73840. Header: res.Header,
  73841. }
  73842. }
  73843. if err != nil {
  73844. return nil, err
  73845. }
  73846. defer googleapi.CloseBody(res)
  73847. if err := googleapi.CheckResponse(res); err != nil {
  73848. return nil, err
  73849. }
  73850. ret := &NetworkEndpointGroupsListNetworkEndpoints{
  73851. ServerResponse: googleapi.ServerResponse{
  73852. Header: res.Header,
  73853. HTTPStatusCode: res.StatusCode,
  73854. },
  73855. }
  73856. target := &ret
  73857. if err := gensupport.DecodeResponse(target, res); err != nil {
  73858. return nil, err
  73859. }
  73860. return ret, nil
  73861. // {
  73862. // "description": "Lists the network endpoints in the specified network endpoint group.",
  73863. // "httpMethod": "POST",
  73864. // "id": "compute.networkEndpointGroups.listNetworkEndpoints",
  73865. // "parameterOrder": [
  73866. // "project",
  73867. // "zone",
  73868. // "networkEndpointGroup"
  73869. // ],
  73870. // "parameters": {
  73871. // "filter": {
  73872. // "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).",
  73873. // "location": "query",
  73874. // "type": "string"
  73875. // },
  73876. // "maxResults": {
  73877. // "default": "500",
  73878. // "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)",
  73879. // "format": "uint32",
  73880. // "location": "query",
  73881. // "minimum": "0",
  73882. // "type": "integer"
  73883. // },
  73884. // "networkEndpointGroup": {
  73885. // "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.",
  73886. // "location": "path",
  73887. // "required": true,
  73888. // "type": "string"
  73889. // },
  73890. // "orderBy": {
  73891. // "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.",
  73892. // "location": "query",
  73893. // "type": "string"
  73894. // },
  73895. // "pageToken": {
  73896. // "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.",
  73897. // "location": "query",
  73898. // "type": "string"
  73899. // },
  73900. // "project": {
  73901. // "description": "Project ID for this request.",
  73902. // "location": "path",
  73903. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73904. // "required": true,
  73905. // "type": "string"
  73906. // },
  73907. // "zone": {
  73908. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  73909. // "location": "path",
  73910. // "required": true,
  73911. // "type": "string"
  73912. // }
  73913. // },
  73914. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
  73915. // "request": {
  73916. // "$ref": "NetworkEndpointGroupsListEndpointsRequest"
  73917. // },
  73918. // "response": {
  73919. // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
  73920. // },
  73921. // "scopes": [
  73922. // "https://www.googleapis.com/auth/cloud-platform",
  73923. // "https://www.googleapis.com/auth/compute",
  73924. // "https://www.googleapis.com/auth/compute.readonly"
  73925. // ]
  73926. // }
  73927. }
  73928. // Pages invokes f for each page of results.
  73929. // A non-nil error returned from f will halt the iteration.
  73930. // The provided context supersedes any context provided to the Context method.
  73931. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
  73932. c.ctx_ = ctx
  73933. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73934. for {
  73935. x, err := c.Do()
  73936. if err != nil {
  73937. return err
  73938. }
  73939. if err := f(x); err != nil {
  73940. return err
  73941. }
  73942. if x.NextPageToken == "" {
  73943. return nil
  73944. }
  73945. c.PageToken(x.NextPageToken)
  73946. }
  73947. }
  73948. // method id "compute.networkEndpointGroups.testIamPermissions":
  73949. type NetworkEndpointGroupsTestIamPermissionsCall struct {
  73950. s *Service
  73951. project string
  73952. zone string
  73953. resource string
  73954. testpermissionsrequest *TestPermissionsRequest
  73955. urlParams_ gensupport.URLParams
  73956. ctx_ context.Context
  73957. header_ http.Header
  73958. }
  73959. // TestIamPermissions: Returns permissions that a caller has on the
  73960. // specified resource.
  73961. func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall {
  73962. c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73963. c.project = project
  73964. c.zone = zone
  73965. c.resource = resource
  73966. c.testpermissionsrequest = testpermissionsrequest
  73967. return c
  73968. }
  73969. // Fields allows partial responses to be retrieved. See
  73970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73971. // for more information.
  73972. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall {
  73973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73974. return c
  73975. }
  73976. // Context sets the context to be used in this call's Do method. Any
  73977. // pending HTTP request will be aborted if the provided context is
  73978. // canceled.
  73979. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall {
  73980. c.ctx_ = ctx
  73981. return c
  73982. }
  73983. // Header returns an http.Header that can be modified by the caller to
  73984. // add HTTP headers to the request.
  73985. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header {
  73986. if c.header_ == nil {
  73987. c.header_ = make(http.Header)
  73988. }
  73989. return c.header_
  73990. }
  73991. func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  73992. reqHeaders := make(http.Header)
  73993. for k, v := range c.header_ {
  73994. reqHeaders[k] = v
  73995. }
  73996. reqHeaders.Set("User-Agent", c.s.userAgent())
  73997. var body io.Reader = nil
  73998. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  73999. if err != nil {
  74000. return nil, err
  74001. }
  74002. reqHeaders.Set("Content-Type", "application/json")
  74003. c.urlParams_.Set("alt", alt)
  74004. c.urlParams_.Set("prettyPrint", "false")
  74005. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions")
  74006. urls += "?" + c.urlParams_.Encode()
  74007. req, err := http.NewRequest("POST", urls, body)
  74008. if err != nil {
  74009. return nil, err
  74010. }
  74011. req.Header = reqHeaders
  74012. googleapi.Expand(req.URL, map[string]string{
  74013. "project": c.project,
  74014. "zone": c.zone,
  74015. "resource": c.resource,
  74016. })
  74017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74018. }
  74019. // Do executes the "compute.networkEndpointGroups.testIamPermissions" call.
  74020. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  74021. // non-2xx status code is an error. Response headers are in either
  74022. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  74023. // returned at all) in error.(*googleapi.Error).Header. Use
  74024. // googleapi.IsNotModified to check whether the returned error was
  74025. // because http.StatusNotModified was returned.
  74026. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  74027. gensupport.SetOptions(c.urlParams_, opts...)
  74028. res, err := c.doRequest("json")
  74029. if res != nil && res.StatusCode == http.StatusNotModified {
  74030. if res.Body != nil {
  74031. res.Body.Close()
  74032. }
  74033. return nil, &googleapi.Error{
  74034. Code: res.StatusCode,
  74035. Header: res.Header,
  74036. }
  74037. }
  74038. if err != nil {
  74039. return nil, err
  74040. }
  74041. defer googleapi.CloseBody(res)
  74042. if err := googleapi.CheckResponse(res); err != nil {
  74043. return nil, err
  74044. }
  74045. ret := &TestPermissionsResponse{
  74046. ServerResponse: googleapi.ServerResponse{
  74047. Header: res.Header,
  74048. HTTPStatusCode: res.StatusCode,
  74049. },
  74050. }
  74051. target := &ret
  74052. if err := gensupport.DecodeResponse(target, res); err != nil {
  74053. return nil, err
  74054. }
  74055. return ret, nil
  74056. // {
  74057. // "description": "Returns permissions that a caller has on the specified resource.",
  74058. // "httpMethod": "POST",
  74059. // "id": "compute.networkEndpointGroups.testIamPermissions",
  74060. // "parameterOrder": [
  74061. // "project",
  74062. // "zone",
  74063. // "resource"
  74064. // ],
  74065. // "parameters": {
  74066. // "project": {
  74067. // "description": "Project ID for this request.",
  74068. // "location": "path",
  74069. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74070. // "required": true,
  74071. // "type": "string"
  74072. // },
  74073. // "resource": {
  74074. // "description": "Name or id of the resource for this request.",
  74075. // "location": "path",
  74076. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74077. // "required": true,
  74078. // "type": "string"
  74079. // },
  74080. // "zone": {
  74081. // "description": "The name of the zone for this request.",
  74082. // "location": "path",
  74083. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74084. // "required": true,
  74085. // "type": "string"
  74086. // }
  74087. // },
  74088. // "path": "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
  74089. // "request": {
  74090. // "$ref": "TestPermissionsRequest"
  74091. // },
  74092. // "response": {
  74093. // "$ref": "TestPermissionsResponse"
  74094. // },
  74095. // "scopes": [
  74096. // "https://www.googleapis.com/auth/cloud-platform",
  74097. // "https://www.googleapis.com/auth/compute",
  74098. // "https://www.googleapis.com/auth/compute.readonly"
  74099. // ]
  74100. // }
  74101. }
  74102. // method id "compute.networks.addPeering":
  74103. type NetworksAddPeeringCall struct {
  74104. s *Service
  74105. project string
  74106. network string
  74107. networksaddpeeringrequest *NetworksAddPeeringRequest
  74108. urlParams_ gensupport.URLParams
  74109. ctx_ context.Context
  74110. header_ http.Header
  74111. }
  74112. // AddPeering: Adds a peering to the specified network.
  74113. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  74114. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74115. c.project = project
  74116. c.network = network
  74117. c.networksaddpeeringrequest = networksaddpeeringrequest
  74118. return c
  74119. }
  74120. // RequestId sets the optional parameter "requestId": An optional
  74121. // request ID to identify requests. Specify a unique request ID so that
  74122. // if you must retry your request, the server will know to ignore the
  74123. // request if it has already been completed.
  74124. //
  74125. // For example, consider a situation where you make an initial request
  74126. // and the request times out. If you make the request again with the
  74127. // same request ID, the server can check if original operation with the
  74128. // same request ID was received, and if so, will ignore the second
  74129. // request. This prevents clients from accidentally creating duplicate
  74130. // commitments.
  74131. //
  74132. // The request ID must be a valid UUID with the exception that zero UUID
  74133. // is not supported (00000000-0000-0000-0000-000000000000).
  74134. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  74135. c.urlParams_.Set("requestId", requestId)
  74136. return c
  74137. }
  74138. // Fields allows partial responses to be retrieved. See
  74139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74140. // for more information.
  74141. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  74142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74143. return c
  74144. }
  74145. // Context sets the context to be used in this call's Do method. Any
  74146. // pending HTTP request will be aborted if the provided context is
  74147. // canceled.
  74148. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  74149. c.ctx_ = ctx
  74150. return c
  74151. }
  74152. // Header returns an http.Header that can be modified by the caller to
  74153. // add HTTP headers to the request.
  74154. func (c *NetworksAddPeeringCall) Header() http.Header {
  74155. if c.header_ == nil {
  74156. c.header_ = make(http.Header)
  74157. }
  74158. return c.header_
  74159. }
  74160. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  74161. reqHeaders := make(http.Header)
  74162. for k, v := range c.header_ {
  74163. reqHeaders[k] = v
  74164. }
  74165. reqHeaders.Set("User-Agent", c.s.userAgent())
  74166. var body io.Reader = nil
  74167. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  74168. if err != nil {
  74169. return nil, err
  74170. }
  74171. reqHeaders.Set("Content-Type", "application/json")
  74172. c.urlParams_.Set("alt", alt)
  74173. c.urlParams_.Set("prettyPrint", "false")
  74174. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  74175. urls += "?" + c.urlParams_.Encode()
  74176. req, err := http.NewRequest("POST", urls, body)
  74177. if err != nil {
  74178. return nil, err
  74179. }
  74180. req.Header = reqHeaders
  74181. googleapi.Expand(req.URL, map[string]string{
  74182. "project": c.project,
  74183. "network": c.network,
  74184. })
  74185. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74186. }
  74187. // Do executes the "compute.networks.addPeering" call.
  74188. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74189. // status code is an error. Response headers are in either
  74190. // *Operation.ServerResponse.Header or (if a response was returned at
  74191. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74192. // to check whether the returned error was because
  74193. // http.StatusNotModified was returned.
  74194. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74195. gensupport.SetOptions(c.urlParams_, opts...)
  74196. res, err := c.doRequest("json")
  74197. if res != nil && res.StatusCode == http.StatusNotModified {
  74198. if res.Body != nil {
  74199. res.Body.Close()
  74200. }
  74201. return nil, &googleapi.Error{
  74202. Code: res.StatusCode,
  74203. Header: res.Header,
  74204. }
  74205. }
  74206. if err != nil {
  74207. return nil, err
  74208. }
  74209. defer googleapi.CloseBody(res)
  74210. if err := googleapi.CheckResponse(res); err != nil {
  74211. return nil, err
  74212. }
  74213. ret := &Operation{
  74214. ServerResponse: googleapi.ServerResponse{
  74215. Header: res.Header,
  74216. HTTPStatusCode: res.StatusCode,
  74217. },
  74218. }
  74219. target := &ret
  74220. if err := gensupport.DecodeResponse(target, res); err != nil {
  74221. return nil, err
  74222. }
  74223. return ret, nil
  74224. // {
  74225. // "description": "Adds a peering to the specified network.",
  74226. // "httpMethod": "POST",
  74227. // "id": "compute.networks.addPeering",
  74228. // "parameterOrder": [
  74229. // "project",
  74230. // "network"
  74231. // ],
  74232. // "parameters": {
  74233. // "network": {
  74234. // "description": "Name of the network resource to add peering to.",
  74235. // "location": "path",
  74236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74237. // "required": true,
  74238. // "type": "string"
  74239. // },
  74240. // "project": {
  74241. // "description": "Project ID for this request.",
  74242. // "location": "path",
  74243. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74244. // "required": true,
  74245. // "type": "string"
  74246. // },
  74247. // "requestId": {
  74248. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74249. // "location": "query",
  74250. // "type": "string"
  74251. // }
  74252. // },
  74253. // "path": "{project}/global/networks/{network}/addPeering",
  74254. // "request": {
  74255. // "$ref": "NetworksAddPeeringRequest"
  74256. // },
  74257. // "response": {
  74258. // "$ref": "Operation"
  74259. // },
  74260. // "scopes": [
  74261. // "https://www.googleapis.com/auth/cloud-platform",
  74262. // "https://www.googleapis.com/auth/compute"
  74263. // ]
  74264. // }
  74265. }
  74266. // method id "compute.networks.delete":
  74267. type NetworksDeleteCall struct {
  74268. s *Service
  74269. project string
  74270. network string
  74271. urlParams_ gensupport.URLParams
  74272. ctx_ context.Context
  74273. header_ http.Header
  74274. }
  74275. // Delete: Deletes the specified network.
  74276. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  74277. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  74278. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74279. c.project = project
  74280. c.network = network
  74281. return c
  74282. }
  74283. // RequestId sets the optional parameter "requestId": An optional
  74284. // request ID to identify requests. Specify a unique request ID so that
  74285. // if you must retry your request, the server will know to ignore the
  74286. // request if it has already been completed.
  74287. //
  74288. // For example, consider a situation where you make an initial request
  74289. // and the request times out. If you make the request again with the
  74290. // same request ID, the server can check if original operation with the
  74291. // same request ID was received, and if so, will ignore the second
  74292. // request. This prevents clients from accidentally creating duplicate
  74293. // commitments.
  74294. //
  74295. // The request ID must be a valid UUID with the exception that zero UUID
  74296. // is not supported (00000000-0000-0000-0000-000000000000).
  74297. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  74298. c.urlParams_.Set("requestId", requestId)
  74299. return c
  74300. }
  74301. // Fields allows partial responses to be retrieved. See
  74302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74303. // for more information.
  74304. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  74305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74306. return c
  74307. }
  74308. // Context sets the context to be used in this call's Do method. Any
  74309. // pending HTTP request will be aborted if the provided context is
  74310. // canceled.
  74311. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  74312. c.ctx_ = ctx
  74313. return c
  74314. }
  74315. // Header returns an http.Header that can be modified by the caller to
  74316. // add HTTP headers to the request.
  74317. func (c *NetworksDeleteCall) Header() http.Header {
  74318. if c.header_ == nil {
  74319. c.header_ = make(http.Header)
  74320. }
  74321. return c.header_
  74322. }
  74323. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  74324. reqHeaders := make(http.Header)
  74325. for k, v := range c.header_ {
  74326. reqHeaders[k] = v
  74327. }
  74328. reqHeaders.Set("User-Agent", c.s.userAgent())
  74329. var body io.Reader = nil
  74330. c.urlParams_.Set("alt", alt)
  74331. c.urlParams_.Set("prettyPrint", "false")
  74332. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  74333. urls += "?" + c.urlParams_.Encode()
  74334. req, err := http.NewRequest("DELETE", urls, body)
  74335. if err != nil {
  74336. return nil, err
  74337. }
  74338. req.Header = reqHeaders
  74339. googleapi.Expand(req.URL, map[string]string{
  74340. "project": c.project,
  74341. "network": c.network,
  74342. })
  74343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74344. }
  74345. // Do executes the "compute.networks.delete" call.
  74346. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74347. // status code is an error. Response headers are in either
  74348. // *Operation.ServerResponse.Header or (if a response was returned at
  74349. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74350. // to check whether the returned error was because
  74351. // http.StatusNotModified was returned.
  74352. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74353. gensupport.SetOptions(c.urlParams_, opts...)
  74354. res, err := c.doRequest("json")
  74355. if res != nil && res.StatusCode == http.StatusNotModified {
  74356. if res.Body != nil {
  74357. res.Body.Close()
  74358. }
  74359. return nil, &googleapi.Error{
  74360. Code: res.StatusCode,
  74361. Header: res.Header,
  74362. }
  74363. }
  74364. if err != nil {
  74365. return nil, err
  74366. }
  74367. defer googleapi.CloseBody(res)
  74368. if err := googleapi.CheckResponse(res); err != nil {
  74369. return nil, err
  74370. }
  74371. ret := &Operation{
  74372. ServerResponse: googleapi.ServerResponse{
  74373. Header: res.Header,
  74374. HTTPStatusCode: res.StatusCode,
  74375. },
  74376. }
  74377. target := &ret
  74378. if err := gensupport.DecodeResponse(target, res); err != nil {
  74379. return nil, err
  74380. }
  74381. return ret, nil
  74382. // {
  74383. // "description": "Deletes the specified network.",
  74384. // "httpMethod": "DELETE",
  74385. // "id": "compute.networks.delete",
  74386. // "parameterOrder": [
  74387. // "project",
  74388. // "network"
  74389. // ],
  74390. // "parameters": {
  74391. // "network": {
  74392. // "description": "Name of the network to delete.",
  74393. // "location": "path",
  74394. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74395. // "required": true,
  74396. // "type": "string"
  74397. // },
  74398. // "project": {
  74399. // "description": "Project ID for this request.",
  74400. // "location": "path",
  74401. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74402. // "required": true,
  74403. // "type": "string"
  74404. // },
  74405. // "requestId": {
  74406. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74407. // "location": "query",
  74408. // "type": "string"
  74409. // }
  74410. // },
  74411. // "path": "{project}/global/networks/{network}",
  74412. // "response": {
  74413. // "$ref": "Operation"
  74414. // },
  74415. // "scopes": [
  74416. // "https://www.googleapis.com/auth/cloud-platform",
  74417. // "https://www.googleapis.com/auth/compute"
  74418. // ]
  74419. // }
  74420. }
  74421. // method id "compute.networks.get":
  74422. type NetworksGetCall struct {
  74423. s *Service
  74424. project string
  74425. network string
  74426. urlParams_ gensupport.URLParams
  74427. ifNoneMatch_ string
  74428. ctx_ context.Context
  74429. header_ http.Header
  74430. }
  74431. // Get: Returns the specified network. Gets a list of available networks
  74432. // by making a list() request.
  74433. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  74434. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  74435. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74436. c.project = project
  74437. c.network = network
  74438. return c
  74439. }
  74440. // Fields allows partial responses to be retrieved. See
  74441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74442. // for more information.
  74443. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  74444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74445. return c
  74446. }
  74447. // IfNoneMatch sets the optional parameter which makes the operation
  74448. // fail if the object's ETag matches the given value. This is useful for
  74449. // getting updates only after the object has changed since the last
  74450. // request. Use googleapi.IsNotModified to check whether the response
  74451. // error from Do is the result of In-None-Match.
  74452. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  74453. c.ifNoneMatch_ = entityTag
  74454. return c
  74455. }
  74456. // Context sets the context to be used in this call's Do method. Any
  74457. // pending HTTP request will be aborted if the provided context is
  74458. // canceled.
  74459. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  74460. c.ctx_ = ctx
  74461. return c
  74462. }
  74463. // Header returns an http.Header that can be modified by the caller to
  74464. // add HTTP headers to the request.
  74465. func (c *NetworksGetCall) Header() http.Header {
  74466. if c.header_ == nil {
  74467. c.header_ = make(http.Header)
  74468. }
  74469. return c.header_
  74470. }
  74471. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  74472. reqHeaders := make(http.Header)
  74473. for k, v := range c.header_ {
  74474. reqHeaders[k] = v
  74475. }
  74476. reqHeaders.Set("User-Agent", c.s.userAgent())
  74477. if c.ifNoneMatch_ != "" {
  74478. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74479. }
  74480. var body io.Reader = nil
  74481. c.urlParams_.Set("alt", alt)
  74482. c.urlParams_.Set("prettyPrint", "false")
  74483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  74484. urls += "?" + c.urlParams_.Encode()
  74485. req, err := http.NewRequest("GET", urls, body)
  74486. if err != nil {
  74487. return nil, err
  74488. }
  74489. req.Header = reqHeaders
  74490. googleapi.Expand(req.URL, map[string]string{
  74491. "project": c.project,
  74492. "network": c.network,
  74493. })
  74494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74495. }
  74496. // Do executes the "compute.networks.get" call.
  74497. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  74498. // code is an error. Response headers are in either
  74499. // *Network.ServerResponse.Header or (if a response was returned at all)
  74500. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  74501. // check whether the returned error was because http.StatusNotModified
  74502. // was returned.
  74503. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  74504. gensupport.SetOptions(c.urlParams_, opts...)
  74505. res, err := c.doRequest("json")
  74506. if res != nil && res.StatusCode == http.StatusNotModified {
  74507. if res.Body != nil {
  74508. res.Body.Close()
  74509. }
  74510. return nil, &googleapi.Error{
  74511. Code: res.StatusCode,
  74512. Header: res.Header,
  74513. }
  74514. }
  74515. if err != nil {
  74516. return nil, err
  74517. }
  74518. defer googleapi.CloseBody(res)
  74519. if err := googleapi.CheckResponse(res); err != nil {
  74520. return nil, err
  74521. }
  74522. ret := &Network{
  74523. ServerResponse: googleapi.ServerResponse{
  74524. Header: res.Header,
  74525. HTTPStatusCode: res.StatusCode,
  74526. },
  74527. }
  74528. target := &ret
  74529. if err := gensupport.DecodeResponse(target, res); err != nil {
  74530. return nil, err
  74531. }
  74532. return ret, nil
  74533. // {
  74534. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  74535. // "httpMethod": "GET",
  74536. // "id": "compute.networks.get",
  74537. // "parameterOrder": [
  74538. // "project",
  74539. // "network"
  74540. // ],
  74541. // "parameters": {
  74542. // "network": {
  74543. // "description": "Name of the network to return.",
  74544. // "location": "path",
  74545. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74546. // "required": true,
  74547. // "type": "string"
  74548. // },
  74549. // "project": {
  74550. // "description": "Project ID for this request.",
  74551. // "location": "path",
  74552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74553. // "required": true,
  74554. // "type": "string"
  74555. // }
  74556. // },
  74557. // "path": "{project}/global/networks/{network}",
  74558. // "response": {
  74559. // "$ref": "Network"
  74560. // },
  74561. // "scopes": [
  74562. // "https://www.googleapis.com/auth/cloud-platform",
  74563. // "https://www.googleapis.com/auth/compute",
  74564. // "https://www.googleapis.com/auth/compute.readonly"
  74565. // ]
  74566. // }
  74567. }
  74568. // method id "compute.networks.insert":
  74569. type NetworksInsertCall struct {
  74570. s *Service
  74571. project string
  74572. network *Network
  74573. urlParams_ gensupport.URLParams
  74574. ctx_ context.Context
  74575. header_ http.Header
  74576. }
  74577. // Insert: Creates a network in the specified project using the data
  74578. // included in the request.
  74579. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  74580. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  74581. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74582. c.project = project
  74583. c.network = network
  74584. return c
  74585. }
  74586. // RequestId sets the optional parameter "requestId": An optional
  74587. // request ID to identify requests. Specify a unique request ID so that
  74588. // if you must retry your request, the server will know to ignore the
  74589. // request if it has already been completed.
  74590. //
  74591. // For example, consider a situation where you make an initial request
  74592. // and the request times out. If you make the request again with the
  74593. // same request ID, the server can check if original operation with the
  74594. // same request ID was received, and if so, will ignore the second
  74595. // request. This prevents clients from accidentally creating duplicate
  74596. // commitments.
  74597. //
  74598. // The request ID must be a valid UUID with the exception that zero UUID
  74599. // is not supported (00000000-0000-0000-0000-000000000000).
  74600. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  74601. c.urlParams_.Set("requestId", requestId)
  74602. return c
  74603. }
  74604. // Fields allows partial responses to be retrieved. See
  74605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74606. // for more information.
  74607. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  74608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74609. return c
  74610. }
  74611. // Context sets the context to be used in this call's Do method. Any
  74612. // pending HTTP request will be aborted if the provided context is
  74613. // canceled.
  74614. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  74615. c.ctx_ = ctx
  74616. return c
  74617. }
  74618. // Header returns an http.Header that can be modified by the caller to
  74619. // add HTTP headers to the request.
  74620. func (c *NetworksInsertCall) Header() http.Header {
  74621. if c.header_ == nil {
  74622. c.header_ = make(http.Header)
  74623. }
  74624. return c.header_
  74625. }
  74626. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  74627. reqHeaders := make(http.Header)
  74628. for k, v := range c.header_ {
  74629. reqHeaders[k] = v
  74630. }
  74631. reqHeaders.Set("User-Agent", c.s.userAgent())
  74632. var body io.Reader = nil
  74633. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  74634. if err != nil {
  74635. return nil, err
  74636. }
  74637. reqHeaders.Set("Content-Type", "application/json")
  74638. c.urlParams_.Set("alt", alt)
  74639. c.urlParams_.Set("prettyPrint", "false")
  74640. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  74641. urls += "?" + c.urlParams_.Encode()
  74642. req, err := http.NewRequest("POST", urls, body)
  74643. if err != nil {
  74644. return nil, err
  74645. }
  74646. req.Header = reqHeaders
  74647. googleapi.Expand(req.URL, map[string]string{
  74648. "project": c.project,
  74649. })
  74650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74651. }
  74652. // Do executes the "compute.networks.insert" call.
  74653. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74654. // status code is an error. Response headers are in either
  74655. // *Operation.ServerResponse.Header or (if a response was returned at
  74656. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74657. // to check whether the returned error was because
  74658. // http.StatusNotModified was returned.
  74659. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74660. gensupport.SetOptions(c.urlParams_, opts...)
  74661. res, err := c.doRequest("json")
  74662. if res != nil && res.StatusCode == http.StatusNotModified {
  74663. if res.Body != nil {
  74664. res.Body.Close()
  74665. }
  74666. return nil, &googleapi.Error{
  74667. Code: res.StatusCode,
  74668. Header: res.Header,
  74669. }
  74670. }
  74671. if err != nil {
  74672. return nil, err
  74673. }
  74674. defer googleapi.CloseBody(res)
  74675. if err := googleapi.CheckResponse(res); err != nil {
  74676. return nil, err
  74677. }
  74678. ret := &Operation{
  74679. ServerResponse: googleapi.ServerResponse{
  74680. Header: res.Header,
  74681. HTTPStatusCode: res.StatusCode,
  74682. },
  74683. }
  74684. target := &ret
  74685. if err := gensupport.DecodeResponse(target, res); err != nil {
  74686. return nil, err
  74687. }
  74688. return ret, nil
  74689. // {
  74690. // "description": "Creates a network in the specified project using the data included in the request.",
  74691. // "httpMethod": "POST",
  74692. // "id": "compute.networks.insert",
  74693. // "parameterOrder": [
  74694. // "project"
  74695. // ],
  74696. // "parameters": {
  74697. // "project": {
  74698. // "description": "Project ID for this request.",
  74699. // "location": "path",
  74700. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74701. // "required": true,
  74702. // "type": "string"
  74703. // },
  74704. // "requestId": {
  74705. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74706. // "location": "query",
  74707. // "type": "string"
  74708. // }
  74709. // },
  74710. // "path": "{project}/global/networks",
  74711. // "request": {
  74712. // "$ref": "Network"
  74713. // },
  74714. // "response": {
  74715. // "$ref": "Operation"
  74716. // },
  74717. // "scopes": [
  74718. // "https://www.googleapis.com/auth/cloud-platform",
  74719. // "https://www.googleapis.com/auth/compute"
  74720. // ]
  74721. // }
  74722. }
  74723. // method id "compute.networks.list":
  74724. type NetworksListCall struct {
  74725. s *Service
  74726. project string
  74727. urlParams_ gensupport.URLParams
  74728. ifNoneMatch_ string
  74729. ctx_ context.Context
  74730. header_ http.Header
  74731. }
  74732. // List: Retrieves the list of networks available to the specified
  74733. // project.
  74734. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  74735. func (r *NetworksService) List(project string) *NetworksListCall {
  74736. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74737. c.project = project
  74738. return c
  74739. }
  74740. // Filter sets the optional parameter "filter": A filter expression that
  74741. // filters resources listed in the response. The expression must specify
  74742. // the field name, a comparison operator, and the value that you want to
  74743. // use for filtering. The value must be a string, a number, or a
  74744. // boolean. The comparison operator must be either =, !=, >, or <.
  74745. //
  74746. // For example, if you are filtering Compute Engine instances, you can
  74747. // exclude instances named example-instance by specifying name !=
  74748. // example-instance.
  74749. //
  74750. // You can also filter nested fields. For example, you could specify
  74751. // scheduling.automaticRestart = false to include instances only if they
  74752. // are not scheduled for automatic restarts. You can use filtering on
  74753. // nested fields to filter based on resource labels.
  74754. //
  74755. // To filter on multiple expressions, provide each separate expression
  74756. // within parentheses. For example, (scheduling.automaticRestart = true)
  74757. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74758. // AND expression. However, you can include AND and OR expressions
  74759. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74760. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74761. // true).
  74762. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  74763. c.urlParams_.Set("filter", filter)
  74764. return c
  74765. }
  74766. // MaxResults sets the optional parameter "maxResults": The maximum
  74767. // number of results per page that should be returned. If the number of
  74768. // available results is larger than maxResults, Compute Engine returns a
  74769. // nextPageToken that can be used to get the next page of results in
  74770. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74771. // (Default: 500)
  74772. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  74773. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74774. return c
  74775. }
  74776. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74777. // a certain order. By default, results are returned in alphanumerical
  74778. // order based on the resource name.
  74779. //
  74780. // You can also sort results in descending order based on the creation
  74781. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74782. // based on the creationTimestamp field in reverse chronological order
  74783. // (newest result first). Use this to sort resources like operations so
  74784. // that the newest operation is returned first.
  74785. //
  74786. // Currently, only sorting by name or creationTimestamp desc is
  74787. // supported.
  74788. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  74789. c.urlParams_.Set("orderBy", orderBy)
  74790. return c
  74791. }
  74792. // PageToken sets the optional parameter "pageToken": Specifies a page
  74793. // token to use. Set pageToken to the nextPageToken returned by a
  74794. // previous list request to get the next page of results.
  74795. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  74796. c.urlParams_.Set("pageToken", pageToken)
  74797. return c
  74798. }
  74799. // Fields allows partial responses to be retrieved. See
  74800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74801. // for more information.
  74802. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  74803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74804. return c
  74805. }
  74806. // IfNoneMatch sets the optional parameter which makes the operation
  74807. // fail if the object's ETag matches the given value. This is useful for
  74808. // getting updates only after the object has changed since the last
  74809. // request. Use googleapi.IsNotModified to check whether the response
  74810. // error from Do is the result of In-None-Match.
  74811. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  74812. c.ifNoneMatch_ = entityTag
  74813. return c
  74814. }
  74815. // Context sets the context to be used in this call's Do method. Any
  74816. // pending HTTP request will be aborted if the provided context is
  74817. // canceled.
  74818. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  74819. c.ctx_ = ctx
  74820. return c
  74821. }
  74822. // Header returns an http.Header that can be modified by the caller to
  74823. // add HTTP headers to the request.
  74824. func (c *NetworksListCall) Header() http.Header {
  74825. if c.header_ == nil {
  74826. c.header_ = make(http.Header)
  74827. }
  74828. return c.header_
  74829. }
  74830. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  74831. reqHeaders := make(http.Header)
  74832. for k, v := range c.header_ {
  74833. reqHeaders[k] = v
  74834. }
  74835. reqHeaders.Set("User-Agent", c.s.userAgent())
  74836. if c.ifNoneMatch_ != "" {
  74837. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74838. }
  74839. var body io.Reader = nil
  74840. c.urlParams_.Set("alt", alt)
  74841. c.urlParams_.Set("prettyPrint", "false")
  74842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  74843. urls += "?" + c.urlParams_.Encode()
  74844. req, err := http.NewRequest("GET", urls, body)
  74845. if err != nil {
  74846. return nil, err
  74847. }
  74848. req.Header = reqHeaders
  74849. googleapi.Expand(req.URL, map[string]string{
  74850. "project": c.project,
  74851. })
  74852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74853. }
  74854. // Do executes the "compute.networks.list" call.
  74855. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  74856. // status code is an error. Response headers are in either
  74857. // *NetworkList.ServerResponse.Header or (if a response was returned at
  74858. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74859. // to check whether the returned error was because
  74860. // http.StatusNotModified was returned.
  74861. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  74862. gensupport.SetOptions(c.urlParams_, opts...)
  74863. res, err := c.doRequest("json")
  74864. if res != nil && res.StatusCode == http.StatusNotModified {
  74865. if res.Body != nil {
  74866. res.Body.Close()
  74867. }
  74868. return nil, &googleapi.Error{
  74869. Code: res.StatusCode,
  74870. Header: res.Header,
  74871. }
  74872. }
  74873. if err != nil {
  74874. return nil, err
  74875. }
  74876. defer googleapi.CloseBody(res)
  74877. if err := googleapi.CheckResponse(res); err != nil {
  74878. return nil, err
  74879. }
  74880. ret := &NetworkList{
  74881. ServerResponse: googleapi.ServerResponse{
  74882. Header: res.Header,
  74883. HTTPStatusCode: res.StatusCode,
  74884. },
  74885. }
  74886. target := &ret
  74887. if err := gensupport.DecodeResponse(target, res); err != nil {
  74888. return nil, err
  74889. }
  74890. return ret, nil
  74891. // {
  74892. // "description": "Retrieves the list of networks available to the specified project.",
  74893. // "httpMethod": "GET",
  74894. // "id": "compute.networks.list",
  74895. // "parameterOrder": [
  74896. // "project"
  74897. // ],
  74898. // "parameters": {
  74899. // "filter": {
  74900. // "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).",
  74901. // "location": "query",
  74902. // "type": "string"
  74903. // },
  74904. // "maxResults": {
  74905. // "default": "500",
  74906. // "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)",
  74907. // "format": "uint32",
  74908. // "location": "query",
  74909. // "minimum": "0",
  74910. // "type": "integer"
  74911. // },
  74912. // "orderBy": {
  74913. // "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.",
  74914. // "location": "query",
  74915. // "type": "string"
  74916. // },
  74917. // "pageToken": {
  74918. // "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.",
  74919. // "location": "query",
  74920. // "type": "string"
  74921. // },
  74922. // "project": {
  74923. // "description": "Project ID for this request.",
  74924. // "location": "path",
  74925. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74926. // "required": true,
  74927. // "type": "string"
  74928. // }
  74929. // },
  74930. // "path": "{project}/global/networks",
  74931. // "response": {
  74932. // "$ref": "NetworkList"
  74933. // },
  74934. // "scopes": [
  74935. // "https://www.googleapis.com/auth/cloud-platform",
  74936. // "https://www.googleapis.com/auth/compute",
  74937. // "https://www.googleapis.com/auth/compute.readonly"
  74938. // ]
  74939. // }
  74940. }
  74941. // Pages invokes f for each page of results.
  74942. // A non-nil error returned from f will halt the iteration.
  74943. // The provided context supersedes any context provided to the Context method.
  74944. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  74945. c.ctx_ = ctx
  74946. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74947. for {
  74948. x, err := c.Do()
  74949. if err != nil {
  74950. return err
  74951. }
  74952. if err := f(x); err != nil {
  74953. return err
  74954. }
  74955. if x.NextPageToken == "" {
  74956. return nil
  74957. }
  74958. c.PageToken(x.NextPageToken)
  74959. }
  74960. }
  74961. // method id "compute.networks.listPeeringRoutes":
  74962. type NetworksListPeeringRoutesCall struct {
  74963. s *Service
  74964. project string
  74965. network string
  74966. urlParams_ gensupport.URLParams
  74967. ifNoneMatch_ string
  74968. ctx_ context.Context
  74969. header_ http.Header
  74970. }
  74971. // ListPeeringRoutes: Lists the peering routes exchanged over peering
  74972. // connection.
  74973. func (r *NetworksService) ListPeeringRoutes(project string, network string) *NetworksListPeeringRoutesCall {
  74974. c := &NetworksListPeeringRoutesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74975. c.project = project
  74976. c.network = network
  74977. return c
  74978. }
  74979. // Direction sets the optional parameter "direction": The direction of
  74980. // the exchanged routes.
  74981. //
  74982. // Possible values:
  74983. // "INCOMING"
  74984. // "OUTGOING"
  74985. func (c *NetworksListPeeringRoutesCall) Direction(direction string) *NetworksListPeeringRoutesCall {
  74986. c.urlParams_.Set("direction", direction)
  74987. return c
  74988. }
  74989. // Filter sets the optional parameter "filter": A filter expression that
  74990. // filters resources listed in the response. The expression must specify
  74991. // the field name, a comparison operator, and the value that you want to
  74992. // use for filtering. The value must be a string, a number, or a
  74993. // boolean. The comparison operator must be either =, !=, >, or <.
  74994. //
  74995. // For example, if you are filtering Compute Engine instances, you can
  74996. // exclude instances named example-instance by specifying name !=
  74997. // example-instance.
  74998. //
  74999. // You can also filter nested fields. For example, you could specify
  75000. // scheduling.automaticRestart = false to include instances only if they
  75001. // are not scheduled for automatic restarts. You can use filtering on
  75002. // nested fields to filter based on resource labels.
  75003. //
  75004. // To filter on multiple expressions, provide each separate expression
  75005. // within parentheses. For example, (scheduling.automaticRestart = true)
  75006. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75007. // AND expression. However, you can include AND and OR expressions
  75008. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75009. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75010. // true).
  75011. func (c *NetworksListPeeringRoutesCall) Filter(filter string) *NetworksListPeeringRoutesCall {
  75012. c.urlParams_.Set("filter", filter)
  75013. return c
  75014. }
  75015. // MaxResults sets the optional parameter "maxResults": The maximum
  75016. // number of results per page that should be returned. If the number of
  75017. // available results is larger than maxResults, Compute Engine returns a
  75018. // nextPageToken that can be used to get the next page of results in
  75019. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75020. // (Default: 500)
  75021. func (c *NetworksListPeeringRoutesCall) MaxResults(maxResults int64) *NetworksListPeeringRoutesCall {
  75022. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75023. return c
  75024. }
  75025. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75026. // a certain order. By default, results are returned in alphanumerical
  75027. // order based on the resource name.
  75028. //
  75029. // You can also sort results in descending order based on the creation
  75030. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75031. // based on the creationTimestamp field in reverse chronological order
  75032. // (newest result first). Use this to sort resources like operations so
  75033. // that the newest operation is returned first.
  75034. //
  75035. // Currently, only sorting by name or creationTimestamp desc is
  75036. // supported.
  75037. func (c *NetworksListPeeringRoutesCall) OrderBy(orderBy string) *NetworksListPeeringRoutesCall {
  75038. c.urlParams_.Set("orderBy", orderBy)
  75039. return c
  75040. }
  75041. // PageToken sets the optional parameter "pageToken": Specifies a page
  75042. // token to use. Set pageToken to the nextPageToken returned by a
  75043. // previous list request to get the next page of results.
  75044. func (c *NetworksListPeeringRoutesCall) PageToken(pageToken string) *NetworksListPeeringRoutesCall {
  75045. c.urlParams_.Set("pageToken", pageToken)
  75046. return c
  75047. }
  75048. // PeeringName sets the optional parameter "peeringName": The response
  75049. // will show routes exchanged over the given peering connection.
  75050. func (c *NetworksListPeeringRoutesCall) PeeringName(peeringName string) *NetworksListPeeringRoutesCall {
  75051. c.urlParams_.Set("peeringName", peeringName)
  75052. return c
  75053. }
  75054. // Region sets the optional parameter "region": The region of the
  75055. // request. The response will include all subnet routes, static routes
  75056. // and dynamic routes in the region.
  75057. func (c *NetworksListPeeringRoutesCall) Region(region string) *NetworksListPeeringRoutesCall {
  75058. c.urlParams_.Set("region", region)
  75059. return c
  75060. }
  75061. // Fields allows partial responses to be retrieved. See
  75062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75063. // for more information.
  75064. func (c *NetworksListPeeringRoutesCall) Fields(s ...googleapi.Field) *NetworksListPeeringRoutesCall {
  75065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75066. return c
  75067. }
  75068. // IfNoneMatch sets the optional parameter which makes the operation
  75069. // fail if the object's ETag matches the given value. This is useful for
  75070. // getting updates only after the object has changed since the last
  75071. // request. Use googleapi.IsNotModified to check whether the response
  75072. // error from Do is the result of In-None-Match.
  75073. func (c *NetworksListPeeringRoutesCall) IfNoneMatch(entityTag string) *NetworksListPeeringRoutesCall {
  75074. c.ifNoneMatch_ = entityTag
  75075. return c
  75076. }
  75077. // Context sets the context to be used in this call's Do method. Any
  75078. // pending HTTP request will be aborted if the provided context is
  75079. // canceled.
  75080. func (c *NetworksListPeeringRoutesCall) Context(ctx context.Context) *NetworksListPeeringRoutesCall {
  75081. c.ctx_ = ctx
  75082. return c
  75083. }
  75084. // Header returns an http.Header that can be modified by the caller to
  75085. // add HTTP headers to the request.
  75086. func (c *NetworksListPeeringRoutesCall) Header() http.Header {
  75087. if c.header_ == nil {
  75088. c.header_ = make(http.Header)
  75089. }
  75090. return c.header_
  75091. }
  75092. func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, error) {
  75093. reqHeaders := make(http.Header)
  75094. for k, v := range c.header_ {
  75095. reqHeaders[k] = v
  75096. }
  75097. reqHeaders.Set("User-Agent", c.s.userAgent())
  75098. if c.ifNoneMatch_ != "" {
  75099. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75100. }
  75101. var body io.Reader = nil
  75102. c.urlParams_.Set("alt", alt)
  75103. c.urlParams_.Set("prettyPrint", "false")
  75104. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listPeeringRoutes")
  75105. urls += "?" + c.urlParams_.Encode()
  75106. req, err := http.NewRequest("GET", urls, body)
  75107. if err != nil {
  75108. return nil, err
  75109. }
  75110. req.Header = reqHeaders
  75111. googleapi.Expand(req.URL, map[string]string{
  75112. "project": c.project,
  75113. "network": c.network,
  75114. })
  75115. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75116. }
  75117. // Do executes the "compute.networks.listPeeringRoutes" call.
  75118. // Exactly one of *ExchangedPeeringRoutesList or error will be non-nil.
  75119. // Any non-2xx status code is an error. Response headers are in either
  75120. // *ExchangedPeeringRoutesList.ServerResponse.Header or (if a response
  75121. // was returned at all) in error.(*googleapi.Error).Header. Use
  75122. // googleapi.IsNotModified to check whether the returned error was
  75123. // because http.StatusNotModified was returned.
  75124. func (c *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*ExchangedPeeringRoutesList, error) {
  75125. gensupport.SetOptions(c.urlParams_, opts...)
  75126. res, err := c.doRequest("json")
  75127. if res != nil && res.StatusCode == http.StatusNotModified {
  75128. if res.Body != nil {
  75129. res.Body.Close()
  75130. }
  75131. return nil, &googleapi.Error{
  75132. Code: res.StatusCode,
  75133. Header: res.Header,
  75134. }
  75135. }
  75136. if err != nil {
  75137. return nil, err
  75138. }
  75139. defer googleapi.CloseBody(res)
  75140. if err := googleapi.CheckResponse(res); err != nil {
  75141. return nil, err
  75142. }
  75143. ret := &ExchangedPeeringRoutesList{
  75144. ServerResponse: googleapi.ServerResponse{
  75145. Header: res.Header,
  75146. HTTPStatusCode: res.StatusCode,
  75147. },
  75148. }
  75149. target := &ret
  75150. if err := gensupport.DecodeResponse(target, res); err != nil {
  75151. return nil, err
  75152. }
  75153. return ret, nil
  75154. // {
  75155. // "description": "Lists the peering routes exchanged over peering connection.",
  75156. // "httpMethod": "GET",
  75157. // "id": "compute.networks.listPeeringRoutes",
  75158. // "parameterOrder": [
  75159. // "project",
  75160. // "network"
  75161. // ],
  75162. // "parameters": {
  75163. // "direction": {
  75164. // "description": "The direction of the exchanged routes.",
  75165. // "enum": [
  75166. // "INCOMING",
  75167. // "OUTGOING"
  75168. // ],
  75169. // "enumDescriptions": [
  75170. // "",
  75171. // ""
  75172. // ],
  75173. // "location": "query",
  75174. // "type": "string"
  75175. // },
  75176. // "filter": {
  75177. // "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).",
  75178. // "location": "query",
  75179. // "type": "string"
  75180. // },
  75181. // "maxResults": {
  75182. // "default": "500",
  75183. // "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)",
  75184. // "format": "uint32",
  75185. // "location": "query",
  75186. // "minimum": "0",
  75187. // "type": "integer"
  75188. // },
  75189. // "network": {
  75190. // "description": "Name of the network for this request.",
  75191. // "location": "path",
  75192. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75193. // "required": true,
  75194. // "type": "string"
  75195. // },
  75196. // "orderBy": {
  75197. // "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.",
  75198. // "location": "query",
  75199. // "type": "string"
  75200. // },
  75201. // "pageToken": {
  75202. // "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.",
  75203. // "location": "query",
  75204. // "type": "string"
  75205. // },
  75206. // "peeringName": {
  75207. // "description": "The response will show routes exchanged over the given peering connection.",
  75208. // "location": "query",
  75209. // "type": "string"
  75210. // },
  75211. // "project": {
  75212. // "description": "Project ID for this request.",
  75213. // "location": "path",
  75214. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75215. // "required": true,
  75216. // "type": "string"
  75217. // },
  75218. // "region": {
  75219. // "description": "The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region.",
  75220. // "location": "query",
  75221. // "type": "string"
  75222. // }
  75223. // },
  75224. // "path": "{project}/global/networks/{network}/listPeeringRoutes",
  75225. // "response": {
  75226. // "$ref": "ExchangedPeeringRoutesList"
  75227. // },
  75228. // "scopes": [
  75229. // "https://www.googleapis.com/auth/cloud-platform",
  75230. // "https://www.googleapis.com/auth/compute",
  75231. // "https://www.googleapis.com/auth/compute.readonly"
  75232. // ]
  75233. // }
  75234. }
  75235. // Pages invokes f for each page of results.
  75236. // A non-nil error returned from f will halt the iteration.
  75237. // The provided context supersedes any context provided to the Context method.
  75238. func (c *NetworksListPeeringRoutesCall) Pages(ctx context.Context, f func(*ExchangedPeeringRoutesList) error) error {
  75239. c.ctx_ = ctx
  75240. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75241. for {
  75242. x, err := c.Do()
  75243. if err != nil {
  75244. return err
  75245. }
  75246. if err := f(x); err != nil {
  75247. return err
  75248. }
  75249. if x.NextPageToken == "" {
  75250. return nil
  75251. }
  75252. c.PageToken(x.NextPageToken)
  75253. }
  75254. }
  75255. // method id "compute.networks.patch":
  75256. type NetworksPatchCall struct {
  75257. s *Service
  75258. project string
  75259. network string
  75260. network2 *Network
  75261. urlParams_ gensupport.URLParams
  75262. ctx_ context.Context
  75263. header_ http.Header
  75264. }
  75265. // Patch: Patches the specified network with the data included in the
  75266. // request. Only the following fields can be modified:
  75267. // routingConfig.routingMode.
  75268. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  75269. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75270. c.project = project
  75271. c.network = network
  75272. c.network2 = network2
  75273. return c
  75274. }
  75275. // RequestId sets the optional parameter "requestId": An optional
  75276. // request ID to identify requests. Specify a unique request ID so that
  75277. // if you must retry your request, the server will know to ignore the
  75278. // request if it has already been completed.
  75279. //
  75280. // For example, consider a situation where you make an initial request
  75281. // and the request times out. If you make the request again with the
  75282. // same request ID, the server can check if original operation with the
  75283. // same request ID was received, and if so, will ignore the second
  75284. // request. This prevents clients from accidentally creating duplicate
  75285. // commitments.
  75286. //
  75287. // The request ID must be a valid UUID with the exception that zero UUID
  75288. // is not supported (00000000-0000-0000-0000-000000000000).
  75289. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  75290. c.urlParams_.Set("requestId", requestId)
  75291. return c
  75292. }
  75293. // Fields allows partial responses to be retrieved. See
  75294. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75295. // for more information.
  75296. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  75297. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75298. return c
  75299. }
  75300. // Context sets the context to be used in this call's Do method. Any
  75301. // pending HTTP request will be aborted if the provided context is
  75302. // canceled.
  75303. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  75304. c.ctx_ = ctx
  75305. return c
  75306. }
  75307. // Header returns an http.Header that can be modified by the caller to
  75308. // add HTTP headers to the request.
  75309. func (c *NetworksPatchCall) Header() http.Header {
  75310. if c.header_ == nil {
  75311. c.header_ = make(http.Header)
  75312. }
  75313. return c.header_
  75314. }
  75315. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  75316. reqHeaders := make(http.Header)
  75317. for k, v := range c.header_ {
  75318. reqHeaders[k] = v
  75319. }
  75320. reqHeaders.Set("User-Agent", c.s.userAgent())
  75321. var body io.Reader = nil
  75322. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  75323. if err != nil {
  75324. return nil, err
  75325. }
  75326. reqHeaders.Set("Content-Type", "application/json")
  75327. c.urlParams_.Set("alt", alt)
  75328. c.urlParams_.Set("prettyPrint", "false")
  75329. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  75330. urls += "?" + c.urlParams_.Encode()
  75331. req, err := http.NewRequest("PATCH", urls, body)
  75332. if err != nil {
  75333. return nil, err
  75334. }
  75335. req.Header = reqHeaders
  75336. googleapi.Expand(req.URL, map[string]string{
  75337. "project": c.project,
  75338. "network": c.network,
  75339. })
  75340. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75341. }
  75342. // Do executes the "compute.networks.patch" call.
  75343. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75344. // status code is an error. Response headers are in either
  75345. // *Operation.ServerResponse.Header or (if a response was returned at
  75346. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75347. // to check whether the returned error was because
  75348. // http.StatusNotModified was returned.
  75349. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75350. gensupport.SetOptions(c.urlParams_, opts...)
  75351. res, err := c.doRequest("json")
  75352. if res != nil && res.StatusCode == http.StatusNotModified {
  75353. if res.Body != nil {
  75354. res.Body.Close()
  75355. }
  75356. return nil, &googleapi.Error{
  75357. Code: res.StatusCode,
  75358. Header: res.Header,
  75359. }
  75360. }
  75361. if err != nil {
  75362. return nil, err
  75363. }
  75364. defer googleapi.CloseBody(res)
  75365. if err := googleapi.CheckResponse(res); err != nil {
  75366. return nil, err
  75367. }
  75368. ret := &Operation{
  75369. ServerResponse: googleapi.ServerResponse{
  75370. Header: res.Header,
  75371. HTTPStatusCode: res.StatusCode,
  75372. },
  75373. }
  75374. target := &ret
  75375. if err := gensupport.DecodeResponse(target, res); err != nil {
  75376. return nil, err
  75377. }
  75378. return ret, nil
  75379. // {
  75380. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  75381. // "httpMethod": "PATCH",
  75382. // "id": "compute.networks.patch",
  75383. // "parameterOrder": [
  75384. // "project",
  75385. // "network"
  75386. // ],
  75387. // "parameters": {
  75388. // "network": {
  75389. // "description": "Name of the network to update.",
  75390. // "location": "path",
  75391. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75392. // "required": true,
  75393. // "type": "string"
  75394. // },
  75395. // "project": {
  75396. // "description": "Project ID for this request.",
  75397. // "location": "path",
  75398. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75399. // "required": true,
  75400. // "type": "string"
  75401. // },
  75402. // "requestId": {
  75403. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75404. // "location": "query",
  75405. // "type": "string"
  75406. // }
  75407. // },
  75408. // "path": "{project}/global/networks/{network}",
  75409. // "request": {
  75410. // "$ref": "Network"
  75411. // },
  75412. // "response": {
  75413. // "$ref": "Operation"
  75414. // },
  75415. // "scopes": [
  75416. // "https://www.googleapis.com/auth/cloud-platform",
  75417. // "https://www.googleapis.com/auth/compute"
  75418. // ]
  75419. // }
  75420. }
  75421. // method id "compute.networks.removePeering":
  75422. type NetworksRemovePeeringCall struct {
  75423. s *Service
  75424. project string
  75425. network string
  75426. networksremovepeeringrequest *NetworksRemovePeeringRequest
  75427. urlParams_ gensupport.URLParams
  75428. ctx_ context.Context
  75429. header_ http.Header
  75430. }
  75431. // RemovePeering: Removes a peering from the specified network.
  75432. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  75433. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75434. c.project = project
  75435. c.network = network
  75436. c.networksremovepeeringrequest = networksremovepeeringrequest
  75437. return c
  75438. }
  75439. // RequestId sets the optional parameter "requestId": An optional
  75440. // request ID to identify requests. Specify a unique request ID so that
  75441. // if you must retry your request, the server will know to ignore the
  75442. // request if it has already been completed.
  75443. //
  75444. // For example, consider a situation where you make an initial request
  75445. // and the request times out. If you make the request again with the
  75446. // same request ID, the server can check if original operation with the
  75447. // same request ID was received, and if so, will ignore the second
  75448. // request. This prevents clients from accidentally creating duplicate
  75449. // commitments.
  75450. //
  75451. // The request ID must be a valid UUID with the exception that zero UUID
  75452. // is not supported (00000000-0000-0000-0000-000000000000).
  75453. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  75454. c.urlParams_.Set("requestId", requestId)
  75455. return c
  75456. }
  75457. // Fields allows partial responses to be retrieved. See
  75458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75459. // for more information.
  75460. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  75461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75462. return c
  75463. }
  75464. // Context sets the context to be used in this call's Do method. Any
  75465. // pending HTTP request will be aborted if the provided context is
  75466. // canceled.
  75467. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  75468. c.ctx_ = ctx
  75469. return c
  75470. }
  75471. // Header returns an http.Header that can be modified by the caller to
  75472. // add HTTP headers to the request.
  75473. func (c *NetworksRemovePeeringCall) Header() http.Header {
  75474. if c.header_ == nil {
  75475. c.header_ = make(http.Header)
  75476. }
  75477. return c.header_
  75478. }
  75479. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  75480. reqHeaders := make(http.Header)
  75481. for k, v := range c.header_ {
  75482. reqHeaders[k] = v
  75483. }
  75484. reqHeaders.Set("User-Agent", c.s.userAgent())
  75485. var body io.Reader = nil
  75486. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  75487. if err != nil {
  75488. return nil, err
  75489. }
  75490. reqHeaders.Set("Content-Type", "application/json")
  75491. c.urlParams_.Set("alt", alt)
  75492. c.urlParams_.Set("prettyPrint", "false")
  75493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  75494. urls += "?" + c.urlParams_.Encode()
  75495. req, err := http.NewRequest("POST", urls, body)
  75496. if err != nil {
  75497. return nil, err
  75498. }
  75499. req.Header = reqHeaders
  75500. googleapi.Expand(req.URL, map[string]string{
  75501. "project": c.project,
  75502. "network": c.network,
  75503. })
  75504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75505. }
  75506. // Do executes the "compute.networks.removePeering" call.
  75507. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75508. // status code is an error. Response headers are in either
  75509. // *Operation.ServerResponse.Header or (if a response was returned at
  75510. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75511. // to check whether the returned error was because
  75512. // http.StatusNotModified was returned.
  75513. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75514. gensupport.SetOptions(c.urlParams_, opts...)
  75515. res, err := c.doRequest("json")
  75516. if res != nil && res.StatusCode == http.StatusNotModified {
  75517. if res.Body != nil {
  75518. res.Body.Close()
  75519. }
  75520. return nil, &googleapi.Error{
  75521. Code: res.StatusCode,
  75522. Header: res.Header,
  75523. }
  75524. }
  75525. if err != nil {
  75526. return nil, err
  75527. }
  75528. defer googleapi.CloseBody(res)
  75529. if err := googleapi.CheckResponse(res); err != nil {
  75530. return nil, err
  75531. }
  75532. ret := &Operation{
  75533. ServerResponse: googleapi.ServerResponse{
  75534. Header: res.Header,
  75535. HTTPStatusCode: res.StatusCode,
  75536. },
  75537. }
  75538. target := &ret
  75539. if err := gensupport.DecodeResponse(target, res); err != nil {
  75540. return nil, err
  75541. }
  75542. return ret, nil
  75543. // {
  75544. // "description": "Removes a peering from the specified network.",
  75545. // "httpMethod": "POST",
  75546. // "id": "compute.networks.removePeering",
  75547. // "parameterOrder": [
  75548. // "project",
  75549. // "network"
  75550. // ],
  75551. // "parameters": {
  75552. // "network": {
  75553. // "description": "Name of the network resource to remove peering from.",
  75554. // "location": "path",
  75555. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75556. // "required": true,
  75557. // "type": "string"
  75558. // },
  75559. // "project": {
  75560. // "description": "Project ID for this request.",
  75561. // "location": "path",
  75562. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75563. // "required": true,
  75564. // "type": "string"
  75565. // },
  75566. // "requestId": {
  75567. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75568. // "location": "query",
  75569. // "type": "string"
  75570. // }
  75571. // },
  75572. // "path": "{project}/global/networks/{network}/removePeering",
  75573. // "request": {
  75574. // "$ref": "NetworksRemovePeeringRequest"
  75575. // },
  75576. // "response": {
  75577. // "$ref": "Operation"
  75578. // },
  75579. // "scopes": [
  75580. // "https://www.googleapis.com/auth/cloud-platform",
  75581. // "https://www.googleapis.com/auth/compute"
  75582. // ]
  75583. // }
  75584. }
  75585. // method id "compute.networks.switchToCustomMode":
  75586. type NetworksSwitchToCustomModeCall struct {
  75587. s *Service
  75588. project string
  75589. network string
  75590. urlParams_ gensupport.URLParams
  75591. ctx_ context.Context
  75592. header_ http.Header
  75593. }
  75594. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  75595. // to custom subnet mode.
  75596. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  75597. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75598. c.project = project
  75599. c.network = network
  75600. return c
  75601. }
  75602. // RequestId sets the optional parameter "requestId": An optional
  75603. // request ID to identify requests. Specify a unique request ID so that
  75604. // if you must retry your request, the server will know to ignore the
  75605. // request if it has already been completed.
  75606. //
  75607. // For example, consider a situation where you make an initial request
  75608. // and the request times out. If you make the request again with the
  75609. // same request ID, the server can check if original operation with the
  75610. // same request ID was received, and if so, will ignore the second
  75611. // request. This prevents clients from accidentally creating duplicate
  75612. // commitments.
  75613. //
  75614. // The request ID must be a valid UUID with the exception that zero UUID
  75615. // is not supported (00000000-0000-0000-0000-000000000000).
  75616. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  75617. c.urlParams_.Set("requestId", requestId)
  75618. return c
  75619. }
  75620. // Fields allows partial responses to be retrieved. See
  75621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75622. // for more information.
  75623. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  75624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75625. return c
  75626. }
  75627. // Context sets the context to be used in this call's Do method. Any
  75628. // pending HTTP request will be aborted if the provided context is
  75629. // canceled.
  75630. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  75631. c.ctx_ = ctx
  75632. return c
  75633. }
  75634. // Header returns an http.Header that can be modified by the caller to
  75635. // add HTTP headers to the request.
  75636. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  75637. if c.header_ == nil {
  75638. c.header_ = make(http.Header)
  75639. }
  75640. return c.header_
  75641. }
  75642. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  75643. reqHeaders := make(http.Header)
  75644. for k, v := range c.header_ {
  75645. reqHeaders[k] = v
  75646. }
  75647. reqHeaders.Set("User-Agent", c.s.userAgent())
  75648. var body io.Reader = nil
  75649. c.urlParams_.Set("alt", alt)
  75650. c.urlParams_.Set("prettyPrint", "false")
  75651. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  75652. urls += "?" + c.urlParams_.Encode()
  75653. req, err := http.NewRequest("POST", urls, body)
  75654. if err != nil {
  75655. return nil, err
  75656. }
  75657. req.Header = reqHeaders
  75658. googleapi.Expand(req.URL, map[string]string{
  75659. "project": c.project,
  75660. "network": c.network,
  75661. })
  75662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75663. }
  75664. // Do executes the "compute.networks.switchToCustomMode" call.
  75665. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75666. // status code is an error. Response headers are in either
  75667. // *Operation.ServerResponse.Header or (if a response was returned at
  75668. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75669. // to check whether the returned error was because
  75670. // http.StatusNotModified was returned.
  75671. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75672. gensupport.SetOptions(c.urlParams_, opts...)
  75673. res, err := c.doRequest("json")
  75674. if res != nil && res.StatusCode == http.StatusNotModified {
  75675. if res.Body != nil {
  75676. res.Body.Close()
  75677. }
  75678. return nil, &googleapi.Error{
  75679. Code: res.StatusCode,
  75680. Header: res.Header,
  75681. }
  75682. }
  75683. if err != nil {
  75684. return nil, err
  75685. }
  75686. defer googleapi.CloseBody(res)
  75687. if err := googleapi.CheckResponse(res); err != nil {
  75688. return nil, err
  75689. }
  75690. ret := &Operation{
  75691. ServerResponse: googleapi.ServerResponse{
  75692. Header: res.Header,
  75693. HTTPStatusCode: res.StatusCode,
  75694. },
  75695. }
  75696. target := &ret
  75697. if err := gensupport.DecodeResponse(target, res); err != nil {
  75698. return nil, err
  75699. }
  75700. return ret, nil
  75701. // {
  75702. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  75703. // "httpMethod": "POST",
  75704. // "id": "compute.networks.switchToCustomMode",
  75705. // "parameterOrder": [
  75706. // "project",
  75707. // "network"
  75708. // ],
  75709. // "parameters": {
  75710. // "network": {
  75711. // "description": "Name of the network to be updated.",
  75712. // "location": "path",
  75713. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75714. // "required": true,
  75715. // "type": "string"
  75716. // },
  75717. // "project": {
  75718. // "description": "Project ID for this request.",
  75719. // "location": "path",
  75720. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75721. // "required": true,
  75722. // "type": "string"
  75723. // },
  75724. // "requestId": {
  75725. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75726. // "location": "query",
  75727. // "type": "string"
  75728. // }
  75729. // },
  75730. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  75731. // "response": {
  75732. // "$ref": "Operation"
  75733. // },
  75734. // "scopes": [
  75735. // "https://www.googleapis.com/auth/cloud-platform",
  75736. // "https://www.googleapis.com/auth/compute"
  75737. // ]
  75738. // }
  75739. }
  75740. // method id "compute.networks.testIamPermissions":
  75741. type NetworksTestIamPermissionsCall struct {
  75742. s *Service
  75743. project string
  75744. resource string
  75745. testpermissionsrequest *TestPermissionsRequest
  75746. urlParams_ gensupport.URLParams
  75747. ctx_ context.Context
  75748. header_ http.Header
  75749. }
  75750. // TestIamPermissions: Returns permissions that a caller has on the
  75751. // specified resource.
  75752. func (r *NetworksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworksTestIamPermissionsCall {
  75753. c := &NetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75754. c.project = project
  75755. c.resource = resource
  75756. c.testpermissionsrequest = testpermissionsrequest
  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 *NetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworksTestIamPermissionsCall {
  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 *NetworksTestIamPermissionsCall) Context(ctx context.Context) *NetworksTestIamPermissionsCall {
  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 *NetworksTestIamPermissionsCall) Header() http.Header {
  75776. if c.header_ == nil {
  75777. c.header_ = make(http.Header)
  75778. }
  75779. return c.header_
  75780. }
  75781. func (c *NetworksTestIamPermissionsCall) 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. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  75789. if err != nil {
  75790. return nil, err
  75791. }
  75792. reqHeaders.Set("Content-Type", "application/json")
  75793. c.urlParams_.Set("alt", alt)
  75794. c.urlParams_.Set("prettyPrint", "false")
  75795. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{resource}/testIamPermissions")
  75796. urls += "?" + c.urlParams_.Encode()
  75797. req, err := http.NewRequest("POST", urls, body)
  75798. if err != nil {
  75799. return nil, err
  75800. }
  75801. req.Header = reqHeaders
  75802. googleapi.Expand(req.URL, map[string]string{
  75803. "project": c.project,
  75804. "resource": c.resource,
  75805. })
  75806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75807. }
  75808. // Do executes the "compute.networks.testIamPermissions" call.
  75809. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  75810. // non-2xx status code is an error. Response headers are in either
  75811. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  75812. // returned at all) in error.(*googleapi.Error).Header. Use
  75813. // googleapi.IsNotModified to check whether the returned error was
  75814. // because http.StatusNotModified was returned.
  75815. func (c *NetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  75816. gensupport.SetOptions(c.urlParams_, opts...)
  75817. res, err := c.doRequest("json")
  75818. if res != nil && res.StatusCode == http.StatusNotModified {
  75819. if res.Body != nil {
  75820. res.Body.Close()
  75821. }
  75822. return nil, &googleapi.Error{
  75823. Code: res.StatusCode,
  75824. Header: res.Header,
  75825. }
  75826. }
  75827. if err != nil {
  75828. return nil, err
  75829. }
  75830. defer googleapi.CloseBody(res)
  75831. if err := googleapi.CheckResponse(res); err != nil {
  75832. return nil, err
  75833. }
  75834. ret := &TestPermissionsResponse{
  75835. ServerResponse: googleapi.ServerResponse{
  75836. Header: res.Header,
  75837. HTTPStatusCode: res.StatusCode,
  75838. },
  75839. }
  75840. target := &ret
  75841. if err := gensupport.DecodeResponse(target, res); err != nil {
  75842. return nil, err
  75843. }
  75844. return ret, nil
  75845. // {
  75846. // "description": "Returns permissions that a caller has on the specified resource.",
  75847. // "httpMethod": "POST",
  75848. // "id": "compute.networks.testIamPermissions",
  75849. // "parameterOrder": [
  75850. // "project",
  75851. // "resource"
  75852. // ],
  75853. // "parameters": {
  75854. // "project": {
  75855. // "description": "Project ID for this request.",
  75856. // "location": "path",
  75857. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75858. // "required": true,
  75859. // "type": "string"
  75860. // },
  75861. // "resource": {
  75862. // "description": "Name or id of the resource for this request.",
  75863. // "location": "path",
  75864. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75865. // "required": true,
  75866. // "type": "string"
  75867. // }
  75868. // },
  75869. // "path": "{project}/global/networks/{resource}/testIamPermissions",
  75870. // "request": {
  75871. // "$ref": "TestPermissionsRequest"
  75872. // },
  75873. // "response": {
  75874. // "$ref": "TestPermissionsResponse"
  75875. // },
  75876. // "scopes": [
  75877. // "https://www.googleapis.com/auth/cloud-platform",
  75878. // "https://www.googleapis.com/auth/compute",
  75879. // "https://www.googleapis.com/auth/compute.readonly"
  75880. // ]
  75881. // }
  75882. }
  75883. // method id "compute.networks.updatePeering":
  75884. type NetworksUpdatePeeringCall struct {
  75885. s *Service
  75886. project string
  75887. network string
  75888. networksupdatepeeringrequest *NetworksUpdatePeeringRequest
  75889. urlParams_ gensupport.URLParams
  75890. ctx_ context.Context
  75891. header_ http.Header
  75892. }
  75893. // UpdatePeering: Updates the specified network peering with the data
  75894. // included in the request Only the following fields can be modified:
  75895. // NetworkPeering.export_custom_routes, and
  75896. // NetworkPeering.import_custom_routes
  75897. func (r *NetworksService) UpdatePeering(project string, network string, networksupdatepeeringrequest *NetworksUpdatePeeringRequest) *NetworksUpdatePeeringCall {
  75898. c := &NetworksUpdatePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75899. c.project = project
  75900. c.network = network
  75901. c.networksupdatepeeringrequest = networksupdatepeeringrequest
  75902. return c
  75903. }
  75904. // RequestId sets the optional parameter "requestId": An optional
  75905. // request ID to identify requests. Specify a unique request ID so that
  75906. // if you must retry your request, the server will know to ignore the
  75907. // request if it has already been completed.
  75908. //
  75909. // For example, consider a situation where you make an initial request
  75910. // and the request times out. If you make the request again with the
  75911. // same request ID, the server can check if original operation with the
  75912. // same request ID was received, and if so, will ignore the second
  75913. // request. This prevents clients from accidentally creating duplicate
  75914. // commitments.
  75915. //
  75916. // The request ID must be a valid UUID with the exception that zero UUID
  75917. // is not supported (00000000-0000-0000-0000-000000000000).
  75918. func (c *NetworksUpdatePeeringCall) RequestId(requestId string) *NetworksUpdatePeeringCall {
  75919. c.urlParams_.Set("requestId", requestId)
  75920. return c
  75921. }
  75922. // Fields allows partial responses to be retrieved. See
  75923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75924. // for more information.
  75925. func (c *NetworksUpdatePeeringCall) Fields(s ...googleapi.Field) *NetworksUpdatePeeringCall {
  75926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75927. return c
  75928. }
  75929. // Context sets the context to be used in this call's Do method. Any
  75930. // pending HTTP request will be aborted if the provided context is
  75931. // canceled.
  75932. func (c *NetworksUpdatePeeringCall) Context(ctx context.Context) *NetworksUpdatePeeringCall {
  75933. c.ctx_ = ctx
  75934. return c
  75935. }
  75936. // Header returns an http.Header that can be modified by the caller to
  75937. // add HTTP headers to the request.
  75938. func (c *NetworksUpdatePeeringCall) Header() http.Header {
  75939. if c.header_ == nil {
  75940. c.header_ = make(http.Header)
  75941. }
  75942. return c.header_
  75943. }
  75944. func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) {
  75945. reqHeaders := make(http.Header)
  75946. for k, v := range c.header_ {
  75947. reqHeaders[k] = v
  75948. }
  75949. reqHeaders.Set("User-Agent", c.s.userAgent())
  75950. var body io.Reader = nil
  75951. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest)
  75952. if err != nil {
  75953. return nil, err
  75954. }
  75955. reqHeaders.Set("Content-Type", "application/json")
  75956. c.urlParams_.Set("alt", alt)
  75957. c.urlParams_.Set("prettyPrint", "false")
  75958. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/updatePeering")
  75959. urls += "?" + c.urlParams_.Encode()
  75960. req, err := http.NewRequest("PATCH", urls, body)
  75961. if err != nil {
  75962. return nil, err
  75963. }
  75964. req.Header = reqHeaders
  75965. googleapi.Expand(req.URL, map[string]string{
  75966. "project": c.project,
  75967. "network": c.network,
  75968. })
  75969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75970. }
  75971. // Do executes the "compute.networks.updatePeering" call.
  75972. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75973. // status code is an error. Response headers are in either
  75974. // *Operation.ServerResponse.Header or (if a response was returned at
  75975. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75976. // to check whether the returned error was because
  75977. // http.StatusNotModified was returned.
  75978. func (c *NetworksUpdatePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75979. gensupport.SetOptions(c.urlParams_, opts...)
  75980. res, err := c.doRequest("json")
  75981. if res != nil && res.StatusCode == http.StatusNotModified {
  75982. if res.Body != nil {
  75983. res.Body.Close()
  75984. }
  75985. return nil, &googleapi.Error{
  75986. Code: res.StatusCode,
  75987. Header: res.Header,
  75988. }
  75989. }
  75990. if err != nil {
  75991. return nil, err
  75992. }
  75993. defer googleapi.CloseBody(res)
  75994. if err := googleapi.CheckResponse(res); err != nil {
  75995. return nil, err
  75996. }
  75997. ret := &Operation{
  75998. ServerResponse: googleapi.ServerResponse{
  75999. Header: res.Header,
  76000. HTTPStatusCode: res.StatusCode,
  76001. },
  76002. }
  76003. target := &ret
  76004. if err := gensupport.DecodeResponse(target, res); err != nil {
  76005. return nil, err
  76006. }
  76007. return ret, nil
  76008. // {
  76009. // "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",
  76010. // "httpMethod": "PATCH",
  76011. // "id": "compute.networks.updatePeering",
  76012. // "parameterOrder": [
  76013. // "project",
  76014. // "network"
  76015. // ],
  76016. // "parameters": {
  76017. // "network": {
  76018. // "description": "Name of the network resource which the updated peering is belonging to.",
  76019. // "location": "path",
  76020. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76021. // "required": true,
  76022. // "type": "string"
  76023. // },
  76024. // "project": {
  76025. // "description": "Project ID for this request.",
  76026. // "location": "path",
  76027. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76028. // "required": true,
  76029. // "type": "string"
  76030. // },
  76031. // "requestId": {
  76032. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76033. // "location": "query",
  76034. // "type": "string"
  76035. // }
  76036. // },
  76037. // "path": "{project}/global/networks/{network}/updatePeering",
  76038. // "request": {
  76039. // "$ref": "NetworksUpdatePeeringRequest"
  76040. // },
  76041. // "response": {
  76042. // "$ref": "Operation"
  76043. // },
  76044. // "scopes": [
  76045. // "https://www.googleapis.com/auth/cloud-platform",
  76046. // "https://www.googleapis.com/auth/compute"
  76047. // ]
  76048. // }
  76049. }
  76050. // method id "compute.nodeGroups.addNodes":
  76051. type NodeGroupsAddNodesCall struct {
  76052. s *Service
  76053. project string
  76054. zone string
  76055. nodeGroup string
  76056. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  76057. urlParams_ gensupport.URLParams
  76058. ctx_ context.Context
  76059. header_ http.Header
  76060. }
  76061. // AddNodes: Adds specified number of nodes to the node group.
  76062. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  76063. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76064. c.project = project
  76065. c.zone = zone
  76066. c.nodeGroup = nodeGroup
  76067. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  76068. return c
  76069. }
  76070. // RequestId sets the optional parameter "requestId": An optional
  76071. // request ID to identify requests. Specify a unique request ID so that
  76072. // if you must retry your request, the server will know to ignore the
  76073. // request if it has already been completed.
  76074. //
  76075. // For example, consider a situation where you make an initial request
  76076. // and the request times out. If you make the request again with the
  76077. // same request ID, the server can check if original operation with the
  76078. // same request ID was received, and if so, will ignore the second
  76079. // request. This prevents clients from accidentally creating duplicate
  76080. // commitments.
  76081. //
  76082. // The request ID must be a valid UUID with the exception that zero UUID
  76083. // is not supported (00000000-0000-0000-0000-000000000000).
  76084. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  76085. c.urlParams_.Set("requestId", requestId)
  76086. return c
  76087. }
  76088. // Fields allows partial responses to be retrieved. See
  76089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76090. // for more information.
  76091. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  76092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76093. return c
  76094. }
  76095. // Context sets the context to be used in this call's Do method. Any
  76096. // pending HTTP request will be aborted if the provided context is
  76097. // canceled.
  76098. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  76099. c.ctx_ = ctx
  76100. return c
  76101. }
  76102. // Header returns an http.Header that can be modified by the caller to
  76103. // add HTTP headers to the request.
  76104. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  76105. if c.header_ == nil {
  76106. c.header_ = make(http.Header)
  76107. }
  76108. return c.header_
  76109. }
  76110. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  76111. reqHeaders := make(http.Header)
  76112. for k, v := range c.header_ {
  76113. reqHeaders[k] = v
  76114. }
  76115. reqHeaders.Set("User-Agent", c.s.userAgent())
  76116. var body io.Reader = nil
  76117. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  76118. if err != nil {
  76119. return nil, err
  76120. }
  76121. reqHeaders.Set("Content-Type", "application/json")
  76122. c.urlParams_.Set("alt", alt)
  76123. c.urlParams_.Set("prettyPrint", "false")
  76124. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  76125. urls += "?" + c.urlParams_.Encode()
  76126. req, err := http.NewRequest("POST", urls, body)
  76127. if err != nil {
  76128. return nil, err
  76129. }
  76130. req.Header = reqHeaders
  76131. googleapi.Expand(req.URL, map[string]string{
  76132. "project": c.project,
  76133. "zone": c.zone,
  76134. "nodeGroup": c.nodeGroup,
  76135. })
  76136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76137. }
  76138. // Do executes the "compute.nodeGroups.addNodes" call.
  76139. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76140. // status code is an error. Response headers are in either
  76141. // *Operation.ServerResponse.Header or (if a response was returned at
  76142. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76143. // to check whether the returned error was because
  76144. // http.StatusNotModified was returned.
  76145. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76146. gensupport.SetOptions(c.urlParams_, opts...)
  76147. res, err := c.doRequest("json")
  76148. if res != nil && res.StatusCode == http.StatusNotModified {
  76149. if res.Body != nil {
  76150. res.Body.Close()
  76151. }
  76152. return nil, &googleapi.Error{
  76153. Code: res.StatusCode,
  76154. Header: res.Header,
  76155. }
  76156. }
  76157. if err != nil {
  76158. return nil, err
  76159. }
  76160. defer googleapi.CloseBody(res)
  76161. if err := googleapi.CheckResponse(res); err != nil {
  76162. return nil, err
  76163. }
  76164. ret := &Operation{
  76165. ServerResponse: googleapi.ServerResponse{
  76166. Header: res.Header,
  76167. HTTPStatusCode: res.StatusCode,
  76168. },
  76169. }
  76170. target := &ret
  76171. if err := gensupport.DecodeResponse(target, res); err != nil {
  76172. return nil, err
  76173. }
  76174. return ret, nil
  76175. // {
  76176. // "description": "Adds specified number of nodes to the node group.",
  76177. // "httpMethod": "POST",
  76178. // "id": "compute.nodeGroups.addNodes",
  76179. // "parameterOrder": [
  76180. // "project",
  76181. // "zone",
  76182. // "nodeGroup"
  76183. // ],
  76184. // "parameters": {
  76185. // "nodeGroup": {
  76186. // "description": "Name of the NodeGroup resource.",
  76187. // "location": "path",
  76188. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76189. // "required": true,
  76190. // "type": "string"
  76191. // },
  76192. // "project": {
  76193. // "description": "Project ID for this request.",
  76194. // "location": "path",
  76195. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76196. // "required": true,
  76197. // "type": "string"
  76198. // },
  76199. // "requestId": {
  76200. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76201. // "location": "query",
  76202. // "type": "string"
  76203. // },
  76204. // "zone": {
  76205. // "description": "The name of the zone for this request.",
  76206. // "location": "path",
  76207. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76208. // "required": true,
  76209. // "type": "string"
  76210. // }
  76211. // },
  76212. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  76213. // "request": {
  76214. // "$ref": "NodeGroupsAddNodesRequest"
  76215. // },
  76216. // "response": {
  76217. // "$ref": "Operation"
  76218. // },
  76219. // "scopes": [
  76220. // "https://www.googleapis.com/auth/cloud-platform",
  76221. // "https://www.googleapis.com/auth/compute"
  76222. // ]
  76223. // }
  76224. }
  76225. // method id "compute.nodeGroups.aggregatedList":
  76226. type NodeGroupsAggregatedListCall struct {
  76227. s *Service
  76228. project string
  76229. urlParams_ gensupport.URLParams
  76230. ifNoneMatch_ string
  76231. ctx_ context.Context
  76232. header_ http.Header
  76233. }
  76234. // AggregatedList: Retrieves an aggregated list of node groups. Note:
  76235. // use nodeGroups.listNodes for more details about each group.
  76236. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  76237. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76238. c.project = project
  76239. return c
  76240. }
  76241. // Filter sets the optional parameter "filter": A filter expression that
  76242. // filters resources listed in the response. The expression must specify
  76243. // the field name, a comparison operator, and the value that you want to
  76244. // use for filtering. The value must be a string, a number, or a
  76245. // boolean. The comparison operator must be either =, !=, >, or <.
  76246. //
  76247. // For example, if you are filtering Compute Engine instances, you can
  76248. // exclude instances named example-instance by specifying name !=
  76249. // example-instance.
  76250. //
  76251. // You can also filter nested fields. For example, you could specify
  76252. // scheduling.automaticRestart = false to include instances only if they
  76253. // are not scheduled for automatic restarts. You can use filtering on
  76254. // nested fields to filter based on resource labels.
  76255. //
  76256. // To filter on multiple expressions, provide each separate expression
  76257. // within parentheses. For example, (scheduling.automaticRestart = true)
  76258. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76259. // AND expression. However, you can include AND and OR expressions
  76260. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76261. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76262. // true).
  76263. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  76264. c.urlParams_.Set("filter", filter)
  76265. return c
  76266. }
  76267. // MaxResults sets the optional parameter "maxResults": The maximum
  76268. // number of results per page that should be returned. If the number of
  76269. // available results is larger than maxResults, Compute Engine returns a
  76270. // nextPageToken that can be used to get the next page of results in
  76271. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76272. // (Default: 500)
  76273. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  76274. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76275. return c
  76276. }
  76277. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76278. // a certain order. By default, results are returned in alphanumerical
  76279. // order based on the resource name.
  76280. //
  76281. // You can also sort results in descending order based on the creation
  76282. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76283. // based on the creationTimestamp field in reverse chronological order
  76284. // (newest result first). Use this to sort resources like operations so
  76285. // that the newest operation is returned first.
  76286. //
  76287. // Currently, only sorting by name or creationTimestamp desc is
  76288. // supported.
  76289. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  76290. c.urlParams_.Set("orderBy", orderBy)
  76291. return c
  76292. }
  76293. // PageToken sets the optional parameter "pageToken": Specifies a page
  76294. // token to use. Set pageToken to the nextPageToken returned by a
  76295. // previous list request to get the next page of results.
  76296. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  76297. c.urlParams_.Set("pageToken", pageToken)
  76298. return c
  76299. }
  76300. // Fields allows partial responses to be retrieved. See
  76301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76302. // for more information.
  76303. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  76304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76305. return c
  76306. }
  76307. // IfNoneMatch sets the optional parameter which makes the operation
  76308. // fail if the object's ETag matches the given value. This is useful for
  76309. // getting updates only after the object has changed since the last
  76310. // request. Use googleapi.IsNotModified to check whether the response
  76311. // error from Do is the result of In-None-Match.
  76312. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  76313. c.ifNoneMatch_ = entityTag
  76314. return c
  76315. }
  76316. // Context sets the context to be used in this call's Do method. Any
  76317. // pending HTTP request will be aborted if the provided context is
  76318. // canceled.
  76319. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  76320. c.ctx_ = ctx
  76321. return c
  76322. }
  76323. // Header returns an http.Header that can be modified by the caller to
  76324. // add HTTP headers to the request.
  76325. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  76326. if c.header_ == nil {
  76327. c.header_ = make(http.Header)
  76328. }
  76329. return c.header_
  76330. }
  76331. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  76332. reqHeaders := make(http.Header)
  76333. for k, v := range c.header_ {
  76334. reqHeaders[k] = v
  76335. }
  76336. reqHeaders.Set("User-Agent", c.s.userAgent())
  76337. if c.ifNoneMatch_ != "" {
  76338. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76339. }
  76340. var body io.Reader = nil
  76341. c.urlParams_.Set("alt", alt)
  76342. c.urlParams_.Set("prettyPrint", "false")
  76343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  76344. urls += "?" + c.urlParams_.Encode()
  76345. req, err := http.NewRequest("GET", urls, body)
  76346. if err != nil {
  76347. return nil, err
  76348. }
  76349. req.Header = reqHeaders
  76350. googleapi.Expand(req.URL, map[string]string{
  76351. "project": c.project,
  76352. })
  76353. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76354. }
  76355. // Do executes the "compute.nodeGroups.aggregatedList" call.
  76356. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  76357. // non-2xx status code is an error. Response headers are in either
  76358. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  76359. // returned at all) in error.(*googleapi.Error).Header. Use
  76360. // googleapi.IsNotModified to check whether the returned error was
  76361. // because http.StatusNotModified was returned.
  76362. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  76363. gensupport.SetOptions(c.urlParams_, opts...)
  76364. res, err := c.doRequest("json")
  76365. if res != nil && res.StatusCode == http.StatusNotModified {
  76366. if res.Body != nil {
  76367. res.Body.Close()
  76368. }
  76369. return nil, &googleapi.Error{
  76370. Code: res.StatusCode,
  76371. Header: res.Header,
  76372. }
  76373. }
  76374. if err != nil {
  76375. return nil, err
  76376. }
  76377. defer googleapi.CloseBody(res)
  76378. if err := googleapi.CheckResponse(res); err != nil {
  76379. return nil, err
  76380. }
  76381. ret := &NodeGroupAggregatedList{
  76382. ServerResponse: googleapi.ServerResponse{
  76383. Header: res.Header,
  76384. HTTPStatusCode: res.StatusCode,
  76385. },
  76386. }
  76387. target := &ret
  76388. if err := gensupport.DecodeResponse(target, res); err != nil {
  76389. return nil, err
  76390. }
  76391. return ret, nil
  76392. // {
  76393. // "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
  76394. // "httpMethod": "GET",
  76395. // "id": "compute.nodeGroups.aggregatedList",
  76396. // "parameterOrder": [
  76397. // "project"
  76398. // ],
  76399. // "parameters": {
  76400. // "filter": {
  76401. // "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).",
  76402. // "location": "query",
  76403. // "type": "string"
  76404. // },
  76405. // "maxResults": {
  76406. // "default": "500",
  76407. // "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)",
  76408. // "format": "uint32",
  76409. // "location": "query",
  76410. // "minimum": "0",
  76411. // "type": "integer"
  76412. // },
  76413. // "orderBy": {
  76414. // "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.",
  76415. // "location": "query",
  76416. // "type": "string"
  76417. // },
  76418. // "pageToken": {
  76419. // "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.",
  76420. // "location": "query",
  76421. // "type": "string"
  76422. // },
  76423. // "project": {
  76424. // "description": "Project ID for this request.",
  76425. // "location": "path",
  76426. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76427. // "required": true,
  76428. // "type": "string"
  76429. // }
  76430. // },
  76431. // "path": "{project}/aggregated/nodeGroups",
  76432. // "response": {
  76433. // "$ref": "NodeGroupAggregatedList"
  76434. // },
  76435. // "scopes": [
  76436. // "https://www.googleapis.com/auth/cloud-platform",
  76437. // "https://www.googleapis.com/auth/compute",
  76438. // "https://www.googleapis.com/auth/compute.readonly"
  76439. // ]
  76440. // }
  76441. }
  76442. // Pages invokes f for each page of results.
  76443. // A non-nil error returned from f will halt the iteration.
  76444. // The provided context supersedes any context provided to the Context method.
  76445. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  76446. c.ctx_ = ctx
  76447. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76448. for {
  76449. x, err := c.Do()
  76450. if err != nil {
  76451. return err
  76452. }
  76453. if err := f(x); err != nil {
  76454. return err
  76455. }
  76456. if x.NextPageToken == "" {
  76457. return nil
  76458. }
  76459. c.PageToken(x.NextPageToken)
  76460. }
  76461. }
  76462. // method id "compute.nodeGroups.delete":
  76463. type NodeGroupsDeleteCall struct {
  76464. s *Service
  76465. project string
  76466. zone string
  76467. nodeGroup string
  76468. urlParams_ gensupport.URLParams
  76469. ctx_ context.Context
  76470. header_ http.Header
  76471. }
  76472. // Delete: Deletes the specified NodeGroup resource.
  76473. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  76474. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76475. c.project = project
  76476. c.zone = zone
  76477. c.nodeGroup = nodeGroup
  76478. return c
  76479. }
  76480. // RequestId sets the optional parameter "requestId": An optional
  76481. // request ID to identify requests. Specify a unique request ID so that
  76482. // if you must retry your request, the server will know to ignore the
  76483. // request if it has already been completed.
  76484. //
  76485. // For example, consider a situation where you make an initial request
  76486. // and the request times out. If you make the request again with the
  76487. // same request ID, the server can check if original operation with the
  76488. // same request ID was received, and if so, will ignore the second
  76489. // request. This prevents clients from accidentally creating duplicate
  76490. // commitments.
  76491. //
  76492. // The request ID must be a valid UUID with the exception that zero UUID
  76493. // is not supported (00000000-0000-0000-0000-000000000000).
  76494. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  76495. c.urlParams_.Set("requestId", requestId)
  76496. return c
  76497. }
  76498. // Fields allows partial responses to be retrieved. See
  76499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76500. // for more information.
  76501. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  76502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76503. return c
  76504. }
  76505. // Context sets the context to be used in this call's Do method. Any
  76506. // pending HTTP request will be aborted if the provided context is
  76507. // canceled.
  76508. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  76509. c.ctx_ = ctx
  76510. return c
  76511. }
  76512. // Header returns an http.Header that can be modified by the caller to
  76513. // add HTTP headers to the request.
  76514. func (c *NodeGroupsDeleteCall) Header() http.Header {
  76515. if c.header_ == nil {
  76516. c.header_ = make(http.Header)
  76517. }
  76518. return c.header_
  76519. }
  76520. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  76521. reqHeaders := make(http.Header)
  76522. for k, v := range c.header_ {
  76523. reqHeaders[k] = v
  76524. }
  76525. reqHeaders.Set("User-Agent", c.s.userAgent())
  76526. var body io.Reader = nil
  76527. c.urlParams_.Set("alt", alt)
  76528. c.urlParams_.Set("prettyPrint", "false")
  76529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  76530. urls += "?" + c.urlParams_.Encode()
  76531. req, err := http.NewRequest("DELETE", urls, body)
  76532. if err != nil {
  76533. return nil, err
  76534. }
  76535. req.Header = reqHeaders
  76536. googleapi.Expand(req.URL, map[string]string{
  76537. "project": c.project,
  76538. "zone": c.zone,
  76539. "nodeGroup": c.nodeGroup,
  76540. })
  76541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76542. }
  76543. // Do executes the "compute.nodeGroups.delete" call.
  76544. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76545. // status code is an error. Response headers are in either
  76546. // *Operation.ServerResponse.Header or (if a response was returned at
  76547. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76548. // to check whether the returned error was because
  76549. // http.StatusNotModified was returned.
  76550. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76551. gensupport.SetOptions(c.urlParams_, opts...)
  76552. res, err := c.doRequest("json")
  76553. if res != nil && res.StatusCode == http.StatusNotModified {
  76554. if res.Body != nil {
  76555. res.Body.Close()
  76556. }
  76557. return nil, &googleapi.Error{
  76558. Code: res.StatusCode,
  76559. Header: res.Header,
  76560. }
  76561. }
  76562. if err != nil {
  76563. return nil, err
  76564. }
  76565. defer googleapi.CloseBody(res)
  76566. if err := googleapi.CheckResponse(res); err != nil {
  76567. return nil, err
  76568. }
  76569. ret := &Operation{
  76570. ServerResponse: googleapi.ServerResponse{
  76571. Header: res.Header,
  76572. HTTPStatusCode: res.StatusCode,
  76573. },
  76574. }
  76575. target := &ret
  76576. if err := gensupport.DecodeResponse(target, res); err != nil {
  76577. return nil, err
  76578. }
  76579. return ret, nil
  76580. // {
  76581. // "description": "Deletes the specified NodeGroup resource.",
  76582. // "httpMethod": "DELETE",
  76583. // "id": "compute.nodeGroups.delete",
  76584. // "parameterOrder": [
  76585. // "project",
  76586. // "zone",
  76587. // "nodeGroup"
  76588. // ],
  76589. // "parameters": {
  76590. // "nodeGroup": {
  76591. // "description": "Name of the NodeGroup resource to delete.",
  76592. // "location": "path",
  76593. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76594. // "required": true,
  76595. // "type": "string"
  76596. // },
  76597. // "project": {
  76598. // "description": "Project ID for this request.",
  76599. // "location": "path",
  76600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76601. // "required": true,
  76602. // "type": "string"
  76603. // },
  76604. // "requestId": {
  76605. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76606. // "location": "query",
  76607. // "type": "string"
  76608. // },
  76609. // "zone": {
  76610. // "description": "The name of the zone for this request.",
  76611. // "location": "path",
  76612. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76613. // "required": true,
  76614. // "type": "string"
  76615. // }
  76616. // },
  76617. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  76618. // "response": {
  76619. // "$ref": "Operation"
  76620. // },
  76621. // "scopes": [
  76622. // "https://www.googleapis.com/auth/cloud-platform",
  76623. // "https://www.googleapis.com/auth/compute"
  76624. // ]
  76625. // }
  76626. }
  76627. // method id "compute.nodeGroups.deleteNodes":
  76628. type NodeGroupsDeleteNodesCall struct {
  76629. s *Service
  76630. project string
  76631. zone string
  76632. nodeGroup string
  76633. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  76634. urlParams_ gensupport.URLParams
  76635. ctx_ context.Context
  76636. header_ http.Header
  76637. }
  76638. // DeleteNodes: Deletes specified nodes from the node group.
  76639. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  76640. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76641. c.project = project
  76642. c.zone = zone
  76643. c.nodeGroup = nodeGroup
  76644. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  76645. return c
  76646. }
  76647. // RequestId sets the optional parameter "requestId": An optional
  76648. // request ID to identify requests. Specify a unique request ID so that
  76649. // if you must retry your request, the server will know to ignore the
  76650. // request if it has already been completed.
  76651. //
  76652. // For example, consider a situation where you make an initial request
  76653. // and the request times out. If you make the request again with the
  76654. // same request ID, the server can check if original operation with the
  76655. // same request ID was received, and if so, will ignore the second
  76656. // request. This prevents clients from accidentally creating duplicate
  76657. // commitments.
  76658. //
  76659. // The request ID must be a valid UUID with the exception that zero UUID
  76660. // is not supported (00000000-0000-0000-0000-000000000000).
  76661. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  76662. c.urlParams_.Set("requestId", requestId)
  76663. return c
  76664. }
  76665. // Fields allows partial responses to be retrieved. See
  76666. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76667. // for more information.
  76668. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  76669. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76670. return c
  76671. }
  76672. // Context sets the context to be used in this call's Do method. Any
  76673. // pending HTTP request will be aborted if the provided context is
  76674. // canceled.
  76675. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  76676. c.ctx_ = ctx
  76677. return c
  76678. }
  76679. // Header returns an http.Header that can be modified by the caller to
  76680. // add HTTP headers to the request.
  76681. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  76682. if c.header_ == nil {
  76683. c.header_ = make(http.Header)
  76684. }
  76685. return c.header_
  76686. }
  76687. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  76688. reqHeaders := make(http.Header)
  76689. for k, v := range c.header_ {
  76690. reqHeaders[k] = v
  76691. }
  76692. reqHeaders.Set("User-Agent", c.s.userAgent())
  76693. var body io.Reader = nil
  76694. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  76695. if err != nil {
  76696. return nil, err
  76697. }
  76698. reqHeaders.Set("Content-Type", "application/json")
  76699. c.urlParams_.Set("alt", alt)
  76700. c.urlParams_.Set("prettyPrint", "false")
  76701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  76702. urls += "?" + c.urlParams_.Encode()
  76703. req, err := http.NewRequest("POST", urls, body)
  76704. if err != nil {
  76705. return nil, err
  76706. }
  76707. req.Header = reqHeaders
  76708. googleapi.Expand(req.URL, map[string]string{
  76709. "project": c.project,
  76710. "zone": c.zone,
  76711. "nodeGroup": c.nodeGroup,
  76712. })
  76713. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76714. }
  76715. // Do executes the "compute.nodeGroups.deleteNodes" call.
  76716. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76717. // status code is an error. Response headers are in either
  76718. // *Operation.ServerResponse.Header or (if a response was returned at
  76719. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76720. // to check whether the returned error was because
  76721. // http.StatusNotModified was returned.
  76722. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76723. gensupport.SetOptions(c.urlParams_, opts...)
  76724. res, err := c.doRequest("json")
  76725. if res != nil && res.StatusCode == http.StatusNotModified {
  76726. if res.Body != nil {
  76727. res.Body.Close()
  76728. }
  76729. return nil, &googleapi.Error{
  76730. Code: res.StatusCode,
  76731. Header: res.Header,
  76732. }
  76733. }
  76734. if err != nil {
  76735. return nil, err
  76736. }
  76737. defer googleapi.CloseBody(res)
  76738. if err := googleapi.CheckResponse(res); err != nil {
  76739. return nil, err
  76740. }
  76741. ret := &Operation{
  76742. ServerResponse: googleapi.ServerResponse{
  76743. Header: res.Header,
  76744. HTTPStatusCode: res.StatusCode,
  76745. },
  76746. }
  76747. target := &ret
  76748. if err := gensupport.DecodeResponse(target, res); err != nil {
  76749. return nil, err
  76750. }
  76751. return ret, nil
  76752. // {
  76753. // "description": "Deletes specified nodes from the node group.",
  76754. // "httpMethod": "POST",
  76755. // "id": "compute.nodeGroups.deleteNodes",
  76756. // "parameterOrder": [
  76757. // "project",
  76758. // "zone",
  76759. // "nodeGroup"
  76760. // ],
  76761. // "parameters": {
  76762. // "nodeGroup": {
  76763. // "description": "Name of the NodeGroup resource to delete.",
  76764. // "location": "path",
  76765. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76766. // "required": true,
  76767. // "type": "string"
  76768. // },
  76769. // "project": {
  76770. // "description": "Project ID for this request.",
  76771. // "location": "path",
  76772. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76773. // "required": true,
  76774. // "type": "string"
  76775. // },
  76776. // "requestId": {
  76777. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76778. // "location": "query",
  76779. // "type": "string"
  76780. // },
  76781. // "zone": {
  76782. // "description": "The name of the zone for this request.",
  76783. // "location": "path",
  76784. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76785. // "required": true,
  76786. // "type": "string"
  76787. // }
  76788. // },
  76789. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  76790. // "request": {
  76791. // "$ref": "NodeGroupsDeleteNodesRequest"
  76792. // },
  76793. // "response": {
  76794. // "$ref": "Operation"
  76795. // },
  76796. // "scopes": [
  76797. // "https://www.googleapis.com/auth/cloud-platform",
  76798. // "https://www.googleapis.com/auth/compute"
  76799. // ]
  76800. // }
  76801. }
  76802. // method id "compute.nodeGroups.get":
  76803. type NodeGroupsGetCall struct {
  76804. s *Service
  76805. project string
  76806. zone string
  76807. nodeGroup string
  76808. urlParams_ gensupport.URLParams
  76809. ifNoneMatch_ string
  76810. ctx_ context.Context
  76811. header_ http.Header
  76812. }
  76813. // Get: Returns the specified NodeGroup. Get a list of available
  76814. // NodeGroups by making a list() request. Note: the "nodes" field should
  76815. // not be used. Use nodeGroups.listNodes instead.
  76816. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  76817. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76818. c.project = project
  76819. c.zone = zone
  76820. c.nodeGroup = nodeGroup
  76821. return c
  76822. }
  76823. // Fields allows partial responses to be retrieved. See
  76824. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76825. // for more information.
  76826. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  76827. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76828. return c
  76829. }
  76830. // IfNoneMatch sets the optional parameter which makes the operation
  76831. // fail if the object's ETag matches the given value. This is useful for
  76832. // getting updates only after the object has changed since the last
  76833. // request. Use googleapi.IsNotModified to check whether the response
  76834. // error from Do is the result of In-None-Match.
  76835. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  76836. c.ifNoneMatch_ = entityTag
  76837. return c
  76838. }
  76839. // Context sets the context to be used in this call's Do method. Any
  76840. // pending HTTP request will be aborted if the provided context is
  76841. // canceled.
  76842. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  76843. c.ctx_ = ctx
  76844. return c
  76845. }
  76846. // Header returns an http.Header that can be modified by the caller to
  76847. // add HTTP headers to the request.
  76848. func (c *NodeGroupsGetCall) Header() http.Header {
  76849. if c.header_ == nil {
  76850. c.header_ = make(http.Header)
  76851. }
  76852. return c.header_
  76853. }
  76854. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  76855. reqHeaders := make(http.Header)
  76856. for k, v := range c.header_ {
  76857. reqHeaders[k] = v
  76858. }
  76859. reqHeaders.Set("User-Agent", c.s.userAgent())
  76860. if c.ifNoneMatch_ != "" {
  76861. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76862. }
  76863. var body io.Reader = nil
  76864. c.urlParams_.Set("alt", alt)
  76865. c.urlParams_.Set("prettyPrint", "false")
  76866. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  76867. urls += "?" + c.urlParams_.Encode()
  76868. req, err := http.NewRequest("GET", urls, body)
  76869. if err != nil {
  76870. return nil, err
  76871. }
  76872. req.Header = reqHeaders
  76873. googleapi.Expand(req.URL, map[string]string{
  76874. "project": c.project,
  76875. "zone": c.zone,
  76876. "nodeGroup": c.nodeGroup,
  76877. })
  76878. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76879. }
  76880. // Do executes the "compute.nodeGroups.get" call.
  76881. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  76882. // status code is an error. Response headers are in either
  76883. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  76884. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76885. // to check whether the returned error was because
  76886. // http.StatusNotModified was returned.
  76887. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  76888. gensupport.SetOptions(c.urlParams_, opts...)
  76889. res, err := c.doRequest("json")
  76890. if res != nil && res.StatusCode == http.StatusNotModified {
  76891. if res.Body != nil {
  76892. res.Body.Close()
  76893. }
  76894. return nil, &googleapi.Error{
  76895. Code: res.StatusCode,
  76896. Header: res.Header,
  76897. }
  76898. }
  76899. if err != nil {
  76900. return nil, err
  76901. }
  76902. defer googleapi.CloseBody(res)
  76903. if err := googleapi.CheckResponse(res); err != nil {
  76904. return nil, err
  76905. }
  76906. ret := &NodeGroup{
  76907. ServerResponse: googleapi.ServerResponse{
  76908. Header: res.Header,
  76909. HTTPStatusCode: res.StatusCode,
  76910. },
  76911. }
  76912. target := &ret
  76913. if err := gensupport.DecodeResponse(target, res); err != nil {
  76914. return nil, err
  76915. }
  76916. return ret, nil
  76917. // {
  76918. // "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.",
  76919. // "httpMethod": "GET",
  76920. // "id": "compute.nodeGroups.get",
  76921. // "parameterOrder": [
  76922. // "project",
  76923. // "zone",
  76924. // "nodeGroup"
  76925. // ],
  76926. // "parameters": {
  76927. // "nodeGroup": {
  76928. // "description": "Name of the node group to return.",
  76929. // "location": "path",
  76930. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76931. // "required": true,
  76932. // "type": "string"
  76933. // },
  76934. // "project": {
  76935. // "description": "Project ID for this request.",
  76936. // "location": "path",
  76937. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76938. // "required": true,
  76939. // "type": "string"
  76940. // },
  76941. // "zone": {
  76942. // "description": "The name of the zone for this request.",
  76943. // "location": "path",
  76944. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76945. // "required": true,
  76946. // "type": "string"
  76947. // }
  76948. // },
  76949. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  76950. // "response": {
  76951. // "$ref": "NodeGroup"
  76952. // },
  76953. // "scopes": [
  76954. // "https://www.googleapis.com/auth/cloud-platform",
  76955. // "https://www.googleapis.com/auth/compute",
  76956. // "https://www.googleapis.com/auth/compute.readonly"
  76957. // ]
  76958. // }
  76959. }
  76960. // method id "compute.nodeGroups.getIamPolicy":
  76961. type NodeGroupsGetIamPolicyCall struct {
  76962. s *Service
  76963. project string
  76964. zone string
  76965. resource string
  76966. urlParams_ gensupport.URLParams
  76967. ifNoneMatch_ string
  76968. ctx_ context.Context
  76969. header_ http.Header
  76970. }
  76971. // GetIamPolicy: Gets the access control policy for a resource. May be
  76972. // empty if no such policy or resource exists.
  76973. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  76974. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76975. c.project = project
  76976. c.zone = zone
  76977. c.resource = resource
  76978. return c
  76979. }
  76980. // Fields allows partial responses to be retrieved. See
  76981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76982. // for more information.
  76983. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  76984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76985. return c
  76986. }
  76987. // IfNoneMatch sets the optional parameter which makes the operation
  76988. // fail if the object's ETag matches the given value. This is useful for
  76989. // getting updates only after the object has changed since the last
  76990. // request. Use googleapi.IsNotModified to check whether the response
  76991. // error from Do is the result of In-None-Match.
  76992. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  76993. c.ifNoneMatch_ = entityTag
  76994. return c
  76995. }
  76996. // Context sets the context to be used in this call's Do method. Any
  76997. // pending HTTP request will be aborted if the provided context is
  76998. // canceled.
  76999. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  77000. c.ctx_ = ctx
  77001. return c
  77002. }
  77003. // Header returns an http.Header that can be modified by the caller to
  77004. // add HTTP headers to the request.
  77005. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  77006. if c.header_ == nil {
  77007. c.header_ = make(http.Header)
  77008. }
  77009. return c.header_
  77010. }
  77011. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  77012. reqHeaders := make(http.Header)
  77013. for k, v := range c.header_ {
  77014. reqHeaders[k] = v
  77015. }
  77016. reqHeaders.Set("User-Agent", c.s.userAgent())
  77017. if c.ifNoneMatch_ != "" {
  77018. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77019. }
  77020. var body io.Reader = nil
  77021. c.urlParams_.Set("alt", alt)
  77022. c.urlParams_.Set("prettyPrint", "false")
  77023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  77024. urls += "?" + c.urlParams_.Encode()
  77025. req, err := http.NewRequest("GET", urls, body)
  77026. if err != nil {
  77027. return nil, err
  77028. }
  77029. req.Header = reqHeaders
  77030. googleapi.Expand(req.URL, map[string]string{
  77031. "project": c.project,
  77032. "zone": c.zone,
  77033. "resource": c.resource,
  77034. })
  77035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77036. }
  77037. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  77038. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  77039. // code is an error. Response headers are in either
  77040. // *Policy.ServerResponse.Header or (if a response was returned at all)
  77041. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77042. // check whether the returned error was because http.StatusNotModified
  77043. // was returned.
  77044. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  77045. gensupport.SetOptions(c.urlParams_, opts...)
  77046. res, err := c.doRequest("json")
  77047. if res != nil && res.StatusCode == http.StatusNotModified {
  77048. if res.Body != nil {
  77049. res.Body.Close()
  77050. }
  77051. return nil, &googleapi.Error{
  77052. Code: res.StatusCode,
  77053. Header: res.Header,
  77054. }
  77055. }
  77056. if err != nil {
  77057. return nil, err
  77058. }
  77059. defer googleapi.CloseBody(res)
  77060. if err := googleapi.CheckResponse(res); err != nil {
  77061. return nil, err
  77062. }
  77063. ret := &Policy{
  77064. ServerResponse: googleapi.ServerResponse{
  77065. Header: res.Header,
  77066. HTTPStatusCode: res.StatusCode,
  77067. },
  77068. }
  77069. target := &ret
  77070. if err := gensupport.DecodeResponse(target, res); err != nil {
  77071. return nil, err
  77072. }
  77073. return ret, nil
  77074. // {
  77075. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  77076. // "httpMethod": "GET",
  77077. // "id": "compute.nodeGroups.getIamPolicy",
  77078. // "parameterOrder": [
  77079. // "project",
  77080. // "zone",
  77081. // "resource"
  77082. // ],
  77083. // "parameters": {
  77084. // "project": {
  77085. // "description": "Project ID for this request.",
  77086. // "location": "path",
  77087. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77088. // "required": true,
  77089. // "type": "string"
  77090. // },
  77091. // "resource": {
  77092. // "description": "Name or id of the resource for this request.",
  77093. // "location": "path",
  77094. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77095. // "required": true,
  77096. // "type": "string"
  77097. // },
  77098. // "zone": {
  77099. // "description": "The name of the zone for this request.",
  77100. // "location": "path",
  77101. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77102. // "required": true,
  77103. // "type": "string"
  77104. // }
  77105. // },
  77106. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  77107. // "response": {
  77108. // "$ref": "Policy"
  77109. // },
  77110. // "scopes": [
  77111. // "https://www.googleapis.com/auth/cloud-platform",
  77112. // "https://www.googleapis.com/auth/compute",
  77113. // "https://www.googleapis.com/auth/compute.readonly"
  77114. // ]
  77115. // }
  77116. }
  77117. // method id "compute.nodeGroups.insert":
  77118. type NodeGroupsInsertCall struct {
  77119. s *Service
  77120. project string
  77121. zone string
  77122. nodegroup *NodeGroup
  77123. urlParams_ gensupport.URLParams
  77124. ctx_ context.Context
  77125. header_ http.Header
  77126. }
  77127. // Insert: Creates a NodeGroup resource in the specified project using
  77128. // the data included in the request.
  77129. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  77130. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77131. c.project = project
  77132. c.zone = zone
  77133. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  77134. c.nodegroup = nodegroup
  77135. return c
  77136. }
  77137. // RequestId sets the optional parameter "requestId": An optional
  77138. // request ID to identify requests. Specify a unique request ID so that
  77139. // if you must retry your request, the server will know to ignore the
  77140. // request if it has already been completed.
  77141. //
  77142. // For example, consider a situation where you make an initial request
  77143. // and the request times out. If you make the request again with the
  77144. // same request ID, the server can check if original operation with the
  77145. // same request ID was received, and if so, will ignore the second
  77146. // request. This prevents clients from accidentally creating duplicate
  77147. // commitments.
  77148. //
  77149. // The request ID must be a valid UUID with the exception that zero UUID
  77150. // is not supported (00000000-0000-0000-0000-000000000000).
  77151. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  77152. c.urlParams_.Set("requestId", requestId)
  77153. return c
  77154. }
  77155. // Fields allows partial responses to be retrieved. See
  77156. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77157. // for more information.
  77158. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  77159. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77160. return c
  77161. }
  77162. // Context sets the context to be used in this call's Do method. Any
  77163. // pending HTTP request will be aborted if the provided context is
  77164. // canceled.
  77165. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  77166. c.ctx_ = ctx
  77167. return c
  77168. }
  77169. // Header returns an http.Header that can be modified by the caller to
  77170. // add HTTP headers to the request.
  77171. func (c *NodeGroupsInsertCall) Header() http.Header {
  77172. if c.header_ == nil {
  77173. c.header_ = make(http.Header)
  77174. }
  77175. return c.header_
  77176. }
  77177. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  77178. reqHeaders := make(http.Header)
  77179. for k, v := range c.header_ {
  77180. reqHeaders[k] = v
  77181. }
  77182. reqHeaders.Set("User-Agent", c.s.userAgent())
  77183. var body io.Reader = nil
  77184. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  77185. if err != nil {
  77186. return nil, err
  77187. }
  77188. reqHeaders.Set("Content-Type", "application/json")
  77189. c.urlParams_.Set("alt", alt)
  77190. c.urlParams_.Set("prettyPrint", "false")
  77191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  77192. urls += "?" + c.urlParams_.Encode()
  77193. req, err := http.NewRequest("POST", urls, body)
  77194. if err != nil {
  77195. return nil, err
  77196. }
  77197. req.Header = reqHeaders
  77198. googleapi.Expand(req.URL, map[string]string{
  77199. "project": c.project,
  77200. "zone": c.zone,
  77201. })
  77202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77203. }
  77204. // Do executes the "compute.nodeGroups.insert" call.
  77205. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77206. // status code is an error. Response headers are in either
  77207. // *Operation.ServerResponse.Header or (if a response was returned at
  77208. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77209. // to check whether the returned error was because
  77210. // http.StatusNotModified was returned.
  77211. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77212. gensupport.SetOptions(c.urlParams_, opts...)
  77213. res, err := c.doRequest("json")
  77214. if res != nil && res.StatusCode == http.StatusNotModified {
  77215. if res.Body != nil {
  77216. res.Body.Close()
  77217. }
  77218. return nil, &googleapi.Error{
  77219. Code: res.StatusCode,
  77220. Header: res.Header,
  77221. }
  77222. }
  77223. if err != nil {
  77224. return nil, err
  77225. }
  77226. defer googleapi.CloseBody(res)
  77227. if err := googleapi.CheckResponse(res); err != nil {
  77228. return nil, err
  77229. }
  77230. ret := &Operation{
  77231. ServerResponse: googleapi.ServerResponse{
  77232. Header: res.Header,
  77233. HTTPStatusCode: res.StatusCode,
  77234. },
  77235. }
  77236. target := &ret
  77237. if err := gensupport.DecodeResponse(target, res); err != nil {
  77238. return nil, err
  77239. }
  77240. return ret, nil
  77241. // {
  77242. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  77243. // "httpMethod": "POST",
  77244. // "id": "compute.nodeGroups.insert",
  77245. // "parameterOrder": [
  77246. // "project",
  77247. // "zone",
  77248. // "initialNodeCount"
  77249. // ],
  77250. // "parameters": {
  77251. // "initialNodeCount": {
  77252. // "description": "Initial count of nodes in the node group.",
  77253. // "format": "int32",
  77254. // "location": "query",
  77255. // "required": true,
  77256. // "type": "integer"
  77257. // },
  77258. // "project": {
  77259. // "description": "Project ID for this request.",
  77260. // "location": "path",
  77261. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77262. // "required": true,
  77263. // "type": "string"
  77264. // },
  77265. // "requestId": {
  77266. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77267. // "location": "query",
  77268. // "type": "string"
  77269. // },
  77270. // "zone": {
  77271. // "description": "The name of the zone for this request.",
  77272. // "location": "path",
  77273. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77274. // "required": true,
  77275. // "type": "string"
  77276. // }
  77277. // },
  77278. // "path": "{project}/zones/{zone}/nodeGroups",
  77279. // "request": {
  77280. // "$ref": "NodeGroup"
  77281. // },
  77282. // "response": {
  77283. // "$ref": "Operation"
  77284. // },
  77285. // "scopes": [
  77286. // "https://www.googleapis.com/auth/cloud-platform",
  77287. // "https://www.googleapis.com/auth/compute"
  77288. // ]
  77289. // }
  77290. }
  77291. // method id "compute.nodeGroups.list":
  77292. type NodeGroupsListCall struct {
  77293. s *Service
  77294. project string
  77295. zone string
  77296. urlParams_ gensupport.URLParams
  77297. ifNoneMatch_ string
  77298. ctx_ context.Context
  77299. header_ http.Header
  77300. }
  77301. // List: Retrieves a list of node groups available to the specified
  77302. // project. Note: use nodeGroups.listNodes for more details about each
  77303. // group.
  77304. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  77305. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77306. c.project = project
  77307. c.zone = zone
  77308. return c
  77309. }
  77310. // Filter sets the optional parameter "filter": A filter expression that
  77311. // filters resources listed in the response. The expression must specify
  77312. // the field name, a comparison operator, and the value that you want to
  77313. // use for filtering. The value must be a string, a number, or a
  77314. // boolean. The comparison operator must be either =, !=, >, or <.
  77315. //
  77316. // For example, if you are filtering Compute Engine instances, you can
  77317. // exclude instances named example-instance by specifying name !=
  77318. // example-instance.
  77319. //
  77320. // You can also filter nested fields. For example, you could specify
  77321. // scheduling.automaticRestart = false to include instances only if they
  77322. // are not scheduled for automatic restarts. You can use filtering on
  77323. // nested fields to filter based on resource labels.
  77324. //
  77325. // To filter on multiple expressions, provide each separate expression
  77326. // within parentheses. For example, (scheduling.automaticRestart = true)
  77327. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77328. // AND expression. However, you can include AND and OR expressions
  77329. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  77330. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  77331. // true).
  77332. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  77333. c.urlParams_.Set("filter", filter)
  77334. return c
  77335. }
  77336. // MaxResults sets the optional parameter "maxResults": The maximum
  77337. // number of results per page that should be returned. If the number of
  77338. // available results is larger than maxResults, Compute Engine returns a
  77339. // nextPageToken that can be used to get the next page of results in
  77340. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  77341. // (Default: 500)
  77342. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  77343. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  77344. return c
  77345. }
  77346. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  77347. // a certain order. By default, results are returned in alphanumerical
  77348. // order based on the resource name.
  77349. //
  77350. // You can also sort results in descending order based on the creation
  77351. // timestamp using orderBy="creationTimestamp desc". This sorts results
  77352. // based on the creationTimestamp field in reverse chronological order
  77353. // (newest result first). Use this to sort resources like operations so
  77354. // that the newest operation is returned first.
  77355. //
  77356. // Currently, only sorting by name or creationTimestamp desc is
  77357. // supported.
  77358. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  77359. c.urlParams_.Set("orderBy", orderBy)
  77360. return c
  77361. }
  77362. // PageToken sets the optional parameter "pageToken": Specifies a page
  77363. // token to use. Set pageToken to the nextPageToken returned by a
  77364. // previous list request to get the next page of results.
  77365. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  77366. c.urlParams_.Set("pageToken", pageToken)
  77367. return c
  77368. }
  77369. // Fields allows partial responses to be retrieved. See
  77370. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77371. // for more information.
  77372. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  77373. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77374. return c
  77375. }
  77376. // IfNoneMatch sets the optional parameter which makes the operation
  77377. // fail if the object's ETag matches the given value. This is useful for
  77378. // getting updates only after the object has changed since the last
  77379. // request. Use googleapi.IsNotModified to check whether the response
  77380. // error from Do is the result of In-None-Match.
  77381. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  77382. c.ifNoneMatch_ = entityTag
  77383. return c
  77384. }
  77385. // Context sets the context to be used in this call's Do method. Any
  77386. // pending HTTP request will be aborted if the provided context is
  77387. // canceled.
  77388. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  77389. c.ctx_ = ctx
  77390. return c
  77391. }
  77392. // Header returns an http.Header that can be modified by the caller to
  77393. // add HTTP headers to the request.
  77394. func (c *NodeGroupsListCall) Header() http.Header {
  77395. if c.header_ == nil {
  77396. c.header_ = make(http.Header)
  77397. }
  77398. return c.header_
  77399. }
  77400. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  77401. reqHeaders := make(http.Header)
  77402. for k, v := range c.header_ {
  77403. reqHeaders[k] = v
  77404. }
  77405. reqHeaders.Set("User-Agent", c.s.userAgent())
  77406. if c.ifNoneMatch_ != "" {
  77407. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77408. }
  77409. var body io.Reader = nil
  77410. c.urlParams_.Set("alt", alt)
  77411. c.urlParams_.Set("prettyPrint", "false")
  77412. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  77413. urls += "?" + c.urlParams_.Encode()
  77414. req, err := http.NewRequest("GET", urls, body)
  77415. if err != nil {
  77416. return nil, err
  77417. }
  77418. req.Header = reqHeaders
  77419. googleapi.Expand(req.URL, map[string]string{
  77420. "project": c.project,
  77421. "zone": c.zone,
  77422. })
  77423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77424. }
  77425. // Do executes the "compute.nodeGroups.list" call.
  77426. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  77427. // status code is an error. Response headers are in either
  77428. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  77429. // at all) in error.(*googleapi.Error).Header. Use
  77430. // googleapi.IsNotModified to check whether the returned error was
  77431. // because http.StatusNotModified was returned.
  77432. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  77433. gensupport.SetOptions(c.urlParams_, opts...)
  77434. res, err := c.doRequest("json")
  77435. if res != nil && res.StatusCode == http.StatusNotModified {
  77436. if res.Body != nil {
  77437. res.Body.Close()
  77438. }
  77439. return nil, &googleapi.Error{
  77440. Code: res.StatusCode,
  77441. Header: res.Header,
  77442. }
  77443. }
  77444. if err != nil {
  77445. return nil, err
  77446. }
  77447. defer googleapi.CloseBody(res)
  77448. if err := googleapi.CheckResponse(res); err != nil {
  77449. return nil, err
  77450. }
  77451. ret := &NodeGroupList{
  77452. ServerResponse: googleapi.ServerResponse{
  77453. Header: res.Header,
  77454. HTTPStatusCode: res.StatusCode,
  77455. },
  77456. }
  77457. target := &ret
  77458. if err := gensupport.DecodeResponse(target, res); err != nil {
  77459. return nil, err
  77460. }
  77461. return ret, nil
  77462. // {
  77463. // "description": "Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.",
  77464. // "httpMethod": "GET",
  77465. // "id": "compute.nodeGroups.list",
  77466. // "parameterOrder": [
  77467. // "project",
  77468. // "zone"
  77469. // ],
  77470. // "parameters": {
  77471. // "filter": {
  77472. // "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).",
  77473. // "location": "query",
  77474. // "type": "string"
  77475. // },
  77476. // "maxResults": {
  77477. // "default": "500",
  77478. // "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)",
  77479. // "format": "uint32",
  77480. // "location": "query",
  77481. // "minimum": "0",
  77482. // "type": "integer"
  77483. // },
  77484. // "orderBy": {
  77485. // "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.",
  77486. // "location": "query",
  77487. // "type": "string"
  77488. // },
  77489. // "pageToken": {
  77490. // "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.",
  77491. // "location": "query",
  77492. // "type": "string"
  77493. // },
  77494. // "project": {
  77495. // "description": "Project ID for this request.",
  77496. // "location": "path",
  77497. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77498. // "required": true,
  77499. // "type": "string"
  77500. // },
  77501. // "zone": {
  77502. // "description": "The name of the zone for this request.",
  77503. // "location": "path",
  77504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77505. // "required": true,
  77506. // "type": "string"
  77507. // }
  77508. // },
  77509. // "path": "{project}/zones/{zone}/nodeGroups",
  77510. // "response": {
  77511. // "$ref": "NodeGroupList"
  77512. // },
  77513. // "scopes": [
  77514. // "https://www.googleapis.com/auth/cloud-platform",
  77515. // "https://www.googleapis.com/auth/compute",
  77516. // "https://www.googleapis.com/auth/compute.readonly"
  77517. // ]
  77518. // }
  77519. }
  77520. // Pages invokes f for each page of results.
  77521. // A non-nil error returned from f will halt the iteration.
  77522. // The provided context supersedes any context provided to the Context method.
  77523. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  77524. c.ctx_ = ctx
  77525. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  77526. for {
  77527. x, err := c.Do()
  77528. if err != nil {
  77529. return err
  77530. }
  77531. if err := f(x); err != nil {
  77532. return err
  77533. }
  77534. if x.NextPageToken == "" {
  77535. return nil
  77536. }
  77537. c.PageToken(x.NextPageToken)
  77538. }
  77539. }
  77540. // method id "compute.nodeGroups.listNodes":
  77541. type NodeGroupsListNodesCall struct {
  77542. s *Service
  77543. project string
  77544. zone string
  77545. nodeGroup string
  77546. urlParams_ gensupport.URLParams
  77547. ctx_ context.Context
  77548. header_ http.Header
  77549. }
  77550. // ListNodes: Lists nodes in the node group.
  77551. func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall {
  77552. c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77553. c.project = project
  77554. c.zone = zone
  77555. c.nodeGroup = nodeGroup
  77556. return c
  77557. }
  77558. // Filter sets the optional parameter "filter": A filter expression that
  77559. // filters resources listed in the response. The expression must specify
  77560. // the field name, a comparison operator, and the value that you want to
  77561. // use for filtering. The value must be a string, a number, or a
  77562. // boolean. The comparison operator must be either =, !=, >, or <.
  77563. //
  77564. // For example, if you are filtering Compute Engine instances, you can
  77565. // exclude instances named example-instance by specifying name !=
  77566. // example-instance.
  77567. //
  77568. // You can also filter nested fields. For example, you could specify
  77569. // scheduling.automaticRestart = false to include instances only if they
  77570. // are not scheduled for automatic restarts. You can use filtering on
  77571. // nested fields to filter based on resource labels.
  77572. //
  77573. // To filter on multiple expressions, provide each separate expression
  77574. // within parentheses. For example, (scheduling.automaticRestart = true)
  77575. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77576. // AND expression. However, you can include AND and OR expressions
  77577. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  77578. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  77579. // true).
  77580. func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall {
  77581. c.urlParams_.Set("filter", filter)
  77582. return c
  77583. }
  77584. // MaxResults sets the optional parameter "maxResults": The maximum
  77585. // number of results per page that should be returned. If the number of
  77586. // available results is larger than maxResults, Compute Engine returns a
  77587. // nextPageToken that can be used to get the next page of results in
  77588. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  77589. // (Default: 500)
  77590. func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall {
  77591. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  77592. return c
  77593. }
  77594. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  77595. // a certain order. By default, results are returned in alphanumerical
  77596. // order based on the resource name.
  77597. //
  77598. // You can also sort results in descending order based on the creation
  77599. // timestamp using orderBy="creationTimestamp desc". This sorts results
  77600. // based on the creationTimestamp field in reverse chronological order
  77601. // (newest result first). Use this to sort resources like operations so
  77602. // that the newest operation is returned first.
  77603. //
  77604. // Currently, only sorting by name or creationTimestamp desc is
  77605. // supported.
  77606. func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall {
  77607. c.urlParams_.Set("orderBy", orderBy)
  77608. return c
  77609. }
  77610. // PageToken sets the optional parameter "pageToken": Specifies a page
  77611. // token to use. Set pageToken to the nextPageToken returned by a
  77612. // previous list request to get the next page of results.
  77613. func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall {
  77614. c.urlParams_.Set("pageToken", pageToken)
  77615. return c
  77616. }
  77617. // Fields allows partial responses to be retrieved. See
  77618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77619. // for more information.
  77620. func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall {
  77621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77622. return c
  77623. }
  77624. // Context sets the context to be used in this call's Do method. Any
  77625. // pending HTTP request will be aborted if the provided context is
  77626. // canceled.
  77627. func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall {
  77628. c.ctx_ = ctx
  77629. return c
  77630. }
  77631. // Header returns an http.Header that can be modified by the caller to
  77632. // add HTTP headers to the request.
  77633. func (c *NodeGroupsListNodesCall) Header() http.Header {
  77634. if c.header_ == nil {
  77635. c.header_ = make(http.Header)
  77636. }
  77637. return c.header_
  77638. }
  77639. func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) {
  77640. reqHeaders := make(http.Header)
  77641. for k, v := range c.header_ {
  77642. reqHeaders[k] = v
  77643. }
  77644. reqHeaders.Set("User-Agent", c.s.userAgent())
  77645. var body io.Reader = nil
  77646. c.urlParams_.Set("alt", alt)
  77647. c.urlParams_.Set("prettyPrint", "false")
  77648. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")
  77649. urls += "?" + c.urlParams_.Encode()
  77650. req, err := http.NewRequest("POST", urls, body)
  77651. if err != nil {
  77652. return nil, err
  77653. }
  77654. req.Header = reqHeaders
  77655. googleapi.Expand(req.URL, map[string]string{
  77656. "project": c.project,
  77657. "zone": c.zone,
  77658. "nodeGroup": c.nodeGroup,
  77659. })
  77660. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77661. }
  77662. // Do executes the "compute.nodeGroups.listNodes" call.
  77663. // Exactly one of *NodeGroupsListNodes or error will be non-nil. Any
  77664. // non-2xx status code is an error. Response headers are in either
  77665. // *NodeGroupsListNodes.ServerResponse.Header or (if a response was
  77666. // returned at all) in error.(*googleapi.Error).Header. Use
  77667. // googleapi.IsNotModified to check whether the returned error was
  77668. // because http.StatusNotModified was returned.
  77669. func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, error) {
  77670. gensupport.SetOptions(c.urlParams_, opts...)
  77671. res, err := c.doRequest("json")
  77672. if res != nil && res.StatusCode == http.StatusNotModified {
  77673. if res.Body != nil {
  77674. res.Body.Close()
  77675. }
  77676. return nil, &googleapi.Error{
  77677. Code: res.StatusCode,
  77678. Header: res.Header,
  77679. }
  77680. }
  77681. if err != nil {
  77682. return nil, err
  77683. }
  77684. defer googleapi.CloseBody(res)
  77685. if err := googleapi.CheckResponse(res); err != nil {
  77686. return nil, err
  77687. }
  77688. ret := &NodeGroupsListNodes{
  77689. ServerResponse: googleapi.ServerResponse{
  77690. Header: res.Header,
  77691. HTTPStatusCode: res.StatusCode,
  77692. },
  77693. }
  77694. target := &ret
  77695. if err := gensupport.DecodeResponse(target, res); err != nil {
  77696. return nil, err
  77697. }
  77698. return ret, nil
  77699. // {
  77700. // "description": "Lists nodes in the node group.",
  77701. // "httpMethod": "POST",
  77702. // "id": "compute.nodeGroups.listNodes",
  77703. // "parameterOrder": [
  77704. // "project",
  77705. // "zone",
  77706. // "nodeGroup"
  77707. // ],
  77708. // "parameters": {
  77709. // "filter": {
  77710. // "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).",
  77711. // "location": "query",
  77712. // "type": "string"
  77713. // },
  77714. // "maxResults": {
  77715. // "default": "500",
  77716. // "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)",
  77717. // "format": "uint32",
  77718. // "location": "query",
  77719. // "minimum": "0",
  77720. // "type": "integer"
  77721. // },
  77722. // "nodeGroup": {
  77723. // "description": "Name of the NodeGroup resource whose nodes you want to list.",
  77724. // "location": "path",
  77725. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77726. // "required": true,
  77727. // "type": "string"
  77728. // },
  77729. // "orderBy": {
  77730. // "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.",
  77731. // "location": "query",
  77732. // "type": "string"
  77733. // },
  77734. // "pageToken": {
  77735. // "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.",
  77736. // "location": "query",
  77737. // "type": "string"
  77738. // },
  77739. // "project": {
  77740. // "description": "Project ID for this request.",
  77741. // "location": "path",
  77742. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77743. // "required": true,
  77744. // "type": "string"
  77745. // },
  77746. // "zone": {
  77747. // "description": "The name of the zone for this request.",
  77748. // "location": "path",
  77749. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77750. // "required": true,
  77751. // "type": "string"
  77752. // }
  77753. // },
  77754. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
  77755. // "response": {
  77756. // "$ref": "NodeGroupsListNodes"
  77757. // },
  77758. // "scopes": [
  77759. // "https://www.googleapis.com/auth/cloud-platform",
  77760. // "https://www.googleapis.com/auth/compute",
  77761. // "https://www.googleapis.com/auth/compute.readonly"
  77762. // ]
  77763. // }
  77764. }
  77765. // Pages invokes f for each page of results.
  77766. // A non-nil error returned from f will halt the iteration.
  77767. // The provided context supersedes any context provided to the Context method.
  77768. func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error {
  77769. c.ctx_ = ctx
  77770. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  77771. for {
  77772. x, err := c.Do()
  77773. if err != nil {
  77774. return err
  77775. }
  77776. if err := f(x); err != nil {
  77777. return err
  77778. }
  77779. if x.NextPageToken == "" {
  77780. return nil
  77781. }
  77782. c.PageToken(x.NextPageToken)
  77783. }
  77784. }
  77785. // method id "compute.nodeGroups.setIamPolicy":
  77786. type NodeGroupsSetIamPolicyCall struct {
  77787. s *Service
  77788. project string
  77789. zone string
  77790. resource string
  77791. zonesetpolicyrequest *ZoneSetPolicyRequest
  77792. urlParams_ gensupport.URLParams
  77793. ctx_ context.Context
  77794. header_ http.Header
  77795. }
  77796. // SetIamPolicy: Sets the access control policy on the specified
  77797. // resource. Replaces any existing policy.
  77798. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  77799. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77800. c.project = project
  77801. c.zone = zone
  77802. c.resource = resource
  77803. c.zonesetpolicyrequest = zonesetpolicyrequest
  77804. return c
  77805. }
  77806. // Fields allows partial responses to be retrieved. See
  77807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77808. // for more information.
  77809. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  77810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77811. return c
  77812. }
  77813. // Context sets the context to be used in this call's Do method. Any
  77814. // pending HTTP request will be aborted if the provided context is
  77815. // canceled.
  77816. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  77817. c.ctx_ = ctx
  77818. return c
  77819. }
  77820. // Header returns an http.Header that can be modified by the caller to
  77821. // add HTTP headers to the request.
  77822. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  77823. if c.header_ == nil {
  77824. c.header_ = make(http.Header)
  77825. }
  77826. return c.header_
  77827. }
  77828. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  77829. reqHeaders := make(http.Header)
  77830. for k, v := range c.header_ {
  77831. reqHeaders[k] = v
  77832. }
  77833. reqHeaders.Set("User-Agent", c.s.userAgent())
  77834. var body io.Reader = nil
  77835. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  77836. if err != nil {
  77837. return nil, err
  77838. }
  77839. reqHeaders.Set("Content-Type", "application/json")
  77840. c.urlParams_.Set("alt", alt)
  77841. c.urlParams_.Set("prettyPrint", "false")
  77842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  77843. urls += "?" + c.urlParams_.Encode()
  77844. req, err := http.NewRequest("POST", urls, body)
  77845. if err != nil {
  77846. return nil, err
  77847. }
  77848. req.Header = reqHeaders
  77849. googleapi.Expand(req.URL, map[string]string{
  77850. "project": c.project,
  77851. "zone": c.zone,
  77852. "resource": c.resource,
  77853. })
  77854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77855. }
  77856. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  77857. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  77858. // code is an error. Response headers are in either
  77859. // *Policy.ServerResponse.Header or (if a response was returned at all)
  77860. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77861. // check whether the returned error was because http.StatusNotModified
  77862. // was returned.
  77863. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  77864. gensupport.SetOptions(c.urlParams_, opts...)
  77865. res, err := c.doRequest("json")
  77866. if res != nil && res.StatusCode == http.StatusNotModified {
  77867. if res.Body != nil {
  77868. res.Body.Close()
  77869. }
  77870. return nil, &googleapi.Error{
  77871. Code: res.StatusCode,
  77872. Header: res.Header,
  77873. }
  77874. }
  77875. if err != nil {
  77876. return nil, err
  77877. }
  77878. defer googleapi.CloseBody(res)
  77879. if err := googleapi.CheckResponse(res); err != nil {
  77880. return nil, err
  77881. }
  77882. ret := &Policy{
  77883. ServerResponse: googleapi.ServerResponse{
  77884. Header: res.Header,
  77885. HTTPStatusCode: res.StatusCode,
  77886. },
  77887. }
  77888. target := &ret
  77889. if err := gensupport.DecodeResponse(target, res); err != nil {
  77890. return nil, err
  77891. }
  77892. return ret, nil
  77893. // {
  77894. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  77895. // "httpMethod": "POST",
  77896. // "id": "compute.nodeGroups.setIamPolicy",
  77897. // "parameterOrder": [
  77898. // "project",
  77899. // "zone",
  77900. // "resource"
  77901. // ],
  77902. // "parameters": {
  77903. // "project": {
  77904. // "description": "Project ID for this request.",
  77905. // "location": "path",
  77906. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77907. // "required": true,
  77908. // "type": "string"
  77909. // },
  77910. // "resource": {
  77911. // "description": "Name or id of the resource for this request.",
  77912. // "location": "path",
  77913. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77914. // "required": true,
  77915. // "type": "string"
  77916. // },
  77917. // "zone": {
  77918. // "description": "The name of the zone for this request.",
  77919. // "location": "path",
  77920. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77921. // "required": true,
  77922. // "type": "string"
  77923. // }
  77924. // },
  77925. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  77926. // "request": {
  77927. // "$ref": "ZoneSetPolicyRequest"
  77928. // },
  77929. // "response": {
  77930. // "$ref": "Policy"
  77931. // },
  77932. // "scopes": [
  77933. // "https://www.googleapis.com/auth/cloud-platform",
  77934. // "https://www.googleapis.com/auth/compute"
  77935. // ]
  77936. // }
  77937. }
  77938. // method id "compute.nodeGroups.setNodeTemplate":
  77939. type NodeGroupsSetNodeTemplateCall struct {
  77940. s *Service
  77941. project string
  77942. zone string
  77943. nodeGroup string
  77944. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  77945. urlParams_ gensupport.URLParams
  77946. ctx_ context.Context
  77947. header_ http.Header
  77948. }
  77949. // SetNodeTemplate: Updates the node template of the node group.
  77950. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  77951. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77952. c.project = project
  77953. c.zone = zone
  77954. c.nodeGroup = nodeGroup
  77955. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  77956. return c
  77957. }
  77958. // RequestId sets the optional parameter "requestId": An optional
  77959. // request ID to identify requests. Specify a unique request ID so that
  77960. // if you must retry your request, the server will know to ignore the
  77961. // request if it has already been completed.
  77962. //
  77963. // For example, consider a situation where you make an initial request
  77964. // and the request times out. If you make the request again with the
  77965. // same request ID, the server can check if original operation with the
  77966. // same request ID was received, and if so, will ignore the second
  77967. // request. This prevents clients from accidentally creating duplicate
  77968. // commitments.
  77969. //
  77970. // The request ID must be a valid UUID with the exception that zero UUID
  77971. // is not supported (00000000-0000-0000-0000-000000000000).
  77972. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  77973. c.urlParams_.Set("requestId", requestId)
  77974. return c
  77975. }
  77976. // Fields allows partial responses to be retrieved. See
  77977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77978. // for more information.
  77979. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  77980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77981. return c
  77982. }
  77983. // Context sets the context to be used in this call's Do method. Any
  77984. // pending HTTP request will be aborted if the provided context is
  77985. // canceled.
  77986. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  77987. c.ctx_ = ctx
  77988. return c
  77989. }
  77990. // Header returns an http.Header that can be modified by the caller to
  77991. // add HTTP headers to the request.
  77992. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  77993. if c.header_ == nil {
  77994. c.header_ = make(http.Header)
  77995. }
  77996. return c.header_
  77997. }
  77998. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  77999. reqHeaders := make(http.Header)
  78000. for k, v := range c.header_ {
  78001. reqHeaders[k] = v
  78002. }
  78003. reqHeaders.Set("User-Agent", c.s.userAgent())
  78004. var body io.Reader = nil
  78005. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  78006. if err != nil {
  78007. return nil, err
  78008. }
  78009. reqHeaders.Set("Content-Type", "application/json")
  78010. c.urlParams_.Set("alt", alt)
  78011. c.urlParams_.Set("prettyPrint", "false")
  78012. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  78013. urls += "?" + c.urlParams_.Encode()
  78014. req, err := http.NewRequest("POST", urls, body)
  78015. if err != nil {
  78016. return nil, err
  78017. }
  78018. req.Header = reqHeaders
  78019. googleapi.Expand(req.URL, map[string]string{
  78020. "project": c.project,
  78021. "zone": c.zone,
  78022. "nodeGroup": c.nodeGroup,
  78023. })
  78024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78025. }
  78026. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  78027. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78028. // status code is an error. Response headers are in either
  78029. // *Operation.ServerResponse.Header or (if a response was returned at
  78030. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78031. // to check whether the returned error was because
  78032. // http.StatusNotModified was returned.
  78033. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78034. gensupport.SetOptions(c.urlParams_, opts...)
  78035. res, err := c.doRequest("json")
  78036. if res != nil && res.StatusCode == http.StatusNotModified {
  78037. if res.Body != nil {
  78038. res.Body.Close()
  78039. }
  78040. return nil, &googleapi.Error{
  78041. Code: res.StatusCode,
  78042. Header: res.Header,
  78043. }
  78044. }
  78045. if err != nil {
  78046. return nil, err
  78047. }
  78048. defer googleapi.CloseBody(res)
  78049. if err := googleapi.CheckResponse(res); err != nil {
  78050. return nil, err
  78051. }
  78052. ret := &Operation{
  78053. ServerResponse: googleapi.ServerResponse{
  78054. Header: res.Header,
  78055. HTTPStatusCode: res.StatusCode,
  78056. },
  78057. }
  78058. target := &ret
  78059. if err := gensupport.DecodeResponse(target, res); err != nil {
  78060. return nil, err
  78061. }
  78062. return ret, nil
  78063. // {
  78064. // "description": "Updates the node template of the node group.",
  78065. // "httpMethod": "POST",
  78066. // "id": "compute.nodeGroups.setNodeTemplate",
  78067. // "parameterOrder": [
  78068. // "project",
  78069. // "zone",
  78070. // "nodeGroup"
  78071. // ],
  78072. // "parameters": {
  78073. // "nodeGroup": {
  78074. // "description": "Name of the NodeGroup resource to update.",
  78075. // "location": "path",
  78076. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78077. // "required": true,
  78078. // "type": "string"
  78079. // },
  78080. // "project": {
  78081. // "description": "Project ID for this request.",
  78082. // "location": "path",
  78083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78084. // "required": true,
  78085. // "type": "string"
  78086. // },
  78087. // "requestId": {
  78088. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78089. // "location": "query",
  78090. // "type": "string"
  78091. // },
  78092. // "zone": {
  78093. // "description": "The name of the zone for this request.",
  78094. // "location": "path",
  78095. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78096. // "required": true,
  78097. // "type": "string"
  78098. // }
  78099. // },
  78100. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  78101. // "request": {
  78102. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  78103. // },
  78104. // "response": {
  78105. // "$ref": "Operation"
  78106. // },
  78107. // "scopes": [
  78108. // "https://www.googleapis.com/auth/cloud-platform",
  78109. // "https://www.googleapis.com/auth/compute"
  78110. // ]
  78111. // }
  78112. }
  78113. // method id "compute.nodeGroups.testIamPermissions":
  78114. type NodeGroupsTestIamPermissionsCall struct {
  78115. s *Service
  78116. project string
  78117. zone string
  78118. resource string
  78119. testpermissionsrequest *TestPermissionsRequest
  78120. urlParams_ gensupport.URLParams
  78121. ctx_ context.Context
  78122. header_ http.Header
  78123. }
  78124. // TestIamPermissions: Returns permissions that a caller has on the
  78125. // specified resource.
  78126. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  78127. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78128. c.project = project
  78129. c.zone = zone
  78130. c.resource = resource
  78131. c.testpermissionsrequest = testpermissionsrequest
  78132. return c
  78133. }
  78134. // Fields allows partial responses to be retrieved. See
  78135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78136. // for more information.
  78137. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  78138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78139. return c
  78140. }
  78141. // Context sets the context to be used in this call's Do method. Any
  78142. // pending HTTP request will be aborted if the provided context is
  78143. // canceled.
  78144. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  78145. c.ctx_ = ctx
  78146. return c
  78147. }
  78148. // Header returns an http.Header that can be modified by the caller to
  78149. // add HTTP headers to the request.
  78150. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  78151. if c.header_ == nil {
  78152. c.header_ = make(http.Header)
  78153. }
  78154. return c.header_
  78155. }
  78156. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  78157. reqHeaders := make(http.Header)
  78158. for k, v := range c.header_ {
  78159. reqHeaders[k] = v
  78160. }
  78161. reqHeaders.Set("User-Agent", c.s.userAgent())
  78162. var body io.Reader = nil
  78163. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  78164. if err != nil {
  78165. return nil, err
  78166. }
  78167. reqHeaders.Set("Content-Type", "application/json")
  78168. c.urlParams_.Set("alt", alt)
  78169. c.urlParams_.Set("prettyPrint", "false")
  78170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  78171. urls += "?" + c.urlParams_.Encode()
  78172. req, err := http.NewRequest("POST", urls, body)
  78173. if err != nil {
  78174. return nil, err
  78175. }
  78176. req.Header = reqHeaders
  78177. googleapi.Expand(req.URL, map[string]string{
  78178. "project": c.project,
  78179. "zone": c.zone,
  78180. "resource": c.resource,
  78181. })
  78182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78183. }
  78184. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  78185. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  78186. // non-2xx status code is an error. Response headers are in either
  78187. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  78188. // returned at all) in error.(*googleapi.Error).Header. Use
  78189. // googleapi.IsNotModified to check whether the returned error was
  78190. // because http.StatusNotModified was returned.
  78191. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  78192. gensupport.SetOptions(c.urlParams_, opts...)
  78193. res, err := c.doRequest("json")
  78194. if res != nil && res.StatusCode == http.StatusNotModified {
  78195. if res.Body != nil {
  78196. res.Body.Close()
  78197. }
  78198. return nil, &googleapi.Error{
  78199. Code: res.StatusCode,
  78200. Header: res.Header,
  78201. }
  78202. }
  78203. if err != nil {
  78204. return nil, err
  78205. }
  78206. defer googleapi.CloseBody(res)
  78207. if err := googleapi.CheckResponse(res); err != nil {
  78208. return nil, err
  78209. }
  78210. ret := &TestPermissionsResponse{
  78211. ServerResponse: googleapi.ServerResponse{
  78212. Header: res.Header,
  78213. HTTPStatusCode: res.StatusCode,
  78214. },
  78215. }
  78216. target := &ret
  78217. if err := gensupport.DecodeResponse(target, res); err != nil {
  78218. return nil, err
  78219. }
  78220. return ret, nil
  78221. // {
  78222. // "description": "Returns permissions that a caller has on the specified resource.",
  78223. // "httpMethod": "POST",
  78224. // "id": "compute.nodeGroups.testIamPermissions",
  78225. // "parameterOrder": [
  78226. // "project",
  78227. // "zone",
  78228. // "resource"
  78229. // ],
  78230. // "parameters": {
  78231. // "project": {
  78232. // "description": "Project ID for this request.",
  78233. // "location": "path",
  78234. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78235. // "required": true,
  78236. // "type": "string"
  78237. // },
  78238. // "resource": {
  78239. // "description": "Name or id of the resource for this request.",
  78240. // "location": "path",
  78241. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78242. // "required": true,
  78243. // "type": "string"
  78244. // },
  78245. // "zone": {
  78246. // "description": "The name of the zone for this request.",
  78247. // "location": "path",
  78248. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78249. // "required": true,
  78250. // "type": "string"
  78251. // }
  78252. // },
  78253. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  78254. // "request": {
  78255. // "$ref": "TestPermissionsRequest"
  78256. // },
  78257. // "response": {
  78258. // "$ref": "TestPermissionsResponse"
  78259. // },
  78260. // "scopes": [
  78261. // "https://www.googleapis.com/auth/cloud-platform",
  78262. // "https://www.googleapis.com/auth/compute",
  78263. // "https://www.googleapis.com/auth/compute.readonly"
  78264. // ]
  78265. // }
  78266. }
  78267. // method id "compute.nodeTemplates.aggregatedList":
  78268. type NodeTemplatesAggregatedListCall struct {
  78269. s *Service
  78270. project string
  78271. urlParams_ gensupport.URLParams
  78272. ifNoneMatch_ string
  78273. ctx_ context.Context
  78274. header_ http.Header
  78275. }
  78276. // AggregatedList: Retrieves an aggregated list of node templates.
  78277. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  78278. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78279. c.project = project
  78280. return c
  78281. }
  78282. // Filter sets the optional parameter "filter": A filter expression that
  78283. // filters resources listed in the response. The expression must specify
  78284. // the field name, a comparison operator, and the value that you want to
  78285. // use for filtering. The value must be a string, a number, or a
  78286. // boolean. The comparison operator must be either =, !=, >, or <.
  78287. //
  78288. // For example, if you are filtering Compute Engine instances, you can
  78289. // exclude instances named example-instance by specifying name !=
  78290. // example-instance.
  78291. //
  78292. // You can also filter nested fields. For example, you could specify
  78293. // scheduling.automaticRestart = false to include instances only if they
  78294. // are not scheduled for automatic restarts. You can use filtering on
  78295. // nested fields to filter based on resource labels.
  78296. //
  78297. // To filter on multiple expressions, provide each separate expression
  78298. // within parentheses. For example, (scheduling.automaticRestart = true)
  78299. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78300. // AND expression. However, you can include AND and OR expressions
  78301. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78302. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78303. // true).
  78304. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  78305. c.urlParams_.Set("filter", filter)
  78306. return c
  78307. }
  78308. // MaxResults sets the optional parameter "maxResults": The maximum
  78309. // number of results per page that should be returned. If the number of
  78310. // available results is larger than maxResults, Compute Engine returns a
  78311. // nextPageToken that can be used to get the next page of results in
  78312. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78313. // (Default: 500)
  78314. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  78315. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78316. return c
  78317. }
  78318. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78319. // a certain order. By default, results are returned in alphanumerical
  78320. // order based on the resource name.
  78321. //
  78322. // You can also sort results in descending order based on the creation
  78323. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78324. // based on the creationTimestamp field in reverse chronological order
  78325. // (newest result first). Use this to sort resources like operations so
  78326. // that the newest operation is returned first.
  78327. //
  78328. // Currently, only sorting by name or creationTimestamp desc is
  78329. // supported.
  78330. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  78331. c.urlParams_.Set("orderBy", orderBy)
  78332. return c
  78333. }
  78334. // PageToken sets the optional parameter "pageToken": Specifies a page
  78335. // token to use. Set pageToken to the nextPageToken returned by a
  78336. // previous list request to get the next page of results.
  78337. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  78338. c.urlParams_.Set("pageToken", pageToken)
  78339. return c
  78340. }
  78341. // Fields allows partial responses to be retrieved. See
  78342. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78343. // for more information.
  78344. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  78345. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78346. return c
  78347. }
  78348. // IfNoneMatch sets the optional parameter which makes the operation
  78349. // fail if the object's ETag matches the given value. This is useful for
  78350. // getting updates only after the object has changed since the last
  78351. // request. Use googleapi.IsNotModified to check whether the response
  78352. // error from Do is the result of In-None-Match.
  78353. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  78354. c.ifNoneMatch_ = entityTag
  78355. return c
  78356. }
  78357. // Context sets the context to be used in this call's Do method. Any
  78358. // pending HTTP request will be aborted if the provided context is
  78359. // canceled.
  78360. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  78361. c.ctx_ = ctx
  78362. return c
  78363. }
  78364. // Header returns an http.Header that can be modified by the caller to
  78365. // add HTTP headers to the request.
  78366. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  78367. if c.header_ == nil {
  78368. c.header_ = make(http.Header)
  78369. }
  78370. return c.header_
  78371. }
  78372. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  78373. reqHeaders := make(http.Header)
  78374. for k, v := range c.header_ {
  78375. reqHeaders[k] = v
  78376. }
  78377. reqHeaders.Set("User-Agent", c.s.userAgent())
  78378. if c.ifNoneMatch_ != "" {
  78379. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78380. }
  78381. var body io.Reader = nil
  78382. c.urlParams_.Set("alt", alt)
  78383. c.urlParams_.Set("prettyPrint", "false")
  78384. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  78385. urls += "?" + c.urlParams_.Encode()
  78386. req, err := http.NewRequest("GET", urls, body)
  78387. if err != nil {
  78388. return nil, err
  78389. }
  78390. req.Header = reqHeaders
  78391. googleapi.Expand(req.URL, map[string]string{
  78392. "project": c.project,
  78393. })
  78394. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78395. }
  78396. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  78397. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  78398. // Any non-2xx status code is an error. Response headers are in either
  78399. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  78400. // was returned at all) in error.(*googleapi.Error).Header. Use
  78401. // googleapi.IsNotModified to check whether the returned error was
  78402. // because http.StatusNotModified was returned.
  78403. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  78404. gensupport.SetOptions(c.urlParams_, opts...)
  78405. res, err := c.doRequest("json")
  78406. if res != nil && res.StatusCode == http.StatusNotModified {
  78407. if res.Body != nil {
  78408. res.Body.Close()
  78409. }
  78410. return nil, &googleapi.Error{
  78411. Code: res.StatusCode,
  78412. Header: res.Header,
  78413. }
  78414. }
  78415. if err != nil {
  78416. return nil, err
  78417. }
  78418. defer googleapi.CloseBody(res)
  78419. if err := googleapi.CheckResponse(res); err != nil {
  78420. return nil, err
  78421. }
  78422. ret := &NodeTemplateAggregatedList{
  78423. ServerResponse: googleapi.ServerResponse{
  78424. Header: res.Header,
  78425. HTTPStatusCode: res.StatusCode,
  78426. },
  78427. }
  78428. target := &ret
  78429. if err := gensupport.DecodeResponse(target, res); err != nil {
  78430. return nil, err
  78431. }
  78432. return ret, nil
  78433. // {
  78434. // "description": "Retrieves an aggregated list of node templates.",
  78435. // "httpMethod": "GET",
  78436. // "id": "compute.nodeTemplates.aggregatedList",
  78437. // "parameterOrder": [
  78438. // "project"
  78439. // ],
  78440. // "parameters": {
  78441. // "filter": {
  78442. // "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).",
  78443. // "location": "query",
  78444. // "type": "string"
  78445. // },
  78446. // "maxResults": {
  78447. // "default": "500",
  78448. // "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)",
  78449. // "format": "uint32",
  78450. // "location": "query",
  78451. // "minimum": "0",
  78452. // "type": "integer"
  78453. // },
  78454. // "orderBy": {
  78455. // "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.",
  78456. // "location": "query",
  78457. // "type": "string"
  78458. // },
  78459. // "pageToken": {
  78460. // "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.",
  78461. // "location": "query",
  78462. // "type": "string"
  78463. // },
  78464. // "project": {
  78465. // "description": "Project ID for this request.",
  78466. // "location": "path",
  78467. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78468. // "required": true,
  78469. // "type": "string"
  78470. // }
  78471. // },
  78472. // "path": "{project}/aggregated/nodeTemplates",
  78473. // "response": {
  78474. // "$ref": "NodeTemplateAggregatedList"
  78475. // },
  78476. // "scopes": [
  78477. // "https://www.googleapis.com/auth/cloud-platform",
  78478. // "https://www.googleapis.com/auth/compute",
  78479. // "https://www.googleapis.com/auth/compute.readonly"
  78480. // ]
  78481. // }
  78482. }
  78483. // Pages invokes f for each page of results.
  78484. // A non-nil error returned from f will halt the iteration.
  78485. // The provided context supersedes any context provided to the Context method.
  78486. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  78487. c.ctx_ = ctx
  78488. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78489. for {
  78490. x, err := c.Do()
  78491. if err != nil {
  78492. return err
  78493. }
  78494. if err := f(x); err != nil {
  78495. return err
  78496. }
  78497. if x.NextPageToken == "" {
  78498. return nil
  78499. }
  78500. c.PageToken(x.NextPageToken)
  78501. }
  78502. }
  78503. // method id "compute.nodeTemplates.delete":
  78504. type NodeTemplatesDeleteCall struct {
  78505. s *Service
  78506. project string
  78507. region string
  78508. nodeTemplate string
  78509. urlParams_ gensupport.URLParams
  78510. ctx_ context.Context
  78511. header_ http.Header
  78512. }
  78513. // Delete: Deletes the specified NodeTemplate resource.
  78514. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  78515. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78516. c.project = project
  78517. c.region = region
  78518. c.nodeTemplate = nodeTemplate
  78519. return c
  78520. }
  78521. // RequestId sets the optional parameter "requestId": An optional
  78522. // request ID to identify requests. Specify a unique request ID so that
  78523. // if you must retry your request, the server will know to ignore the
  78524. // request if it has already been completed.
  78525. //
  78526. // For example, consider a situation where you make an initial request
  78527. // and the request times out. If you make the request again with the
  78528. // same request ID, the server can check if original operation with the
  78529. // same request ID was received, and if so, will ignore the second
  78530. // request. This prevents clients from accidentally creating duplicate
  78531. // commitments.
  78532. //
  78533. // The request ID must be a valid UUID with the exception that zero UUID
  78534. // is not supported (00000000-0000-0000-0000-000000000000).
  78535. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  78536. c.urlParams_.Set("requestId", requestId)
  78537. return c
  78538. }
  78539. // Fields allows partial responses to be retrieved. See
  78540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78541. // for more information.
  78542. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  78543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78544. return c
  78545. }
  78546. // Context sets the context to be used in this call's Do method. Any
  78547. // pending HTTP request will be aborted if the provided context is
  78548. // canceled.
  78549. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  78550. c.ctx_ = ctx
  78551. return c
  78552. }
  78553. // Header returns an http.Header that can be modified by the caller to
  78554. // add HTTP headers to the request.
  78555. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  78556. if c.header_ == nil {
  78557. c.header_ = make(http.Header)
  78558. }
  78559. return c.header_
  78560. }
  78561. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  78562. reqHeaders := make(http.Header)
  78563. for k, v := range c.header_ {
  78564. reqHeaders[k] = v
  78565. }
  78566. reqHeaders.Set("User-Agent", c.s.userAgent())
  78567. var body io.Reader = nil
  78568. c.urlParams_.Set("alt", alt)
  78569. c.urlParams_.Set("prettyPrint", "false")
  78570. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  78571. urls += "?" + c.urlParams_.Encode()
  78572. req, err := http.NewRequest("DELETE", urls, body)
  78573. if err != nil {
  78574. return nil, err
  78575. }
  78576. req.Header = reqHeaders
  78577. googleapi.Expand(req.URL, map[string]string{
  78578. "project": c.project,
  78579. "region": c.region,
  78580. "nodeTemplate": c.nodeTemplate,
  78581. })
  78582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78583. }
  78584. // Do executes the "compute.nodeTemplates.delete" call.
  78585. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78586. // status code is an error. Response headers are in either
  78587. // *Operation.ServerResponse.Header or (if a response was returned at
  78588. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78589. // to check whether the returned error was because
  78590. // http.StatusNotModified was returned.
  78591. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78592. gensupport.SetOptions(c.urlParams_, opts...)
  78593. res, err := c.doRequest("json")
  78594. if res != nil && res.StatusCode == http.StatusNotModified {
  78595. if res.Body != nil {
  78596. res.Body.Close()
  78597. }
  78598. return nil, &googleapi.Error{
  78599. Code: res.StatusCode,
  78600. Header: res.Header,
  78601. }
  78602. }
  78603. if err != nil {
  78604. return nil, err
  78605. }
  78606. defer googleapi.CloseBody(res)
  78607. if err := googleapi.CheckResponse(res); err != nil {
  78608. return nil, err
  78609. }
  78610. ret := &Operation{
  78611. ServerResponse: googleapi.ServerResponse{
  78612. Header: res.Header,
  78613. HTTPStatusCode: res.StatusCode,
  78614. },
  78615. }
  78616. target := &ret
  78617. if err := gensupport.DecodeResponse(target, res); err != nil {
  78618. return nil, err
  78619. }
  78620. return ret, nil
  78621. // {
  78622. // "description": "Deletes the specified NodeTemplate resource.",
  78623. // "httpMethod": "DELETE",
  78624. // "id": "compute.nodeTemplates.delete",
  78625. // "parameterOrder": [
  78626. // "project",
  78627. // "region",
  78628. // "nodeTemplate"
  78629. // ],
  78630. // "parameters": {
  78631. // "nodeTemplate": {
  78632. // "description": "Name of the NodeTemplate resource to delete.",
  78633. // "location": "path",
  78634. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78635. // "required": true,
  78636. // "type": "string"
  78637. // },
  78638. // "project": {
  78639. // "description": "Project ID for this request.",
  78640. // "location": "path",
  78641. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78642. // "required": true,
  78643. // "type": "string"
  78644. // },
  78645. // "region": {
  78646. // "description": "The name of the region for this request.",
  78647. // "location": "path",
  78648. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78649. // "required": true,
  78650. // "type": "string"
  78651. // },
  78652. // "requestId": {
  78653. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78654. // "location": "query",
  78655. // "type": "string"
  78656. // }
  78657. // },
  78658. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  78659. // "response": {
  78660. // "$ref": "Operation"
  78661. // },
  78662. // "scopes": [
  78663. // "https://www.googleapis.com/auth/cloud-platform",
  78664. // "https://www.googleapis.com/auth/compute"
  78665. // ]
  78666. // }
  78667. }
  78668. // method id "compute.nodeTemplates.get":
  78669. type NodeTemplatesGetCall struct {
  78670. s *Service
  78671. project string
  78672. region string
  78673. nodeTemplate string
  78674. urlParams_ gensupport.URLParams
  78675. ifNoneMatch_ string
  78676. ctx_ context.Context
  78677. header_ http.Header
  78678. }
  78679. // Get: Returns the specified node template. Gets a list of available
  78680. // node templates by making a list() request.
  78681. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  78682. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78683. c.project = project
  78684. c.region = region
  78685. c.nodeTemplate = nodeTemplate
  78686. return c
  78687. }
  78688. // Fields allows partial responses to be retrieved. See
  78689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78690. // for more information.
  78691. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  78692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78693. return c
  78694. }
  78695. // IfNoneMatch sets the optional parameter which makes the operation
  78696. // fail if the object's ETag matches the given value. This is useful for
  78697. // getting updates only after the object has changed since the last
  78698. // request. Use googleapi.IsNotModified to check whether the response
  78699. // error from Do is the result of In-None-Match.
  78700. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  78701. c.ifNoneMatch_ = entityTag
  78702. return c
  78703. }
  78704. // Context sets the context to be used in this call's Do method. Any
  78705. // pending HTTP request will be aborted if the provided context is
  78706. // canceled.
  78707. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  78708. c.ctx_ = ctx
  78709. return c
  78710. }
  78711. // Header returns an http.Header that can be modified by the caller to
  78712. // add HTTP headers to the request.
  78713. func (c *NodeTemplatesGetCall) Header() http.Header {
  78714. if c.header_ == nil {
  78715. c.header_ = make(http.Header)
  78716. }
  78717. return c.header_
  78718. }
  78719. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  78720. reqHeaders := make(http.Header)
  78721. for k, v := range c.header_ {
  78722. reqHeaders[k] = v
  78723. }
  78724. reqHeaders.Set("User-Agent", c.s.userAgent())
  78725. if c.ifNoneMatch_ != "" {
  78726. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78727. }
  78728. var body io.Reader = nil
  78729. c.urlParams_.Set("alt", alt)
  78730. c.urlParams_.Set("prettyPrint", "false")
  78731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  78732. urls += "?" + c.urlParams_.Encode()
  78733. req, err := http.NewRequest("GET", urls, body)
  78734. if err != nil {
  78735. return nil, err
  78736. }
  78737. req.Header = reqHeaders
  78738. googleapi.Expand(req.URL, map[string]string{
  78739. "project": c.project,
  78740. "region": c.region,
  78741. "nodeTemplate": c.nodeTemplate,
  78742. })
  78743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78744. }
  78745. // Do executes the "compute.nodeTemplates.get" call.
  78746. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  78747. // status code is an error. Response headers are in either
  78748. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  78749. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78750. // to check whether the returned error was because
  78751. // http.StatusNotModified was returned.
  78752. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  78753. gensupport.SetOptions(c.urlParams_, opts...)
  78754. res, err := c.doRequest("json")
  78755. if res != nil && res.StatusCode == http.StatusNotModified {
  78756. if res.Body != nil {
  78757. res.Body.Close()
  78758. }
  78759. return nil, &googleapi.Error{
  78760. Code: res.StatusCode,
  78761. Header: res.Header,
  78762. }
  78763. }
  78764. if err != nil {
  78765. return nil, err
  78766. }
  78767. defer googleapi.CloseBody(res)
  78768. if err := googleapi.CheckResponse(res); err != nil {
  78769. return nil, err
  78770. }
  78771. ret := &NodeTemplate{
  78772. ServerResponse: googleapi.ServerResponse{
  78773. Header: res.Header,
  78774. HTTPStatusCode: res.StatusCode,
  78775. },
  78776. }
  78777. target := &ret
  78778. if err := gensupport.DecodeResponse(target, res); err != nil {
  78779. return nil, err
  78780. }
  78781. return ret, nil
  78782. // {
  78783. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  78784. // "httpMethod": "GET",
  78785. // "id": "compute.nodeTemplates.get",
  78786. // "parameterOrder": [
  78787. // "project",
  78788. // "region",
  78789. // "nodeTemplate"
  78790. // ],
  78791. // "parameters": {
  78792. // "nodeTemplate": {
  78793. // "description": "Name of the node template to return.",
  78794. // "location": "path",
  78795. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78796. // "required": true,
  78797. // "type": "string"
  78798. // },
  78799. // "project": {
  78800. // "description": "Project ID for this request.",
  78801. // "location": "path",
  78802. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78803. // "required": true,
  78804. // "type": "string"
  78805. // },
  78806. // "region": {
  78807. // "description": "The name of the region for this request.",
  78808. // "location": "path",
  78809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78810. // "required": true,
  78811. // "type": "string"
  78812. // }
  78813. // },
  78814. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  78815. // "response": {
  78816. // "$ref": "NodeTemplate"
  78817. // },
  78818. // "scopes": [
  78819. // "https://www.googleapis.com/auth/cloud-platform",
  78820. // "https://www.googleapis.com/auth/compute",
  78821. // "https://www.googleapis.com/auth/compute.readonly"
  78822. // ]
  78823. // }
  78824. }
  78825. // method id "compute.nodeTemplates.getIamPolicy":
  78826. type NodeTemplatesGetIamPolicyCall struct {
  78827. s *Service
  78828. project string
  78829. region string
  78830. resource string
  78831. urlParams_ gensupport.URLParams
  78832. ifNoneMatch_ string
  78833. ctx_ context.Context
  78834. header_ http.Header
  78835. }
  78836. // GetIamPolicy: Gets the access control policy for a resource. May be
  78837. // empty if no such policy or resource exists.
  78838. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  78839. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78840. c.project = project
  78841. c.region = region
  78842. c.resource = resource
  78843. return c
  78844. }
  78845. // Fields allows partial responses to be retrieved. See
  78846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78847. // for more information.
  78848. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  78849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78850. return c
  78851. }
  78852. // IfNoneMatch sets the optional parameter which makes the operation
  78853. // fail if the object's ETag matches the given value. This is useful for
  78854. // getting updates only after the object has changed since the last
  78855. // request. Use googleapi.IsNotModified to check whether the response
  78856. // error from Do is the result of In-None-Match.
  78857. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  78858. c.ifNoneMatch_ = entityTag
  78859. return c
  78860. }
  78861. // Context sets the context to be used in this call's Do method. Any
  78862. // pending HTTP request will be aborted if the provided context is
  78863. // canceled.
  78864. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  78865. c.ctx_ = ctx
  78866. return c
  78867. }
  78868. // Header returns an http.Header that can be modified by the caller to
  78869. // add HTTP headers to the request.
  78870. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  78871. if c.header_ == nil {
  78872. c.header_ = make(http.Header)
  78873. }
  78874. return c.header_
  78875. }
  78876. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  78877. reqHeaders := make(http.Header)
  78878. for k, v := range c.header_ {
  78879. reqHeaders[k] = v
  78880. }
  78881. reqHeaders.Set("User-Agent", c.s.userAgent())
  78882. if c.ifNoneMatch_ != "" {
  78883. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78884. }
  78885. var body io.Reader = nil
  78886. c.urlParams_.Set("alt", alt)
  78887. c.urlParams_.Set("prettyPrint", "false")
  78888. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  78889. urls += "?" + c.urlParams_.Encode()
  78890. req, err := http.NewRequest("GET", urls, body)
  78891. if err != nil {
  78892. return nil, err
  78893. }
  78894. req.Header = reqHeaders
  78895. googleapi.Expand(req.URL, map[string]string{
  78896. "project": c.project,
  78897. "region": c.region,
  78898. "resource": c.resource,
  78899. })
  78900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78901. }
  78902. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  78903. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  78904. // code is an error. Response headers are in either
  78905. // *Policy.ServerResponse.Header or (if a response was returned at all)
  78906. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  78907. // check whether the returned error was because http.StatusNotModified
  78908. // was returned.
  78909. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  78910. gensupport.SetOptions(c.urlParams_, opts...)
  78911. res, err := c.doRequest("json")
  78912. if res != nil && res.StatusCode == http.StatusNotModified {
  78913. if res.Body != nil {
  78914. res.Body.Close()
  78915. }
  78916. return nil, &googleapi.Error{
  78917. Code: res.StatusCode,
  78918. Header: res.Header,
  78919. }
  78920. }
  78921. if err != nil {
  78922. return nil, err
  78923. }
  78924. defer googleapi.CloseBody(res)
  78925. if err := googleapi.CheckResponse(res); err != nil {
  78926. return nil, err
  78927. }
  78928. ret := &Policy{
  78929. ServerResponse: googleapi.ServerResponse{
  78930. Header: res.Header,
  78931. HTTPStatusCode: res.StatusCode,
  78932. },
  78933. }
  78934. target := &ret
  78935. if err := gensupport.DecodeResponse(target, res); err != nil {
  78936. return nil, err
  78937. }
  78938. return ret, nil
  78939. // {
  78940. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  78941. // "httpMethod": "GET",
  78942. // "id": "compute.nodeTemplates.getIamPolicy",
  78943. // "parameterOrder": [
  78944. // "project",
  78945. // "region",
  78946. // "resource"
  78947. // ],
  78948. // "parameters": {
  78949. // "project": {
  78950. // "description": "Project ID for this request.",
  78951. // "location": "path",
  78952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78953. // "required": true,
  78954. // "type": "string"
  78955. // },
  78956. // "region": {
  78957. // "description": "The name of the region for this request.",
  78958. // "location": "path",
  78959. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78960. // "required": true,
  78961. // "type": "string"
  78962. // },
  78963. // "resource": {
  78964. // "description": "Name or id of the resource for this request.",
  78965. // "location": "path",
  78966. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78967. // "required": true,
  78968. // "type": "string"
  78969. // }
  78970. // },
  78971. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  78972. // "response": {
  78973. // "$ref": "Policy"
  78974. // },
  78975. // "scopes": [
  78976. // "https://www.googleapis.com/auth/cloud-platform",
  78977. // "https://www.googleapis.com/auth/compute",
  78978. // "https://www.googleapis.com/auth/compute.readonly"
  78979. // ]
  78980. // }
  78981. }
  78982. // method id "compute.nodeTemplates.insert":
  78983. type NodeTemplatesInsertCall struct {
  78984. s *Service
  78985. project string
  78986. region string
  78987. nodetemplate *NodeTemplate
  78988. urlParams_ gensupport.URLParams
  78989. ctx_ context.Context
  78990. header_ http.Header
  78991. }
  78992. // Insert: Creates a NodeTemplate resource in the specified project
  78993. // using the data included in the request.
  78994. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  78995. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78996. c.project = project
  78997. c.region = region
  78998. c.nodetemplate = nodetemplate
  78999. return c
  79000. }
  79001. // RequestId sets the optional parameter "requestId": An optional
  79002. // request ID to identify requests. Specify a unique request ID so that
  79003. // if you must retry your request, the server will know to ignore the
  79004. // request if it has already been completed.
  79005. //
  79006. // For example, consider a situation where you make an initial request
  79007. // and the request times out. If you make the request again with the
  79008. // same request ID, the server can check if original operation with the
  79009. // same request ID was received, and if so, will ignore the second
  79010. // request. This prevents clients from accidentally creating duplicate
  79011. // commitments.
  79012. //
  79013. // The request ID must be a valid UUID with the exception that zero UUID
  79014. // is not supported (00000000-0000-0000-0000-000000000000).
  79015. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  79016. c.urlParams_.Set("requestId", requestId)
  79017. return c
  79018. }
  79019. // Fields allows partial responses to be retrieved. See
  79020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79021. // for more information.
  79022. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  79023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79024. return c
  79025. }
  79026. // Context sets the context to be used in this call's Do method. Any
  79027. // pending HTTP request will be aborted if the provided context is
  79028. // canceled.
  79029. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  79030. c.ctx_ = ctx
  79031. return c
  79032. }
  79033. // Header returns an http.Header that can be modified by the caller to
  79034. // add HTTP headers to the request.
  79035. func (c *NodeTemplatesInsertCall) Header() http.Header {
  79036. if c.header_ == nil {
  79037. c.header_ = make(http.Header)
  79038. }
  79039. return c.header_
  79040. }
  79041. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  79042. reqHeaders := make(http.Header)
  79043. for k, v := range c.header_ {
  79044. reqHeaders[k] = v
  79045. }
  79046. reqHeaders.Set("User-Agent", c.s.userAgent())
  79047. var body io.Reader = nil
  79048. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  79049. if err != nil {
  79050. return nil, err
  79051. }
  79052. reqHeaders.Set("Content-Type", "application/json")
  79053. c.urlParams_.Set("alt", alt)
  79054. c.urlParams_.Set("prettyPrint", "false")
  79055. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  79056. urls += "?" + c.urlParams_.Encode()
  79057. req, err := http.NewRequest("POST", urls, body)
  79058. if err != nil {
  79059. return nil, err
  79060. }
  79061. req.Header = reqHeaders
  79062. googleapi.Expand(req.URL, map[string]string{
  79063. "project": c.project,
  79064. "region": c.region,
  79065. })
  79066. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79067. }
  79068. // Do executes the "compute.nodeTemplates.insert" call.
  79069. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79070. // status code is an error. Response headers are in either
  79071. // *Operation.ServerResponse.Header or (if a response was returned at
  79072. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79073. // to check whether the returned error was because
  79074. // http.StatusNotModified was returned.
  79075. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79076. gensupport.SetOptions(c.urlParams_, opts...)
  79077. res, err := c.doRequest("json")
  79078. if res != nil && res.StatusCode == http.StatusNotModified {
  79079. if res.Body != nil {
  79080. res.Body.Close()
  79081. }
  79082. return nil, &googleapi.Error{
  79083. Code: res.StatusCode,
  79084. Header: res.Header,
  79085. }
  79086. }
  79087. if err != nil {
  79088. return nil, err
  79089. }
  79090. defer googleapi.CloseBody(res)
  79091. if err := googleapi.CheckResponse(res); err != nil {
  79092. return nil, err
  79093. }
  79094. ret := &Operation{
  79095. ServerResponse: googleapi.ServerResponse{
  79096. Header: res.Header,
  79097. HTTPStatusCode: res.StatusCode,
  79098. },
  79099. }
  79100. target := &ret
  79101. if err := gensupport.DecodeResponse(target, res); err != nil {
  79102. return nil, err
  79103. }
  79104. return ret, nil
  79105. // {
  79106. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  79107. // "httpMethod": "POST",
  79108. // "id": "compute.nodeTemplates.insert",
  79109. // "parameterOrder": [
  79110. // "project",
  79111. // "region"
  79112. // ],
  79113. // "parameters": {
  79114. // "project": {
  79115. // "description": "Project ID for this request.",
  79116. // "location": "path",
  79117. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79118. // "required": true,
  79119. // "type": "string"
  79120. // },
  79121. // "region": {
  79122. // "description": "The name of the region for this request.",
  79123. // "location": "path",
  79124. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79125. // "required": true,
  79126. // "type": "string"
  79127. // },
  79128. // "requestId": {
  79129. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79130. // "location": "query",
  79131. // "type": "string"
  79132. // }
  79133. // },
  79134. // "path": "{project}/regions/{region}/nodeTemplates",
  79135. // "request": {
  79136. // "$ref": "NodeTemplate"
  79137. // },
  79138. // "response": {
  79139. // "$ref": "Operation"
  79140. // },
  79141. // "scopes": [
  79142. // "https://www.googleapis.com/auth/cloud-platform",
  79143. // "https://www.googleapis.com/auth/compute"
  79144. // ]
  79145. // }
  79146. }
  79147. // method id "compute.nodeTemplates.list":
  79148. type NodeTemplatesListCall struct {
  79149. s *Service
  79150. project string
  79151. region string
  79152. urlParams_ gensupport.URLParams
  79153. ifNoneMatch_ string
  79154. ctx_ context.Context
  79155. header_ http.Header
  79156. }
  79157. // List: Retrieves a list of node templates available to the specified
  79158. // project.
  79159. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  79160. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79161. c.project = project
  79162. c.region = region
  79163. return c
  79164. }
  79165. // Filter sets the optional parameter "filter": A filter expression that
  79166. // filters resources listed in the response. The expression must specify
  79167. // the field name, a comparison operator, and the value that you want to
  79168. // use for filtering. The value must be a string, a number, or a
  79169. // boolean. The comparison operator must be either =, !=, >, or <.
  79170. //
  79171. // For example, if you are filtering Compute Engine instances, you can
  79172. // exclude instances named example-instance by specifying name !=
  79173. // example-instance.
  79174. //
  79175. // You can also filter nested fields. For example, you could specify
  79176. // scheduling.automaticRestart = false to include instances only if they
  79177. // are not scheduled for automatic restarts. You can use filtering on
  79178. // nested fields to filter based on resource labels.
  79179. //
  79180. // To filter on multiple expressions, provide each separate expression
  79181. // within parentheses. For example, (scheduling.automaticRestart = true)
  79182. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79183. // AND expression. However, you can include AND and OR expressions
  79184. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79185. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79186. // true).
  79187. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  79188. c.urlParams_.Set("filter", filter)
  79189. return c
  79190. }
  79191. // MaxResults sets the optional parameter "maxResults": The maximum
  79192. // number of results per page that should be returned. If the number of
  79193. // available results is larger than maxResults, Compute Engine returns a
  79194. // nextPageToken that can be used to get the next page of results in
  79195. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79196. // (Default: 500)
  79197. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  79198. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79199. return c
  79200. }
  79201. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79202. // a certain order. By default, results are returned in alphanumerical
  79203. // order based on the resource name.
  79204. //
  79205. // You can also sort results in descending order based on the creation
  79206. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79207. // based on the creationTimestamp field in reverse chronological order
  79208. // (newest result first). Use this to sort resources like operations so
  79209. // that the newest operation is returned first.
  79210. //
  79211. // Currently, only sorting by name or creationTimestamp desc is
  79212. // supported.
  79213. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  79214. c.urlParams_.Set("orderBy", orderBy)
  79215. return c
  79216. }
  79217. // PageToken sets the optional parameter "pageToken": Specifies a page
  79218. // token to use. Set pageToken to the nextPageToken returned by a
  79219. // previous list request to get the next page of results.
  79220. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  79221. c.urlParams_.Set("pageToken", pageToken)
  79222. return c
  79223. }
  79224. // Fields allows partial responses to be retrieved. See
  79225. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79226. // for more information.
  79227. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  79228. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79229. return c
  79230. }
  79231. // IfNoneMatch sets the optional parameter which makes the operation
  79232. // fail if the object's ETag matches the given value. This is useful for
  79233. // getting updates only after the object has changed since the last
  79234. // request. Use googleapi.IsNotModified to check whether the response
  79235. // error from Do is the result of In-None-Match.
  79236. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  79237. c.ifNoneMatch_ = entityTag
  79238. return c
  79239. }
  79240. // Context sets the context to be used in this call's Do method. Any
  79241. // pending HTTP request will be aborted if the provided context is
  79242. // canceled.
  79243. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  79244. c.ctx_ = ctx
  79245. return c
  79246. }
  79247. // Header returns an http.Header that can be modified by the caller to
  79248. // add HTTP headers to the request.
  79249. func (c *NodeTemplatesListCall) Header() http.Header {
  79250. if c.header_ == nil {
  79251. c.header_ = make(http.Header)
  79252. }
  79253. return c.header_
  79254. }
  79255. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  79256. reqHeaders := make(http.Header)
  79257. for k, v := range c.header_ {
  79258. reqHeaders[k] = v
  79259. }
  79260. reqHeaders.Set("User-Agent", c.s.userAgent())
  79261. if c.ifNoneMatch_ != "" {
  79262. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79263. }
  79264. var body io.Reader = nil
  79265. c.urlParams_.Set("alt", alt)
  79266. c.urlParams_.Set("prettyPrint", "false")
  79267. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  79268. urls += "?" + c.urlParams_.Encode()
  79269. req, err := http.NewRequest("GET", urls, body)
  79270. if err != nil {
  79271. return nil, err
  79272. }
  79273. req.Header = reqHeaders
  79274. googleapi.Expand(req.URL, map[string]string{
  79275. "project": c.project,
  79276. "region": c.region,
  79277. })
  79278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79279. }
  79280. // Do executes the "compute.nodeTemplates.list" call.
  79281. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  79282. // non-2xx status code is an error. Response headers are in either
  79283. // *NodeTemplateList.ServerResponse.Header or (if a response was
  79284. // returned at all) in error.(*googleapi.Error).Header. Use
  79285. // googleapi.IsNotModified to check whether the returned error was
  79286. // because http.StatusNotModified was returned.
  79287. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  79288. gensupport.SetOptions(c.urlParams_, opts...)
  79289. res, err := c.doRequest("json")
  79290. if res != nil && res.StatusCode == http.StatusNotModified {
  79291. if res.Body != nil {
  79292. res.Body.Close()
  79293. }
  79294. return nil, &googleapi.Error{
  79295. Code: res.StatusCode,
  79296. Header: res.Header,
  79297. }
  79298. }
  79299. if err != nil {
  79300. return nil, err
  79301. }
  79302. defer googleapi.CloseBody(res)
  79303. if err := googleapi.CheckResponse(res); err != nil {
  79304. return nil, err
  79305. }
  79306. ret := &NodeTemplateList{
  79307. ServerResponse: googleapi.ServerResponse{
  79308. Header: res.Header,
  79309. HTTPStatusCode: res.StatusCode,
  79310. },
  79311. }
  79312. target := &ret
  79313. if err := gensupport.DecodeResponse(target, res); err != nil {
  79314. return nil, err
  79315. }
  79316. return ret, nil
  79317. // {
  79318. // "description": "Retrieves a list of node templates available to the specified project.",
  79319. // "httpMethod": "GET",
  79320. // "id": "compute.nodeTemplates.list",
  79321. // "parameterOrder": [
  79322. // "project",
  79323. // "region"
  79324. // ],
  79325. // "parameters": {
  79326. // "filter": {
  79327. // "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).",
  79328. // "location": "query",
  79329. // "type": "string"
  79330. // },
  79331. // "maxResults": {
  79332. // "default": "500",
  79333. // "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)",
  79334. // "format": "uint32",
  79335. // "location": "query",
  79336. // "minimum": "0",
  79337. // "type": "integer"
  79338. // },
  79339. // "orderBy": {
  79340. // "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.",
  79341. // "location": "query",
  79342. // "type": "string"
  79343. // },
  79344. // "pageToken": {
  79345. // "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.",
  79346. // "location": "query",
  79347. // "type": "string"
  79348. // },
  79349. // "project": {
  79350. // "description": "Project ID for this request.",
  79351. // "location": "path",
  79352. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79353. // "required": true,
  79354. // "type": "string"
  79355. // },
  79356. // "region": {
  79357. // "description": "The name of the region for this request.",
  79358. // "location": "path",
  79359. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79360. // "required": true,
  79361. // "type": "string"
  79362. // }
  79363. // },
  79364. // "path": "{project}/regions/{region}/nodeTemplates",
  79365. // "response": {
  79366. // "$ref": "NodeTemplateList"
  79367. // },
  79368. // "scopes": [
  79369. // "https://www.googleapis.com/auth/cloud-platform",
  79370. // "https://www.googleapis.com/auth/compute",
  79371. // "https://www.googleapis.com/auth/compute.readonly"
  79372. // ]
  79373. // }
  79374. }
  79375. // Pages invokes f for each page of results.
  79376. // A non-nil error returned from f will halt the iteration.
  79377. // The provided context supersedes any context provided to the Context method.
  79378. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  79379. c.ctx_ = ctx
  79380. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79381. for {
  79382. x, err := c.Do()
  79383. if err != nil {
  79384. return err
  79385. }
  79386. if err := f(x); err != nil {
  79387. return err
  79388. }
  79389. if x.NextPageToken == "" {
  79390. return nil
  79391. }
  79392. c.PageToken(x.NextPageToken)
  79393. }
  79394. }
  79395. // method id "compute.nodeTemplates.setIamPolicy":
  79396. type NodeTemplatesSetIamPolicyCall struct {
  79397. s *Service
  79398. project string
  79399. region string
  79400. resource string
  79401. regionsetpolicyrequest *RegionSetPolicyRequest
  79402. urlParams_ gensupport.URLParams
  79403. ctx_ context.Context
  79404. header_ http.Header
  79405. }
  79406. // SetIamPolicy: Sets the access control policy on the specified
  79407. // resource. Replaces any existing policy.
  79408. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  79409. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79410. c.project = project
  79411. c.region = region
  79412. c.resource = resource
  79413. c.regionsetpolicyrequest = regionsetpolicyrequest
  79414. return c
  79415. }
  79416. // Fields allows partial responses to be retrieved. See
  79417. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79418. // for more information.
  79419. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  79420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79421. return c
  79422. }
  79423. // Context sets the context to be used in this call's Do method. Any
  79424. // pending HTTP request will be aborted if the provided context is
  79425. // canceled.
  79426. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  79427. c.ctx_ = ctx
  79428. return c
  79429. }
  79430. // Header returns an http.Header that can be modified by the caller to
  79431. // add HTTP headers to the request.
  79432. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  79433. if c.header_ == nil {
  79434. c.header_ = make(http.Header)
  79435. }
  79436. return c.header_
  79437. }
  79438. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  79439. reqHeaders := make(http.Header)
  79440. for k, v := range c.header_ {
  79441. reqHeaders[k] = v
  79442. }
  79443. reqHeaders.Set("User-Agent", c.s.userAgent())
  79444. var body io.Reader = nil
  79445. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  79446. if err != nil {
  79447. return nil, err
  79448. }
  79449. reqHeaders.Set("Content-Type", "application/json")
  79450. c.urlParams_.Set("alt", alt)
  79451. c.urlParams_.Set("prettyPrint", "false")
  79452. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  79453. urls += "?" + c.urlParams_.Encode()
  79454. req, err := http.NewRequest("POST", urls, body)
  79455. if err != nil {
  79456. return nil, err
  79457. }
  79458. req.Header = reqHeaders
  79459. googleapi.Expand(req.URL, map[string]string{
  79460. "project": c.project,
  79461. "region": c.region,
  79462. "resource": c.resource,
  79463. })
  79464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79465. }
  79466. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  79467. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  79468. // code is an error. Response headers are in either
  79469. // *Policy.ServerResponse.Header or (if a response was returned at all)
  79470. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  79471. // check whether the returned error was because http.StatusNotModified
  79472. // was returned.
  79473. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  79474. gensupport.SetOptions(c.urlParams_, opts...)
  79475. res, err := c.doRequest("json")
  79476. if res != nil && res.StatusCode == http.StatusNotModified {
  79477. if res.Body != nil {
  79478. res.Body.Close()
  79479. }
  79480. return nil, &googleapi.Error{
  79481. Code: res.StatusCode,
  79482. Header: res.Header,
  79483. }
  79484. }
  79485. if err != nil {
  79486. return nil, err
  79487. }
  79488. defer googleapi.CloseBody(res)
  79489. if err := googleapi.CheckResponse(res); err != nil {
  79490. return nil, err
  79491. }
  79492. ret := &Policy{
  79493. ServerResponse: googleapi.ServerResponse{
  79494. Header: res.Header,
  79495. HTTPStatusCode: res.StatusCode,
  79496. },
  79497. }
  79498. target := &ret
  79499. if err := gensupport.DecodeResponse(target, res); err != nil {
  79500. return nil, err
  79501. }
  79502. return ret, nil
  79503. // {
  79504. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  79505. // "httpMethod": "POST",
  79506. // "id": "compute.nodeTemplates.setIamPolicy",
  79507. // "parameterOrder": [
  79508. // "project",
  79509. // "region",
  79510. // "resource"
  79511. // ],
  79512. // "parameters": {
  79513. // "project": {
  79514. // "description": "Project ID for this request.",
  79515. // "location": "path",
  79516. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79517. // "required": true,
  79518. // "type": "string"
  79519. // },
  79520. // "region": {
  79521. // "description": "The name of the region for this request.",
  79522. // "location": "path",
  79523. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79524. // "required": true,
  79525. // "type": "string"
  79526. // },
  79527. // "resource": {
  79528. // "description": "Name or id of the resource for this request.",
  79529. // "location": "path",
  79530. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79531. // "required": true,
  79532. // "type": "string"
  79533. // }
  79534. // },
  79535. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  79536. // "request": {
  79537. // "$ref": "RegionSetPolicyRequest"
  79538. // },
  79539. // "response": {
  79540. // "$ref": "Policy"
  79541. // },
  79542. // "scopes": [
  79543. // "https://www.googleapis.com/auth/cloud-platform",
  79544. // "https://www.googleapis.com/auth/compute"
  79545. // ]
  79546. // }
  79547. }
  79548. // method id "compute.nodeTemplates.testIamPermissions":
  79549. type NodeTemplatesTestIamPermissionsCall struct {
  79550. s *Service
  79551. project string
  79552. region string
  79553. resource string
  79554. testpermissionsrequest *TestPermissionsRequest
  79555. urlParams_ gensupport.URLParams
  79556. ctx_ context.Context
  79557. header_ http.Header
  79558. }
  79559. // TestIamPermissions: Returns permissions that a caller has on the
  79560. // specified resource.
  79561. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  79562. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79563. c.project = project
  79564. c.region = region
  79565. c.resource = resource
  79566. c.testpermissionsrequest = testpermissionsrequest
  79567. return c
  79568. }
  79569. // Fields allows partial responses to be retrieved. See
  79570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79571. // for more information.
  79572. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  79573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79574. return c
  79575. }
  79576. // Context sets the context to be used in this call's Do method. Any
  79577. // pending HTTP request will be aborted if the provided context is
  79578. // canceled.
  79579. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  79580. c.ctx_ = ctx
  79581. return c
  79582. }
  79583. // Header returns an http.Header that can be modified by the caller to
  79584. // add HTTP headers to the request.
  79585. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  79586. if c.header_ == nil {
  79587. c.header_ = make(http.Header)
  79588. }
  79589. return c.header_
  79590. }
  79591. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  79592. reqHeaders := make(http.Header)
  79593. for k, v := range c.header_ {
  79594. reqHeaders[k] = v
  79595. }
  79596. reqHeaders.Set("User-Agent", c.s.userAgent())
  79597. var body io.Reader = nil
  79598. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  79599. if err != nil {
  79600. return nil, err
  79601. }
  79602. reqHeaders.Set("Content-Type", "application/json")
  79603. c.urlParams_.Set("alt", alt)
  79604. c.urlParams_.Set("prettyPrint", "false")
  79605. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  79606. urls += "?" + c.urlParams_.Encode()
  79607. req, err := http.NewRequest("POST", urls, body)
  79608. if err != nil {
  79609. return nil, err
  79610. }
  79611. req.Header = reqHeaders
  79612. googleapi.Expand(req.URL, map[string]string{
  79613. "project": c.project,
  79614. "region": c.region,
  79615. "resource": c.resource,
  79616. })
  79617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79618. }
  79619. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  79620. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  79621. // non-2xx status code is an error. Response headers are in either
  79622. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  79623. // returned at all) in error.(*googleapi.Error).Header. Use
  79624. // googleapi.IsNotModified to check whether the returned error was
  79625. // because http.StatusNotModified was returned.
  79626. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  79627. gensupport.SetOptions(c.urlParams_, opts...)
  79628. res, err := c.doRequest("json")
  79629. if res != nil && res.StatusCode == http.StatusNotModified {
  79630. if res.Body != nil {
  79631. res.Body.Close()
  79632. }
  79633. return nil, &googleapi.Error{
  79634. Code: res.StatusCode,
  79635. Header: res.Header,
  79636. }
  79637. }
  79638. if err != nil {
  79639. return nil, err
  79640. }
  79641. defer googleapi.CloseBody(res)
  79642. if err := googleapi.CheckResponse(res); err != nil {
  79643. return nil, err
  79644. }
  79645. ret := &TestPermissionsResponse{
  79646. ServerResponse: googleapi.ServerResponse{
  79647. Header: res.Header,
  79648. HTTPStatusCode: res.StatusCode,
  79649. },
  79650. }
  79651. target := &ret
  79652. if err := gensupport.DecodeResponse(target, res); err != nil {
  79653. return nil, err
  79654. }
  79655. return ret, nil
  79656. // {
  79657. // "description": "Returns permissions that a caller has on the specified resource.",
  79658. // "httpMethod": "POST",
  79659. // "id": "compute.nodeTemplates.testIamPermissions",
  79660. // "parameterOrder": [
  79661. // "project",
  79662. // "region",
  79663. // "resource"
  79664. // ],
  79665. // "parameters": {
  79666. // "project": {
  79667. // "description": "Project ID for this request.",
  79668. // "location": "path",
  79669. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79670. // "required": true,
  79671. // "type": "string"
  79672. // },
  79673. // "region": {
  79674. // "description": "The name of the region for this request.",
  79675. // "location": "path",
  79676. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79677. // "required": true,
  79678. // "type": "string"
  79679. // },
  79680. // "resource": {
  79681. // "description": "Name or id of the resource for this request.",
  79682. // "location": "path",
  79683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79684. // "required": true,
  79685. // "type": "string"
  79686. // }
  79687. // },
  79688. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  79689. // "request": {
  79690. // "$ref": "TestPermissionsRequest"
  79691. // },
  79692. // "response": {
  79693. // "$ref": "TestPermissionsResponse"
  79694. // },
  79695. // "scopes": [
  79696. // "https://www.googleapis.com/auth/cloud-platform",
  79697. // "https://www.googleapis.com/auth/compute",
  79698. // "https://www.googleapis.com/auth/compute.readonly"
  79699. // ]
  79700. // }
  79701. }
  79702. // method id "compute.nodeTypes.aggregatedList":
  79703. type NodeTypesAggregatedListCall struct {
  79704. s *Service
  79705. project string
  79706. urlParams_ gensupport.URLParams
  79707. ifNoneMatch_ string
  79708. ctx_ context.Context
  79709. header_ http.Header
  79710. }
  79711. // AggregatedList: Retrieves an aggregated list of node types.
  79712. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  79713. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79714. c.project = project
  79715. return c
  79716. }
  79717. // Filter sets the optional parameter "filter": A filter expression that
  79718. // filters resources listed in the response. The expression must specify
  79719. // the field name, a comparison operator, and the value that you want to
  79720. // use for filtering. The value must be a string, a number, or a
  79721. // boolean. The comparison operator must be either =, !=, >, or <.
  79722. //
  79723. // For example, if you are filtering Compute Engine instances, you can
  79724. // exclude instances named example-instance by specifying name !=
  79725. // example-instance.
  79726. //
  79727. // You can also filter nested fields. For example, you could specify
  79728. // scheduling.automaticRestart = false to include instances only if they
  79729. // are not scheduled for automatic restarts. You can use filtering on
  79730. // nested fields to filter based on resource labels.
  79731. //
  79732. // To filter on multiple expressions, provide each separate expression
  79733. // within parentheses. For example, (scheduling.automaticRestart = true)
  79734. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79735. // AND expression. However, you can include AND and OR expressions
  79736. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79737. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79738. // true).
  79739. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  79740. c.urlParams_.Set("filter", filter)
  79741. return c
  79742. }
  79743. // MaxResults sets the optional parameter "maxResults": The maximum
  79744. // number of results per page that should be returned. If the number of
  79745. // available results is larger than maxResults, Compute Engine returns a
  79746. // nextPageToken that can be used to get the next page of results in
  79747. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79748. // (Default: 500)
  79749. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  79750. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79751. return c
  79752. }
  79753. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79754. // a certain order. By default, results are returned in alphanumerical
  79755. // order based on the resource name.
  79756. //
  79757. // You can also sort results in descending order based on the creation
  79758. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79759. // based on the creationTimestamp field in reverse chronological order
  79760. // (newest result first). Use this to sort resources like operations so
  79761. // that the newest operation is returned first.
  79762. //
  79763. // Currently, only sorting by name or creationTimestamp desc is
  79764. // supported.
  79765. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  79766. c.urlParams_.Set("orderBy", orderBy)
  79767. return c
  79768. }
  79769. // PageToken sets the optional parameter "pageToken": Specifies a page
  79770. // token to use. Set pageToken to the nextPageToken returned by a
  79771. // previous list request to get the next page of results.
  79772. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  79773. c.urlParams_.Set("pageToken", pageToken)
  79774. return c
  79775. }
  79776. // Fields allows partial responses to be retrieved. See
  79777. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79778. // for more information.
  79779. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  79780. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79781. return c
  79782. }
  79783. // IfNoneMatch sets the optional parameter which makes the operation
  79784. // fail if the object's ETag matches the given value. This is useful for
  79785. // getting updates only after the object has changed since the last
  79786. // request. Use googleapi.IsNotModified to check whether the response
  79787. // error from Do is the result of In-None-Match.
  79788. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  79789. c.ifNoneMatch_ = entityTag
  79790. return c
  79791. }
  79792. // Context sets the context to be used in this call's Do method. Any
  79793. // pending HTTP request will be aborted if the provided context is
  79794. // canceled.
  79795. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  79796. c.ctx_ = ctx
  79797. return c
  79798. }
  79799. // Header returns an http.Header that can be modified by the caller to
  79800. // add HTTP headers to the request.
  79801. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  79802. if c.header_ == nil {
  79803. c.header_ = make(http.Header)
  79804. }
  79805. return c.header_
  79806. }
  79807. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  79808. reqHeaders := make(http.Header)
  79809. for k, v := range c.header_ {
  79810. reqHeaders[k] = v
  79811. }
  79812. reqHeaders.Set("User-Agent", c.s.userAgent())
  79813. if c.ifNoneMatch_ != "" {
  79814. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79815. }
  79816. var body io.Reader = nil
  79817. c.urlParams_.Set("alt", alt)
  79818. c.urlParams_.Set("prettyPrint", "false")
  79819. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  79820. urls += "?" + c.urlParams_.Encode()
  79821. req, err := http.NewRequest("GET", urls, body)
  79822. if err != nil {
  79823. return nil, err
  79824. }
  79825. req.Header = reqHeaders
  79826. googleapi.Expand(req.URL, map[string]string{
  79827. "project": c.project,
  79828. })
  79829. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79830. }
  79831. // Do executes the "compute.nodeTypes.aggregatedList" call.
  79832. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  79833. // non-2xx status code is an error. Response headers are in either
  79834. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  79835. // returned at all) in error.(*googleapi.Error).Header. Use
  79836. // googleapi.IsNotModified to check whether the returned error was
  79837. // because http.StatusNotModified was returned.
  79838. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  79839. gensupport.SetOptions(c.urlParams_, opts...)
  79840. res, err := c.doRequest("json")
  79841. if res != nil && res.StatusCode == http.StatusNotModified {
  79842. if res.Body != nil {
  79843. res.Body.Close()
  79844. }
  79845. return nil, &googleapi.Error{
  79846. Code: res.StatusCode,
  79847. Header: res.Header,
  79848. }
  79849. }
  79850. if err != nil {
  79851. return nil, err
  79852. }
  79853. defer googleapi.CloseBody(res)
  79854. if err := googleapi.CheckResponse(res); err != nil {
  79855. return nil, err
  79856. }
  79857. ret := &NodeTypeAggregatedList{
  79858. ServerResponse: googleapi.ServerResponse{
  79859. Header: res.Header,
  79860. HTTPStatusCode: res.StatusCode,
  79861. },
  79862. }
  79863. target := &ret
  79864. if err := gensupport.DecodeResponse(target, res); err != nil {
  79865. return nil, err
  79866. }
  79867. return ret, nil
  79868. // {
  79869. // "description": "Retrieves an aggregated list of node types.",
  79870. // "httpMethod": "GET",
  79871. // "id": "compute.nodeTypes.aggregatedList",
  79872. // "parameterOrder": [
  79873. // "project"
  79874. // ],
  79875. // "parameters": {
  79876. // "filter": {
  79877. // "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).",
  79878. // "location": "query",
  79879. // "type": "string"
  79880. // },
  79881. // "maxResults": {
  79882. // "default": "500",
  79883. // "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)",
  79884. // "format": "uint32",
  79885. // "location": "query",
  79886. // "minimum": "0",
  79887. // "type": "integer"
  79888. // },
  79889. // "orderBy": {
  79890. // "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.",
  79891. // "location": "query",
  79892. // "type": "string"
  79893. // },
  79894. // "pageToken": {
  79895. // "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.",
  79896. // "location": "query",
  79897. // "type": "string"
  79898. // },
  79899. // "project": {
  79900. // "description": "Project ID for this request.",
  79901. // "location": "path",
  79902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79903. // "required": true,
  79904. // "type": "string"
  79905. // }
  79906. // },
  79907. // "path": "{project}/aggregated/nodeTypes",
  79908. // "response": {
  79909. // "$ref": "NodeTypeAggregatedList"
  79910. // },
  79911. // "scopes": [
  79912. // "https://www.googleapis.com/auth/cloud-platform",
  79913. // "https://www.googleapis.com/auth/compute",
  79914. // "https://www.googleapis.com/auth/compute.readonly"
  79915. // ]
  79916. // }
  79917. }
  79918. // Pages invokes f for each page of results.
  79919. // A non-nil error returned from f will halt the iteration.
  79920. // The provided context supersedes any context provided to the Context method.
  79921. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  79922. c.ctx_ = ctx
  79923. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79924. for {
  79925. x, err := c.Do()
  79926. if err != nil {
  79927. return err
  79928. }
  79929. if err := f(x); err != nil {
  79930. return err
  79931. }
  79932. if x.NextPageToken == "" {
  79933. return nil
  79934. }
  79935. c.PageToken(x.NextPageToken)
  79936. }
  79937. }
  79938. // method id "compute.nodeTypes.get":
  79939. type NodeTypesGetCall struct {
  79940. s *Service
  79941. project string
  79942. zone string
  79943. nodeType string
  79944. urlParams_ gensupport.URLParams
  79945. ifNoneMatch_ string
  79946. ctx_ context.Context
  79947. header_ http.Header
  79948. }
  79949. // Get: Returns the specified node type. Gets a list of available node
  79950. // types by making a list() request.
  79951. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  79952. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79953. c.project = project
  79954. c.zone = zone
  79955. c.nodeType = nodeType
  79956. return c
  79957. }
  79958. // Fields allows partial responses to be retrieved. See
  79959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79960. // for more information.
  79961. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  79962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79963. return c
  79964. }
  79965. // IfNoneMatch sets the optional parameter which makes the operation
  79966. // fail if the object's ETag matches the given value. This is useful for
  79967. // getting updates only after the object has changed since the last
  79968. // request. Use googleapi.IsNotModified to check whether the response
  79969. // error from Do is the result of In-None-Match.
  79970. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  79971. c.ifNoneMatch_ = entityTag
  79972. return c
  79973. }
  79974. // Context sets the context to be used in this call's Do method. Any
  79975. // pending HTTP request will be aborted if the provided context is
  79976. // canceled.
  79977. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  79978. c.ctx_ = ctx
  79979. return c
  79980. }
  79981. // Header returns an http.Header that can be modified by the caller to
  79982. // add HTTP headers to the request.
  79983. func (c *NodeTypesGetCall) Header() http.Header {
  79984. if c.header_ == nil {
  79985. c.header_ = make(http.Header)
  79986. }
  79987. return c.header_
  79988. }
  79989. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  79990. reqHeaders := make(http.Header)
  79991. for k, v := range c.header_ {
  79992. reqHeaders[k] = v
  79993. }
  79994. reqHeaders.Set("User-Agent", c.s.userAgent())
  79995. if c.ifNoneMatch_ != "" {
  79996. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79997. }
  79998. var body io.Reader = nil
  79999. c.urlParams_.Set("alt", alt)
  80000. c.urlParams_.Set("prettyPrint", "false")
  80001. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  80002. urls += "?" + c.urlParams_.Encode()
  80003. req, err := http.NewRequest("GET", urls, body)
  80004. if err != nil {
  80005. return nil, err
  80006. }
  80007. req.Header = reqHeaders
  80008. googleapi.Expand(req.URL, map[string]string{
  80009. "project": c.project,
  80010. "zone": c.zone,
  80011. "nodeType": c.nodeType,
  80012. })
  80013. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80014. }
  80015. // Do executes the "compute.nodeTypes.get" call.
  80016. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  80017. // code is an error. Response headers are in either
  80018. // *NodeType.ServerResponse.Header or (if a response was returned at
  80019. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80020. // to check whether the returned error was because
  80021. // http.StatusNotModified was returned.
  80022. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  80023. gensupport.SetOptions(c.urlParams_, opts...)
  80024. res, err := c.doRequest("json")
  80025. if res != nil && res.StatusCode == http.StatusNotModified {
  80026. if res.Body != nil {
  80027. res.Body.Close()
  80028. }
  80029. return nil, &googleapi.Error{
  80030. Code: res.StatusCode,
  80031. Header: res.Header,
  80032. }
  80033. }
  80034. if err != nil {
  80035. return nil, err
  80036. }
  80037. defer googleapi.CloseBody(res)
  80038. if err := googleapi.CheckResponse(res); err != nil {
  80039. return nil, err
  80040. }
  80041. ret := &NodeType{
  80042. ServerResponse: googleapi.ServerResponse{
  80043. Header: res.Header,
  80044. HTTPStatusCode: res.StatusCode,
  80045. },
  80046. }
  80047. target := &ret
  80048. if err := gensupport.DecodeResponse(target, res); err != nil {
  80049. return nil, err
  80050. }
  80051. return ret, nil
  80052. // {
  80053. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  80054. // "httpMethod": "GET",
  80055. // "id": "compute.nodeTypes.get",
  80056. // "parameterOrder": [
  80057. // "project",
  80058. // "zone",
  80059. // "nodeType"
  80060. // ],
  80061. // "parameters": {
  80062. // "nodeType": {
  80063. // "description": "Name of the node type to return.",
  80064. // "location": "path",
  80065. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80066. // "required": true,
  80067. // "type": "string"
  80068. // },
  80069. // "project": {
  80070. // "description": "Project ID for this request.",
  80071. // "location": "path",
  80072. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80073. // "required": true,
  80074. // "type": "string"
  80075. // },
  80076. // "zone": {
  80077. // "description": "The name of the zone for this request.",
  80078. // "location": "path",
  80079. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80080. // "required": true,
  80081. // "type": "string"
  80082. // }
  80083. // },
  80084. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  80085. // "response": {
  80086. // "$ref": "NodeType"
  80087. // },
  80088. // "scopes": [
  80089. // "https://www.googleapis.com/auth/cloud-platform",
  80090. // "https://www.googleapis.com/auth/compute",
  80091. // "https://www.googleapis.com/auth/compute.readonly"
  80092. // ]
  80093. // }
  80094. }
  80095. // method id "compute.nodeTypes.list":
  80096. type NodeTypesListCall struct {
  80097. s *Service
  80098. project string
  80099. zone string
  80100. urlParams_ gensupport.URLParams
  80101. ifNoneMatch_ string
  80102. ctx_ context.Context
  80103. header_ http.Header
  80104. }
  80105. // List: Retrieves a list of node types available to the specified
  80106. // project.
  80107. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  80108. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80109. c.project = project
  80110. c.zone = zone
  80111. return c
  80112. }
  80113. // Filter sets the optional parameter "filter": A filter expression that
  80114. // filters resources listed in the response. The expression must specify
  80115. // the field name, a comparison operator, and the value that you want to
  80116. // use for filtering. The value must be a string, a number, or a
  80117. // boolean. The comparison operator must be either =, !=, >, or <.
  80118. //
  80119. // For example, if you are filtering Compute Engine instances, you can
  80120. // exclude instances named example-instance by specifying name !=
  80121. // example-instance.
  80122. //
  80123. // You can also filter nested fields. For example, you could specify
  80124. // scheduling.automaticRestart = false to include instances only if they
  80125. // are not scheduled for automatic restarts. You can use filtering on
  80126. // nested fields to filter based on resource labels.
  80127. //
  80128. // To filter on multiple expressions, provide each separate expression
  80129. // within parentheses. For example, (scheduling.automaticRestart = true)
  80130. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80131. // AND expression. However, you can include AND and OR expressions
  80132. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80133. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80134. // true).
  80135. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  80136. c.urlParams_.Set("filter", filter)
  80137. return c
  80138. }
  80139. // MaxResults sets the optional parameter "maxResults": The maximum
  80140. // number of results per page that should be returned. If the number of
  80141. // available results is larger than maxResults, Compute Engine returns a
  80142. // nextPageToken that can be used to get the next page of results in
  80143. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80144. // (Default: 500)
  80145. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  80146. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80147. return c
  80148. }
  80149. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80150. // a certain order. By default, results are returned in alphanumerical
  80151. // order based on the resource name.
  80152. //
  80153. // You can also sort results in descending order based on the creation
  80154. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80155. // based on the creationTimestamp field in reverse chronological order
  80156. // (newest result first). Use this to sort resources like operations so
  80157. // that the newest operation is returned first.
  80158. //
  80159. // Currently, only sorting by name or creationTimestamp desc is
  80160. // supported.
  80161. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  80162. c.urlParams_.Set("orderBy", orderBy)
  80163. return c
  80164. }
  80165. // PageToken sets the optional parameter "pageToken": Specifies a page
  80166. // token to use. Set pageToken to the nextPageToken returned by a
  80167. // previous list request to get the next page of results.
  80168. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  80169. c.urlParams_.Set("pageToken", pageToken)
  80170. return c
  80171. }
  80172. // Fields allows partial responses to be retrieved. See
  80173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80174. // for more information.
  80175. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  80176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80177. return c
  80178. }
  80179. // IfNoneMatch sets the optional parameter which makes the operation
  80180. // fail if the object's ETag matches the given value. This is useful for
  80181. // getting updates only after the object has changed since the last
  80182. // request. Use googleapi.IsNotModified to check whether the response
  80183. // error from Do is the result of In-None-Match.
  80184. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  80185. c.ifNoneMatch_ = entityTag
  80186. return c
  80187. }
  80188. // Context sets the context to be used in this call's Do method. Any
  80189. // pending HTTP request will be aborted if the provided context is
  80190. // canceled.
  80191. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  80192. c.ctx_ = ctx
  80193. return c
  80194. }
  80195. // Header returns an http.Header that can be modified by the caller to
  80196. // add HTTP headers to the request.
  80197. func (c *NodeTypesListCall) Header() http.Header {
  80198. if c.header_ == nil {
  80199. c.header_ = make(http.Header)
  80200. }
  80201. return c.header_
  80202. }
  80203. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  80204. reqHeaders := make(http.Header)
  80205. for k, v := range c.header_ {
  80206. reqHeaders[k] = v
  80207. }
  80208. reqHeaders.Set("User-Agent", c.s.userAgent())
  80209. if c.ifNoneMatch_ != "" {
  80210. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80211. }
  80212. var body io.Reader = nil
  80213. c.urlParams_.Set("alt", alt)
  80214. c.urlParams_.Set("prettyPrint", "false")
  80215. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  80216. urls += "?" + c.urlParams_.Encode()
  80217. req, err := http.NewRequest("GET", urls, body)
  80218. if err != nil {
  80219. return nil, err
  80220. }
  80221. req.Header = reqHeaders
  80222. googleapi.Expand(req.URL, map[string]string{
  80223. "project": c.project,
  80224. "zone": c.zone,
  80225. })
  80226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80227. }
  80228. // Do executes the "compute.nodeTypes.list" call.
  80229. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  80230. // status code is an error. Response headers are in either
  80231. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  80232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80233. // to check whether the returned error was because
  80234. // http.StatusNotModified was returned.
  80235. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  80236. gensupport.SetOptions(c.urlParams_, opts...)
  80237. res, err := c.doRequest("json")
  80238. if res != nil && res.StatusCode == http.StatusNotModified {
  80239. if res.Body != nil {
  80240. res.Body.Close()
  80241. }
  80242. return nil, &googleapi.Error{
  80243. Code: res.StatusCode,
  80244. Header: res.Header,
  80245. }
  80246. }
  80247. if err != nil {
  80248. return nil, err
  80249. }
  80250. defer googleapi.CloseBody(res)
  80251. if err := googleapi.CheckResponse(res); err != nil {
  80252. return nil, err
  80253. }
  80254. ret := &NodeTypeList{
  80255. ServerResponse: googleapi.ServerResponse{
  80256. Header: res.Header,
  80257. HTTPStatusCode: res.StatusCode,
  80258. },
  80259. }
  80260. target := &ret
  80261. if err := gensupport.DecodeResponse(target, res); err != nil {
  80262. return nil, err
  80263. }
  80264. return ret, nil
  80265. // {
  80266. // "description": "Retrieves a list of node types available to the specified project.",
  80267. // "httpMethod": "GET",
  80268. // "id": "compute.nodeTypes.list",
  80269. // "parameterOrder": [
  80270. // "project",
  80271. // "zone"
  80272. // ],
  80273. // "parameters": {
  80274. // "filter": {
  80275. // "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).",
  80276. // "location": "query",
  80277. // "type": "string"
  80278. // },
  80279. // "maxResults": {
  80280. // "default": "500",
  80281. // "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)",
  80282. // "format": "uint32",
  80283. // "location": "query",
  80284. // "minimum": "0",
  80285. // "type": "integer"
  80286. // },
  80287. // "orderBy": {
  80288. // "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.",
  80289. // "location": "query",
  80290. // "type": "string"
  80291. // },
  80292. // "pageToken": {
  80293. // "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.",
  80294. // "location": "query",
  80295. // "type": "string"
  80296. // },
  80297. // "project": {
  80298. // "description": "Project ID for this request.",
  80299. // "location": "path",
  80300. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80301. // "required": true,
  80302. // "type": "string"
  80303. // },
  80304. // "zone": {
  80305. // "description": "The name of the zone for this request.",
  80306. // "location": "path",
  80307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80308. // "required": true,
  80309. // "type": "string"
  80310. // }
  80311. // },
  80312. // "path": "{project}/zones/{zone}/nodeTypes",
  80313. // "response": {
  80314. // "$ref": "NodeTypeList"
  80315. // },
  80316. // "scopes": [
  80317. // "https://www.googleapis.com/auth/cloud-platform",
  80318. // "https://www.googleapis.com/auth/compute",
  80319. // "https://www.googleapis.com/auth/compute.readonly"
  80320. // ]
  80321. // }
  80322. }
  80323. // Pages invokes f for each page of results.
  80324. // A non-nil error returned from f will halt the iteration.
  80325. // The provided context supersedes any context provided to the Context method.
  80326. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  80327. c.ctx_ = ctx
  80328. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80329. for {
  80330. x, err := c.Do()
  80331. if err != nil {
  80332. return err
  80333. }
  80334. if err := f(x); err != nil {
  80335. return err
  80336. }
  80337. if x.NextPageToken == "" {
  80338. return nil
  80339. }
  80340. c.PageToken(x.NextPageToken)
  80341. }
  80342. }
  80343. // method id "compute.projects.disableXpnHost":
  80344. type ProjectsDisableXpnHostCall struct {
  80345. s *Service
  80346. project string
  80347. urlParams_ gensupport.URLParams
  80348. ctx_ context.Context
  80349. header_ http.Header
  80350. }
  80351. // DisableXpnHost: Disable this project as a shared VPC host project.
  80352. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  80353. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80354. c.project = project
  80355. return c
  80356. }
  80357. // RequestId sets the optional parameter "requestId": An optional
  80358. // request ID to identify requests. Specify a unique request ID so that
  80359. // if you must retry your request, the server will know to ignore the
  80360. // request if it has already been completed.
  80361. //
  80362. // For example, consider a situation where you make an initial request
  80363. // and the request times out. If you make the request again with the
  80364. // same request ID, the server can check if original operation with the
  80365. // same request ID was received, and if so, will ignore the second
  80366. // request. This prevents clients from accidentally creating duplicate
  80367. // commitments.
  80368. //
  80369. // The request ID must be a valid UUID with the exception that zero UUID
  80370. // is not supported (00000000-0000-0000-0000-000000000000).
  80371. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  80372. c.urlParams_.Set("requestId", requestId)
  80373. return c
  80374. }
  80375. // Fields allows partial responses to be retrieved. See
  80376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80377. // for more information.
  80378. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  80379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80380. return c
  80381. }
  80382. // Context sets the context to be used in this call's Do method. Any
  80383. // pending HTTP request will be aborted if the provided context is
  80384. // canceled.
  80385. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  80386. c.ctx_ = ctx
  80387. return c
  80388. }
  80389. // Header returns an http.Header that can be modified by the caller to
  80390. // add HTTP headers to the request.
  80391. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  80392. if c.header_ == nil {
  80393. c.header_ = make(http.Header)
  80394. }
  80395. return c.header_
  80396. }
  80397. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  80398. reqHeaders := make(http.Header)
  80399. for k, v := range c.header_ {
  80400. reqHeaders[k] = v
  80401. }
  80402. reqHeaders.Set("User-Agent", c.s.userAgent())
  80403. var body io.Reader = nil
  80404. c.urlParams_.Set("alt", alt)
  80405. c.urlParams_.Set("prettyPrint", "false")
  80406. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  80407. urls += "?" + c.urlParams_.Encode()
  80408. req, err := http.NewRequest("POST", urls, body)
  80409. if err != nil {
  80410. return nil, err
  80411. }
  80412. req.Header = reqHeaders
  80413. googleapi.Expand(req.URL, map[string]string{
  80414. "project": c.project,
  80415. })
  80416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80417. }
  80418. // Do executes the "compute.projects.disableXpnHost" call.
  80419. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80420. // status code is an error. Response headers are in either
  80421. // *Operation.ServerResponse.Header or (if a response was returned at
  80422. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80423. // to check whether the returned error was because
  80424. // http.StatusNotModified was returned.
  80425. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80426. gensupport.SetOptions(c.urlParams_, opts...)
  80427. res, err := c.doRequest("json")
  80428. if res != nil && res.StatusCode == http.StatusNotModified {
  80429. if res.Body != nil {
  80430. res.Body.Close()
  80431. }
  80432. return nil, &googleapi.Error{
  80433. Code: res.StatusCode,
  80434. Header: res.Header,
  80435. }
  80436. }
  80437. if err != nil {
  80438. return nil, err
  80439. }
  80440. defer googleapi.CloseBody(res)
  80441. if err := googleapi.CheckResponse(res); err != nil {
  80442. return nil, err
  80443. }
  80444. ret := &Operation{
  80445. ServerResponse: googleapi.ServerResponse{
  80446. Header: res.Header,
  80447. HTTPStatusCode: res.StatusCode,
  80448. },
  80449. }
  80450. target := &ret
  80451. if err := gensupport.DecodeResponse(target, res); err != nil {
  80452. return nil, err
  80453. }
  80454. return ret, nil
  80455. // {
  80456. // "description": "Disable this project as a shared VPC host project.",
  80457. // "httpMethod": "POST",
  80458. // "id": "compute.projects.disableXpnHost",
  80459. // "parameterOrder": [
  80460. // "project"
  80461. // ],
  80462. // "parameters": {
  80463. // "project": {
  80464. // "description": "Project ID for this request.",
  80465. // "location": "path",
  80466. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80467. // "required": true,
  80468. // "type": "string"
  80469. // },
  80470. // "requestId": {
  80471. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80472. // "location": "query",
  80473. // "type": "string"
  80474. // }
  80475. // },
  80476. // "path": "{project}/disableXpnHost",
  80477. // "response": {
  80478. // "$ref": "Operation"
  80479. // },
  80480. // "scopes": [
  80481. // "https://www.googleapis.com/auth/cloud-platform",
  80482. // "https://www.googleapis.com/auth/compute"
  80483. // ]
  80484. // }
  80485. }
  80486. // method id "compute.projects.disableXpnResource":
  80487. type ProjectsDisableXpnResourceCall struct {
  80488. s *Service
  80489. project string
  80490. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  80491. urlParams_ gensupport.URLParams
  80492. ctx_ context.Context
  80493. header_ http.Header
  80494. }
  80495. // DisableXpnResource: Disable a serivce resource (a.k.a service
  80496. // project) associated with this host project.
  80497. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  80498. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80499. c.project = project
  80500. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  80501. return c
  80502. }
  80503. // RequestId sets the optional parameter "requestId": An optional
  80504. // request ID to identify requests. Specify a unique request ID so that
  80505. // if you must retry your request, the server will know to ignore the
  80506. // request if it has already been completed.
  80507. //
  80508. // For example, consider a situation where you make an initial request
  80509. // and the request times out. If you make the request again with the
  80510. // same request ID, the server can check if original operation with the
  80511. // same request ID was received, and if so, will ignore the second
  80512. // request. This prevents clients from accidentally creating duplicate
  80513. // commitments.
  80514. //
  80515. // The request ID must be a valid UUID with the exception that zero UUID
  80516. // is not supported (00000000-0000-0000-0000-000000000000).
  80517. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  80518. c.urlParams_.Set("requestId", requestId)
  80519. return c
  80520. }
  80521. // Fields allows partial responses to be retrieved. See
  80522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80523. // for more information.
  80524. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  80525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80526. return c
  80527. }
  80528. // Context sets the context to be used in this call's Do method. Any
  80529. // pending HTTP request will be aborted if the provided context is
  80530. // canceled.
  80531. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  80532. c.ctx_ = ctx
  80533. return c
  80534. }
  80535. // Header returns an http.Header that can be modified by the caller to
  80536. // add HTTP headers to the request.
  80537. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  80538. if c.header_ == nil {
  80539. c.header_ = make(http.Header)
  80540. }
  80541. return c.header_
  80542. }
  80543. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  80544. reqHeaders := make(http.Header)
  80545. for k, v := range c.header_ {
  80546. reqHeaders[k] = v
  80547. }
  80548. reqHeaders.Set("User-Agent", c.s.userAgent())
  80549. var body io.Reader = nil
  80550. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  80551. if err != nil {
  80552. return nil, err
  80553. }
  80554. reqHeaders.Set("Content-Type", "application/json")
  80555. c.urlParams_.Set("alt", alt)
  80556. c.urlParams_.Set("prettyPrint", "false")
  80557. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  80558. urls += "?" + c.urlParams_.Encode()
  80559. req, err := http.NewRequest("POST", urls, body)
  80560. if err != nil {
  80561. return nil, err
  80562. }
  80563. req.Header = reqHeaders
  80564. googleapi.Expand(req.URL, map[string]string{
  80565. "project": c.project,
  80566. })
  80567. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80568. }
  80569. // Do executes the "compute.projects.disableXpnResource" call.
  80570. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80571. // status code is an error. Response headers are in either
  80572. // *Operation.ServerResponse.Header or (if a response was returned at
  80573. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80574. // to check whether the returned error was because
  80575. // http.StatusNotModified was returned.
  80576. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80577. gensupport.SetOptions(c.urlParams_, opts...)
  80578. res, err := c.doRequest("json")
  80579. if res != nil && res.StatusCode == http.StatusNotModified {
  80580. if res.Body != nil {
  80581. res.Body.Close()
  80582. }
  80583. return nil, &googleapi.Error{
  80584. Code: res.StatusCode,
  80585. Header: res.Header,
  80586. }
  80587. }
  80588. if err != nil {
  80589. return nil, err
  80590. }
  80591. defer googleapi.CloseBody(res)
  80592. if err := googleapi.CheckResponse(res); err != nil {
  80593. return nil, err
  80594. }
  80595. ret := &Operation{
  80596. ServerResponse: googleapi.ServerResponse{
  80597. Header: res.Header,
  80598. HTTPStatusCode: res.StatusCode,
  80599. },
  80600. }
  80601. target := &ret
  80602. if err := gensupport.DecodeResponse(target, res); err != nil {
  80603. return nil, err
  80604. }
  80605. return ret, nil
  80606. // {
  80607. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  80608. // "httpMethod": "POST",
  80609. // "id": "compute.projects.disableXpnResource",
  80610. // "parameterOrder": [
  80611. // "project"
  80612. // ],
  80613. // "parameters": {
  80614. // "project": {
  80615. // "description": "Project ID for this request.",
  80616. // "location": "path",
  80617. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80618. // "required": true,
  80619. // "type": "string"
  80620. // },
  80621. // "requestId": {
  80622. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80623. // "location": "query",
  80624. // "type": "string"
  80625. // }
  80626. // },
  80627. // "path": "{project}/disableXpnResource",
  80628. // "request": {
  80629. // "$ref": "ProjectsDisableXpnResourceRequest"
  80630. // },
  80631. // "response": {
  80632. // "$ref": "Operation"
  80633. // },
  80634. // "scopes": [
  80635. // "https://www.googleapis.com/auth/cloud-platform",
  80636. // "https://www.googleapis.com/auth/compute"
  80637. // ]
  80638. // }
  80639. }
  80640. // method id "compute.projects.enableXpnHost":
  80641. type ProjectsEnableXpnHostCall struct {
  80642. s *Service
  80643. project string
  80644. urlParams_ gensupport.URLParams
  80645. ctx_ context.Context
  80646. header_ http.Header
  80647. }
  80648. // EnableXpnHost: Enable this project as a shared VPC host project.
  80649. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  80650. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80651. c.project = project
  80652. return c
  80653. }
  80654. // RequestId sets the optional parameter "requestId": An optional
  80655. // request ID to identify requests. Specify a unique request ID so that
  80656. // if you must retry your request, the server will know to ignore the
  80657. // request if it has already been completed.
  80658. //
  80659. // For example, consider a situation where you make an initial request
  80660. // and the request times out. If you make the request again with the
  80661. // same request ID, the server can check if original operation with the
  80662. // same request ID was received, and if so, will ignore the second
  80663. // request. This prevents clients from accidentally creating duplicate
  80664. // commitments.
  80665. //
  80666. // The request ID must be a valid UUID with the exception that zero UUID
  80667. // is not supported (00000000-0000-0000-0000-000000000000).
  80668. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  80669. c.urlParams_.Set("requestId", requestId)
  80670. return c
  80671. }
  80672. // Fields allows partial responses to be retrieved. See
  80673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80674. // for more information.
  80675. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  80676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80677. return c
  80678. }
  80679. // Context sets the context to be used in this call's Do method. Any
  80680. // pending HTTP request will be aborted if the provided context is
  80681. // canceled.
  80682. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  80683. c.ctx_ = ctx
  80684. return c
  80685. }
  80686. // Header returns an http.Header that can be modified by the caller to
  80687. // add HTTP headers to the request.
  80688. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  80689. if c.header_ == nil {
  80690. c.header_ = make(http.Header)
  80691. }
  80692. return c.header_
  80693. }
  80694. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  80695. reqHeaders := make(http.Header)
  80696. for k, v := range c.header_ {
  80697. reqHeaders[k] = v
  80698. }
  80699. reqHeaders.Set("User-Agent", c.s.userAgent())
  80700. var body io.Reader = nil
  80701. c.urlParams_.Set("alt", alt)
  80702. c.urlParams_.Set("prettyPrint", "false")
  80703. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  80704. urls += "?" + c.urlParams_.Encode()
  80705. req, err := http.NewRequest("POST", urls, body)
  80706. if err != nil {
  80707. return nil, err
  80708. }
  80709. req.Header = reqHeaders
  80710. googleapi.Expand(req.URL, map[string]string{
  80711. "project": c.project,
  80712. })
  80713. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80714. }
  80715. // Do executes the "compute.projects.enableXpnHost" call.
  80716. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80717. // status code is an error. Response headers are in either
  80718. // *Operation.ServerResponse.Header or (if a response was returned at
  80719. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80720. // to check whether the returned error was because
  80721. // http.StatusNotModified was returned.
  80722. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80723. gensupport.SetOptions(c.urlParams_, opts...)
  80724. res, err := c.doRequest("json")
  80725. if res != nil && res.StatusCode == http.StatusNotModified {
  80726. if res.Body != nil {
  80727. res.Body.Close()
  80728. }
  80729. return nil, &googleapi.Error{
  80730. Code: res.StatusCode,
  80731. Header: res.Header,
  80732. }
  80733. }
  80734. if err != nil {
  80735. return nil, err
  80736. }
  80737. defer googleapi.CloseBody(res)
  80738. if err := googleapi.CheckResponse(res); err != nil {
  80739. return nil, err
  80740. }
  80741. ret := &Operation{
  80742. ServerResponse: googleapi.ServerResponse{
  80743. Header: res.Header,
  80744. HTTPStatusCode: res.StatusCode,
  80745. },
  80746. }
  80747. target := &ret
  80748. if err := gensupport.DecodeResponse(target, res); err != nil {
  80749. return nil, err
  80750. }
  80751. return ret, nil
  80752. // {
  80753. // "description": "Enable this project as a shared VPC host project.",
  80754. // "httpMethod": "POST",
  80755. // "id": "compute.projects.enableXpnHost",
  80756. // "parameterOrder": [
  80757. // "project"
  80758. // ],
  80759. // "parameters": {
  80760. // "project": {
  80761. // "description": "Project ID for this request.",
  80762. // "location": "path",
  80763. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80764. // "required": true,
  80765. // "type": "string"
  80766. // },
  80767. // "requestId": {
  80768. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80769. // "location": "query",
  80770. // "type": "string"
  80771. // }
  80772. // },
  80773. // "path": "{project}/enableXpnHost",
  80774. // "response": {
  80775. // "$ref": "Operation"
  80776. // },
  80777. // "scopes": [
  80778. // "https://www.googleapis.com/auth/cloud-platform",
  80779. // "https://www.googleapis.com/auth/compute"
  80780. // ]
  80781. // }
  80782. }
  80783. // method id "compute.projects.enableXpnResource":
  80784. type ProjectsEnableXpnResourceCall struct {
  80785. s *Service
  80786. project string
  80787. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  80788. urlParams_ gensupport.URLParams
  80789. ctx_ context.Context
  80790. header_ http.Header
  80791. }
  80792. // EnableXpnResource: Enable service resource (a.k.a service project)
  80793. // for a host project, so that subnets in the host project can be used
  80794. // by instances in the service project.
  80795. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  80796. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80797. c.project = project
  80798. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  80799. return c
  80800. }
  80801. // RequestId sets the optional parameter "requestId": An optional
  80802. // request ID to identify requests. Specify a unique request ID so that
  80803. // if you must retry your request, the server will know to ignore the
  80804. // request if it has already been completed.
  80805. //
  80806. // For example, consider a situation where you make an initial request
  80807. // and the request times out. If you make the request again with the
  80808. // same request ID, the server can check if original operation with the
  80809. // same request ID was received, and if so, will ignore the second
  80810. // request. This prevents clients from accidentally creating duplicate
  80811. // commitments.
  80812. //
  80813. // The request ID must be a valid UUID with the exception that zero UUID
  80814. // is not supported (00000000-0000-0000-0000-000000000000).
  80815. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  80816. c.urlParams_.Set("requestId", requestId)
  80817. return c
  80818. }
  80819. // Fields allows partial responses to be retrieved. See
  80820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80821. // for more information.
  80822. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  80823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80824. return c
  80825. }
  80826. // Context sets the context to be used in this call's Do method. Any
  80827. // pending HTTP request will be aborted if the provided context is
  80828. // canceled.
  80829. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  80830. c.ctx_ = ctx
  80831. return c
  80832. }
  80833. // Header returns an http.Header that can be modified by the caller to
  80834. // add HTTP headers to the request.
  80835. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  80836. if c.header_ == nil {
  80837. c.header_ = make(http.Header)
  80838. }
  80839. return c.header_
  80840. }
  80841. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  80842. reqHeaders := make(http.Header)
  80843. for k, v := range c.header_ {
  80844. reqHeaders[k] = v
  80845. }
  80846. reqHeaders.Set("User-Agent", c.s.userAgent())
  80847. var body io.Reader = nil
  80848. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  80849. if err != nil {
  80850. return nil, err
  80851. }
  80852. reqHeaders.Set("Content-Type", "application/json")
  80853. c.urlParams_.Set("alt", alt)
  80854. c.urlParams_.Set("prettyPrint", "false")
  80855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  80856. urls += "?" + c.urlParams_.Encode()
  80857. req, err := http.NewRequest("POST", urls, body)
  80858. if err != nil {
  80859. return nil, err
  80860. }
  80861. req.Header = reqHeaders
  80862. googleapi.Expand(req.URL, map[string]string{
  80863. "project": c.project,
  80864. })
  80865. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80866. }
  80867. // Do executes the "compute.projects.enableXpnResource" call.
  80868. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80869. // status code is an error. Response headers are in either
  80870. // *Operation.ServerResponse.Header or (if a response was returned at
  80871. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80872. // to check whether the returned error was because
  80873. // http.StatusNotModified was returned.
  80874. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80875. gensupport.SetOptions(c.urlParams_, opts...)
  80876. res, err := c.doRequest("json")
  80877. if res != nil && res.StatusCode == http.StatusNotModified {
  80878. if res.Body != nil {
  80879. res.Body.Close()
  80880. }
  80881. return nil, &googleapi.Error{
  80882. Code: res.StatusCode,
  80883. Header: res.Header,
  80884. }
  80885. }
  80886. if err != nil {
  80887. return nil, err
  80888. }
  80889. defer googleapi.CloseBody(res)
  80890. if err := googleapi.CheckResponse(res); err != nil {
  80891. return nil, err
  80892. }
  80893. ret := &Operation{
  80894. ServerResponse: googleapi.ServerResponse{
  80895. Header: res.Header,
  80896. HTTPStatusCode: res.StatusCode,
  80897. },
  80898. }
  80899. target := &ret
  80900. if err := gensupport.DecodeResponse(target, res); err != nil {
  80901. return nil, err
  80902. }
  80903. return ret, nil
  80904. // {
  80905. // "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.",
  80906. // "httpMethod": "POST",
  80907. // "id": "compute.projects.enableXpnResource",
  80908. // "parameterOrder": [
  80909. // "project"
  80910. // ],
  80911. // "parameters": {
  80912. // "project": {
  80913. // "description": "Project ID for this request.",
  80914. // "location": "path",
  80915. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80916. // "required": true,
  80917. // "type": "string"
  80918. // },
  80919. // "requestId": {
  80920. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80921. // "location": "query",
  80922. // "type": "string"
  80923. // }
  80924. // },
  80925. // "path": "{project}/enableXpnResource",
  80926. // "request": {
  80927. // "$ref": "ProjectsEnableXpnResourceRequest"
  80928. // },
  80929. // "response": {
  80930. // "$ref": "Operation"
  80931. // },
  80932. // "scopes": [
  80933. // "https://www.googleapis.com/auth/cloud-platform",
  80934. // "https://www.googleapis.com/auth/compute"
  80935. // ]
  80936. // }
  80937. }
  80938. // method id "compute.projects.get":
  80939. type ProjectsGetCall struct {
  80940. s *Service
  80941. project string
  80942. urlParams_ gensupport.URLParams
  80943. ifNoneMatch_ string
  80944. ctx_ context.Context
  80945. header_ http.Header
  80946. }
  80947. // Get: Returns the specified Project resource.
  80948. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  80949. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  80950. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80951. c.project = project
  80952. return c
  80953. }
  80954. // Fields allows partial responses to be retrieved. See
  80955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80956. // for more information.
  80957. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  80958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80959. return c
  80960. }
  80961. // IfNoneMatch sets the optional parameter which makes the operation
  80962. // fail if the object's ETag matches the given value. This is useful for
  80963. // getting updates only after the object has changed since the last
  80964. // request. Use googleapi.IsNotModified to check whether the response
  80965. // error from Do is the result of In-None-Match.
  80966. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  80967. c.ifNoneMatch_ = entityTag
  80968. return c
  80969. }
  80970. // Context sets the context to be used in this call's Do method. Any
  80971. // pending HTTP request will be aborted if the provided context is
  80972. // canceled.
  80973. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  80974. c.ctx_ = ctx
  80975. return c
  80976. }
  80977. // Header returns an http.Header that can be modified by the caller to
  80978. // add HTTP headers to the request.
  80979. func (c *ProjectsGetCall) Header() http.Header {
  80980. if c.header_ == nil {
  80981. c.header_ = make(http.Header)
  80982. }
  80983. return c.header_
  80984. }
  80985. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  80986. reqHeaders := make(http.Header)
  80987. for k, v := range c.header_ {
  80988. reqHeaders[k] = v
  80989. }
  80990. reqHeaders.Set("User-Agent", c.s.userAgent())
  80991. if c.ifNoneMatch_ != "" {
  80992. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80993. }
  80994. var body io.Reader = nil
  80995. c.urlParams_.Set("alt", alt)
  80996. c.urlParams_.Set("prettyPrint", "false")
  80997. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  80998. urls += "?" + c.urlParams_.Encode()
  80999. req, err := http.NewRequest("GET", urls, body)
  81000. if err != nil {
  81001. return nil, err
  81002. }
  81003. req.Header = reqHeaders
  81004. googleapi.Expand(req.URL, map[string]string{
  81005. "project": c.project,
  81006. })
  81007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81008. }
  81009. // Do executes the "compute.projects.get" call.
  81010. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  81011. // code is an error. Response headers are in either
  81012. // *Project.ServerResponse.Header or (if a response was returned at all)
  81013. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81014. // check whether the returned error was because http.StatusNotModified
  81015. // was returned.
  81016. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  81017. gensupport.SetOptions(c.urlParams_, opts...)
  81018. res, err := c.doRequest("json")
  81019. if res != nil && res.StatusCode == http.StatusNotModified {
  81020. if res.Body != nil {
  81021. res.Body.Close()
  81022. }
  81023. return nil, &googleapi.Error{
  81024. Code: res.StatusCode,
  81025. Header: res.Header,
  81026. }
  81027. }
  81028. if err != nil {
  81029. return nil, err
  81030. }
  81031. defer googleapi.CloseBody(res)
  81032. if err := googleapi.CheckResponse(res); err != nil {
  81033. return nil, err
  81034. }
  81035. ret := &Project{
  81036. ServerResponse: googleapi.ServerResponse{
  81037. Header: res.Header,
  81038. HTTPStatusCode: res.StatusCode,
  81039. },
  81040. }
  81041. target := &ret
  81042. if err := gensupport.DecodeResponse(target, res); err != nil {
  81043. return nil, err
  81044. }
  81045. return ret, nil
  81046. // {
  81047. // "description": "Returns the specified Project resource.",
  81048. // "httpMethod": "GET",
  81049. // "id": "compute.projects.get",
  81050. // "parameterOrder": [
  81051. // "project"
  81052. // ],
  81053. // "parameters": {
  81054. // "project": {
  81055. // "description": "Project ID for this request.",
  81056. // "location": "path",
  81057. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81058. // "required": true,
  81059. // "type": "string"
  81060. // }
  81061. // },
  81062. // "path": "{project}",
  81063. // "response": {
  81064. // "$ref": "Project"
  81065. // },
  81066. // "scopes": [
  81067. // "https://www.googleapis.com/auth/cloud-platform",
  81068. // "https://www.googleapis.com/auth/compute",
  81069. // "https://www.googleapis.com/auth/compute.readonly"
  81070. // ]
  81071. // }
  81072. }
  81073. // method id "compute.projects.getXpnHost":
  81074. type ProjectsGetXpnHostCall struct {
  81075. s *Service
  81076. project string
  81077. urlParams_ gensupport.URLParams
  81078. ifNoneMatch_ string
  81079. ctx_ context.Context
  81080. header_ http.Header
  81081. }
  81082. // GetXpnHost: Gets the shared VPC host project that this project links
  81083. // to. May be empty if no link exists.
  81084. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  81085. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81086. c.project = project
  81087. return c
  81088. }
  81089. // Fields allows partial responses to be retrieved. See
  81090. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81091. // for more information.
  81092. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  81093. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81094. return c
  81095. }
  81096. // IfNoneMatch sets the optional parameter which makes the operation
  81097. // fail if the object's ETag matches the given value. This is useful for
  81098. // getting updates only after the object has changed since the last
  81099. // request. Use googleapi.IsNotModified to check whether the response
  81100. // error from Do is the result of In-None-Match.
  81101. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  81102. c.ifNoneMatch_ = entityTag
  81103. return c
  81104. }
  81105. // Context sets the context to be used in this call's Do method. Any
  81106. // pending HTTP request will be aborted if the provided context is
  81107. // canceled.
  81108. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  81109. c.ctx_ = ctx
  81110. return c
  81111. }
  81112. // Header returns an http.Header that can be modified by the caller to
  81113. // add HTTP headers to the request.
  81114. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  81115. if c.header_ == nil {
  81116. c.header_ = make(http.Header)
  81117. }
  81118. return c.header_
  81119. }
  81120. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  81121. reqHeaders := make(http.Header)
  81122. for k, v := range c.header_ {
  81123. reqHeaders[k] = v
  81124. }
  81125. reqHeaders.Set("User-Agent", c.s.userAgent())
  81126. if c.ifNoneMatch_ != "" {
  81127. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81128. }
  81129. var body io.Reader = nil
  81130. c.urlParams_.Set("alt", alt)
  81131. c.urlParams_.Set("prettyPrint", "false")
  81132. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  81133. urls += "?" + c.urlParams_.Encode()
  81134. req, err := http.NewRequest("GET", urls, body)
  81135. if err != nil {
  81136. return nil, err
  81137. }
  81138. req.Header = reqHeaders
  81139. googleapi.Expand(req.URL, map[string]string{
  81140. "project": c.project,
  81141. })
  81142. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81143. }
  81144. // Do executes the "compute.projects.getXpnHost" call.
  81145. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  81146. // code is an error. Response headers are in either
  81147. // *Project.ServerResponse.Header or (if a response was returned at all)
  81148. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81149. // check whether the returned error was because http.StatusNotModified
  81150. // was returned.
  81151. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  81152. gensupport.SetOptions(c.urlParams_, opts...)
  81153. res, err := c.doRequest("json")
  81154. if res != nil && res.StatusCode == http.StatusNotModified {
  81155. if res.Body != nil {
  81156. res.Body.Close()
  81157. }
  81158. return nil, &googleapi.Error{
  81159. Code: res.StatusCode,
  81160. Header: res.Header,
  81161. }
  81162. }
  81163. if err != nil {
  81164. return nil, err
  81165. }
  81166. defer googleapi.CloseBody(res)
  81167. if err := googleapi.CheckResponse(res); err != nil {
  81168. return nil, err
  81169. }
  81170. ret := &Project{
  81171. ServerResponse: googleapi.ServerResponse{
  81172. Header: res.Header,
  81173. HTTPStatusCode: res.StatusCode,
  81174. },
  81175. }
  81176. target := &ret
  81177. if err := gensupport.DecodeResponse(target, res); err != nil {
  81178. return nil, err
  81179. }
  81180. return ret, nil
  81181. // {
  81182. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  81183. // "httpMethod": "GET",
  81184. // "id": "compute.projects.getXpnHost",
  81185. // "parameterOrder": [
  81186. // "project"
  81187. // ],
  81188. // "parameters": {
  81189. // "project": {
  81190. // "description": "Project ID for this request.",
  81191. // "location": "path",
  81192. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81193. // "required": true,
  81194. // "type": "string"
  81195. // }
  81196. // },
  81197. // "path": "{project}/getXpnHost",
  81198. // "response": {
  81199. // "$ref": "Project"
  81200. // },
  81201. // "scopes": [
  81202. // "https://www.googleapis.com/auth/cloud-platform",
  81203. // "https://www.googleapis.com/auth/compute"
  81204. // ]
  81205. // }
  81206. }
  81207. // method id "compute.projects.getXpnResources":
  81208. type ProjectsGetXpnResourcesCall struct {
  81209. s *Service
  81210. project string
  81211. urlParams_ gensupport.URLParams
  81212. ifNoneMatch_ string
  81213. ctx_ context.Context
  81214. header_ http.Header
  81215. }
  81216. // GetXpnResources: Gets service resources (a.k.a service project)
  81217. // associated with this host project.
  81218. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  81219. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81220. c.project = project
  81221. return c
  81222. }
  81223. // Filter sets the optional parameter "filter": A filter expression that
  81224. // filters resources listed in the response. The expression must specify
  81225. // the field name, a comparison operator, and the value that you want to
  81226. // use for filtering. The value must be a string, a number, or a
  81227. // boolean. The comparison operator must be either =, !=, >, or <.
  81228. //
  81229. // For example, if you are filtering Compute Engine instances, you can
  81230. // exclude instances named example-instance by specifying name !=
  81231. // example-instance.
  81232. //
  81233. // You can also filter nested fields. For example, you could specify
  81234. // scheduling.automaticRestart = false to include instances only if they
  81235. // are not scheduled for automatic restarts. You can use filtering on
  81236. // nested fields to filter based on resource labels.
  81237. //
  81238. // To filter on multiple expressions, provide each separate expression
  81239. // within parentheses. For example, (scheduling.automaticRestart = true)
  81240. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  81241. // AND expression. However, you can include AND and OR expressions
  81242. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  81243. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  81244. // true).
  81245. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  81246. c.urlParams_.Set("filter", filter)
  81247. return c
  81248. }
  81249. // MaxResults sets the optional parameter "maxResults": The maximum
  81250. // number of results per page that should be returned. If the number of
  81251. // available results is larger than maxResults, Compute Engine returns a
  81252. // nextPageToken that can be used to get the next page of results in
  81253. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  81254. // (Default: 500)
  81255. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  81256. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81257. return c
  81258. }
  81259. // OrderBy sets the optional parameter "order_by": Sorts list results by
  81260. // a certain order. By default, results are returned in alphanumerical
  81261. // order based on the resource name.
  81262. //
  81263. // You can also sort results in descending order based on the creation
  81264. // timestamp using orderBy="creationTimestamp desc". This sorts results
  81265. // based on the creationTimestamp field in reverse chronological order
  81266. // (newest result first). Use this to sort resources like operations so
  81267. // that the newest operation is returned first.
  81268. //
  81269. // Currently, only sorting by name or creationTimestamp desc is
  81270. // supported.
  81271. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  81272. c.urlParams_.Set("order_by", orderBy)
  81273. return c
  81274. }
  81275. // PageToken sets the optional parameter "pageToken": Specifies a page
  81276. // token to use. Set pageToken to the nextPageToken returned by a
  81277. // previous list request to get the next page of results.
  81278. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  81279. c.urlParams_.Set("pageToken", pageToken)
  81280. return c
  81281. }
  81282. // Fields allows partial responses to be retrieved. See
  81283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81284. // for more information.
  81285. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  81286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81287. return c
  81288. }
  81289. // IfNoneMatch sets the optional parameter which makes the operation
  81290. // fail if the object's ETag matches the given value. This is useful for
  81291. // getting updates only after the object has changed since the last
  81292. // request. Use googleapi.IsNotModified to check whether the response
  81293. // error from Do is the result of In-None-Match.
  81294. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  81295. c.ifNoneMatch_ = entityTag
  81296. return c
  81297. }
  81298. // Context sets the context to be used in this call's Do method. Any
  81299. // pending HTTP request will be aborted if the provided context is
  81300. // canceled.
  81301. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  81302. c.ctx_ = ctx
  81303. return c
  81304. }
  81305. // Header returns an http.Header that can be modified by the caller to
  81306. // add HTTP headers to the request.
  81307. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  81308. if c.header_ == nil {
  81309. c.header_ = make(http.Header)
  81310. }
  81311. return c.header_
  81312. }
  81313. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  81314. reqHeaders := make(http.Header)
  81315. for k, v := range c.header_ {
  81316. reqHeaders[k] = v
  81317. }
  81318. reqHeaders.Set("User-Agent", c.s.userAgent())
  81319. if c.ifNoneMatch_ != "" {
  81320. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81321. }
  81322. var body io.Reader = nil
  81323. c.urlParams_.Set("alt", alt)
  81324. c.urlParams_.Set("prettyPrint", "false")
  81325. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  81326. urls += "?" + c.urlParams_.Encode()
  81327. req, err := http.NewRequest("GET", urls, body)
  81328. if err != nil {
  81329. return nil, err
  81330. }
  81331. req.Header = reqHeaders
  81332. googleapi.Expand(req.URL, map[string]string{
  81333. "project": c.project,
  81334. })
  81335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81336. }
  81337. // Do executes the "compute.projects.getXpnResources" call.
  81338. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  81339. // non-2xx status code is an error. Response headers are in either
  81340. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  81341. // returned at all) in error.(*googleapi.Error).Header. Use
  81342. // googleapi.IsNotModified to check whether the returned error was
  81343. // because http.StatusNotModified was returned.
  81344. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  81345. gensupport.SetOptions(c.urlParams_, opts...)
  81346. res, err := c.doRequest("json")
  81347. if res != nil && res.StatusCode == http.StatusNotModified {
  81348. if res.Body != nil {
  81349. res.Body.Close()
  81350. }
  81351. return nil, &googleapi.Error{
  81352. Code: res.StatusCode,
  81353. Header: res.Header,
  81354. }
  81355. }
  81356. if err != nil {
  81357. return nil, err
  81358. }
  81359. defer googleapi.CloseBody(res)
  81360. if err := googleapi.CheckResponse(res); err != nil {
  81361. return nil, err
  81362. }
  81363. ret := &ProjectsGetXpnResources{
  81364. ServerResponse: googleapi.ServerResponse{
  81365. Header: res.Header,
  81366. HTTPStatusCode: res.StatusCode,
  81367. },
  81368. }
  81369. target := &ret
  81370. if err := gensupport.DecodeResponse(target, res); err != nil {
  81371. return nil, err
  81372. }
  81373. return ret, nil
  81374. // {
  81375. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  81376. // "httpMethod": "GET",
  81377. // "id": "compute.projects.getXpnResources",
  81378. // "parameterOrder": [
  81379. // "project"
  81380. // ],
  81381. // "parameters": {
  81382. // "filter": {
  81383. // "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).",
  81384. // "location": "query",
  81385. // "type": "string"
  81386. // },
  81387. // "maxResults": {
  81388. // "default": "500",
  81389. // "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)",
  81390. // "format": "uint32",
  81391. // "location": "query",
  81392. // "minimum": "0",
  81393. // "type": "integer"
  81394. // },
  81395. // "order_by": {
  81396. // "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.",
  81397. // "location": "query",
  81398. // "type": "string"
  81399. // },
  81400. // "pageToken": {
  81401. // "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.",
  81402. // "location": "query",
  81403. // "type": "string"
  81404. // },
  81405. // "project": {
  81406. // "description": "Project ID for this request.",
  81407. // "location": "path",
  81408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81409. // "required": true,
  81410. // "type": "string"
  81411. // }
  81412. // },
  81413. // "path": "{project}/getXpnResources",
  81414. // "response": {
  81415. // "$ref": "ProjectsGetXpnResources"
  81416. // },
  81417. // "scopes": [
  81418. // "https://www.googleapis.com/auth/cloud-platform",
  81419. // "https://www.googleapis.com/auth/compute"
  81420. // ]
  81421. // }
  81422. }
  81423. // Pages invokes f for each page of results.
  81424. // A non-nil error returned from f will halt the iteration.
  81425. // The provided context supersedes any context provided to the Context method.
  81426. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  81427. c.ctx_ = ctx
  81428. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81429. for {
  81430. x, err := c.Do()
  81431. if err != nil {
  81432. return err
  81433. }
  81434. if err := f(x); err != nil {
  81435. return err
  81436. }
  81437. if x.NextPageToken == "" {
  81438. return nil
  81439. }
  81440. c.PageToken(x.NextPageToken)
  81441. }
  81442. }
  81443. // method id "compute.projects.listXpnHosts":
  81444. type ProjectsListXpnHostsCall struct {
  81445. s *Service
  81446. project string
  81447. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  81448. urlParams_ gensupport.URLParams
  81449. ctx_ context.Context
  81450. header_ http.Header
  81451. }
  81452. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  81453. // in an organization.
  81454. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  81455. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81456. c.project = project
  81457. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  81458. return c
  81459. }
  81460. // Filter sets the optional parameter "filter": A filter expression that
  81461. // filters resources listed in the response. The expression must specify
  81462. // the field name, a comparison operator, and the value that you want to
  81463. // use for filtering. The value must be a string, a number, or a
  81464. // boolean. The comparison operator must be either =, !=, >, or <.
  81465. //
  81466. // For example, if you are filtering Compute Engine instances, you can
  81467. // exclude instances named example-instance by specifying name !=
  81468. // example-instance.
  81469. //
  81470. // You can also filter nested fields. For example, you could specify
  81471. // scheduling.automaticRestart = false to include instances only if they
  81472. // are not scheduled for automatic restarts. You can use filtering on
  81473. // nested fields to filter based on resource labels.
  81474. //
  81475. // To filter on multiple expressions, provide each separate expression
  81476. // within parentheses. For example, (scheduling.automaticRestart = true)
  81477. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  81478. // AND expression. However, you can include AND and OR expressions
  81479. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  81480. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  81481. // true).
  81482. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  81483. c.urlParams_.Set("filter", filter)
  81484. return c
  81485. }
  81486. // MaxResults sets the optional parameter "maxResults": The maximum
  81487. // number of results per page that should be returned. If the number of
  81488. // available results is larger than maxResults, Compute Engine returns a
  81489. // nextPageToken that can be used to get the next page of results in
  81490. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  81491. // (Default: 500)
  81492. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  81493. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81494. return c
  81495. }
  81496. // OrderBy sets the optional parameter "order_by": Sorts list results by
  81497. // a certain order. By default, results are returned in alphanumerical
  81498. // order based on the resource name.
  81499. //
  81500. // You can also sort results in descending order based on the creation
  81501. // timestamp using orderBy="creationTimestamp desc". This sorts results
  81502. // based on the creationTimestamp field in reverse chronological order
  81503. // (newest result first). Use this to sort resources like operations so
  81504. // that the newest operation is returned first.
  81505. //
  81506. // Currently, only sorting by name or creationTimestamp desc is
  81507. // supported.
  81508. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  81509. c.urlParams_.Set("order_by", orderBy)
  81510. return c
  81511. }
  81512. // PageToken sets the optional parameter "pageToken": Specifies a page
  81513. // token to use. Set pageToken to the nextPageToken returned by a
  81514. // previous list request to get the next page of results.
  81515. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  81516. c.urlParams_.Set("pageToken", pageToken)
  81517. return c
  81518. }
  81519. // Fields allows partial responses to be retrieved. See
  81520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81521. // for more information.
  81522. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  81523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81524. return c
  81525. }
  81526. // Context sets the context to be used in this call's Do method. Any
  81527. // pending HTTP request will be aborted if the provided context is
  81528. // canceled.
  81529. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  81530. c.ctx_ = ctx
  81531. return c
  81532. }
  81533. // Header returns an http.Header that can be modified by the caller to
  81534. // add HTTP headers to the request.
  81535. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  81536. if c.header_ == nil {
  81537. c.header_ = make(http.Header)
  81538. }
  81539. return c.header_
  81540. }
  81541. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  81542. reqHeaders := make(http.Header)
  81543. for k, v := range c.header_ {
  81544. reqHeaders[k] = v
  81545. }
  81546. reqHeaders.Set("User-Agent", c.s.userAgent())
  81547. var body io.Reader = nil
  81548. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  81549. if err != nil {
  81550. return nil, err
  81551. }
  81552. reqHeaders.Set("Content-Type", "application/json")
  81553. c.urlParams_.Set("alt", alt)
  81554. c.urlParams_.Set("prettyPrint", "false")
  81555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  81556. urls += "?" + c.urlParams_.Encode()
  81557. req, err := http.NewRequest("POST", urls, body)
  81558. if err != nil {
  81559. return nil, err
  81560. }
  81561. req.Header = reqHeaders
  81562. googleapi.Expand(req.URL, map[string]string{
  81563. "project": c.project,
  81564. })
  81565. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81566. }
  81567. // Do executes the "compute.projects.listXpnHosts" call.
  81568. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  81569. // status code is an error. Response headers are in either
  81570. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  81571. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81572. // to check whether the returned error was because
  81573. // http.StatusNotModified was returned.
  81574. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  81575. gensupport.SetOptions(c.urlParams_, opts...)
  81576. res, err := c.doRequest("json")
  81577. if res != nil && res.StatusCode == http.StatusNotModified {
  81578. if res.Body != nil {
  81579. res.Body.Close()
  81580. }
  81581. return nil, &googleapi.Error{
  81582. Code: res.StatusCode,
  81583. Header: res.Header,
  81584. }
  81585. }
  81586. if err != nil {
  81587. return nil, err
  81588. }
  81589. defer googleapi.CloseBody(res)
  81590. if err := googleapi.CheckResponse(res); err != nil {
  81591. return nil, err
  81592. }
  81593. ret := &XpnHostList{
  81594. ServerResponse: googleapi.ServerResponse{
  81595. Header: res.Header,
  81596. HTTPStatusCode: res.StatusCode,
  81597. },
  81598. }
  81599. target := &ret
  81600. if err := gensupport.DecodeResponse(target, res); err != nil {
  81601. return nil, err
  81602. }
  81603. return ret, nil
  81604. // {
  81605. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  81606. // "httpMethod": "POST",
  81607. // "id": "compute.projects.listXpnHosts",
  81608. // "parameterOrder": [
  81609. // "project"
  81610. // ],
  81611. // "parameters": {
  81612. // "filter": {
  81613. // "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).",
  81614. // "location": "query",
  81615. // "type": "string"
  81616. // },
  81617. // "maxResults": {
  81618. // "default": "500",
  81619. // "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)",
  81620. // "format": "uint32",
  81621. // "location": "query",
  81622. // "minimum": "0",
  81623. // "type": "integer"
  81624. // },
  81625. // "order_by": {
  81626. // "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.",
  81627. // "location": "query",
  81628. // "type": "string"
  81629. // },
  81630. // "pageToken": {
  81631. // "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.",
  81632. // "location": "query",
  81633. // "type": "string"
  81634. // },
  81635. // "project": {
  81636. // "description": "Project ID for this request.",
  81637. // "location": "path",
  81638. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81639. // "required": true,
  81640. // "type": "string"
  81641. // }
  81642. // },
  81643. // "path": "{project}/listXpnHosts",
  81644. // "request": {
  81645. // "$ref": "ProjectsListXpnHostsRequest"
  81646. // },
  81647. // "response": {
  81648. // "$ref": "XpnHostList"
  81649. // },
  81650. // "scopes": [
  81651. // "https://www.googleapis.com/auth/cloud-platform",
  81652. // "https://www.googleapis.com/auth/compute"
  81653. // ]
  81654. // }
  81655. }
  81656. // Pages invokes f for each page of results.
  81657. // A non-nil error returned from f will halt the iteration.
  81658. // The provided context supersedes any context provided to the Context method.
  81659. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  81660. c.ctx_ = ctx
  81661. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81662. for {
  81663. x, err := c.Do()
  81664. if err != nil {
  81665. return err
  81666. }
  81667. if err := f(x); err != nil {
  81668. return err
  81669. }
  81670. if x.NextPageToken == "" {
  81671. return nil
  81672. }
  81673. c.PageToken(x.NextPageToken)
  81674. }
  81675. }
  81676. // method id "compute.projects.moveDisk":
  81677. type ProjectsMoveDiskCall struct {
  81678. s *Service
  81679. project string
  81680. diskmoverequest *DiskMoveRequest
  81681. urlParams_ gensupport.URLParams
  81682. ctx_ context.Context
  81683. header_ http.Header
  81684. }
  81685. // MoveDisk: Moves a persistent disk from one zone to another.
  81686. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  81687. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81688. c.project = project
  81689. c.diskmoverequest = diskmoverequest
  81690. return c
  81691. }
  81692. // RequestId sets the optional parameter "requestId": An optional
  81693. // request ID to identify requests. Specify a unique request ID so that
  81694. // if you must retry your request, the server will know to ignore the
  81695. // request if it has already been completed.
  81696. //
  81697. // For example, consider a situation where you make an initial request
  81698. // and the request times out. If you make the request again with the
  81699. // same request ID, the server can check if original operation with the
  81700. // same request ID was received, and if so, will ignore the second
  81701. // request. This prevents clients from accidentally creating duplicate
  81702. // commitments.
  81703. //
  81704. // The request ID must be a valid UUID with the exception that zero UUID
  81705. // is not supported (00000000-0000-0000-0000-000000000000).
  81706. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  81707. c.urlParams_.Set("requestId", requestId)
  81708. return c
  81709. }
  81710. // Fields allows partial responses to be retrieved. See
  81711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81712. // for more information.
  81713. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  81714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81715. return c
  81716. }
  81717. // Context sets the context to be used in this call's Do method. Any
  81718. // pending HTTP request will be aborted if the provided context is
  81719. // canceled.
  81720. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  81721. c.ctx_ = ctx
  81722. return c
  81723. }
  81724. // Header returns an http.Header that can be modified by the caller to
  81725. // add HTTP headers to the request.
  81726. func (c *ProjectsMoveDiskCall) Header() http.Header {
  81727. if c.header_ == nil {
  81728. c.header_ = make(http.Header)
  81729. }
  81730. return c.header_
  81731. }
  81732. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  81733. reqHeaders := make(http.Header)
  81734. for k, v := range c.header_ {
  81735. reqHeaders[k] = v
  81736. }
  81737. reqHeaders.Set("User-Agent", c.s.userAgent())
  81738. var body io.Reader = nil
  81739. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  81740. if err != nil {
  81741. return nil, err
  81742. }
  81743. reqHeaders.Set("Content-Type", "application/json")
  81744. c.urlParams_.Set("alt", alt)
  81745. c.urlParams_.Set("prettyPrint", "false")
  81746. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  81747. urls += "?" + c.urlParams_.Encode()
  81748. req, err := http.NewRequest("POST", urls, body)
  81749. if err != nil {
  81750. return nil, err
  81751. }
  81752. req.Header = reqHeaders
  81753. googleapi.Expand(req.URL, map[string]string{
  81754. "project": c.project,
  81755. })
  81756. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81757. }
  81758. // Do executes the "compute.projects.moveDisk" call.
  81759. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81760. // status code is an error. Response headers are in either
  81761. // *Operation.ServerResponse.Header or (if a response was returned at
  81762. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81763. // to check whether the returned error was because
  81764. // http.StatusNotModified was returned.
  81765. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81766. gensupport.SetOptions(c.urlParams_, opts...)
  81767. res, err := c.doRequest("json")
  81768. if res != nil && res.StatusCode == http.StatusNotModified {
  81769. if res.Body != nil {
  81770. res.Body.Close()
  81771. }
  81772. return nil, &googleapi.Error{
  81773. Code: res.StatusCode,
  81774. Header: res.Header,
  81775. }
  81776. }
  81777. if err != nil {
  81778. return nil, err
  81779. }
  81780. defer googleapi.CloseBody(res)
  81781. if err := googleapi.CheckResponse(res); err != nil {
  81782. return nil, err
  81783. }
  81784. ret := &Operation{
  81785. ServerResponse: googleapi.ServerResponse{
  81786. Header: res.Header,
  81787. HTTPStatusCode: res.StatusCode,
  81788. },
  81789. }
  81790. target := &ret
  81791. if err := gensupport.DecodeResponse(target, res); err != nil {
  81792. return nil, err
  81793. }
  81794. return ret, nil
  81795. // {
  81796. // "description": "Moves a persistent disk from one zone to another.",
  81797. // "httpMethod": "POST",
  81798. // "id": "compute.projects.moveDisk",
  81799. // "parameterOrder": [
  81800. // "project"
  81801. // ],
  81802. // "parameters": {
  81803. // "project": {
  81804. // "description": "Project ID for this request.",
  81805. // "location": "path",
  81806. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81807. // "required": true,
  81808. // "type": "string"
  81809. // },
  81810. // "requestId": {
  81811. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81812. // "location": "query",
  81813. // "type": "string"
  81814. // }
  81815. // },
  81816. // "path": "{project}/moveDisk",
  81817. // "request": {
  81818. // "$ref": "DiskMoveRequest"
  81819. // },
  81820. // "response": {
  81821. // "$ref": "Operation"
  81822. // },
  81823. // "scopes": [
  81824. // "https://www.googleapis.com/auth/cloud-platform",
  81825. // "https://www.googleapis.com/auth/compute"
  81826. // ]
  81827. // }
  81828. }
  81829. // method id "compute.projects.moveInstance":
  81830. type ProjectsMoveInstanceCall struct {
  81831. s *Service
  81832. project string
  81833. instancemoverequest *InstanceMoveRequest
  81834. urlParams_ gensupport.URLParams
  81835. ctx_ context.Context
  81836. header_ http.Header
  81837. }
  81838. // MoveInstance: Moves an instance and its attached persistent disks
  81839. // from one zone to another.
  81840. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  81841. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81842. c.project = project
  81843. c.instancemoverequest = instancemoverequest
  81844. return c
  81845. }
  81846. // RequestId sets the optional parameter "requestId": An optional
  81847. // request ID to identify requests. Specify a unique request ID so that
  81848. // if you must retry your request, the server will know to ignore the
  81849. // request if it has already been completed.
  81850. //
  81851. // For example, consider a situation where you make an initial request
  81852. // and the request times out. If you make the request again with the
  81853. // same request ID, the server can check if original operation with the
  81854. // same request ID was received, and if so, will ignore the second
  81855. // request. This prevents clients from accidentally creating duplicate
  81856. // commitments.
  81857. //
  81858. // The request ID must be a valid UUID with the exception that zero UUID
  81859. // is not supported (00000000-0000-0000-0000-000000000000).
  81860. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  81861. c.urlParams_.Set("requestId", requestId)
  81862. return c
  81863. }
  81864. // Fields allows partial responses to be retrieved. See
  81865. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81866. // for more information.
  81867. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  81868. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81869. return c
  81870. }
  81871. // Context sets the context to be used in this call's Do method. Any
  81872. // pending HTTP request will be aborted if the provided context is
  81873. // canceled.
  81874. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  81875. c.ctx_ = ctx
  81876. return c
  81877. }
  81878. // Header returns an http.Header that can be modified by the caller to
  81879. // add HTTP headers to the request.
  81880. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  81881. if c.header_ == nil {
  81882. c.header_ = make(http.Header)
  81883. }
  81884. return c.header_
  81885. }
  81886. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  81887. reqHeaders := make(http.Header)
  81888. for k, v := range c.header_ {
  81889. reqHeaders[k] = v
  81890. }
  81891. reqHeaders.Set("User-Agent", c.s.userAgent())
  81892. var body io.Reader = nil
  81893. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  81894. if err != nil {
  81895. return nil, err
  81896. }
  81897. reqHeaders.Set("Content-Type", "application/json")
  81898. c.urlParams_.Set("alt", alt)
  81899. c.urlParams_.Set("prettyPrint", "false")
  81900. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  81901. urls += "?" + c.urlParams_.Encode()
  81902. req, err := http.NewRequest("POST", urls, body)
  81903. if err != nil {
  81904. return nil, err
  81905. }
  81906. req.Header = reqHeaders
  81907. googleapi.Expand(req.URL, map[string]string{
  81908. "project": c.project,
  81909. })
  81910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81911. }
  81912. // Do executes the "compute.projects.moveInstance" call.
  81913. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81914. // status code is an error. Response headers are in either
  81915. // *Operation.ServerResponse.Header or (if a response was returned at
  81916. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81917. // to check whether the returned error was because
  81918. // http.StatusNotModified was returned.
  81919. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81920. gensupport.SetOptions(c.urlParams_, opts...)
  81921. res, err := c.doRequest("json")
  81922. if res != nil && res.StatusCode == http.StatusNotModified {
  81923. if res.Body != nil {
  81924. res.Body.Close()
  81925. }
  81926. return nil, &googleapi.Error{
  81927. Code: res.StatusCode,
  81928. Header: res.Header,
  81929. }
  81930. }
  81931. if err != nil {
  81932. return nil, err
  81933. }
  81934. defer googleapi.CloseBody(res)
  81935. if err := googleapi.CheckResponse(res); err != nil {
  81936. return nil, err
  81937. }
  81938. ret := &Operation{
  81939. ServerResponse: googleapi.ServerResponse{
  81940. Header: res.Header,
  81941. HTTPStatusCode: res.StatusCode,
  81942. },
  81943. }
  81944. target := &ret
  81945. if err := gensupport.DecodeResponse(target, res); err != nil {
  81946. return nil, err
  81947. }
  81948. return ret, nil
  81949. // {
  81950. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  81951. // "httpMethod": "POST",
  81952. // "id": "compute.projects.moveInstance",
  81953. // "parameterOrder": [
  81954. // "project"
  81955. // ],
  81956. // "parameters": {
  81957. // "project": {
  81958. // "description": "Project ID for this request.",
  81959. // "location": "path",
  81960. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81961. // "required": true,
  81962. // "type": "string"
  81963. // },
  81964. // "requestId": {
  81965. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81966. // "location": "query",
  81967. // "type": "string"
  81968. // }
  81969. // },
  81970. // "path": "{project}/moveInstance",
  81971. // "request": {
  81972. // "$ref": "InstanceMoveRequest"
  81973. // },
  81974. // "response": {
  81975. // "$ref": "Operation"
  81976. // },
  81977. // "scopes": [
  81978. // "https://www.googleapis.com/auth/cloud-platform",
  81979. // "https://www.googleapis.com/auth/compute"
  81980. // ]
  81981. // }
  81982. }
  81983. // method id "compute.projects.setCommonInstanceMetadata":
  81984. type ProjectsSetCommonInstanceMetadataCall struct {
  81985. s *Service
  81986. project string
  81987. metadata *Metadata
  81988. urlParams_ gensupport.URLParams
  81989. ctx_ context.Context
  81990. header_ http.Header
  81991. }
  81992. // SetCommonInstanceMetadata: Sets metadata common to all instances
  81993. // within the specified project using the data included in the request.
  81994. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  81995. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  81996. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81997. c.project = project
  81998. c.metadata = metadata
  81999. return c
  82000. }
  82001. // RequestId sets the optional parameter "requestId": An optional
  82002. // request ID to identify requests. Specify a unique request ID so that
  82003. // if you must retry your request, the server will know to ignore the
  82004. // request if it has already been completed.
  82005. //
  82006. // For example, consider a situation where you make an initial request
  82007. // and the request times out. If you make the request again with the
  82008. // same request ID, the server can check if original operation with the
  82009. // same request ID was received, and if so, will ignore the second
  82010. // request. This prevents clients from accidentally creating duplicate
  82011. // commitments.
  82012. //
  82013. // The request ID must be a valid UUID with the exception that zero UUID
  82014. // is not supported (00000000-0000-0000-0000-000000000000).
  82015. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  82016. c.urlParams_.Set("requestId", requestId)
  82017. return c
  82018. }
  82019. // Fields allows partial responses to be retrieved. See
  82020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82021. // for more information.
  82022. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  82023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82024. return c
  82025. }
  82026. // Context sets the context to be used in this call's Do method. Any
  82027. // pending HTTP request will be aborted if the provided context is
  82028. // canceled.
  82029. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  82030. c.ctx_ = ctx
  82031. return c
  82032. }
  82033. // Header returns an http.Header that can be modified by the caller to
  82034. // add HTTP headers to the request.
  82035. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  82036. if c.header_ == nil {
  82037. c.header_ = make(http.Header)
  82038. }
  82039. return c.header_
  82040. }
  82041. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  82042. reqHeaders := make(http.Header)
  82043. for k, v := range c.header_ {
  82044. reqHeaders[k] = v
  82045. }
  82046. reqHeaders.Set("User-Agent", c.s.userAgent())
  82047. var body io.Reader = nil
  82048. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  82049. if err != nil {
  82050. return nil, err
  82051. }
  82052. reqHeaders.Set("Content-Type", "application/json")
  82053. c.urlParams_.Set("alt", alt)
  82054. c.urlParams_.Set("prettyPrint", "false")
  82055. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  82056. urls += "?" + c.urlParams_.Encode()
  82057. req, err := http.NewRequest("POST", urls, body)
  82058. if err != nil {
  82059. return nil, err
  82060. }
  82061. req.Header = reqHeaders
  82062. googleapi.Expand(req.URL, map[string]string{
  82063. "project": c.project,
  82064. })
  82065. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82066. }
  82067. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  82068. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82069. // status code is an error. Response headers are in either
  82070. // *Operation.ServerResponse.Header or (if a response was returned at
  82071. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82072. // to check whether the returned error was because
  82073. // http.StatusNotModified was returned.
  82074. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82075. gensupport.SetOptions(c.urlParams_, opts...)
  82076. res, err := c.doRequest("json")
  82077. if res != nil && res.StatusCode == http.StatusNotModified {
  82078. if res.Body != nil {
  82079. res.Body.Close()
  82080. }
  82081. return nil, &googleapi.Error{
  82082. Code: res.StatusCode,
  82083. Header: res.Header,
  82084. }
  82085. }
  82086. if err != nil {
  82087. return nil, err
  82088. }
  82089. defer googleapi.CloseBody(res)
  82090. if err := googleapi.CheckResponse(res); err != nil {
  82091. return nil, err
  82092. }
  82093. ret := &Operation{
  82094. ServerResponse: googleapi.ServerResponse{
  82095. Header: res.Header,
  82096. HTTPStatusCode: res.StatusCode,
  82097. },
  82098. }
  82099. target := &ret
  82100. if err := gensupport.DecodeResponse(target, res); err != nil {
  82101. return nil, err
  82102. }
  82103. return ret, nil
  82104. // {
  82105. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  82106. // "httpMethod": "POST",
  82107. // "id": "compute.projects.setCommonInstanceMetadata",
  82108. // "parameterOrder": [
  82109. // "project"
  82110. // ],
  82111. // "parameters": {
  82112. // "project": {
  82113. // "description": "Project ID for this request.",
  82114. // "location": "path",
  82115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82116. // "required": true,
  82117. // "type": "string"
  82118. // },
  82119. // "requestId": {
  82120. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82121. // "location": "query",
  82122. // "type": "string"
  82123. // }
  82124. // },
  82125. // "path": "{project}/setCommonInstanceMetadata",
  82126. // "request": {
  82127. // "$ref": "Metadata"
  82128. // },
  82129. // "response": {
  82130. // "$ref": "Operation"
  82131. // },
  82132. // "scopes": [
  82133. // "https://www.googleapis.com/auth/cloud-platform",
  82134. // "https://www.googleapis.com/auth/compute"
  82135. // ]
  82136. // }
  82137. }
  82138. // method id "compute.projects.setDefaultNetworkTier":
  82139. type ProjectsSetDefaultNetworkTierCall struct {
  82140. s *Service
  82141. project string
  82142. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  82143. urlParams_ gensupport.URLParams
  82144. ctx_ context.Context
  82145. header_ http.Header
  82146. }
  82147. // SetDefaultNetworkTier: Sets the default network tier of the project.
  82148. // The default network tier is used when an
  82149. // address/forwardingRule/instance is created without specifying the
  82150. // network tier field.
  82151. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  82152. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82153. c.project = project
  82154. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  82155. return c
  82156. }
  82157. // RequestId sets the optional parameter "requestId": An optional
  82158. // request ID to identify requests. Specify a unique request ID so that
  82159. // if you must retry your request, the server will know to ignore the
  82160. // request if it has already been completed.
  82161. //
  82162. // For example, consider a situation where you make an initial request
  82163. // and the request times out. If you make the request again with the
  82164. // same request ID, the server can check if original operation with the
  82165. // same request ID was received, and if so, will ignore the second
  82166. // request. This prevents clients from accidentally creating duplicate
  82167. // commitments.
  82168. //
  82169. // The request ID must be a valid UUID with the exception that zero UUID
  82170. // is not supported (00000000-0000-0000-0000-000000000000).
  82171. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  82172. c.urlParams_.Set("requestId", requestId)
  82173. return c
  82174. }
  82175. // Fields allows partial responses to be retrieved. See
  82176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82177. // for more information.
  82178. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  82179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82180. return c
  82181. }
  82182. // Context sets the context to be used in this call's Do method. Any
  82183. // pending HTTP request will be aborted if the provided context is
  82184. // canceled.
  82185. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  82186. c.ctx_ = ctx
  82187. return c
  82188. }
  82189. // Header returns an http.Header that can be modified by the caller to
  82190. // add HTTP headers to the request.
  82191. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  82192. if c.header_ == nil {
  82193. c.header_ = make(http.Header)
  82194. }
  82195. return c.header_
  82196. }
  82197. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  82198. reqHeaders := make(http.Header)
  82199. for k, v := range c.header_ {
  82200. reqHeaders[k] = v
  82201. }
  82202. reqHeaders.Set("User-Agent", c.s.userAgent())
  82203. var body io.Reader = nil
  82204. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  82205. if err != nil {
  82206. return nil, err
  82207. }
  82208. reqHeaders.Set("Content-Type", "application/json")
  82209. c.urlParams_.Set("alt", alt)
  82210. c.urlParams_.Set("prettyPrint", "false")
  82211. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  82212. urls += "?" + c.urlParams_.Encode()
  82213. req, err := http.NewRequest("POST", urls, body)
  82214. if err != nil {
  82215. return nil, err
  82216. }
  82217. req.Header = reqHeaders
  82218. googleapi.Expand(req.URL, map[string]string{
  82219. "project": c.project,
  82220. })
  82221. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82222. }
  82223. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  82224. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82225. // status code is an error. Response headers are in either
  82226. // *Operation.ServerResponse.Header or (if a response was returned at
  82227. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82228. // to check whether the returned error was because
  82229. // http.StatusNotModified was returned.
  82230. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82231. gensupport.SetOptions(c.urlParams_, opts...)
  82232. res, err := c.doRequest("json")
  82233. if res != nil && res.StatusCode == http.StatusNotModified {
  82234. if res.Body != nil {
  82235. res.Body.Close()
  82236. }
  82237. return nil, &googleapi.Error{
  82238. Code: res.StatusCode,
  82239. Header: res.Header,
  82240. }
  82241. }
  82242. if err != nil {
  82243. return nil, err
  82244. }
  82245. defer googleapi.CloseBody(res)
  82246. if err := googleapi.CheckResponse(res); err != nil {
  82247. return nil, err
  82248. }
  82249. ret := &Operation{
  82250. ServerResponse: googleapi.ServerResponse{
  82251. Header: res.Header,
  82252. HTTPStatusCode: res.StatusCode,
  82253. },
  82254. }
  82255. target := &ret
  82256. if err := gensupport.DecodeResponse(target, res); err != nil {
  82257. return nil, err
  82258. }
  82259. return ret, nil
  82260. // {
  82261. // "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.",
  82262. // "httpMethod": "POST",
  82263. // "id": "compute.projects.setDefaultNetworkTier",
  82264. // "parameterOrder": [
  82265. // "project"
  82266. // ],
  82267. // "parameters": {
  82268. // "project": {
  82269. // "description": "Project ID for this request.",
  82270. // "location": "path",
  82271. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82272. // "required": true,
  82273. // "type": "string"
  82274. // },
  82275. // "requestId": {
  82276. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82277. // "location": "query",
  82278. // "type": "string"
  82279. // }
  82280. // },
  82281. // "path": "{project}/setDefaultNetworkTier",
  82282. // "request": {
  82283. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  82284. // },
  82285. // "response": {
  82286. // "$ref": "Operation"
  82287. // },
  82288. // "scopes": [
  82289. // "https://www.googleapis.com/auth/cloud-platform",
  82290. // "https://www.googleapis.com/auth/compute"
  82291. // ]
  82292. // }
  82293. }
  82294. // method id "compute.projects.setUsageExportBucket":
  82295. type ProjectsSetUsageExportBucketCall struct {
  82296. s *Service
  82297. project string
  82298. usageexportlocation *UsageExportLocation
  82299. urlParams_ gensupport.URLParams
  82300. ctx_ context.Context
  82301. header_ http.Header
  82302. }
  82303. // SetUsageExportBucket: Enables the usage export feature and sets the
  82304. // usage export bucket where reports are stored. If you provide an empty
  82305. // request body using this method, the usage export feature will be
  82306. // disabled.
  82307. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  82308. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  82309. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82310. c.project = project
  82311. c.usageexportlocation = usageexportlocation
  82312. return c
  82313. }
  82314. // RequestId sets the optional parameter "requestId": An optional
  82315. // request ID to identify requests. Specify a unique request ID so that
  82316. // if you must retry your request, the server will know to ignore the
  82317. // request if it has already been completed.
  82318. //
  82319. // For example, consider a situation where you make an initial request
  82320. // and the request times out. If you make the request again with the
  82321. // same request ID, the server can check if original operation with the
  82322. // same request ID was received, and if so, will ignore the second
  82323. // request. This prevents clients from accidentally creating duplicate
  82324. // commitments.
  82325. //
  82326. // The request ID must be a valid UUID with the exception that zero UUID
  82327. // is not supported (00000000-0000-0000-0000-000000000000).
  82328. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  82329. c.urlParams_.Set("requestId", requestId)
  82330. return c
  82331. }
  82332. // Fields allows partial responses to be retrieved. See
  82333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82334. // for more information.
  82335. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  82336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82337. return c
  82338. }
  82339. // Context sets the context to be used in this call's Do method. Any
  82340. // pending HTTP request will be aborted if the provided context is
  82341. // canceled.
  82342. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  82343. c.ctx_ = ctx
  82344. return c
  82345. }
  82346. // Header returns an http.Header that can be modified by the caller to
  82347. // add HTTP headers to the request.
  82348. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  82349. if c.header_ == nil {
  82350. c.header_ = make(http.Header)
  82351. }
  82352. return c.header_
  82353. }
  82354. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  82355. reqHeaders := make(http.Header)
  82356. for k, v := range c.header_ {
  82357. reqHeaders[k] = v
  82358. }
  82359. reqHeaders.Set("User-Agent", c.s.userAgent())
  82360. var body io.Reader = nil
  82361. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  82362. if err != nil {
  82363. return nil, err
  82364. }
  82365. reqHeaders.Set("Content-Type", "application/json")
  82366. c.urlParams_.Set("alt", alt)
  82367. c.urlParams_.Set("prettyPrint", "false")
  82368. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  82369. urls += "?" + c.urlParams_.Encode()
  82370. req, err := http.NewRequest("POST", urls, body)
  82371. if err != nil {
  82372. return nil, err
  82373. }
  82374. req.Header = reqHeaders
  82375. googleapi.Expand(req.URL, map[string]string{
  82376. "project": c.project,
  82377. })
  82378. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82379. }
  82380. // Do executes the "compute.projects.setUsageExportBucket" call.
  82381. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82382. // status code is an error. Response headers are in either
  82383. // *Operation.ServerResponse.Header or (if a response was returned at
  82384. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82385. // to check whether the returned error was because
  82386. // http.StatusNotModified was returned.
  82387. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82388. gensupport.SetOptions(c.urlParams_, opts...)
  82389. res, err := c.doRequest("json")
  82390. if res != nil && res.StatusCode == http.StatusNotModified {
  82391. if res.Body != nil {
  82392. res.Body.Close()
  82393. }
  82394. return nil, &googleapi.Error{
  82395. Code: res.StatusCode,
  82396. Header: res.Header,
  82397. }
  82398. }
  82399. if err != nil {
  82400. return nil, err
  82401. }
  82402. defer googleapi.CloseBody(res)
  82403. if err := googleapi.CheckResponse(res); err != nil {
  82404. return nil, err
  82405. }
  82406. ret := &Operation{
  82407. ServerResponse: googleapi.ServerResponse{
  82408. Header: res.Header,
  82409. HTTPStatusCode: res.StatusCode,
  82410. },
  82411. }
  82412. target := &ret
  82413. if err := gensupport.DecodeResponse(target, res); err != nil {
  82414. return nil, err
  82415. }
  82416. return ret, nil
  82417. // {
  82418. // "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.",
  82419. // "httpMethod": "POST",
  82420. // "id": "compute.projects.setUsageExportBucket",
  82421. // "parameterOrder": [
  82422. // "project"
  82423. // ],
  82424. // "parameters": {
  82425. // "project": {
  82426. // "description": "Project ID for this request.",
  82427. // "location": "path",
  82428. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82429. // "required": true,
  82430. // "type": "string"
  82431. // },
  82432. // "requestId": {
  82433. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82434. // "location": "query",
  82435. // "type": "string"
  82436. // }
  82437. // },
  82438. // "path": "{project}/setUsageExportBucket",
  82439. // "request": {
  82440. // "$ref": "UsageExportLocation"
  82441. // },
  82442. // "response": {
  82443. // "$ref": "Operation"
  82444. // },
  82445. // "scopes": [
  82446. // "https://www.googleapis.com/auth/cloud-platform",
  82447. // "https://www.googleapis.com/auth/compute",
  82448. // "https://www.googleapis.com/auth/devstorage.full_control",
  82449. // "https://www.googleapis.com/auth/devstorage.read_only",
  82450. // "https://www.googleapis.com/auth/devstorage.read_write"
  82451. // ]
  82452. // }
  82453. }
  82454. // method id "compute.regionAutoscalers.delete":
  82455. type RegionAutoscalersDeleteCall struct {
  82456. s *Service
  82457. project string
  82458. region string
  82459. autoscaler string
  82460. urlParams_ gensupport.URLParams
  82461. ctx_ context.Context
  82462. header_ http.Header
  82463. }
  82464. // Delete: Deletes the specified autoscaler.
  82465. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  82466. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82467. c.project = project
  82468. c.region = region
  82469. c.autoscaler = autoscaler
  82470. return c
  82471. }
  82472. // RequestId sets the optional parameter "requestId": An optional
  82473. // request ID to identify requests. Specify a unique request ID so that
  82474. // if you must retry your request, the server will know to ignore the
  82475. // request if it has already been completed.
  82476. //
  82477. // For example, consider a situation where you make an initial request
  82478. // and the request times out. If you make the request again with the
  82479. // same request ID, the server can check if original operation with the
  82480. // same request ID was received, and if so, will ignore the second
  82481. // request. This prevents clients from accidentally creating duplicate
  82482. // commitments.
  82483. //
  82484. // The request ID must be a valid UUID with the exception that zero UUID
  82485. // is not supported (00000000-0000-0000-0000-000000000000).
  82486. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  82487. c.urlParams_.Set("requestId", requestId)
  82488. return c
  82489. }
  82490. // Fields allows partial responses to be retrieved. See
  82491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82492. // for more information.
  82493. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  82494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82495. return c
  82496. }
  82497. // Context sets the context to be used in this call's Do method. Any
  82498. // pending HTTP request will be aborted if the provided context is
  82499. // canceled.
  82500. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  82501. c.ctx_ = ctx
  82502. return c
  82503. }
  82504. // Header returns an http.Header that can be modified by the caller to
  82505. // add HTTP headers to the request.
  82506. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  82507. if c.header_ == nil {
  82508. c.header_ = make(http.Header)
  82509. }
  82510. return c.header_
  82511. }
  82512. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  82513. reqHeaders := make(http.Header)
  82514. for k, v := range c.header_ {
  82515. reqHeaders[k] = v
  82516. }
  82517. reqHeaders.Set("User-Agent", c.s.userAgent())
  82518. var body io.Reader = nil
  82519. c.urlParams_.Set("alt", alt)
  82520. c.urlParams_.Set("prettyPrint", "false")
  82521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  82522. urls += "?" + c.urlParams_.Encode()
  82523. req, err := http.NewRequest("DELETE", urls, body)
  82524. if err != nil {
  82525. return nil, err
  82526. }
  82527. req.Header = reqHeaders
  82528. googleapi.Expand(req.URL, map[string]string{
  82529. "project": c.project,
  82530. "region": c.region,
  82531. "autoscaler": c.autoscaler,
  82532. })
  82533. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82534. }
  82535. // Do executes the "compute.regionAutoscalers.delete" call.
  82536. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82537. // status code is an error. Response headers are in either
  82538. // *Operation.ServerResponse.Header or (if a response was returned at
  82539. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82540. // to check whether the returned error was because
  82541. // http.StatusNotModified was returned.
  82542. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82543. gensupport.SetOptions(c.urlParams_, opts...)
  82544. res, err := c.doRequest("json")
  82545. if res != nil && res.StatusCode == http.StatusNotModified {
  82546. if res.Body != nil {
  82547. res.Body.Close()
  82548. }
  82549. return nil, &googleapi.Error{
  82550. Code: res.StatusCode,
  82551. Header: res.Header,
  82552. }
  82553. }
  82554. if err != nil {
  82555. return nil, err
  82556. }
  82557. defer googleapi.CloseBody(res)
  82558. if err := googleapi.CheckResponse(res); err != nil {
  82559. return nil, err
  82560. }
  82561. ret := &Operation{
  82562. ServerResponse: googleapi.ServerResponse{
  82563. Header: res.Header,
  82564. HTTPStatusCode: res.StatusCode,
  82565. },
  82566. }
  82567. target := &ret
  82568. if err := gensupport.DecodeResponse(target, res); err != nil {
  82569. return nil, err
  82570. }
  82571. return ret, nil
  82572. // {
  82573. // "description": "Deletes the specified autoscaler.",
  82574. // "httpMethod": "DELETE",
  82575. // "id": "compute.regionAutoscalers.delete",
  82576. // "parameterOrder": [
  82577. // "project",
  82578. // "region",
  82579. // "autoscaler"
  82580. // ],
  82581. // "parameters": {
  82582. // "autoscaler": {
  82583. // "description": "Name of the autoscaler to delete.",
  82584. // "location": "path",
  82585. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82586. // "required": true,
  82587. // "type": "string"
  82588. // },
  82589. // "project": {
  82590. // "description": "Project ID for this request.",
  82591. // "location": "path",
  82592. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82593. // "required": true,
  82594. // "type": "string"
  82595. // },
  82596. // "region": {
  82597. // "description": "Name of the region scoping this request.",
  82598. // "location": "path",
  82599. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82600. // "required": true,
  82601. // "type": "string"
  82602. // },
  82603. // "requestId": {
  82604. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82605. // "location": "query",
  82606. // "type": "string"
  82607. // }
  82608. // },
  82609. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  82610. // "response": {
  82611. // "$ref": "Operation"
  82612. // },
  82613. // "scopes": [
  82614. // "https://www.googleapis.com/auth/cloud-platform",
  82615. // "https://www.googleapis.com/auth/compute"
  82616. // ]
  82617. // }
  82618. }
  82619. // method id "compute.regionAutoscalers.get":
  82620. type RegionAutoscalersGetCall struct {
  82621. s *Service
  82622. project string
  82623. region string
  82624. autoscaler string
  82625. urlParams_ gensupport.URLParams
  82626. ifNoneMatch_ string
  82627. ctx_ context.Context
  82628. header_ http.Header
  82629. }
  82630. // Get: Returns the specified autoscaler.
  82631. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  82632. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82633. c.project = project
  82634. c.region = region
  82635. c.autoscaler = autoscaler
  82636. return c
  82637. }
  82638. // Fields allows partial responses to be retrieved. See
  82639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82640. // for more information.
  82641. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  82642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82643. return c
  82644. }
  82645. // IfNoneMatch sets the optional parameter which makes the operation
  82646. // fail if the object's ETag matches the given value. This is useful for
  82647. // getting updates only after the object has changed since the last
  82648. // request. Use googleapi.IsNotModified to check whether the response
  82649. // error from Do is the result of In-None-Match.
  82650. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  82651. c.ifNoneMatch_ = entityTag
  82652. return c
  82653. }
  82654. // Context sets the context to be used in this call's Do method. Any
  82655. // pending HTTP request will be aborted if the provided context is
  82656. // canceled.
  82657. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  82658. c.ctx_ = ctx
  82659. return c
  82660. }
  82661. // Header returns an http.Header that can be modified by the caller to
  82662. // add HTTP headers to the request.
  82663. func (c *RegionAutoscalersGetCall) Header() http.Header {
  82664. if c.header_ == nil {
  82665. c.header_ = make(http.Header)
  82666. }
  82667. return c.header_
  82668. }
  82669. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  82670. reqHeaders := make(http.Header)
  82671. for k, v := range c.header_ {
  82672. reqHeaders[k] = v
  82673. }
  82674. reqHeaders.Set("User-Agent", c.s.userAgent())
  82675. if c.ifNoneMatch_ != "" {
  82676. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82677. }
  82678. var body io.Reader = nil
  82679. c.urlParams_.Set("alt", alt)
  82680. c.urlParams_.Set("prettyPrint", "false")
  82681. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  82682. urls += "?" + c.urlParams_.Encode()
  82683. req, err := http.NewRequest("GET", urls, body)
  82684. if err != nil {
  82685. return nil, err
  82686. }
  82687. req.Header = reqHeaders
  82688. googleapi.Expand(req.URL, map[string]string{
  82689. "project": c.project,
  82690. "region": c.region,
  82691. "autoscaler": c.autoscaler,
  82692. })
  82693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82694. }
  82695. // Do executes the "compute.regionAutoscalers.get" call.
  82696. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  82697. // status code is an error. Response headers are in either
  82698. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  82699. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82700. // to check whether the returned error was because
  82701. // http.StatusNotModified was returned.
  82702. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  82703. gensupport.SetOptions(c.urlParams_, opts...)
  82704. res, err := c.doRequest("json")
  82705. if res != nil && res.StatusCode == http.StatusNotModified {
  82706. if res.Body != nil {
  82707. res.Body.Close()
  82708. }
  82709. return nil, &googleapi.Error{
  82710. Code: res.StatusCode,
  82711. Header: res.Header,
  82712. }
  82713. }
  82714. if err != nil {
  82715. return nil, err
  82716. }
  82717. defer googleapi.CloseBody(res)
  82718. if err := googleapi.CheckResponse(res); err != nil {
  82719. return nil, err
  82720. }
  82721. ret := &Autoscaler{
  82722. ServerResponse: googleapi.ServerResponse{
  82723. Header: res.Header,
  82724. HTTPStatusCode: res.StatusCode,
  82725. },
  82726. }
  82727. target := &ret
  82728. if err := gensupport.DecodeResponse(target, res); err != nil {
  82729. return nil, err
  82730. }
  82731. return ret, nil
  82732. // {
  82733. // "description": "Returns the specified autoscaler.",
  82734. // "httpMethod": "GET",
  82735. // "id": "compute.regionAutoscalers.get",
  82736. // "parameterOrder": [
  82737. // "project",
  82738. // "region",
  82739. // "autoscaler"
  82740. // ],
  82741. // "parameters": {
  82742. // "autoscaler": {
  82743. // "description": "Name of the autoscaler to return.",
  82744. // "location": "path",
  82745. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82746. // "required": true,
  82747. // "type": "string"
  82748. // },
  82749. // "project": {
  82750. // "description": "Project ID for this request.",
  82751. // "location": "path",
  82752. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82753. // "required": true,
  82754. // "type": "string"
  82755. // },
  82756. // "region": {
  82757. // "description": "Name of the region scoping this request.",
  82758. // "location": "path",
  82759. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82760. // "required": true,
  82761. // "type": "string"
  82762. // }
  82763. // },
  82764. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  82765. // "response": {
  82766. // "$ref": "Autoscaler"
  82767. // },
  82768. // "scopes": [
  82769. // "https://www.googleapis.com/auth/cloud-platform",
  82770. // "https://www.googleapis.com/auth/compute",
  82771. // "https://www.googleapis.com/auth/compute.readonly"
  82772. // ]
  82773. // }
  82774. }
  82775. // method id "compute.regionAutoscalers.insert":
  82776. type RegionAutoscalersInsertCall struct {
  82777. s *Service
  82778. project string
  82779. region string
  82780. autoscaler *Autoscaler
  82781. urlParams_ gensupport.URLParams
  82782. ctx_ context.Context
  82783. header_ http.Header
  82784. }
  82785. // Insert: Creates an autoscaler in the specified project using the data
  82786. // included in the request.
  82787. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  82788. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82789. c.project = project
  82790. c.region = region
  82791. c.autoscaler = autoscaler
  82792. return c
  82793. }
  82794. // RequestId sets the optional parameter "requestId": An optional
  82795. // request ID to identify requests. Specify a unique request ID so that
  82796. // if you must retry your request, the server will know to ignore the
  82797. // request if it has already been completed.
  82798. //
  82799. // For example, consider a situation where you make an initial request
  82800. // and the request times out. If you make the request again with the
  82801. // same request ID, the server can check if original operation with the
  82802. // same request ID was received, and if so, will ignore the second
  82803. // request. This prevents clients from accidentally creating duplicate
  82804. // commitments.
  82805. //
  82806. // The request ID must be a valid UUID with the exception that zero UUID
  82807. // is not supported (00000000-0000-0000-0000-000000000000).
  82808. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  82809. c.urlParams_.Set("requestId", requestId)
  82810. return c
  82811. }
  82812. // Fields allows partial responses to be retrieved. See
  82813. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82814. // for more information.
  82815. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  82816. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82817. return c
  82818. }
  82819. // Context sets the context to be used in this call's Do method. Any
  82820. // pending HTTP request will be aborted if the provided context is
  82821. // canceled.
  82822. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  82823. c.ctx_ = ctx
  82824. return c
  82825. }
  82826. // Header returns an http.Header that can be modified by the caller to
  82827. // add HTTP headers to the request.
  82828. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  82829. if c.header_ == nil {
  82830. c.header_ = make(http.Header)
  82831. }
  82832. return c.header_
  82833. }
  82834. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  82835. reqHeaders := make(http.Header)
  82836. for k, v := range c.header_ {
  82837. reqHeaders[k] = v
  82838. }
  82839. reqHeaders.Set("User-Agent", c.s.userAgent())
  82840. var body io.Reader = nil
  82841. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  82842. if err != nil {
  82843. return nil, err
  82844. }
  82845. reqHeaders.Set("Content-Type", "application/json")
  82846. c.urlParams_.Set("alt", alt)
  82847. c.urlParams_.Set("prettyPrint", "false")
  82848. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  82849. urls += "?" + c.urlParams_.Encode()
  82850. req, err := http.NewRequest("POST", urls, body)
  82851. if err != nil {
  82852. return nil, err
  82853. }
  82854. req.Header = reqHeaders
  82855. googleapi.Expand(req.URL, map[string]string{
  82856. "project": c.project,
  82857. "region": c.region,
  82858. })
  82859. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82860. }
  82861. // Do executes the "compute.regionAutoscalers.insert" call.
  82862. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82863. // status code is an error. Response headers are in either
  82864. // *Operation.ServerResponse.Header or (if a response was returned at
  82865. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82866. // to check whether the returned error was because
  82867. // http.StatusNotModified was returned.
  82868. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82869. gensupport.SetOptions(c.urlParams_, opts...)
  82870. res, err := c.doRequest("json")
  82871. if res != nil && res.StatusCode == http.StatusNotModified {
  82872. if res.Body != nil {
  82873. res.Body.Close()
  82874. }
  82875. return nil, &googleapi.Error{
  82876. Code: res.StatusCode,
  82877. Header: res.Header,
  82878. }
  82879. }
  82880. if err != nil {
  82881. return nil, err
  82882. }
  82883. defer googleapi.CloseBody(res)
  82884. if err := googleapi.CheckResponse(res); err != nil {
  82885. return nil, err
  82886. }
  82887. ret := &Operation{
  82888. ServerResponse: googleapi.ServerResponse{
  82889. Header: res.Header,
  82890. HTTPStatusCode: res.StatusCode,
  82891. },
  82892. }
  82893. target := &ret
  82894. if err := gensupport.DecodeResponse(target, res); err != nil {
  82895. return nil, err
  82896. }
  82897. return ret, nil
  82898. // {
  82899. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  82900. // "httpMethod": "POST",
  82901. // "id": "compute.regionAutoscalers.insert",
  82902. // "parameterOrder": [
  82903. // "project",
  82904. // "region"
  82905. // ],
  82906. // "parameters": {
  82907. // "project": {
  82908. // "description": "Project ID for this request.",
  82909. // "location": "path",
  82910. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82911. // "required": true,
  82912. // "type": "string"
  82913. // },
  82914. // "region": {
  82915. // "description": "Name of the region scoping this request.",
  82916. // "location": "path",
  82917. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82918. // "required": true,
  82919. // "type": "string"
  82920. // },
  82921. // "requestId": {
  82922. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82923. // "location": "query",
  82924. // "type": "string"
  82925. // }
  82926. // },
  82927. // "path": "{project}/regions/{region}/autoscalers",
  82928. // "request": {
  82929. // "$ref": "Autoscaler"
  82930. // },
  82931. // "response": {
  82932. // "$ref": "Operation"
  82933. // },
  82934. // "scopes": [
  82935. // "https://www.googleapis.com/auth/cloud-platform",
  82936. // "https://www.googleapis.com/auth/compute"
  82937. // ]
  82938. // }
  82939. }
  82940. // method id "compute.regionAutoscalers.list":
  82941. type RegionAutoscalersListCall struct {
  82942. s *Service
  82943. project string
  82944. region string
  82945. urlParams_ gensupport.URLParams
  82946. ifNoneMatch_ string
  82947. ctx_ context.Context
  82948. header_ http.Header
  82949. }
  82950. // List: Retrieves a list of autoscalers contained within the specified
  82951. // region.
  82952. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  82953. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82954. c.project = project
  82955. c.region = region
  82956. return c
  82957. }
  82958. // Filter sets the optional parameter "filter": A filter expression that
  82959. // filters resources listed in the response. The expression must specify
  82960. // the field name, a comparison operator, and the value that you want to
  82961. // use for filtering. The value must be a string, a number, or a
  82962. // boolean. The comparison operator must be either =, !=, >, or <.
  82963. //
  82964. // For example, if you are filtering Compute Engine instances, you can
  82965. // exclude instances named example-instance by specifying name !=
  82966. // example-instance.
  82967. //
  82968. // You can also filter nested fields. For example, you could specify
  82969. // scheduling.automaticRestart = false to include instances only if they
  82970. // are not scheduled for automatic restarts. You can use filtering on
  82971. // nested fields to filter based on resource labels.
  82972. //
  82973. // To filter on multiple expressions, provide each separate expression
  82974. // within parentheses. For example, (scheduling.automaticRestart = true)
  82975. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82976. // AND expression. However, you can include AND and OR expressions
  82977. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82978. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82979. // true).
  82980. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  82981. c.urlParams_.Set("filter", filter)
  82982. return c
  82983. }
  82984. // MaxResults sets the optional parameter "maxResults": The maximum
  82985. // number of results per page that should be returned. If the number of
  82986. // available results is larger than maxResults, Compute Engine returns a
  82987. // nextPageToken that can be used to get the next page of results in
  82988. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82989. // (Default: 500)
  82990. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  82991. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82992. return c
  82993. }
  82994. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82995. // a certain order. By default, results are returned in alphanumerical
  82996. // order based on the resource name.
  82997. //
  82998. // You can also sort results in descending order based on the creation
  82999. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83000. // based on the creationTimestamp field in reverse chronological order
  83001. // (newest result first). Use this to sort resources like operations so
  83002. // that the newest operation is returned first.
  83003. //
  83004. // Currently, only sorting by name or creationTimestamp desc is
  83005. // supported.
  83006. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  83007. c.urlParams_.Set("orderBy", orderBy)
  83008. return c
  83009. }
  83010. // PageToken sets the optional parameter "pageToken": Specifies a page
  83011. // token to use. Set pageToken to the nextPageToken returned by a
  83012. // previous list request to get the next page of results.
  83013. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  83014. c.urlParams_.Set("pageToken", pageToken)
  83015. return c
  83016. }
  83017. // Fields allows partial responses to be retrieved. See
  83018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83019. // for more information.
  83020. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  83021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83022. return c
  83023. }
  83024. // IfNoneMatch sets the optional parameter which makes the operation
  83025. // fail if the object's ETag matches the given value. This is useful for
  83026. // getting updates only after the object has changed since the last
  83027. // request. Use googleapi.IsNotModified to check whether the response
  83028. // error from Do is the result of In-None-Match.
  83029. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  83030. c.ifNoneMatch_ = entityTag
  83031. return c
  83032. }
  83033. // Context sets the context to be used in this call's Do method. Any
  83034. // pending HTTP request will be aborted if the provided context is
  83035. // canceled.
  83036. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  83037. c.ctx_ = ctx
  83038. return c
  83039. }
  83040. // Header returns an http.Header that can be modified by the caller to
  83041. // add HTTP headers to the request.
  83042. func (c *RegionAutoscalersListCall) Header() http.Header {
  83043. if c.header_ == nil {
  83044. c.header_ = make(http.Header)
  83045. }
  83046. return c.header_
  83047. }
  83048. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  83049. reqHeaders := make(http.Header)
  83050. for k, v := range c.header_ {
  83051. reqHeaders[k] = v
  83052. }
  83053. reqHeaders.Set("User-Agent", c.s.userAgent())
  83054. if c.ifNoneMatch_ != "" {
  83055. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83056. }
  83057. var body io.Reader = nil
  83058. c.urlParams_.Set("alt", alt)
  83059. c.urlParams_.Set("prettyPrint", "false")
  83060. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  83061. urls += "?" + c.urlParams_.Encode()
  83062. req, err := http.NewRequest("GET", urls, body)
  83063. if err != nil {
  83064. return nil, err
  83065. }
  83066. req.Header = reqHeaders
  83067. googleapi.Expand(req.URL, map[string]string{
  83068. "project": c.project,
  83069. "region": c.region,
  83070. })
  83071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83072. }
  83073. // Do executes the "compute.regionAutoscalers.list" call.
  83074. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  83075. // non-2xx status code is an error. Response headers are in either
  83076. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  83077. // returned at all) in error.(*googleapi.Error).Header. Use
  83078. // googleapi.IsNotModified to check whether the returned error was
  83079. // because http.StatusNotModified was returned.
  83080. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  83081. gensupport.SetOptions(c.urlParams_, opts...)
  83082. res, err := c.doRequest("json")
  83083. if res != nil && res.StatusCode == http.StatusNotModified {
  83084. if res.Body != nil {
  83085. res.Body.Close()
  83086. }
  83087. return nil, &googleapi.Error{
  83088. Code: res.StatusCode,
  83089. Header: res.Header,
  83090. }
  83091. }
  83092. if err != nil {
  83093. return nil, err
  83094. }
  83095. defer googleapi.CloseBody(res)
  83096. if err := googleapi.CheckResponse(res); err != nil {
  83097. return nil, err
  83098. }
  83099. ret := &RegionAutoscalerList{
  83100. ServerResponse: googleapi.ServerResponse{
  83101. Header: res.Header,
  83102. HTTPStatusCode: res.StatusCode,
  83103. },
  83104. }
  83105. target := &ret
  83106. if err := gensupport.DecodeResponse(target, res); err != nil {
  83107. return nil, err
  83108. }
  83109. return ret, nil
  83110. // {
  83111. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  83112. // "httpMethod": "GET",
  83113. // "id": "compute.regionAutoscalers.list",
  83114. // "parameterOrder": [
  83115. // "project",
  83116. // "region"
  83117. // ],
  83118. // "parameters": {
  83119. // "filter": {
  83120. // "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).",
  83121. // "location": "query",
  83122. // "type": "string"
  83123. // },
  83124. // "maxResults": {
  83125. // "default": "500",
  83126. // "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)",
  83127. // "format": "uint32",
  83128. // "location": "query",
  83129. // "minimum": "0",
  83130. // "type": "integer"
  83131. // },
  83132. // "orderBy": {
  83133. // "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.",
  83134. // "location": "query",
  83135. // "type": "string"
  83136. // },
  83137. // "pageToken": {
  83138. // "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.",
  83139. // "location": "query",
  83140. // "type": "string"
  83141. // },
  83142. // "project": {
  83143. // "description": "Project ID for this request.",
  83144. // "location": "path",
  83145. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83146. // "required": true,
  83147. // "type": "string"
  83148. // },
  83149. // "region": {
  83150. // "description": "Name of the region scoping this request.",
  83151. // "location": "path",
  83152. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83153. // "required": true,
  83154. // "type": "string"
  83155. // }
  83156. // },
  83157. // "path": "{project}/regions/{region}/autoscalers",
  83158. // "response": {
  83159. // "$ref": "RegionAutoscalerList"
  83160. // },
  83161. // "scopes": [
  83162. // "https://www.googleapis.com/auth/cloud-platform",
  83163. // "https://www.googleapis.com/auth/compute",
  83164. // "https://www.googleapis.com/auth/compute.readonly"
  83165. // ]
  83166. // }
  83167. }
  83168. // Pages invokes f for each page of results.
  83169. // A non-nil error returned from f will halt the iteration.
  83170. // The provided context supersedes any context provided to the Context method.
  83171. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  83172. c.ctx_ = ctx
  83173. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  83174. for {
  83175. x, err := c.Do()
  83176. if err != nil {
  83177. return err
  83178. }
  83179. if err := f(x); err != nil {
  83180. return err
  83181. }
  83182. if x.NextPageToken == "" {
  83183. return nil
  83184. }
  83185. c.PageToken(x.NextPageToken)
  83186. }
  83187. }
  83188. // method id "compute.regionAutoscalers.patch":
  83189. type RegionAutoscalersPatchCall struct {
  83190. s *Service
  83191. project string
  83192. region string
  83193. autoscaler *Autoscaler
  83194. urlParams_ gensupport.URLParams
  83195. ctx_ context.Context
  83196. header_ http.Header
  83197. }
  83198. // Patch: Updates an autoscaler in the specified project using the data
  83199. // included in the request. This method supports PATCH semantics and
  83200. // uses the JSON merge patch format and processing rules.
  83201. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  83202. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83203. c.project = project
  83204. c.region = region
  83205. c.autoscaler = autoscaler
  83206. return c
  83207. }
  83208. // Autoscaler sets the optional parameter "autoscaler": Name of the
  83209. // autoscaler to patch.
  83210. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  83211. c.urlParams_.Set("autoscaler", autoscaler)
  83212. return c
  83213. }
  83214. // RequestId sets the optional parameter "requestId": An optional
  83215. // request ID to identify requests. Specify a unique request ID so that
  83216. // if you must retry your request, the server will know to ignore the
  83217. // request if it has already been completed.
  83218. //
  83219. // For example, consider a situation where you make an initial request
  83220. // and the request times out. If you make the request again with the
  83221. // same request ID, the server can check if original operation with the
  83222. // same request ID was received, and if so, will ignore the second
  83223. // request. This prevents clients from accidentally creating duplicate
  83224. // commitments.
  83225. //
  83226. // The request ID must be a valid UUID with the exception that zero UUID
  83227. // is not supported (00000000-0000-0000-0000-000000000000).
  83228. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  83229. c.urlParams_.Set("requestId", requestId)
  83230. return c
  83231. }
  83232. // Fields allows partial responses to be retrieved. See
  83233. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83234. // for more information.
  83235. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  83236. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83237. return c
  83238. }
  83239. // Context sets the context to be used in this call's Do method. Any
  83240. // pending HTTP request will be aborted if the provided context is
  83241. // canceled.
  83242. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  83243. c.ctx_ = ctx
  83244. return c
  83245. }
  83246. // Header returns an http.Header that can be modified by the caller to
  83247. // add HTTP headers to the request.
  83248. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  83249. if c.header_ == nil {
  83250. c.header_ = make(http.Header)
  83251. }
  83252. return c.header_
  83253. }
  83254. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  83255. reqHeaders := make(http.Header)
  83256. for k, v := range c.header_ {
  83257. reqHeaders[k] = v
  83258. }
  83259. reqHeaders.Set("User-Agent", c.s.userAgent())
  83260. var body io.Reader = nil
  83261. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  83262. if err != nil {
  83263. return nil, err
  83264. }
  83265. reqHeaders.Set("Content-Type", "application/json")
  83266. c.urlParams_.Set("alt", alt)
  83267. c.urlParams_.Set("prettyPrint", "false")
  83268. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  83269. urls += "?" + c.urlParams_.Encode()
  83270. req, err := http.NewRequest("PATCH", urls, body)
  83271. if err != nil {
  83272. return nil, err
  83273. }
  83274. req.Header = reqHeaders
  83275. googleapi.Expand(req.URL, map[string]string{
  83276. "project": c.project,
  83277. "region": c.region,
  83278. })
  83279. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83280. }
  83281. // Do executes the "compute.regionAutoscalers.patch" call.
  83282. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83283. // status code is an error. Response headers are in either
  83284. // *Operation.ServerResponse.Header or (if a response was returned at
  83285. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83286. // to check whether the returned error was because
  83287. // http.StatusNotModified was returned.
  83288. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83289. gensupport.SetOptions(c.urlParams_, opts...)
  83290. res, err := c.doRequest("json")
  83291. if res != nil && res.StatusCode == http.StatusNotModified {
  83292. if res.Body != nil {
  83293. res.Body.Close()
  83294. }
  83295. return nil, &googleapi.Error{
  83296. Code: res.StatusCode,
  83297. Header: res.Header,
  83298. }
  83299. }
  83300. if err != nil {
  83301. return nil, err
  83302. }
  83303. defer googleapi.CloseBody(res)
  83304. if err := googleapi.CheckResponse(res); err != nil {
  83305. return nil, err
  83306. }
  83307. ret := &Operation{
  83308. ServerResponse: googleapi.ServerResponse{
  83309. Header: res.Header,
  83310. HTTPStatusCode: res.StatusCode,
  83311. },
  83312. }
  83313. target := &ret
  83314. if err := gensupport.DecodeResponse(target, res); err != nil {
  83315. return nil, err
  83316. }
  83317. return ret, nil
  83318. // {
  83319. // "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.",
  83320. // "httpMethod": "PATCH",
  83321. // "id": "compute.regionAutoscalers.patch",
  83322. // "parameterOrder": [
  83323. // "project",
  83324. // "region"
  83325. // ],
  83326. // "parameters": {
  83327. // "autoscaler": {
  83328. // "description": "Name of the autoscaler to patch.",
  83329. // "location": "query",
  83330. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83331. // "type": "string"
  83332. // },
  83333. // "project": {
  83334. // "description": "Project ID for this request.",
  83335. // "location": "path",
  83336. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83337. // "required": true,
  83338. // "type": "string"
  83339. // },
  83340. // "region": {
  83341. // "description": "Name of the region scoping this request.",
  83342. // "location": "path",
  83343. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83344. // "required": true,
  83345. // "type": "string"
  83346. // },
  83347. // "requestId": {
  83348. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83349. // "location": "query",
  83350. // "type": "string"
  83351. // }
  83352. // },
  83353. // "path": "{project}/regions/{region}/autoscalers",
  83354. // "request": {
  83355. // "$ref": "Autoscaler"
  83356. // },
  83357. // "response": {
  83358. // "$ref": "Operation"
  83359. // },
  83360. // "scopes": [
  83361. // "https://www.googleapis.com/auth/cloud-platform",
  83362. // "https://www.googleapis.com/auth/compute"
  83363. // ]
  83364. // }
  83365. }
  83366. // method id "compute.regionAutoscalers.testIamPermissions":
  83367. type RegionAutoscalersTestIamPermissionsCall struct {
  83368. s *Service
  83369. project string
  83370. region string
  83371. resource string
  83372. testpermissionsrequest *TestPermissionsRequest
  83373. urlParams_ gensupport.URLParams
  83374. ctx_ context.Context
  83375. header_ http.Header
  83376. }
  83377. // TestIamPermissions: Returns permissions that a caller has on the
  83378. // specified resource.
  83379. func (r *RegionAutoscalersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionAutoscalersTestIamPermissionsCall {
  83380. c := &RegionAutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83381. c.project = project
  83382. c.region = region
  83383. c.resource = resource
  83384. c.testpermissionsrequest = testpermissionsrequest
  83385. return c
  83386. }
  83387. // Fields allows partial responses to be retrieved. See
  83388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83389. // for more information.
  83390. func (c *RegionAutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionAutoscalersTestIamPermissionsCall {
  83391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83392. return c
  83393. }
  83394. // Context sets the context to be used in this call's Do method. Any
  83395. // pending HTTP request will be aborted if the provided context is
  83396. // canceled.
  83397. func (c *RegionAutoscalersTestIamPermissionsCall) Context(ctx context.Context) *RegionAutoscalersTestIamPermissionsCall {
  83398. c.ctx_ = ctx
  83399. return c
  83400. }
  83401. // Header returns an http.Header that can be modified by the caller to
  83402. // add HTTP headers to the request.
  83403. func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header {
  83404. if c.header_ == nil {
  83405. c.header_ = make(http.Header)
  83406. }
  83407. return c.header_
  83408. }
  83409. func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  83410. reqHeaders := make(http.Header)
  83411. for k, v := range c.header_ {
  83412. reqHeaders[k] = v
  83413. }
  83414. reqHeaders.Set("User-Agent", c.s.userAgent())
  83415. var body io.Reader = nil
  83416. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  83417. if err != nil {
  83418. return nil, err
  83419. }
  83420. reqHeaders.Set("Content-Type", "application/json")
  83421. c.urlParams_.Set("alt", alt)
  83422. c.urlParams_.Set("prettyPrint", "false")
  83423. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions")
  83424. urls += "?" + c.urlParams_.Encode()
  83425. req, err := http.NewRequest("POST", urls, body)
  83426. if err != nil {
  83427. return nil, err
  83428. }
  83429. req.Header = reqHeaders
  83430. googleapi.Expand(req.URL, map[string]string{
  83431. "project": c.project,
  83432. "region": c.region,
  83433. "resource": c.resource,
  83434. })
  83435. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83436. }
  83437. // Do executes the "compute.regionAutoscalers.testIamPermissions" call.
  83438. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  83439. // non-2xx status code is an error. Response headers are in either
  83440. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  83441. // returned at all) in error.(*googleapi.Error).Header. Use
  83442. // googleapi.IsNotModified to check whether the returned error was
  83443. // because http.StatusNotModified was returned.
  83444. func (c *RegionAutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  83445. gensupport.SetOptions(c.urlParams_, opts...)
  83446. res, err := c.doRequest("json")
  83447. if res != nil && res.StatusCode == http.StatusNotModified {
  83448. if res.Body != nil {
  83449. res.Body.Close()
  83450. }
  83451. return nil, &googleapi.Error{
  83452. Code: res.StatusCode,
  83453. Header: res.Header,
  83454. }
  83455. }
  83456. if err != nil {
  83457. return nil, err
  83458. }
  83459. defer googleapi.CloseBody(res)
  83460. if err := googleapi.CheckResponse(res); err != nil {
  83461. return nil, err
  83462. }
  83463. ret := &TestPermissionsResponse{
  83464. ServerResponse: googleapi.ServerResponse{
  83465. Header: res.Header,
  83466. HTTPStatusCode: res.StatusCode,
  83467. },
  83468. }
  83469. target := &ret
  83470. if err := gensupport.DecodeResponse(target, res); err != nil {
  83471. return nil, err
  83472. }
  83473. return ret, nil
  83474. // {
  83475. // "description": "Returns permissions that a caller has on the specified resource.",
  83476. // "httpMethod": "POST",
  83477. // "id": "compute.regionAutoscalers.testIamPermissions",
  83478. // "parameterOrder": [
  83479. // "project",
  83480. // "region",
  83481. // "resource"
  83482. // ],
  83483. // "parameters": {
  83484. // "project": {
  83485. // "description": "Project ID for this request.",
  83486. // "location": "path",
  83487. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83488. // "required": true,
  83489. // "type": "string"
  83490. // },
  83491. // "region": {
  83492. // "description": "The name of the region for this request.",
  83493. // "location": "path",
  83494. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83495. // "required": true,
  83496. // "type": "string"
  83497. // },
  83498. // "resource": {
  83499. // "description": "Name or id of the resource for this request.",
  83500. // "location": "path",
  83501. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83502. // "required": true,
  83503. // "type": "string"
  83504. // }
  83505. // },
  83506. // "path": "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions",
  83507. // "request": {
  83508. // "$ref": "TestPermissionsRequest"
  83509. // },
  83510. // "response": {
  83511. // "$ref": "TestPermissionsResponse"
  83512. // },
  83513. // "scopes": [
  83514. // "https://www.googleapis.com/auth/cloud-platform",
  83515. // "https://www.googleapis.com/auth/compute",
  83516. // "https://www.googleapis.com/auth/compute.readonly"
  83517. // ]
  83518. // }
  83519. }
  83520. // method id "compute.regionAutoscalers.update":
  83521. type RegionAutoscalersUpdateCall struct {
  83522. s *Service
  83523. project string
  83524. region string
  83525. autoscaler *Autoscaler
  83526. urlParams_ gensupport.URLParams
  83527. ctx_ context.Context
  83528. header_ http.Header
  83529. }
  83530. // Update: Updates an autoscaler in the specified project using the data
  83531. // included in the request.
  83532. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  83533. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83534. c.project = project
  83535. c.region = region
  83536. c.autoscaler = autoscaler
  83537. return c
  83538. }
  83539. // Autoscaler sets the optional parameter "autoscaler": Name of the
  83540. // autoscaler to update.
  83541. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  83542. c.urlParams_.Set("autoscaler", autoscaler)
  83543. return c
  83544. }
  83545. // RequestId sets the optional parameter "requestId": An optional
  83546. // request ID to identify requests. Specify a unique request ID so that
  83547. // if you must retry your request, the server will know to ignore the
  83548. // request if it has already been completed.
  83549. //
  83550. // For example, consider a situation where you make an initial request
  83551. // and the request times out. If you make the request again with the
  83552. // same request ID, the server can check if original operation with the
  83553. // same request ID was received, and if so, will ignore the second
  83554. // request. This prevents clients from accidentally creating duplicate
  83555. // commitments.
  83556. //
  83557. // The request ID must be a valid UUID with the exception that zero UUID
  83558. // is not supported (00000000-0000-0000-0000-000000000000).
  83559. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  83560. c.urlParams_.Set("requestId", requestId)
  83561. return c
  83562. }
  83563. // Fields allows partial responses to be retrieved. See
  83564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83565. // for more information.
  83566. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  83567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83568. return c
  83569. }
  83570. // Context sets the context to be used in this call's Do method. Any
  83571. // pending HTTP request will be aborted if the provided context is
  83572. // canceled.
  83573. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  83574. c.ctx_ = ctx
  83575. return c
  83576. }
  83577. // Header returns an http.Header that can be modified by the caller to
  83578. // add HTTP headers to the request.
  83579. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  83580. if c.header_ == nil {
  83581. c.header_ = make(http.Header)
  83582. }
  83583. return c.header_
  83584. }
  83585. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  83586. reqHeaders := make(http.Header)
  83587. for k, v := range c.header_ {
  83588. reqHeaders[k] = v
  83589. }
  83590. reqHeaders.Set("User-Agent", c.s.userAgent())
  83591. var body io.Reader = nil
  83592. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  83593. if err != nil {
  83594. return nil, err
  83595. }
  83596. reqHeaders.Set("Content-Type", "application/json")
  83597. c.urlParams_.Set("alt", alt)
  83598. c.urlParams_.Set("prettyPrint", "false")
  83599. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  83600. urls += "?" + c.urlParams_.Encode()
  83601. req, err := http.NewRequest("PUT", urls, body)
  83602. if err != nil {
  83603. return nil, err
  83604. }
  83605. req.Header = reqHeaders
  83606. googleapi.Expand(req.URL, map[string]string{
  83607. "project": c.project,
  83608. "region": c.region,
  83609. })
  83610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83611. }
  83612. // Do executes the "compute.regionAutoscalers.update" call.
  83613. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83614. // status code is an error. Response headers are in either
  83615. // *Operation.ServerResponse.Header or (if a response was returned at
  83616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83617. // to check whether the returned error was because
  83618. // http.StatusNotModified was returned.
  83619. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83620. gensupport.SetOptions(c.urlParams_, opts...)
  83621. res, err := c.doRequest("json")
  83622. if res != nil && res.StatusCode == http.StatusNotModified {
  83623. if res.Body != nil {
  83624. res.Body.Close()
  83625. }
  83626. return nil, &googleapi.Error{
  83627. Code: res.StatusCode,
  83628. Header: res.Header,
  83629. }
  83630. }
  83631. if err != nil {
  83632. return nil, err
  83633. }
  83634. defer googleapi.CloseBody(res)
  83635. if err := googleapi.CheckResponse(res); err != nil {
  83636. return nil, err
  83637. }
  83638. ret := &Operation{
  83639. ServerResponse: googleapi.ServerResponse{
  83640. Header: res.Header,
  83641. HTTPStatusCode: res.StatusCode,
  83642. },
  83643. }
  83644. target := &ret
  83645. if err := gensupport.DecodeResponse(target, res); err != nil {
  83646. return nil, err
  83647. }
  83648. return ret, nil
  83649. // {
  83650. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  83651. // "httpMethod": "PUT",
  83652. // "id": "compute.regionAutoscalers.update",
  83653. // "parameterOrder": [
  83654. // "project",
  83655. // "region"
  83656. // ],
  83657. // "parameters": {
  83658. // "autoscaler": {
  83659. // "description": "Name of the autoscaler to update.",
  83660. // "location": "query",
  83661. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83662. // "type": "string"
  83663. // },
  83664. // "project": {
  83665. // "description": "Project ID for this request.",
  83666. // "location": "path",
  83667. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83668. // "required": true,
  83669. // "type": "string"
  83670. // },
  83671. // "region": {
  83672. // "description": "Name of the region scoping this request.",
  83673. // "location": "path",
  83674. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83675. // "required": true,
  83676. // "type": "string"
  83677. // },
  83678. // "requestId": {
  83679. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83680. // "location": "query",
  83681. // "type": "string"
  83682. // }
  83683. // },
  83684. // "path": "{project}/regions/{region}/autoscalers",
  83685. // "request": {
  83686. // "$ref": "Autoscaler"
  83687. // },
  83688. // "response": {
  83689. // "$ref": "Operation"
  83690. // },
  83691. // "scopes": [
  83692. // "https://www.googleapis.com/auth/cloud-platform",
  83693. // "https://www.googleapis.com/auth/compute"
  83694. // ]
  83695. // }
  83696. }
  83697. // method id "compute.regionBackendServices.delete":
  83698. type RegionBackendServicesDeleteCall struct {
  83699. s *Service
  83700. project string
  83701. region string
  83702. backendService string
  83703. urlParams_ gensupport.URLParams
  83704. ctx_ context.Context
  83705. header_ http.Header
  83706. }
  83707. // Delete: Deletes the specified regional BackendService resource.
  83708. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  83709. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83710. c.project = project
  83711. c.region = region
  83712. c.backendService = backendService
  83713. return c
  83714. }
  83715. // RequestId sets the optional parameter "requestId": An optional
  83716. // request ID to identify requests. Specify a unique request ID so that
  83717. // if you must retry your request, the server will know to ignore the
  83718. // request if it has already been completed.
  83719. //
  83720. // For example, consider a situation where you make an initial request
  83721. // and the request times out. If you make the request again with the
  83722. // same request ID, the server can check if original operation with the
  83723. // same request ID was received, and if so, will ignore the second
  83724. // request. This prevents clients from accidentally creating duplicate
  83725. // commitments.
  83726. //
  83727. // The request ID must be a valid UUID with the exception that zero UUID
  83728. // is not supported (00000000-0000-0000-0000-000000000000).
  83729. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  83730. c.urlParams_.Set("requestId", requestId)
  83731. return c
  83732. }
  83733. // Fields allows partial responses to be retrieved. See
  83734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83735. // for more information.
  83736. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  83737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83738. return c
  83739. }
  83740. // Context sets the context to be used in this call's Do method. Any
  83741. // pending HTTP request will be aborted if the provided context is
  83742. // canceled.
  83743. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  83744. c.ctx_ = ctx
  83745. return c
  83746. }
  83747. // Header returns an http.Header that can be modified by the caller to
  83748. // add HTTP headers to the request.
  83749. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  83750. if c.header_ == nil {
  83751. c.header_ = make(http.Header)
  83752. }
  83753. return c.header_
  83754. }
  83755. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  83756. reqHeaders := make(http.Header)
  83757. for k, v := range c.header_ {
  83758. reqHeaders[k] = v
  83759. }
  83760. reqHeaders.Set("User-Agent", c.s.userAgent())
  83761. var body io.Reader = nil
  83762. c.urlParams_.Set("alt", alt)
  83763. c.urlParams_.Set("prettyPrint", "false")
  83764. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  83765. urls += "?" + c.urlParams_.Encode()
  83766. req, err := http.NewRequest("DELETE", urls, body)
  83767. if err != nil {
  83768. return nil, err
  83769. }
  83770. req.Header = reqHeaders
  83771. googleapi.Expand(req.URL, map[string]string{
  83772. "project": c.project,
  83773. "region": c.region,
  83774. "backendService": c.backendService,
  83775. })
  83776. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83777. }
  83778. // Do executes the "compute.regionBackendServices.delete" call.
  83779. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83780. // status code is an error. Response headers are in either
  83781. // *Operation.ServerResponse.Header or (if a response was returned at
  83782. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83783. // to check whether the returned error was because
  83784. // http.StatusNotModified was returned.
  83785. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83786. gensupport.SetOptions(c.urlParams_, opts...)
  83787. res, err := c.doRequest("json")
  83788. if res != nil && res.StatusCode == http.StatusNotModified {
  83789. if res.Body != nil {
  83790. res.Body.Close()
  83791. }
  83792. return nil, &googleapi.Error{
  83793. Code: res.StatusCode,
  83794. Header: res.Header,
  83795. }
  83796. }
  83797. if err != nil {
  83798. return nil, err
  83799. }
  83800. defer googleapi.CloseBody(res)
  83801. if err := googleapi.CheckResponse(res); err != nil {
  83802. return nil, err
  83803. }
  83804. ret := &Operation{
  83805. ServerResponse: googleapi.ServerResponse{
  83806. Header: res.Header,
  83807. HTTPStatusCode: res.StatusCode,
  83808. },
  83809. }
  83810. target := &ret
  83811. if err := gensupport.DecodeResponse(target, res); err != nil {
  83812. return nil, err
  83813. }
  83814. return ret, nil
  83815. // {
  83816. // "description": "Deletes the specified regional BackendService resource.",
  83817. // "httpMethod": "DELETE",
  83818. // "id": "compute.regionBackendServices.delete",
  83819. // "parameterOrder": [
  83820. // "project",
  83821. // "region",
  83822. // "backendService"
  83823. // ],
  83824. // "parameters": {
  83825. // "backendService": {
  83826. // "description": "Name of the BackendService resource to delete.",
  83827. // "location": "path",
  83828. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83829. // "required": true,
  83830. // "type": "string"
  83831. // },
  83832. // "project": {
  83833. // "description": "Project ID for this request.",
  83834. // "location": "path",
  83835. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83836. // "required": true,
  83837. // "type": "string"
  83838. // },
  83839. // "region": {
  83840. // "description": "Name of the region scoping this request.",
  83841. // "location": "path",
  83842. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83843. // "required": true,
  83844. // "type": "string"
  83845. // },
  83846. // "requestId": {
  83847. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83848. // "location": "query",
  83849. // "type": "string"
  83850. // }
  83851. // },
  83852. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  83853. // "response": {
  83854. // "$ref": "Operation"
  83855. // },
  83856. // "scopes": [
  83857. // "https://www.googleapis.com/auth/cloud-platform",
  83858. // "https://www.googleapis.com/auth/compute"
  83859. // ]
  83860. // }
  83861. }
  83862. // method id "compute.regionBackendServices.get":
  83863. type RegionBackendServicesGetCall struct {
  83864. s *Service
  83865. project string
  83866. region string
  83867. backendService string
  83868. urlParams_ gensupport.URLParams
  83869. ifNoneMatch_ string
  83870. ctx_ context.Context
  83871. header_ http.Header
  83872. }
  83873. // Get: Returns the specified regional BackendService resource.
  83874. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  83875. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83876. c.project = project
  83877. c.region = region
  83878. c.backendService = backendService
  83879. return c
  83880. }
  83881. // Fields allows partial responses to be retrieved. See
  83882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83883. // for more information.
  83884. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  83885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83886. return c
  83887. }
  83888. // IfNoneMatch sets the optional parameter which makes the operation
  83889. // fail if the object's ETag matches the given value. This is useful for
  83890. // getting updates only after the object has changed since the last
  83891. // request. Use googleapi.IsNotModified to check whether the response
  83892. // error from Do is the result of In-None-Match.
  83893. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  83894. c.ifNoneMatch_ = entityTag
  83895. return c
  83896. }
  83897. // Context sets the context to be used in this call's Do method. Any
  83898. // pending HTTP request will be aborted if the provided context is
  83899. // canceled.
  83900. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  83901. c.ctx_ = ctx
  83902. return c
  83903. }
  83904. // Header returns an http.Header that can be modified by the caller to
  83905. // add HTTP headers to the request.
  83906. func (c *RegionBackendServicesGetCall) Header() http.Header {
  83907. if c.header_ == nil {
  83908. c.header_ = make(http.Header)
  83909. }
  83910. return c.header_
  83911. }
  83912. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  83913. reqHeaders := make(http.Header)
  83914. for k, v := range c.header_ {
  83915. reqHeaders[k] = v
  83916. }
  83917. reqHeaders.Set("User-Agent", c.s.userAgent())
  83918. if c.ifNoneMatch_ != "" {
  83919. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83920. }
  83921. var body io.Reader = nil
  83922. c.urlParams_.Set("alt", alt)
  83923. c.urlParams_.Set("prettyPrint", "false")
  83924. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  83925. urls += "?" + c.urlParams_.Encode()
  83926. req, err := http.NewRequest("GET", urls, body)
  83927. if err != nil {
  83928. return nil, err
  83929. }
  83930. req.Header = reqHeaders
  83931. googleapi.Expand(req.URL, map[string]string{
  83932. "project": c.project,
  83933. "region": c.region,
  83934. "backendService": c.backendService,
  83935. })
  83936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83937. }
  83938. // Do executes the "compute.regionBackendServices.get" call.
  83939. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  83940. // status code is an error. Response headers are in either
  83941. // *BackendService.ServerResponse.Header or (if a response was returned
  83942. // at all) in error.(*googleapi.Error).Header. Use
  83943. // googleapi.IsNotModified to check whether the returned error was
  83944. // because http.StatusNotModified was returned.
  83945. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  83946. gensupport.SetOptions(c.urlParams_, opts...)
  83947. res, err := c.doRequest("json")
  83948. if res != nil && res.StatusCode == http.StatusNotModified {
  83949. if res.Body != nil {
  83950. res.Body.Close()
  83951. }
  83952. return nil, &googleapi.Error{
  83953. Code: res.StatusCode,
  83954. Header: res.Header,
  83955. }
  83956. }
  83957. if err != nil {
  83958. return nil, err
  83959. }
  83960. defer googleapi.CloseBody(res)
  83961. if err := googleapi.CheckResponse(res); err != nil {
  83962. return nil, err
  83963. }
  83964. ret := &BackendService{
  83965. ServerResponse: googleapi.ServerResponse{
  83966. Header: res.Header,
  83967. HTTPStatusCode: res.StatusCode,
  83968. },
  83969. }
  83970. target := &ret
  83971. if err := gensupport.DecodeResponse(target, res); err != nil {
  83972. return nil, err
  83973. }
  83974. return ret, nil
  83975. // {
  83976. // "description": "Returns the specified regional BackendService resource.",
  83977. // "httpMethod": "GET",
  83978. // "id": "compute.regionBackendServices.get",
  83979. // "parameterOrder": [
  83980. // "project",
  83981. // "region",
  83982. // "backendService"
  83983. // ],
  83984. // "parameters": {
  83985. // "backendService": {
  83986. // "description": "Name of the BackendService resource to return.",
  83987. // "location": "path",
  83988. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83989. // "required": true,
  83990. // "type": "string"
  83991. // },
  83992. // "project": {
  83993. // "description": "Project ID for this request.",
  83994. // "location": "path",
  83995. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83996. // "required": true,
  83997. // "type": "string"
  83998. // },
  83999. // "region": {
  84000. // "description": "Name of the region scoping this request.",
  84001. // "location": "path",
  84002. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84003. // "required": true,
  84004. // "type": "string"
  84005. // }
  84006. // },
  84007. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  84008. // "response": {
  84009. // "$ref": "BackendService"
  84010. // },
  84011. // "scopes": [
  84012. // "https://www.googleapis.com/auth/cloud-platform",
  84013. // "https://www.googleapis.com/auth/compute",
  84014. // "https://www.googleapis.com/auth/compute.readonly"
  84015. // ]
  84016. // }
  84017. }
  84018. // method id "compute.regionBackendServices.getHealth":
  84019. type RegionBackendServicesGetHealthCall struct {
  84020. s *Service
  84021. project string
  84022. region string
  84023. backendService string
  84024. resourcegroupreference *ResourceGroupReference
  84025. urlParams_ gensupport.URLParams
  84026. ctx_ context.Context
  84027. header_ http.Header
  84028. }
  84029. // GetHealth: Gets the most recent health check results for this
  84030. // regional BackendService.
  84031. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  84032. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84033. c.project = project
  84034. c.region = region
  84035. c.backendService = backendService
  84036. c.resourcegroupreference = resourcegroupreference
  84037. return c
  84038. }
  84039. // Fields allows partial responses to be retrieved. See
  84040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84041. // for more information.
  84042. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  84043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84044. return c
  84045. }
  84046. // Context sets the context to be used in this call's Do method. Any
  84047. // pending HTTP request will be aborted if the provided context is
  84048. // canceled.
  84049. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  84050. c.ctx_ = ctx
  84051. return c
  84052. }
  84053. // Header returns an http.Header that can be modified by the caller to
  84054. // add HTTP headers to the request.
  84055. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  84056. if c.header_ == nil {
  84057. c.header_ = make(http.Header)
  84058. }
  84059. return c.header_
  84060. }
  84061. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  84062. reqHeaders := make(http.Header)
  84063. for k, v := range c.header_ {
  84064. reqHeaders[k] = v
  84065. }
  84066. reqHeaders.Set("User-Agent", c.s.userAgent())
  84067. var body io.Reader = nil
  84068. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  84069. if err != nil {
  84070. return nil, err
  84071. }
  84072. reqHeaders.Set("Content-Type", "application/json")
  84073. c.urlParams_.Set("alt", alt)
  84074. c.urlParams_.Set("prettyPrint", "false")
  84075. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  84076. urls += "?" + c.urlParams_.Encode()
  84077. req, err := http.NewRequest("POST", urls, body)
  84078. if err != nil {
  84079. return nil, err
  84080. }
  84081. req.Header = reqHeaders
  84082. googleapi.Expand(req.URL, map[string]string{
  84083. "project": c.project,
  84084. "region": c.region,
  84085. "backendService": c.backendService,
  84086. })
  84087. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84088. }
  84089. // Do executes the "compute.regionBackendServices.getHealth" call.
  84090. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  84091. // Any non-2xx status code is an error. Response headers are in either
  84092. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  84093. // was returned at all) in error.(*googleapi.Error).Header. Use
  84094. // googleapi.IsNotModified to check whether the returned error was
  84095. // because http.StatusNotModified was returned.
  84096. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  84097. gensupport.SetOptions(c.urlParams_, opts...)
  84098. res, err := c.doRequest("json")
  84099. if res != nil && res.StatusCode == http.StatusNotModified {
  84100. if res.Body != nil {
  84101. res.Body.Close()
  84102. }
  84103. return nil, &googleapi.Error{
  84104. Code: res.StatusCode,
  84105. Header: res.Header,
  84106. }
  84107. }
  84108. if err != nil {
  84109. return nil, err
  84110. }
  84111. defer googleapi.CloseBody(res)
  84112. if err := googleapi.CheckResponse(res); err != nil {
  84113. return nil, err
  84114. }
  84115. ret := &BackendServiceGroupHealth{
  84116. ServerResponse: googleapi.ServerResponse{
  84117. Header: res.Header,
  84118. HTTPStatusCode: res.StatusCode,
  84119. },
  84120. }
  84121. target := &ret
  84122. if err := gensupport.DecodeResponse(target, res); err != nil {
  84123. return nil, err
  84124. }
  84125. return ret, nil
  84126. // {
  84127. // "description": "Gets the most recent health check results for this regional BackendService.",
  84128. // "httpMethod": "POST",
  84129. // "id": "compute.regionBackendServices.getHealth",
  84130. // "parameterOrder": [
  84131. // "project",
  84132. // "region",
  84133. // "backendService"
  84134. // ],
  84135. // "parameters": {
  84136. // "backendService": {
  84137. // "description": "Name of the BackendService resource for which to get health.",
  84138. // "location": "path",
  84139. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84140. // "required": true,
  84141. // "type": "string"
  84142. // },
  84143. // "project": {
  84144. // "location": "path",
  84145. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84146. // "required": true,
  84147. // "type": "string"
  84148. // },
  84149. // "region": {
  84150. // "description": "Name of the region scoping this request.",
  84151. // "location": "path",
  84152. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84153. // "required": true,
  84154. // "type": "string"
  84155. // }
  84156. // },
  84157. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  84158. // "request": {
  84159. // "$ref": "ResourceGroupReference"
  84160. // },
  84161. // "response": {
  84162. // "$ref": "BackendServiceGroupHealth"
  84163. // },
  84164. // "scopes": [
  84165. // "https://www.googleapis.com/auth/cloud-platform",
  84166. // "https://www.googleapis.com/auth/compute",
  84167. // "https://www.googleapis.com/auth/compute.readonly"
  84168. // ]
  84169. // }
  84170. }
  84171. // method id "compute.regionBackendServices.insert":
  84172. type RegionBackendServicesInsertCall struct {
  84173. s *Service
  84174. project string
  84175. region string
  84176. backendservice *BackendService
  84177. urlParams_ gensupport.URLParams
  84178. ctx_ context.Context
  84179. header_ http.Header
  84180. }
  84181. // Insert: Creates a regional BackendService resource in the specified
  84182. // project using the data included in the request. There are several
  84183. // restrictions and guidelines to keep in mind when creating a regional
  84184. // backend service. Read Restrictions and Guidelines for more
  84185. // information.
  84186. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  84187. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84188. c.project = project
  84189. c.region = region
  84190. c.backendservice = backendservice
  84191. return c
  84192. }
  84193. // RequestId sets the optional parameter "requestId": An optional
  84194. // request ID to identify requests. Specify a unique request ID so that
  84195. // if you must retry your request, the server will know to ignore the
  84196. // request if it has already been completed.
  84197. //
  84198. // For example, consider a situation where you make an initial request
  84199. // and the request times out. If you make the request again with the
  84200. // same request ID, the server can check if original operation with the
  84201. // same request ID was received, and if so, will ignore the second
  84202. // request. This prevents clients from accidentally creating duplicate
  84203. // commitments.
  84204. //
  84205. // The request ID must be a valid UUID with the exception that zero UUID
  84206. // is not supported (00000000-0000-0000-0000-000000000000).
  84207. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  84208. c.urlParams_.Set("requestId", requestId)
  84209. return c
  84210. }
  84211. // Fields allows partial responses to be retrieved. See
  84212. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84213. // for more information.
  84214. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  84215. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84216. return c
  84217. }
  84218. // Context sets the context to be used in this call's Do method. Any
  84219. // pending HTTP request will be aborted if the provided context is
  84220. // canceled.
  84221. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  84222. c.ctx_ = ctx
  84223. return c
  84224. }
  84225. // Header returns an http.Header that can be modified by the caller to
  84226. // add HTTP headers to the request.
  84227. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  84228. if c.header_ == nil {
  84229. c.header_ = make(http.Header)
  84230. }
  84231. return c.header_
  84232. }
  84233. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  84234. reqHeaders := make(http.Header)
  84235. for k, v := range c.header_ {
  84236. reqHeaders[k] = v
  84237. }
  84238. reqHeaders.Set("User-Agent", c.s.userAgent())
  84239. var body io.Reader = nil
  84240. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  84241. if err != nil {
  84242. return nil, err
  84243. }
  84244. reqHeaders.Set("Content-Type", "application/json")
  84245. c.urlParams_.Set("alt", alt)
  84246. c.urlParams_.Set("prettyPrint", "false")
  84247. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  84248. urls += "?" + c.urlParams_.Encode()
  84249. req, err := http.NewRequest("POST", urls, body)
  84250. if err != nil {
  84251. return nil, err
  84252. }
  84253. req.Header = reqHeaders
  84254. googleapi.Expand(req.URL, map[string]string{
  84255. "project": c.project,
  84256. "region": c.region,
  84257. })
  84258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84259. }
  84260. // Do executes the "compute.regionBackendServices.insert" call.
  84261. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84262. // status code is an error. Response headers are in either
  84263. // *Operation.ServerResponse.Header or (if a response was returned at
  84264. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84265. // to check whether the returned error was because
  84266. // http.StatusNotModified was returned.
  84267. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84268. gensupport.SetOptions(c.urlParams_, opts...)
  84269. res, err := c.doRequest("json")
  84270. if res != nil && res.StatusCode == http.StatusNotModified {
  84271. if res.Body != nil {
  84272. res.Body.Close()
  84273. }
  84274. return nil, &googleapi.Error{
  84275. Code: res.StatusCode,
  84276. Header: res.Header,
  84277. }
  84278. }
  84279. if err != nil {
  84280. return nil, err
  84281. }
  84282. defer googleapi.CloseBody(res)
  84283. if err := googleapi.CheckResponse(res); err != nil {
  84284. return nil, err
  84285. }
  84286. ret := &Operation{
  84287. ServerResponse: googleapi.ServerResponse{
  84288. Header: res.Header,
  84289. HTTPStatusCode: res.StatusCode,
  84290. },
  84291. }
  84292. target := &ret
  84293. if err := gensupport.DecodeResponse(target, res); err != nil {
  84294. return nil, err
  84295. }
  84296. return ret, nil
  84297. // {
  84298. // "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.",
  84299. // "httpMethod": "POST",
  84300. // "id": "compute.regionBackendServices.insert",
  84301. // "parameterOrder": [
  84302. // "project",
  84303. // "region"
  84304. // ],
  84305. // "parameters": {
  84306. // "project": {
  84307. // "description": "Project ID for this request.",
  84308. // "location": "path",
  84309. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84310. // "required": true,
  84311. // "type": "string"
  84312. // },
  84313. // "region": {
  84314. // "description": "Name of the region scoping this request.",
  84315. // "location": "path",
  84316. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84317. // "required": true,
  84318. // "type": "string"
  84319. // },
  84320. // "requestId": {
  84321. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84322. // "location": "query",
  84323. // "type": "string"
  84324. // }
  84325. // },
  84326. // "path": "{project}/regions/{region}/backendServices",
  84327. // "request": {
  84328. // "$ref": "BackendService"
  84329. // },
  84330. // "response": {
  84331. // "$ref": "Operation"
  84332. // },
  84333. // "scopes": [
  84334. // "https://www.googleapis.com/auth/cloud-platform",
  84335. // "https://www.googleapis.com/auth/compute"
  84336. // ]
  84337. // }
  84338. }
  84339. // method id "compute.regionBackendServices.list":
  84340. type RegionBackendServicesListCall struct {
  84341. s *Service
  84342. project string
  84343. region string
  84344. urlParams_ gensupport.URLParams
  84345. ifNoneMatch_ string
  84346. ctx_ context.Context
  84347. header_ http.Header
  84348. }
  84349. // List: Retrieves the list of regional BackendService resources
  84350. // available to the specified project in the given region.
  84351. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  84352. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84353. c.project = project
  84354. c.region = region
  84355. return c
  84356. }
  84357. // Filter sets the optional parameter "filter": A filter expression that
  84358. // filters resources listed in the response. The expression must specify
  84359. // the field name, a comparison operator, and the value that you want to
  84360. // use for filtering. The value must be a string, a number, or a
  84361. // boolean. The comparison operator must be either =, !=, >, or <.
  84362. //
  84363. // For example, if you are filtering Compute Engine instances, you can
  84364. // exclude instances named example-instance by specifying name !=
  84365. // example-instance.
  84366. //
  84367. // You can also filter nested fields. For example, you could specify
  84368. // scheduling.automaticRestart = false to include instances only if they
  84369. // are not scheduled for automatic restarts. You can use filtering on
  84370. // nested fields to filter based on resource labels.
  84371. //
  84372. // To filter on multiple expressions, provide each separate expression
  84373. // within parentheses. For example, (scheduling.automaticRestart = true)
  84374. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84375. // AND expression. However, you can include AND and OR expressions
  84376. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84377. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84378. // true).
  84379. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  84380. c.urlParams_.Set("filter", filter)
  84381. return c
  84382. }
  84383. // MaxResults sets the optional parameter "maxResults": The maximum
  84384. // number of results per page that should be returned. If the number of
  84385. // available results is larger than maxResults, Compute Engine returns a
  84386. // nextPageToken that can be used to get the next page of results in
  84387. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84388. // (Default: 500)
  84389. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  84390. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84391. return c
  84392. }
  84393. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84394. // a certain order. By default, results are returned in alphanumerical
  84395. // order based on the resource name.
  84396. //
  84397. // You can also sort results in descending order based on the creation
  84398. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84399. // based on the creationTimestamp field in reverse chronological order
  84400. // (newest result first). Use this to sort resources like operations so
  84401. // that the newest operation is returned first.
  84402. //
  84403. // Currently, only sorting by name or creationTimestamp desc is
  84404. // supported.
  84405. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  84406. c.urlParams_.Set("orderBy", orderBy)
  84407. return c
  84408. }
  84409. // PageToken sets the optional parameter "pageToken": Specifies a page
  84410. // token to use. Set pageToken to the nextPageToken returned by a
  84411. // previous list request to get the next page of results.
  84412. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  84413. c.urlParams_.Set("pageToken", pageToken)
  84414. return c
  84415. }
  84416. // Fields allows partial responses to be retrieved. See
  84417. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84418. // for more information.
  84419. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  84420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84421. return c
  84422. }
  84423. // IfNoneMatch sets the optional parameter which makes the operation
  84424. // fail if the object's ETag matches the given value. This is useful for
  84425. // getting updates only after the object has changed since the last
  84426. // request. Use googleapi.IsNotModified to check whether the response
  84427. // error from Do is the result of In-None-Match.
  84428. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  84429. c.ifNoneMatch_ = entityTag
  84430. return c
  84431. }
  84432. // Context sets the context to be used in this call's Do method. Any
  84433. // pending HTTP request will be aborted if the provided context is
  84434. // canceled.
  84435. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  84436. c.ctx_ = ctx
  84437. return c
  84438. }
  84439. // Header returns an http.Header that can be modified by the caller to
  84440. // add HTTP headers to the request.
  84441. func (c *RegionBackendServicesListCall) Header() http.Header {
  84442. if c.header_ == nil {
  84443. c.header_ = make(http.Header)
  84444. }
  84445. return c.header_
  84446. }
  84447. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  84448. reqHeaders := make(http.Header)
  84449. for k, v := range c.header_ {
  84450. reqHeaders[k] = v
  84451. }
  84452. reqHeaders.Set("User-Agent", c.s.userAgent())
  84453. if c.ifNoneMatch_ != "" {
  84454. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84455. }
  84456. var body io.Reader = nil
  84457. c.urlParams_.Set("alt", alt)
  84458. c.urlParams_.Set("prettyPrint", "false")
  84459. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  84460. urls += "?" + c.urlParams_.Encode()
  84461. req, err := http.NewRequest("GET", urls, body)
  84462. if err != nil {
  84463. return nil, err
  84464. }
  84465. req.Header = reqHeaders
  84466. googleapi.Expand(req.URL, map[string]string{
  84467. "project": c.project,
  84468. "region": c.region,
  84469. })
  84470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84471. }
  84472. // Do executes the "compute.regionBackendServices.list" call.
  84473. // Exactly one of *BackendServiceList or error will be non-nil. Any
  84474. // non-2xx status code is an error. Response headers are in either
  84475. // *BackendServiceList.ServerResponse.Header or (if a response was
  84476. // returned at all) in error.(*googleapi.Error).Header. Use
  84477. // googleapi.IsNotModified to check whether the returned error was
  84478. // because http.StatusNotModified was returned.
  84479. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  84480. gensupport.SetOptions(c.urlParams_, opts...)
  84481. res, err := c.doRequest("json")
  84482. if res != nil && res.StatusCode == http.StatusNotModified {
  84483. if res.Body != nil {
  84484. res.Body.Close()
  84485. }
  84486. return nil, &googleapi.Error{
  84487. Code: res.StatusCode,
  84488. Header: res.Header,
  84489. }
  84490. }
  84491. if err != nil {
  84492. return nil, err
  84493. }
  84494. defer googleapi.CloseBody(res)
  84495. if err := googleapi.CheckResponse(res); err != nil {
  84496. return nil, err
  84497. }
  84498. ret := &BackendServiceList{
  84499. ServerResponse: googleapi.ServerResponse{
  84500. Header: res.Header,
  84501. HTTPStatusCode: res.StatusCode,
  84502. },
  84503. }
  84504. target := &ret
  84505. if err := gensupport.DecodeResponse(target, res); err != nil {
  84506. return nil, err
  84507. }
  84508. return ret, nil
  84509. // {
  84510. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  84511. // "httpMethod": "GET",
  84512. // "id": "compute.regionBackendServices.list",
  84513. // "parameterOrder": [
  84514. // "project",
  84515. // "region"
  84516. // ],
  84517. // "parameters": {
  84518. // "filter": {
  84519. // "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).",
  84520. // "location": "query",
  84521. // "type": "string"
  84522. // },
  84523. // "maxResults": {
  84524. // "default": "500",
  84525. // "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)",
  84526. // "format": "uint32",
  84527. // "location": "query",
  84528. // "minimum": "0",
  84529. // "type": "integer"
  84530. // },
  84531. // "orderBy": {
  84532. // "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.",
  84533. // "location": "query",
  84534. // "type": "string"
  84535. // },
  84536. // "pageToken": {
  84537. // "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.",
  84538. // "location": "query",
  84539. // "type": "string"
  84540. // },
  84541. // "project": {
  84542. // "description": "Project ID for this request.",
  84543. // "location": "path",
  84544. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84545. // "required": true,
  84546. // "type": "string"
  84547. // },
  84548. // "region": {
  84549. // "description": "Name of the region scoping this request.",
  84550. // "location": "path",
  84551. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84552. // "required": true,
  84553. // "type": "string"
  84554. // }
  84555. // },
  84556. // "path": "{project}/regions/{region}/backendServices",
  84557. // "response": {
  84558. // "$ref": "BackendServiceList"
  84559. // },
  84560. // "scopes": [
  84561. // "https://www.googleapis.com/auth/cloud-platform",
  84562. // "https://www.googleapis.com/auth/compute",
  84563. // "https://www.googleapis.com/auth/compute.readonly"
  84564. // ]
  84565. // }
  84566. }
  84567. // Pages invokes f for each page of results.
  84568. // A non-nil error returned from f will halt the iteration.
  84569. // The provided context supersedes any context provided to the Context method.
  84570. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  84571. c.ctx_ = ctx
  84572. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84573. for {
  84574. x, err := c.Do()
  84575. if err != nil {
  84576. return err
  84577. }
  84578. if err := f(x); err != nil {
  84579. return err
  84580. }
  84581. if x.NextPageToken == "" {
  84582. return nil
  84583. }
  84584. c.PageToken(x.NextPageToken)
  84585. }
  84586. }
  84587. // method id "compute.regionBackendServices.patch":
  84588. type RegionBackendServicesPatchCall struct {
  84589. s *Service
  84590. project string
  84591. region string
  84592. backendService string
  84593. backendservice *BackendService
  84594. urlParams_ gensupport.URLParams
  84595. ctx_ context.Context
  84596. header_ http.Header
  84597. }
  84598. // Patch: Updates the specified regional BackendService resource with
  84599. // the data included in the request. There are several restrictions and
  84600. // guidelines to keep in mind when updating a backend service. Read
  84601. // Restrictions and Guidelines for more information. This method
  84602. // supports PATCH semantics and uses the JSON merge patch format and
  84603. // processing rules.
  84604. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  84605. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84606. c.project = project
  84607. c.region = region
  84608. c.backendService = backendService
  84609. c.backendservice = backendservice
  84610. return c
  84611. }
  84612. // RequestId sets the optional parameter "requestId": An optional
  84613. // request ID to identify requests. Specify a unique request ID so that
  84614. // if you must retry your request, the server will know to ignore the
  84615. // request if it has already been completed.
  84616. //
  84617. // For example, consider a situation where you make an initial request
  84618. // and the request times out. If you make the request again with the
  84619. // same request ID, the server can check if original operation with the
  84620. // same request ID was received, and if so, will ignore the second
  84621. // request. This prevents clients from accidentally creating duplicate
  84622. // commitments.
  84623. //
  84624. // The request ID must be a valid UUID with the exception that zero UUID
  84625. // is not supported (00000000-0000-0000-0000-000000000000).
  84626. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  84627. c.urlParams_.Set("requestId", requestId)
  84628. return c
  84629. }
  84630. // Fields allows partial responses to be retrieved. See
  84631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84632. // for more information.
  84633. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  84634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84635. return c
  84636. }
  84637. // Context sets the context to be used in this call's Do method. Any
  84638. // pending HTTP request will be aborted if the provided context is
  84639. // canceled.
  84640. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  84641. c.ctx_ = ctx
  84642. return c
  84643. }
  84644. // Header returns an http.Header that can be modified by the caller to
  84645. // add HTTP headers to the request.
  84646. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  84647. if c.header_ == nil {
  84648. c.header_ = make(http.Header)
  84649. }
  84650. return c.header_
  84651. }
  84652. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  84653. reqHeaders := make(http.Header)
  84654. for k, v := range c.header_ {
  84655. reqHeaders[k] = v
  84656. }
  84657. reqHeaders.Set("User-Agent", c.s.userAgent())
  84658. var body io.Reader = nil
  84659. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  84660. if err != nil {
  84661. return nil, err
  84662. }
  84663. reqHeaders.Set("Content-Type", "application/json")
  84664. c.urlParams_.Set("alt", alt)
  84665. c.urlParams_.Set("prettyPrint", "false")
  84666. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  84667. urls += "?" + c.urlParams_.Encode()
  84668. req, err := http.NewRequest("PATCH", urls, body)
  84669. if err != nil {
  84670. return nil, err
  84671. }
  84672. req.Header = reqHeaders
  84673. googleapi.Expand(req.URL, map[string]string{
  84674. "project": c.project,
  84675. "region": c.region,
  84676. "backendService": c.backendService,
  84677. })
  84678. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84679. }
  84680. // Do executes the "compute.regionBackendServices.patch" call.
  84681. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84682. // status code is an error. Response headers are in either
  84683. // *Operation.ServerResponse.Header or (if a response was returned at
  84684. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84685. // to check whether the returned error was because
  84686. // http.StatusNotModified was returned.
  84687. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84688. gensupport.SetOptions(c.urlParams_, opts...)
  84689. res, err := c.doRequest("json")
  84690. if res != nil && res.StatusCode == http.StatusNotModified {
  84691. if res.Body != nil {
  84692. res.Body.Close()
  84693. }
  84694. return nil, &googleapi.Error{
  84695. Code: res.StatusCode,
  84696. Header: res.Header,
  84697. }
  84698. }
  84699. if err != nil {
  84700. return nil, err
  84701. }
  84702. defer googleapi.CloseBody(res)
  84703. if err := googleapi.CheckResponse(res); err != nil {
  84704. return nil, err
  84705. }
  84706. ret := &Operation{
  84707. ServerResponse: googleapi.ServerResponse{
  84708. Header: res.Header,
  84709. HTTPStatusCode: res.StatusCode,
  84710. },
  84711. }
  84712. target := &ret
  84713. if err := gensupport.DecodeResponse(target, res); err != nil {
  84714. return nil, err
  84715. }
  84716. return ret, nil
  84717. // {
  84718. // "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.",
  84719. // "httpMethod": "PATCH",
  84720. // "id": "compute.regionBackendServices.patch",
  84721. // "parameterOrder": [
  84722. // "project",
  84723. // "region",
  84724. // "backendService"
  84725. // ],
  84726. // "parameters": {
  84727. // "backendService": {
  84728. // "description": "Name of the BackendService resource to patch.",
  84729. // "location": "path",
  84730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84731. // "required": true,
  84732. // "type": "string"
  84733. // },
  84734. // "project": {
  84735. // "description": "Project ID for this request.",
  84736. // "location": "path",
  84737. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84738. // "required": true,
  84739. // "type": "string"
  84740. // },
  84741. // "region": {
  84742. // "description": "Name of the region scoping this request.",
  84743. // "location": "path",
  84744. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84745. // "required": true,
  84746. // "type": "string"
  84747. // },
  84748. // "requestId": {
  84749. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84750. // "location": "query",
  84751. // "type": "string"
  84752. // }
  84753. // },
  84754. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  84755. // "request": {
  84756. // "$ref": "BackendService"
  84757. // },
  84758. // "response": {
  84759. // "$ref": "Operation"
  84760. // },
  84761. // "scopes": [
  84762. // "https://www.googleapis.com/auth/cloud-platform",
  84763. // "https://www.googleapis.com/auth/compute"
  84764. // ]
  84765. // }
  84766. }
  84767. // method id "compute.regionBackendServices.testIamPermissions":
  84768. type RegionBackendServicesTestIamPermissionsCall struct {
  84769. s *Service
  84770. project string
  84771. region string
  84772. resource string
  84773. testpermissionsrequest *TestPermissionsRequest
  84774. urlParams_ gensupport.URLParams
  84775. ctx_ context.Context
  84776. header_ http.Header
  84777. }
  84778. // TestIamPermissions: Returns permissions that a caller has on the
  84779. // specified resource.
  84780. func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall {
  84781. c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84782. c.project = project
  84783. c.region = region
  84784. c.resource = resource
  84785. c.testpermissionsrequest = testpermissionsrequest
  84786. return c
  84787. }
  84788. // Fields allows partial responses to be retrieved. See
  84789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84790. // for more information.
  84791. func (c *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall {
  84792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84793. return c
  84794. }
  84795. // Context sets the context to be used in this call's Do method. Any
  84796. // pending HTTP request will be aborted if the provided context is
  84797. // canceled.
  84798. func (c *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall {
  84799. c.ctx_ = ctx
  84800. return c
  84801. }
  84802. // Header returns an http.Header that can be modified by the caller to
  84803. // add HTTP headers to the request.
  84804. func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header {
  84805. if c.header_ == nil {
  84806. c.header_ = make(http.Header)
  84807. }
  84808. return c.header_
  84809. }
  84810. func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  84811. reqHeaders := make(http.Header)
  84812. for k, v := range c.header_ {
  84813. reqHeaders[k] = v
  84814. }
  84815. reqHeaders.Set("User-Agent", c.s.userAgent())
  84816. var body io.Reader = nil
  84817. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  84818. if err != nil {
  84819. return nil, err
  84820. }
  84821. reqHeaders.Set("Content-Type", "application/json")
  84822. c.urlParams_.Set("alt", alt)
  84823. c.urlParams_.Set("prettyPrint", "false")
  84824. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{resource}/testIamPermissions")
  84825. urls += "?" + c.urlParams_.Encode()
  84826. req, err := http.NewRequest("POST", urls, body)
  84827. if err != nil {
  84828. return nil, err
  84829. }
  84830. req.Header = reqHeaders
  84831. googleapi.Expand(req.URL, map[string]string{
  84832. "project": c.project,
  84833. "region": c.region,
  84834. "resource": c.resource,
  84835. })
  84836. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84837. }
  84838. // Do executes the "compute.regionBackendServices.testIamPermissions" call.
  84839. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  84840. // non-2xx status code is an error. Response headers are in either
  84841. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  84842. // returned at all) in error.(*googleapi.Error).Header. Use
  84843. // googleapi.IsNotModified to check whether the returned error was
  84844. // because http.StatusNotModified was returned.
  84845. func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  84846. gensupport.SetOptions(c.urlParams_, opts...)
  84847. res, err := c.doRequest("json")
  84848. if res != nil && res.StatusCode == http.StatusNotModified {
  84849. if res.Body != nil {
  84850. res.Body.Close()
  84851. }
  84852. return nil, &googleapi.Error{
  84853. Code: res.StatusCode,
  84854. Header: res.Header,
  84855. }
  84856. }
  84857. if err != nil {
  84858. return nil, err
  84859. }
  84860. defer googleapi.CloseBody(res)
  84861. if err := googleapi.CheckResponse(res); err != nil {
  84862. return nil, err
  84863. }
  84864. ret := &TestPermissionsResponse{
  84865. ServerResponse: googleapi.ServerResponse{
  84866. Header: res.Header,
  84867. HTTPStatusCode: res.StatusCode,
  84868. },
  84869. }
  84870. target := &ret
  84871. if err := gensupport.DecodeResponse(target, res); err != nil {
  84872. return nil, err
  84873. }
  84874. return ret, nil
  84875. // {
  84876. // "description": "Returns permissions that a caller has on the specified resource.",
  84877. // "httpMethod": "POST",
  84878. // "id": "compute.regionBackendServices.testIamPermissions",
  84879. // "parameterOrder": [
  84880. // "project",
  84881. // "region",
  84882. // "resource"
  84883. // ],
  84884. // "parameters": {
  84885. // "project": {
  84886. // "description": "Project ID for this request.",
  84887. // "location": "path",
  84888. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84889. // "required": true,
  84890. // "type": "string"
  84891. // },
  84892. // "region": {
  84893. // "description": "The name of the region for this request.",
  84894. // "location": "path",
  84895. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84896. // "required": true,
  84897. // "type": "string"
  84898. // },
  84899. // "resource": {
  84900. // "description": "Name or id of the resource for this request.",
  84901. // "location": "path",
  84902. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84903. // "required": true,
  84904. // "type": "string"
  84905. // }
  84906. // },
  84907. // "path": "{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
  84908. // "request": {
  84909. // "$ref": "TestPermissionsRequest"
  84910. // },
  84911. // "response": {
  84912. // "$ref": "TestPermissionsResponse"
  84913. // },
  84914. // "scopes": [
  84915. // "https://www.googleapis.com/auth/cloud-platform",
  84916. // "https://www.googleapis.com/auth/compute",
  84917. // "https://www.googleapis.com/auth/compute.readonly"
  84918. // ]
  84919. // }
  84920. }
  84921. // method id "compute.regionBackendServices.update":
  84922. type RegionBackendServicesUpdateCall struct {
  84923. s *Service
  84924. project string
  84925. region string
  84926. backendService string
  84927. backendservice *BackendService
  84928. urlParams_ gensupport.URLParams
  84929. ctx_ context.Context
  84930. header_ http.Header
  84931. }
  84932. // Update: Updates the specified regional BackendService resource with
  84933. // the data included in the request. There are several restrictions and
  84934. // guidelines to keep in mind when updating a backend service. Read
  84935. // Restrictions and Guidelines for more information.
  84936. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  84937. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84938. c.project = project
  84939. c.region = region
  84940. c.backendService = backendService
  84941. c.backendservice = backendservice
  84942. return c
  84943. }
  84944. // RequestId sets the optional parameter "requestId": An optional
  84945. // request ID to identify requests. Specify a unique request ID so that
  84946. // if you must retry your request, the server will know to ignore the
  84947. // request if it has already been completed.
  84948. //
  84949. // For example, consider a situation where you make an initial request
  84950. // and the request times out. If you make the request again with the
  84951. // same request ID, the server can check if original operation with the
  84952. // same request ID was received, and if so, will ignore the second
  84953. // request. This prevents clients from accidentally creating duplicate
  84954. // commitments.
  84955. //
  84956. // The request ID must be a valid UUID with the exception that zero UUID
  84957. // is not supported (00000000-0000-0000-0000-000000000000).
  84958. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  84959. c.urlParams_.Set("requestId", requestId)
  84960. return c
  84961. }
  84962. // Fields allows partial responses to be retrieved. See
  84963. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84964. // for more information.
  84965. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  84966. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84967. return c
  84968. }
  84969. // Context sets the context to be used in this call's Do method. Any
  84970. // pending HTTP request will be aborted if the provided context is
  84971. // canceled.
  84972. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  84973. c.ctx_ = ctx
  84974. return c
  84975. }
  84976. // Header returns an http.Header that can be modified by the caller to
  84977. // add HTTP headers to the request.
  84978. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  84979. if c.header_ == nil {
  84980. c.header_ = make(http.Header)
  84981. }
  84982. return c.header_
  84983. }
  84984. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  84985. reqHeaders := make(http.Header)
  84986. for k, v := range c.header_ {
  84987. reqHeaders[k] = v
  84988. }
  84989. reqHeaders.Set("User-Agent", c.s.userAgent())
  84990. var body io.Reader = nil
  84991. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  84992. if err != nil {
  84993. return nil, err
  84994. }
  84995. reqHeaders.Set("Content-Type", "application/json")
  84996. c.urlParams_.Set("alt", alt)
  84997. c.urlParams_.Set("prettyPrint", "false")
  84998. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  84999. urls += "?" + c.urlParams_.Encode()
  85000. req, err := http.NewRequest("PUT", urls, body)
  85001. if err != nil {
  85002. return nil, err
  85003. }
  85004. req.Header = reqHeaders
  85005. googleapi.Expand(req.URL, map[string]string{
  85006. "project": c.project,
  85007. "region": c.region,
  85008. "backendService": c.backendService,
  85009. })
  85010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85011. }
  85012. // Do executes the "compute.regionBackendServices.update" call.
  85013. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85014. // status code is an error. Response headers are in either
  85015. // *Operation.ServerResponse.Header or (if a response was returned at
  85016. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85017. // to check whether the returned error was because
  85018. // http.StatusNotModified was returned.
  85019. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85020. gensupport.SetOptions(c.urlParams_, opts...)
  85021. res, err := c.doRequest("json")
  85022. if res != nil && res.StatusCode == http.StatusNotModified {
  85023. if res.Body != nil {
  85024. res.Body.Close()
  85025. }
  85026. return nil, &googleapi.Error{
  85027. Code: res.StatusCode,
  85028. Header: res.Header,
  85029. }
  85030. }
  85031. if err != nil {
  85032. return nil, err
  85033. }
  85034. defer googleapi.CloseBody(res)
  85035. if err := googleapi.CheckResponse(res); err != nil {
  85036. return nil, err
  85037. }
  85038. ret := &Operation{
  85039. ServerResponse: googleapi.ServerResponse{
  85040. Header: res.Header,
  85041. HTTPStatusCode: res.StatusCode,
  85042. },
  85043. }
  85044. target := &ret
  85045. if err := gensupport.DecodeResponse(target, res); err != nil {
  85046. return nil, err
  85047. }
  85048. return ret, nil
  85049. // {
  85050. // "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.",
  85051. // "httpMethod": "PUT",
  85052. // "id": "compute.regionBackendServices.update",
  85053. // "parameterOrder": [
  85054. // "project",
  85055. // "region",
  85056. // "backendService"
  85057. // ],
  85058. // "parameters": {
  85059. // "backendService": {
  85060. // "description": "Name of the BackendService resource to update.",
  85061. // "location": "path",
  85062. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85063. // "required": true,
  85064. // "type": "string"
  85065. // },
  85066. // "project": {
  85067. // "description": "Project ID for this request.",
  85068. // "location": "path",
  85069. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85070. // "required": true,
  85071. // "type": "string"
  85072. // },
  85073. // "region": {
  85074. // "description": "Name of the region scoping this request.",
  85075. // "location": "path",
  85076. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85077. // "required": true,
  85078. // "type": "string"
  85079. // },
  85080. // "requestId": {
  85081. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85082. // "location": "query",
  85083. // "type": "string"
  85084. // }
  85085. // },
  85086. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  85087. // "request": {
  85088. // "$ref": "BackendService"
  85089. // },
  85090. // "response": {
  85091. // "$ref": "Operation"
  85092. // },
  85093. // "scopes": [
  85094. // "https://www.googleapis.com/auth/cloud-platform",
  85095. // "https://www.googleapis.com/auth/compute"
  85096. // ]
  85097. // }
  85098. }
  85099. // method id "compute.regionCommitments.aggregatedList":
  85100. type RegionCommitmentsAggregatedListCall struct {
  85101. s *Service
  85102. project string
  85103. urlParams_ gensupport.URLParams
  85104. ifNoneMatch_ string
  85105. ctx_ context.Context
  85106. header_ http.Header
  85107. }
  85108. // AggregatedList: Retrieves an aggregated list of commitments.
  85109. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  85110. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85111. c.project = project
  85112. return c
  85113. }
  85114. // Filter sets the optional parameter "filter": A filter expression that
  85115. // filters resources listed in the response. The expression must specify
  85116. // the field name, a comparison operator, and the value that you want to
  85117. // use for filtering. The value must be a string, a number, or a
  85118. // boolean. The comparison operator must be either =, !=, >, or <.
  85119. //
  85120. // For example, if you are filtering Compute Engine instances, you can
  85121. // exclude instances named example-instance by specifying name !=
  85122. // example-instance.
  85123. //
  85124. // You can also filter nested fields. For example, you could specify
  85125. // scheduling.automaticRestart = false to include instances only if they
  85126. // are not scheduled for automatic restarts. You can use filtering on
  85127. // nested fields to filter based on resource labels.
  85128. //
  85129. // To filter on multiple expressions, provide each separate expression
  85130. // within parentheses. For example, (scheduling.automaticRestart = true)
  85131. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85132. // AND expression. However, you can include AND and OR expressions
  85133. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85134. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85135. // true).
  85136. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  85137. c.urlParams_.Set("filter", filter)
  85138. return c
  85139. }
  85140. // MaxResults sets the optional parameter "maxResults": The maximum
  85141. // number of results per page that should be returned. If the number of
  85142. // available results is larger than maxResults, Compute Engine returns a
  85143. // nextPageToken that can be used to get the next page of results in
  85144. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85145. // (Default: 500)
  85146. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  85147. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85148. return c
  85149. }
  85150. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85151. // a certain order. By default, results are returned in alphanumerical
  85152. // order based on the resource name.
  85153. //
  85154. // You can also sort results in descending order based on the creation
  85155. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85156. // based on the creationTimestamp field in reverse chronological order
  85157. // (newest result first). Use this to sort resources like operations so
  85158. // that the newest operation is returned first.
  85159. //
  85160. // Currently, only sorting by name or creationTimestamp desc is
  85161. // supported.
  85162. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  85163. c.urlParams_.Set("orderBy", orderBy)
  85164. return c
  85165. }
  85166. // PageToken sets the optional parameter "pageToken": Specifies a page
  85167. // token to use. Set pageToken to the nextPageToken returned by a
  85168. // previous list request to get the next page of results.
  85169. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  85170. c.urlParams_.Set("pageToken", pageToken)
  85171. return c
  85172. }
  85173. // Fields allows partial responses to be retrieved. See
  85174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85175. // for more information.
  85176. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  85177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85178. return c
  85179. }
  85180. // IfNoneMatch sets the optional parameter which makes the operation
  85181. // fail if the object's ETag matches the given value. This is useful for
  85182. // getting updates only after the object has changed since the last
  85183. // request. Use googleapi.IsNotModified to check whether the response
  85184. // error from Do is the result of In-None-Match.
  85185. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  85186. c.ifNoneMatch_ = entityTag
  85187. return c
  85188. }
  85189. // Context sets the context to be used in this call's Do method. Any
  85190. // pending HTTP request will be aborted if the provided context is
  85191. // canceled.
  85192. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  85193. c.ctx_ = ctx
  85194. return c
  85195. }
  85196. // Header returns an http.Header that can be modified by the caller to
  85197. // add HTTP headers to the request.
  85198. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  85199. if c.header_ == nil {
  85200. c.header_ = make(http.Header)
  85201. }
  85202. return c.header_
  85203. }
  85204. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  85205. reqHeaders := make(http.Header)
  85206. for k, v := range c.header_ {
  85207. reqHeaders[k] = v
  85208. }
  85209. reqHeaders.Set("User-Agent", c.s.userAgent())
  85210. if c.ifNoneMatch_ != "" {
  85211. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85212. }
  85213. var body io.Reader = nil
  85214. c.urlParams_.Set("alt", alt)
  85215. c.urlParams_.Set("prettyPrint", "false")
  85216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  85217. urls += "?" + c.urlParams_.Encode()
  85218. req, err := http.NewRequest("GET", urls, body)
  85219. if err != nil {
  85220. return nil, err
  85221. }
  85222. req.Header = reqHeaders
  85223. googleapi.Expand(req.URL, map[string]string{
  85224. "project": c.project,
  85225. })
  85226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85227. }
  85228. // Do executes the "compute.regionCommitments.aggregatedList" call.
  85229. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  85230. // Any non-2xx status code is an error. Response headers are in either
  85231. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  85232. // returned at all) in error.(*googleapi.Error).Header. Use
  85233. // googleapi.IsNotModified to check whether the returned error was
  85234. // because http.StatusNotModified was returned.
  85235. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  85236. gensupport.SetOptions(c.urlParams_, opts...)
  85237. res, err := c.doRequest("json")
  85238. if res != nil && res.StatusCode == http.StatusNotModified {
  85239. if res.Body != nil {
  85240. res.Body.Close()
  85241. }
  85242. return nil, &googleapi.Error{
  85243. Code: res.StatusCode,
  85244. Header: res.Header,
  85245. }
  85246. }
  85247. if err != nil {
  85248. return nil, err
  85249. }
  85250. defer googleapi.CloseBody(res)
  85251. if err := googleapi.CheckResponse(res); err != nil {
  85252. return nil, err
  85253. }
  85254. ret := &CommitmentAggregatedList{
  85255. ServerResponse: googleapi.ServerResponse{
  85256. Header: res.Header,
  85257. HTTPStatusCode: res.StatusCode,
  85258. },
  85259. }
  85260. target := &ret
  85261. if err := gensupport.DecodeResponse(target, res); err != nil {
  85262. return nil, err
  85263. }
  85264. return ret, nil
  85265. // {
  85266. // "description": "Retrieves an aggregated list of commitments.",
  85267. // "httpMethod": "GET",
  85268. // "id": "compute.regionCommitments.aggregatedList",
  85269. // "parameterOrder": [
  85270. // "project"
  85271. // ],
  85272. // "parameters": {
  85273. // "filter": {
  85274. // "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).",
  85275. // "location": "query",
  85276. // "type": "string"
  85277. // },
  85278. // "maxResults": {
  85279. // "default": "500",
  85280. // "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)",
  85281. // "format": "uint32",
  85282. // "location": "query",
  85283. // "minimum": "0",
  85284. // "type": "integer"
  85285. // },
  85286. // "orderBy": {
  85287. // "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.",
  85288. // "location": "query",
  85289. // "type": "string"
  85290. // },
  85291. // "pageToken": {
  85292. // "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.",
  85293. // "location": "query",
  85294. // "type": "string"
  85295. // },
  85296. // "project": {
  85297. // "description": "Project ID for this request.",
  85298. // "location": "path",
  85299. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85300. // "required": true,
  85301. // "type": "string"
  85302. // }
  85303. // },
  85304. // "path": "{project}/aggregated/commitments",
  85305. // "response": {
  85306. // "$ref": "CommitmentAggregatedList"
  85307. // },
  85308. // "scopes": [
  85309. // "https://www.googleapis.com/auth/cloud-platform",
  85310. // "https://www.googleapis.com/auth/compute",
  85311. // "https://www.googleapis.com/auth/compute.readonly"
  85312. // ]
  85313. // }
  85314. }
  85315. // Pages invokes f for each page of results.
  85316. // A non-nil error returned from f will halt the iteration.
  85317. // The provided context supersedes any context provided to the Context method.
  85318. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  85319. c.ctx_ = ctx
  85320. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85321. for {
  85322. x, err := c.Do()
  85323. if err != nil {
  85324. return err
  85325. }
  85326. if err := f(x); err != nil {
  85327. return err
  85328. }
  85329. if x.NextPageToken == "" {
  85330. return nil
  85331. }
  85332. c.PageToken(x.NextPageToken)
  85333. }
  85334. }
  85335. // method id "compute.regionCommitments.get":
  85336. type RegionCommitmentsGetCall struct {
  85337. s *Service
  85338. project string
  85339. region string
  85340. commitment string
  85341. urlParams_ gensupport.URLParams
  85342. ifNoneMatch_ string
  85343. ctx_ context.Context
  85344. header_ http.Header
  85345. }
  85346. // Get: Returns the specified commitment resource. Gets a list of
  85347. // available commitments by making a list() request.
  85348. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  85349. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85350. c.project = project
  85351. c.region = region
  85352. c.commitment = commitment
  85353. return c
  85354. }
  85355. // Fields allows partial responses to be retrieved. See
  85356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85357. // for more information.
  85358. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  85359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85360. return c
  85361. }
  85362. // IfNoneMatch sets the optional parameter which makes the operation
  85363. // fail if the object's ETag matches the given value. This is useful for
  85364. // getting updates only after the object has changed since the last
  85365. // request. Use googleapi.IsNotModified to check whether the response
  85366. // error from Do is the result of In-None-Match.
  85367. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  85368. c.ifNoneMatch_ = entityTag
  85369. return c
  85370. }
  85371. // Context sets the context to be used in this call's Do method. Any
  85372. // pending HTTP request will be aborted if the provided context is
  85373. // canceled.
  85374. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  85375. c.ctx_ = ctx
  85376. return c
  85377. }
  85378. // Header returns an http.Header that can be modified by the caller to
  85379. // add HTTP headers to the request.
  85380. func (c *RegionCommitmentsGetCall) Header() http.Header {
  85381. if c.header_ == nil {
  85382. c.header_ = make(http.Header)
  85383. }
  85384. return c.header_
  85385. }
  85386. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  85387. reqHeaders := make(http.Header)
  85388. for k, v := range c.header_ {
  85389. reqHeaders[k] = v
  85390. }
  85391. reqHeaders.Set("User-Agent", c.s.userAgent())
  85392. if c.ifNoneMatch_ != "" {
  85393. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85394. }
  85395. var body io.Reader = nil
  85396. c.urlParams_.Set("alt", alt)
  85397. c.urlParams_.Set("prettyPrint", "false")
  85398. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  85399. urls += "?" + c.urlParams_.Encode()
  85400. req, err := http.NewRequest("GET", urls, body)
  85401. if err != nil {
  85402. return nil, err
  85403. }
  85404. req.Header = reqHeaders
  85405. googleapi.Expand(req.URL, map[string]string{
  85406. "project": c.project,
  85407. "region": c.region,
  85408. "commitment": c.commitment,
  85409. })
  85410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85411. }
  85412. // Do executes the "compute.regionCommitments.get" call.
  85413. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  85414. // status code is an error. Response headers are in either
  85415. // *Commitment.ServerResponse.Header or (if a response was returned at
  85416. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85417. // to check whether the returned error was because
  85418. // http.StatusNotModified was returned.
  85419. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  85420. gensupport.SetOptions(c.urlParams_, opts...)
  85421. res, err := c.doRequest("json")
  85422. if res != nil && res.StatusCode == http.StatusNotModified {
  85423. if res.Body != nil {
  85424. res.Body.Close()
  85425. }
  85426. return nil, &googleapi.Error{
  85427. Code: res.StatusCode,
  85428. Header: res.Header,
  85429. }
  85430. }
  85431. if err != nil {
  85432. return nil, err
  85433. }
  85434. defer googleapi.CloseBody(res)
  85435. if err := googleapi.CheckResponse(res); err != nil {
  85436. return nil, err
  85437. }
  85438. ret := &Commitment{
  85439. ServerResponse: googleapi.ServerResponse{
  85440. Header: res.Header,
  85441. HTTPStatusCode: res.StatusCode,
  85442. },
  85443. }
  85444. target := &ret
  85445. if err := gensupport.DecodeResponse(target, res); err != nil {
  85446. return nil, err
  85447. }
  85448. return ret, nil
  85449. // {
  85450. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  85451. // "httpMethod": "GET",
  85452. // "id": "compute.regionCommitments.get",
  85453. // "parameterOrder": [
  85454. // "project",
  85455. // "region",
  85456. // "commitment"
  85457. // ],
  85458. // "parameters": {
  85459. // "commitment": {
  85460. // "description": "Name of the commitment to return.",
  85461. // "location": "path",
  85462. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85463. // "required": true,
  85464. // "type": "string"
  85465. // },
  85466. // "project": {
  85467. // "description": "Project ID for this request.",
  85468. // "location": "path",
  85469. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85470. // "required": true,
  85471. // "type": "string"
  85472. // },
  85473. // "region": {
  85474. // "description": "Name of the region for this request.",
  85475. // "location": "path",
  85476. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85477. // "required": true,
  85478. // "type": "string"
  85479. // }
  85480. // },
  85481. // "path": "{project}/regions/{region}/commitments/{commitment}",
  85482. // "response": {
  85483. // "$ref": "Commitment"
  85484. // },
  85485. // "scopes": [
  85486. // "https://www.googleapis.com/auth/cloud-platform",
  85487. // "https://www.googleapis.com/auth/compute",
  85488. // "https://www.googleapis.com/auth/compute.readonly"
  85489. // ]
  85490. // }
  85491. }
  85492. // method id "compute.regionCommitments.insert":
  85493. type RegionCommitmentsInsertCall struct {
  85494. s *Service
  85495. project string
  85496. region string
  85497. commitment *Commitment
  85498. urlParams_ gensupport.URLParams
  85499. ctx_ context.Context
  85500. header_ http.Header
  85501. }
  85502. // Insert: Creates a commitment in the specified project using the data
  85503. // included in the request.
  85504. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  85505. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85506. c.project = project
  85507. c.region = region
  85508. c.commitment = commitment
  85509. return c
  85510. }
  85511. // RequestId sets the optional parameter "requestId": An optional
  85512. // request ID to identify requests. Specify a unique request ID so that
  85513. // if you must retry your request, the server will know to ignore the
  85514. // request if it has already been completed.
  85515. //
  85516. // For example, consider a situation where you make an initial request
  85517. // and the request times out. If you make the request again with the
  85518. // same request ID, the server can check if original operation with the
  85519. // same request ID was received, and if so, will ignore the second
  85520. // request. This prevents clients from accidentally creating duplicate
  85521. // commitments.
  85522. //
  85523. // The request ID must be a valid UUID with the exception that zero UUID
  85524. // is not supported (00000000-0000-0000-0000-000000000000).
  85525. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  85526. c.urlParams_.Set("requestId", requestId)
  85527. return c
  85528. }
  85529. // Fields allows partial responses to be retrieved. See
  85530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85531. // for more information.
  85532. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  85533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85534. return c
  85535. }
  85536. // Context sets the context to be used in this call's Do method. Any
  85537. // pending HTTP request will be aborted if the provided context is
  85538. // canceled.
  85539. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  85540. c.ctx_ = ctx
  85541. return c
  85542. }
  85543. // Header returns an http.Header that can be modified by the caller to
  85544. // add HTTP headers to the request.
  85545. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  85546. if c.header_ == nil {
  85547. c.header_ = make(http.Header)
  85548. }
  85549. return c.header_
  85550. }
  85551. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  85552. reqHeaders := make(http.Header)
  85553. for k, v := range c.header_ {
  85554. reqHeaders[k] = v
  85555. }
  85556. reqHeaders.Set("User-Agent", c.s.userAgent())
  85557. var body io.Reader = nil
  85558. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  85559. if err != nil {
  85560. return nil, err
  85561. }
  85562. reqHeaders.Set("Content-Type", "application/json")
  85563. c.urlParams_.Set("alt", alt)
  85564. c.urlParams_.Set("prettyPrint", "false")
  85565. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  85566. urls += "?" + c.urlParams_.Encode()
  85567. req, err := http.NewRequest("POST", urls, body)
  85568. if err != nil {
  85569. return nil, err
  85570. }
  85571. req.Header = reqHeaders
  85572. googleapi.Expand(req.URL, map[string]string{
  85573. "project": c.project,
  85574. "region": c.region,
  85575. })
  85576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85577. }
  85578. // Do executes the "compute.regionCommitments.insert" call.
  85579. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85580. // status code is an error. Response headers are in either
  85581. // *Operation.ServerResponse.Header or (if a response was returned at
  85582. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85583. // to check whether the returned error was because
  85584. // http.StatusNotModified was returned.
  85585. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85586. gensupport.SetOptions(c.urlParams_, opts...)
  85587. res, err := c.doRequest("json")
  85588. if res != nil && res.StatusCode == http.StatusNotModified {
  85589. if res.Body != nil {
  85590. res.Body.Close()
  85591. }
  85592. return nil, &googleapi.Error{
  85593. Code: res.StatusCode,
  85594. Header: res.Header,
  85595. }
  85596. }
  85597. if err != nil {
  85598. return nil, err
  85599. }
  85600. defer googleapi.CloseBody(res)
  85601. if err := googleapi.CheckResponse(res); err != nil {
  85602. return nil, err
  85603. }
  85604. ret := &Operation{
  85605. ServerResponse: googleapi.ServerResponse{
  85606. Header: res.Header,
  85607. HTTPStatusCode: res.StatusCode,
  85608. },
  85609. }
  85610. target := &ret
  85611. if err := gensupport.DecodeResponse(target, res); err != nil {
  85612. return nil, err
  85613. }
  85614. return ret, nil
  85615. // {
  85616. // "description": "Creates a commitment in the specified project using the data included in the request.",
  85617. // "httpMethod": "POST",
  85618. // "id": "compute.regionCommitments.insert",
  85619. // "parameterOrder": [
  85620. // "project",
  85621. // "region"
  85622. // ],
  85623. // "parameters": {
  85624. // "project": {
  85625. // "description": "Project ID for this request.",
  85626. // "location": "path",
  85627. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85628. // "required": true,
  85629. // "type": "string"
  85630. // },
  85631. // "region": {
  85632. // "description": "Name of the region for this request.",
  85633. // "location": "path",
  85634. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85635. // "required": true,
  85636. // "type": "string"
  85637. // },
  85638. // "requestId": {
  85639. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85640. // "location": "query",
  85641. // "type": "string"
  85642. // }
  85643. // },
  85644. // "path": "{project}/regions/{region}/commitments",
  85645. // "request": {
  85646. // "$ref": "Commitment"
  85647. // },
  85648. // "response": {
  85649. // "$ref": "Operation"
  85650. // },
  85651. // "scopes": [
  85652. // "https://www.googleapis.com/auth/cloud-platform",
  85653. // "https://www.googleapis.com/auth/compute"
  85654. // ]
  85655. // }
  85656. }
  85657. // method id "compute.regionCommitments.list":
  85658. type RegionCommitmentsListCall struct {
  85659. s *Service
  85660. project string
  85661. region string
  85662. urlParams_ gensupport.URLParams
  85663. ifNoneMatch_ string
  85664. ctx_ context.Context
  85665. header_ http.Header
  85666. }
  85667. // List: Retrieves a list of commitments contained within the specified
  85668. // region.
  85669. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  85670. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85671. c.project = project
  85672. c.region = region
  85673. return c
  85674. }
  85675. // Filter sets the optional parameter "filter": A filter expression that
  85676. // filters resources listed in the response. The expression must specify
  85677. // the field name, a comparison operator, and the value that you want to
  85678. // use for filtering. The value must be a string, a number, or a
  85679. // boolean. The comparison operator must be either =, !=, >, or <.
  85680. //
  85681. // For example, if you are filtering Compute Engine instances, you can
  85682. // exclude instances named example-instance by specifying name !=
  85683. // example-instance.
  85684. //
  85685. // You can also filter nested fields. For example, you could specify
  85686. // scheduling.automaticRestart = false to include instances only if they
  85687. // are not scheduled for automatic restarts. You can use filtering on
  85688. // nested fields to filter based on resource labels.
  85689. //
  85690. // To filter on multiple expressions, provide each separate expression
  85691. // within parentheses. For example, (scheduling.automaticRestart = true)
  85692. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85693. // AND expression. However, you can include AND and OR expressions
  85694. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85695. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85696. // true).
  85697. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  85698. c.urlParams_.Set("filter", filter)
  85699. return c
  85700. }
  85701. // MaxResults sets the optional parameter "maxResults": The maximum
  85702. // number of results per page that should be returned. If the number of
  85703. // available results is larger than maxResults, Compute Engine returns a
  85704. // nextPageToken that can be used to get the next page of results in
  85705. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85706. // (Default: 500)
  85707. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  85708. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85709. return c
  85710. }
  85711. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85712. // a certain order. By default, results are returned in alphanumerical
  85713. // order based on the resource name.
  85714. //
  85715. // You can also sort results in descending order based on the creation
  85716. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85717. // based on the creationTimestamp field in reverse chronological order
  85718. // (newest result first). Use this to sort resources like operations so
  85719. // that the newest operation is returned first.
  85720. //
  85721. // Currently, only sorting by name or creationTimestamp desc is
  85722. // supported.
  85723. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  85724. c.urlParams_.Set("orderBy", orderBy)
  85725. return c
  85726. }
  85727. // PageToken sets the optional parameter "pageToken": Specifies a page
  85728. // token to use. Set pageToken to the nextPageToken returned by a
  85729. // previous list request to get the next page of results.
  85730. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  85731. c.urlParams_.Set("pageToken", pageToken)
  85732. return c
  85733. }
  85734. // Fields allows partial responses to be retrieved. See
  85735. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85736. // for more information.
  85737. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  85738. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85739. return c
  85740. }
  85741. // IfNoneMatch sets the optional parameter which makes the operation
  85742. // fail if the object's ETag matches the given value. This is useful for
  85743. // getting updates only after the object has changed since the last
  85744. // request. Use googleapi.IsNotModified to check whether the response
  85745. // error from Do is the result of In-None-Match.
  85746. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  85747. c.ifNoneMatch_ = entityTag
  85748. return c
  85749. }
  85750. // Context sets the context to be used in this call's Do method. Any
  85751. // pending HTTP request will be aborted if the provided context is
  85752. // canceled.
  85753. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  85754. c.ctx_ = ctx
  85755. return c
  85756. }
  85757. // Header returns an http.Header that can be modified by the caller to
  85758. // add HTTP headers to the request.
  85759. func (c *RegionCommitmentsListCall) Header() http.Header {
  85760. if c.header_ == nil {
  85761. c.header_ = make(http.Header)
  85762. }
  85763. return c.header_
  85764. }
  85765. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  85766. reqHeaders := make(http.Header)
  85767. for k, v := range c.header_ {
  85768. reqHeaders[k] = v
  85769. }
  85770. reqHeaders.Set("User-Agent", c.s.userAgent())
  85771. if c.ifNoneMatch_ != "" {
  85772. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85773. }
  85774. var body io.Reader = nil
  85775. c.urlParams_.Set("alt", alt)
  85776. c.urlParams_.Set("prettyPrint", "false")
  85777. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  85778. urls += "?" + c.urlParams_.Encode()
  85779. req, err := http.NewRequest("GET", urls, body)
  85780. if err != nil {
  85781. return nil, err
  85782. }
  85783. req.Header = reqHeaders
  85784. googleapi.Expand(req.URL, map[string]string{
  85785. "project": c.project,
  85786. "region": c.region,
  85787. })
  85788. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85789. }
  85790. // Do executes the "compute.regionCommitments.list" call.
  85791. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  85792. // status code is an error. Response headers are in either
  85793. // *CommitmentList.ServerResponse.Header or (if a response was returned
  85794. // at all) in error.(*googleapi.Error).Header. Use
  85795. // googleapi.IsNotModified to check whether the returned error was
  85796. // because http.StatusNotModified was returned.
  85797. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  85798. gensupport.SetOptions(c.urlParams_, opts...)
  85799. res, err := c.doRequest("json")
  85800. if res != nil && res.StatusCode == http.StatusNotModified {
  85801. if res.Body != nil {
  85802. res.Body.Close()
  85803. }
  85804. return nil, &googleapi.Error{
  85805. Code: res.StatusCode,
  85806. Header: res.Header,
  85807. }
  85808. }
  85809. if err != nil {
  85810. return nil, err
  85811. }
  85812. defer googleapi.CloseBody(res)
  85813. if err := googleapi.CheckResponse(res); err != nil {
  85814. return nil, err
  85815. }
  85816. ret := &CommitmentList{
  85817. ServerResponse: googleapi.ServerResponse{
  85818. Header: res.Header,
  85819. HTTPStatusCode: res.StatusCode,
  85820. },
  85821. }
  85822. target := &ret
  85823. if err := gensupport.DecodeResponse(target, res); err != nil {
  85824. return nil, err
  85825. }
  85826. return ret, nil
  85827. // {
  85828. // "description": "Retrieves a list of commitments contained within the specified region.",
  85829. // "httpMethod": "GET",
  85830. // "id": "compute.regionCommitments.list",
  85831. // "parameterOrder": [
  85832. // "project",
  85833. // "region"
  85834. // ],
  85835. // "parameters": {
  85836. // "filter": {
  85837. // "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).",
  85838. // "location": "query",
  85839. // "type": "string"
  85840. // },
  85841. // "maxResults": {
  85842. // "default": "500",
  85843. // "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)",
  85844. // "format": "uint32",
  85845. // "location": "query",
  85846. // "minimum": "0",
  85847. // "type": "integer"
  85848. // },
  85849. // "orderBy": {
  85850. // "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.",
  85851. // "location": "query",
  85852. // "type": "string"
  85853. // },
  85854. // "pageToken": {
  85855. // "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.",
  85856. // "location": "query",
  85857. // "type": "string"
  85858. // },
  85859. // "project": {
  85860. // "description": "Project ID for this request.",
  85861. // "location": "path",
  85862. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85863. // "required": true,
  85864. // "type": "string"
  85865. // },
  85866. // "region": {
  85867. // "description": "Name of the region for this request.",
  85868. // "location": "path",
  85869. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85870. // "required": true,
  85871. // "type": "string"
  85872. // }
  85873. // },
  85874. // "path": "{project}/regions/{region}/commitments",
  85875. // "response": {
  85876. // "$ref": "CommitmentList"
  85877. // },
  85878. // "scopes": [
  85879. // "https://www.googleapis.com/auth/cloud-platform",
  85880. // "https://www.googleapis.com/auth/compute",
  85881. // "https://www.googleapis.com/auth/compute.readonly"
  85882. // ]
  85883. // }
  85884. }
  85885. // Pages invokes f for each page of results.
  85886. // A non-nil error returned from f will halt the iteration.
  85887. // The provided context supersedes any context provided to the Context method.
  85888. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  85889. c.ctx_ = ctx
  85890. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85891. for {
  85892. x, err := c.Do()
  85893. if err != nil {
  85894. return err
  85895. }
  85896. if err := f(x); err != nil {
  85897. return err
  85898. }
  85899. if x.NextPageToken == "" {
  85900. return nil
  85901. }
  85902. c.PageToken(x.NextPageToken)
  85903. }
  85904. }
  85905. // method id "compute.regionCommitments.updateAllocations":
  85906. type RegionCommitmentsUpdateAllocationsCall struct {
  85907. s *Service
  85908. project string
  85909. region string
  85910. commitment string
  85911. regioncommitmentsupdateallocationsrequest *RegionCommitmentsUpdateAllocationsRequest
  85912. urlParams_ gensupport.URLParams
  85913. ctx_ context.Context
  85914. header_ http.Header
  85915. }
  85916. // UpdateAllocations: Update the shape of allocations for GPUS/Local
  85917. // SSDs of allocations within the commitments.
  85918. func (r *RegionCommitmentsService) UpdateAllocations(project string, region string, commitment string, regioncommitmentsupdateallocationsrequest *RegionCommitmentsUpdateAllocationsRequest) *RegionCommitmentsUpdateAllocationsCall {
  85919. c := &RegionCommitmentsUpdateAllocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85920. c.project = project
  85921. c.region = region
  85922. c.commitment = commitment
  85923. c.regioncommitmentsupdateallocationsrequest = regioncommitmentsupdateallocationsrequest
  85924. return c
  85925. }
  85926. // RequestId sets the optional parameter "requestId": An optional
  85927. // request ID to identify requests. Specify a unique request ID so that
  85928. // if you must retry your request, the server will know to ignore the
  85929. // request if it has already been completed.
  85930. //
  85931. // For example, consider a situation where you make an initial request
  85932. // and the request times out. If you make the request again with the
  85933. // same request ID, the server can check if original operation with the
  85934. // same request ID was received, and if so, will ignore the second
  85935. // request. This prevents clients from accidentally creating duplicate
  85936. // commitments.
  85937. //
  85938. // The request ID must be a valid UUID with the exception that zero UUID
  85939. // is not supported (00000000-0000-0000-0000-000000000000).
  85940. func (c *RegionCommitmentsUpdateAllocationsCall) RequestId(requestId string) *RegionCommitmentsUpdateAllocationsCall {
  85941. c.urlParams_.Set("requestId", requestId)
  85942. return c
  85943. }
  85944. // Fields allows partial responses to be retrieved. See
  85945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85946. // for more information.
  85947. func (c *RegionCommitmentsUpdateAllocationsCall) Fields(s ...googleapi.Field) *RegionCommitmentsUpdateAllocationsCall {
  85948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85949. return c
  85950. }
  85951. // Context sets the context to be used in this call's Do method. Any
  85952. // pending HTTP request will be aborted if the provided context is
  85953. // canceled.
  85954. func (c *RegionCommitmentsUpdateAllocationsCall) Context(ctx context.Context) *RegionCommitmentsUpdateAllocationsCall {
  85955. c.ctx_ = ctx
  85956. return c
  85957. }
  85958. // Header returns an http.Header that can be modified by the caller to
  85959. // add HTTP headers to the request.
  85960. func (c *RegionCommitmentsUpdateAllocationsCall) Header() http.Header {
  85961. if c.header_ == nil {
  85962. c.header_ = make(http.Header)
  85963. }
  85964. return c.header_
  85965. }
  85966. func (c *RegionCommitmentsUpdateAllocationsCall) doRequest(alt string) (*http.Response, error) {
  85967. reqHeaders := make(http.Header)
  85968. for k, v := range c.header_ {
  85969. reqHeaders[k] = v
  85970. }
  85971. reqHeaders.Set("User-Agent", c.s.userAgent())
  85972. var body io.Reader = nil
  85973. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioncommitmentsupdateallocationsrequest)
  85974. if err != nil {
  85975. return nil, err
  85976. }
  85977. reqHeaders.Set("Content-Type", "application/json")
  85978. c.urlParams_.Set("alt", alt)
  85979. c.urlParams_.Set("prettyPrint", "false")
  85980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}/updateAllocations")
  85981. urls += "?" + c.urlParams_.Encode()
  85982. req, err := http.NewRequest("POST", urls, body)
  85983. if err != nil {
  85984. return nil, err
  85985. }
  85986. req.Header = reqHeaders
  85987. googleapi.Expand(req.URL, map[string]string{
  85988. "project": c.project,
  85989. "region": c.region,
  85990. "commitment": c.commitment,
  85991. })
  85992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85993. }
  85994. // Do executes the "compute.regionCommitments.updateAllocations" call.
  85995. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85996. // status code is an error. Response headers are in either
  85997. // *Operation.ServerResponse.Header or (if a response was returned at
  85998. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85999. // to check whether the returned error was because
  86000. // http.StatusNotModified was returned.
  86001. func (c *RegionCommitmentsUpdateAllocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86002. gensupport.SetOptions(c.urlParams_, opts...)
  86003. res, err := c.doRequest("json")
  86004. if res != nil && res.StatusCode == http.StatusNotModified {
  86005. if res.Body != nil {
  86006. res.Body.Close()
  86007. }
  86008. return nil, &googleapi.Error{
  86009. Code: res.StatusCode,
  86010. Header: res.Header,
  86011. }
  86012. }
  86013. if err != nil {
  86014. return nil, err
  86015. }
  86016. defer googleapi.CloseBody(res)
  86017. if err := googleapi.CheckResponse(res); err != nil {
  86018. return nil, err
  86019. }
  86020. ret := &Operation{
  86021. ServerResponse: googleapi.ServerResponse{
  86022. Header: res.Header,
  86023. HTTPStatusCode: res.StatusCode,
  86024. },
  86025. }
  86026. target := &ret
  86027. if err := gensupport.DecodeResponse(target, res); err != nil {
  86028. return nil, err
  86029. }
  86030. return ret, nil
  86031. // {
  86032. // "description": "Update the shape of allocations for GPUS/Local SSDs of allocations within the commitments.",
  86033. // "httpMethod": "POST",
  86034. // "id": "compute.regionCommitments.updateAllocations",
  86035. // "parameterOrder": [
  86036. // "project",
  86037. // "region",
  86038. // "commitment"
  86039. // ],
  86040. // "parameters": {
  86041. // "commitment": {
  86042. // "description": "Name of the commitment of which the allocation's capacities are being updated.",
  86043. // "location": "path",
  86044. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86045. // "required": true,
  86046. // "type": "string"
  86047. // },
  86048. // "project": {
  86049. // "description": "Project ID for this request.",
  86050. // "location": "path",
  86051. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86052. // "required": true,
  86053. // "type": "string"
  86054. // },
  86055. // "region": {
  86056. // "description": "Name of the region for this request.",
  86057. // "location": "path",
  86058. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86059. // "required": true,
  86060. // "type": "string"
  86061. // },
  86062. // "requestId": {
  86063. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86064. // "location": "query",
  86065. // "type": "string"
  86066. // }
  86067. // },
  86068. // "path": "{project}/regions/{region}/commitments/{commitment}/updateAllocations",
  86069. // "request": {
  86070. // "$ref": "RegionCommitmentsUpdateAllocationsRequest"
  86071. // },
  86072. // "response": {
  86073. // "$ref": "Operation"
  86074. // },
  86075. // "scopes": [
  86076. // "https://www.googleapis.com/auth/cloud-platform",
  86077. // "https://www.googleapis.com/auth/compute"
  86078. // ]
  86079. // }
  86080. }
  86081. // method id "compute.regionDiskTypes.get":
  86082. type RegionDiskTypesGetCall struct {
  86083. s *Service
  86084. project string
  86085. region string
  86086. diskType string
  86087. urlParams_ gensupport.URLParams
  86088. ifNoneMatch_ string
  86089. ctx_ context.Context
  86090. header_ http.Header
  86091. }
  86092. // Get: Returns the specified regional disk type. Gets a list of
  86093. // available disk types by making a list() request.
  86094. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  86095. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86096. c.project = project
  86097. c.region = region
  86098. c.diskType = diskType
  86099. return c
  86100. }
  86101. // Fields allows partial responses to be retrieved. See
  86102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86103. // for more information.
  86104. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  86105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86106. return c
  86107. }
  86108. // IfNoneMatch sets the optional parameter which makes the operation
  86109. // fail if the object's ETag matches the given value. This is useful for
  86110. // getting updates only after the object has changed since the last
  86111. // request. Use googleapi.IsNotModified to check whether the response
  86112. // error from Do is the result of In-None-Match.
  86113. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  86114. c.ifNoneMatch_ = entityTag
  86115. return c
  86116. }
  86117. // Context sets the context to be used in this call's Do method. Any
  86118. // pending HTTP request will be aborted if the provided context is
  86119. // canceled.
  86120. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  86121. c.ctx_ = ctx
  86122. return c
  86123. }
  86124. // Header returns an http.Header that can be modified by the caller to
  86125. // add HTTP headers to the request.
  86126. func (c *RegionDiskTypesGetCall) Header() http.Header {
  86127. if c.header_ == nil {
  86128. c.header_ = make(http.Header)
  86129. }
  86130. return c.header_
  86131. }
  86132. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  86133. reqHeaders := make(http.Header)
  86134. for k, v := range c.header_ {
  86135. reqHeaders[k] = v
  86136. }
  86137. reqHeaders.Set("User-Agent", c.s.userAgent())
  86138. if c.ifNoneMatch_ != "" {
  86139. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86140. }
  86141. var body io.Reader = nil
  86142. c.urlParams_.Set("alt", alt)
  86143. c.urlParams_.Set("prettyPrint", "false")
  86144. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  86145. urls += "?" + c.urlParams_.Encode()
  86146. req, err := http.NewRequest("GET", 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. "region": c.region,
  86154. "diskType": c.diskType,
  86155. })
  86156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86157. }
  86158. // Do executes the "compute.regionDiskTypes.get" call.
  86159. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  86160. // code is an error. Response headers are in either
  86161. // *DiskType.ServerResponse.Header or (if a response was returned at
  86162. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86163. // to check whether the returned error was because
  86164. // http.StatusNotModified was returned.
  86165. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, 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 := &DiskType{
  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 the specified regional disk type. Gets a list of available disk types by making a list() request.",
  86197. // "httpMethod": "GET",
  86198. // "id": "compute.regionDiskTypes.get",
  86199. // "parameterOrder": [
  86200. // "project",
  86201. // "region",
  86202. // "diskType"
  86203. // ],
  86204. // "parameters": {
  86205. // "diskType": {
  86206. // "description": "Name of the disk type to return.",
  86207. // "location": "path",
  86208. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86209. // "required": true,
  86210. // "type": "string"
  86211. // },
  86212. // "project": {
  86213. // "description": "Project ID for this request.",
  86214. // "location": "path",
  86215. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86216. // "required": true,
  86217. // "type": "string"
  86218. // },
  86219. // "region": {
  86220. // "description": "The name of the region 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}/regions/{region}/diskTypes/{diskType}",
  86228. // "response": {
  86229. // "$ref": "DiskType"
  86230. // },
  86231. // "scopes": [
  86232. // "https://www.googleapis.com/auth/cloud-platform",
  86233. // "https://www.googleapis.com/auth/compute",
  86234. // "https://www.googleapis.com/auth/compute.readonly"
  86235. // ]
  86236. // }
  86237. }
  86238. // method id "compute.regionDiskTypes.list":
  86239. type RegionDiskTypesListCall struct {
  86240. s *Service
  86241. project string
  86242. region string
  86243. urlParams_ gensupport.URLParams
  86244. ifNoneMatch_ string
  86245. ctx_ context.Context
  86246. header_ http.Header
  86247. }
  86248. // List: Retrieves a list of regional disk types available to the
  86249. // specified project.
  86250. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  86251. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86252. c.project = project
  86253. c.region = region
  86254. return c
  86255. }
  86256. // Filter sets the optional parameter "filter": A filter expression that
  86257. // filters resources listed in the response. The expression must specify
  86258. // the field name, a comparison operator, and the value that you want to
  86259. // use for filtering. The value must be a string, a number, or a
  86260. // boolean. The comparison operator must be either =, !=, >, or <.
  86261. //
  86262. // For example, if you are filtering Compute Engine instances, you can
  86263. // exclude instances named example-instance by specifying name !=
  86264. // example-instance.
  86265. //
  86266. // You can also filter nested fields. For example, you could specify
  86267. // scheduling.automaticRestart = false to include instances only if they
  86268. // are not scheduled for automatic restarts. You can use filtering on
  86269. // nested fields to filter based on resource labels.
  86270. //
  86271. // To filter on multiple expressions, provide each separate expression
  86272. // within parentheses. For example, (scheduling.automaticRestart = true)
  86273. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86274. // AND expression. However, you can include AND and OR expressions
  86275. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86276. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86277. // true).
  86278. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  86279. c.urlParams_.Set("filter", filter)
  86280. return c
  86281. }
  86282. // MaxResults sets the optional parameter "maxResults": The maximum
  86283. // number of results per page that should be returned. If the number of
  86284. // available results is larger than maxResults, Compute Engine returns a
  86285. // nextPageToken that can be used to get the next page of results in
  86286. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86287. // (Default: 500)
  86288. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  86289. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86290. return c
  86291. }
  86292. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86293. // a certain order. By default, results are returned in alphanumerical
  86294. // order based on the resource name.
  86295. //
  86296. // You can also sort results in descending order based on the creation
  86297. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86298. // based on the creationTimestamp field in reverse chronological order
  86299. // (newest result first). Use this to sort resources like operations so
  86300. // that the newest operation is returned first.
  86301. //
  86302. // Currently, only sorting by name or creationTimestamp desc is
  86303. // supported.
  86304. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  86305. c.urlParams_.Set("orderBy", orderBy)
  86306. return c
  86307. }
  86308. // PageToken sets the optional parameter "pageToken": Specifies a page
  86309. // token to use. Set pageToken to the nextPageToken returned by a
  86310. // previous list request to get the next page of results.
  86311. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  86312. c.urlParams_.Set("pageToken", pageToken)
  86313. return c
  86314. }
  86315. // Fields allows partial responses to be retrieved. See
  86316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86317. // for more information.
  86318. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  86319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86320. return c
  86321. }
  86322. // IfNoneMatch sets the optional parameter which makes the operation
  86323. // fail if the object's ETag matches the given value. This is useful for
  86324. // getting updates only after the object has changed since the last
  86325. // request. Use googleapi.IsNotModified to check whether the response
  86326. // error from Do is the result of In-None-Match.
  86327. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  86328. c.ifNoneMatch_ = entityTag
  86329. return c
  86330. }
  86331. // Context sets the context to be used in this call's Do method. Any
  86332. // pending HTTP request will be aborted if the provided context is
  86333. // canceled.
  86334. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  86335. c.ctx_ = ctx
  86336. return c
  86337. }
  86338. // Header returns an http.Header that can be modified by the caller to
  86339. // add HTTP headers to the request.
  86340. func (c *RegionDiskTypesListCall) Header() http.Header {
  86341. if c.header_ == nil {
  86342. c.header_ = make(http.Header)
  86343. }
  86344. return c.header_
  86345. }
  86346. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  86347. reqHeaders := make(http.Header)
  86348. for k, v := range c.header_ {
  86349. reqHeaders[k] = v
  86350. }
  86351. reqHeaders.Set("User-Agent", c.s.userAgent())
  86352. if c.ifNoneMatch_ != "" {
  86353. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86354. }
  86355. var body io.Reader = nil
  86356. c.urlParams_.Set("alt", alt)
  86357. c.urlParams_.Set("prettyPrint", "false")
  86358. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  86359. urls += "?" + c.urlParams_.Encode()
  86360. req, err := http.NewRequest("GET", urls, body)
  86361. if err != nil {
  86362. return nil, err
  86363. }
  86364. req.Header = reqHeaders
  86365. googleapi.Expand(req.URL, map[string]string{
  86366. "project": c.project,
  86367. "region": c.region,
  86368. })
  86369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86370. }
  86371. // Do executes the "compute.regionDiskTypes.list" call.
  86372. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  86373. // non-2xx status code is an error. Response headers are in either
  86374. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  86375. // returned at all) in error.(*googleapi.Error).Header. Use
  86376. // googleapi.IsNotModified to check whether the returned error was
  86377. // because http.StatusNotModified was returned.
  86378. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  86379. gensupport.SetOptions(c.urlParams_, opts...)
  86380. res, err := c.doRequest("json")
  86381. if res != nil && res.StatusCode == http.StatusNotModified {
  86382. if res.Body != nil {
  86383. res.Body.Close()
  86384. }
  86385. return nil, &googleapi.Error{
  86386. Code: res.StatusCode,
  86387. Header: res.Header,
  86388. }
  86389. }
  86390. if err != nil {
  86391. return nil, err
  86392. }
  86393. defer googleapi.CloseBody(res)
  86394. if err := googleapi.CheckResponse(res); err != nil {
  86395. return nil, err
  86396. }
  86397. ret := &RegionDiskTypeList{
  86398. ServerResponse: googleapi.ServerResponse{
  86399. Header: res.Header,
  86400. HTTPStatusCode: res.StatusCode,
  86401. },
  86402. }
  86403. target := &ret
  86404. if err := gensupport.DecodeResponse(target, res); err != nil {
  86405. return nil, err
  86406. }
  86407. return ret, nil
  86408. // {
  86409. // "description": "Retrieves a list of regional disk types available to the specified project.",
  86410. // "httpMethod": "GET",
  86411. // "id": "compute.regionDiskTypes.list",
  86412. // "parameterOrder": [
  86413. // "project",
  86414. // "region"
  86415. // ],
  86416. // "parameters": {
  86417. // "filter": {
  86418. // "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).",
  86419. // "location": "query",
  86420. // "type": "string"
  86421. // },
  86422. // "maxResults": {
  86423. // "default": "500",
  86424. // "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)",
  86425. // "format": "uint32",
  86426. // "location": "query",
  86427. // "minimum": "0",
  86428. // "type": "integer"
  86429. // },
  86430. // "orderBy": {
  86431. // "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.",
  86432. // "location": "query",
  86433. // "type": "string"
  86434. // },
  86435. // "pageToken": {
  86436. // "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.",
  86437. // "location": "query",
  86438. // "type": "string"
  86439. // },
  86440. // "project": {
  86441. // "description": "Project ID for this request.",
  86442. // "location": "path",
  86443. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86444. // "required": true,
  86445. // "type": "string"
  86446. // },
  86447. // "region": {
  86448. // "description": "The name of the region for this request.",
  86449. // "location": "path",
  86450. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86451. // "required": true,
  86452. // "type": "string"
  86453. // }
  86454. // },
  86455. // "path": "{project}/regions/{region}/diskTypes",
  86456. // "response": {
  86457. // "$ref": "RegionDiskTypeList"
  86458. // },
  86459. // "scopes": [
  86460. // "https://www.googleapis.com/auth/cloud-platform",
  86461. // "https://www.googleapis.com/auth/compute",
  86462. // "https://www.googleapis.com/auth/compute.readonly"
  86463. // ]
  86464. // }
  86465. }
  86466. // Pages invokes f for each page of results.
  86467. // A non-nil error returned from f will halt the iteration.
  86468. // The provided context supersedes any context provided to the Context method.
  86469. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  86470. c.ctx_ = ctx
  86471. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86472. for {
  86473. x, err := c.Do()
  86474. if err != nil {
  86475. return err
  86476. }
  86477. if err := f(x); err != nil {
  86478. return err
  86479. }
  86480. if x.NextPageToken == "" {
  86481. return nil
  86482. }
  86483. c.PageToken(x.NextPageToken)
  86484. }
  86485. }
  86486. // method id "compute.regionDisks.addResourcePolicies":
  86487. type RegionDisksAddResourcePoliciesCall struct {
  86488. s *Service
  86489. project string
  86490. region string
  86491. disk string
  86492. regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest
  86493. urlParams_ gensupport.URLParams
  86494. ctx_ context.Context
  86495. header_ http.Header
  86496. }
  86497. // AddResourcePolicies: Adds existing resource policies to a regional
  86498. // disk. You can only add one policy which will be applied to this disk
  86499. // for scheduling snapshot creation.
  86500. func (r *RegionDisksService) AddResourcePolicies(project string, region string, disk string, regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest) *RegionDisksAddResourcePoliciesCall {
  86501. c := &RegionDisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86502. c.project = project
  86503. c.region = region
  86504. c.disk = disk
  86505. c.regiondisksaddresourcepoliciesrequest = regiondisksaddresourcepoliciesrequest
  86506. return c
  86507. }
  86508. // RequestId sets the optional parameter "requestId": An optional
  86509. // request ID to identify requests. Specify a unique request ID so that
  86510. // if you must retry your request, the server will know to ignore the
  86511. // request if it has already been completed.
  86512. //
  86513. // For example, consider a situation where you make an initial request
  86514. // and the request times out. If you make the request again with the
  86515. // same request ID, the server can check if original operation with the
  86516. // same request ID was received, and if so, will ignore the second
  86517. // request. This prevents clients from accidentally creating duplicate
  86518. // commitments.
  86519. //
  86520. // The request ID must be a valid UUID with the exception that zero UUID
  86521. // is not supported (00000000-0000-0000-0000-000000000000).
  86522. func (c *RegionDisksAddResourcePoliciesCall) RequestId(requestId string) *RegionDisksAddResourcePoliciesCall {
  86523. c.urlParams_.Set("requestId", requestId)
  86524. return c
  86525. }
  86526. // Fields allows partial responses to be retrieved. See
  86527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86528. // for more information.
  86529. func (c *RegionDisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksAddResourcePoliciesCall {
  86530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86531. return c
  86532. }
  86533. // Context sets the context to be used in this call's Do method. Any
  86534. // pending HTTP request will be aborted if the provided context is
  86535. // canceled.
  86536. func (c *RegionDisksAddResourcePoliciesCall) Context(ctx context.Context) *RegionDisksAddResourcePoliciesCall {
  86537. c.ctx_ = ctx
  86538. return c
  86539. }
  86540. // Header returns an http.Header that can be modified by the caller to
  86541. // add HTTP headers to the request.
  86542. func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header {
  86543. if c.header_ == nil {
  86544. c.header_ = make(http.Header)
  86545. }
  86546. return c.header_
  86547. }
  86548. func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  86549. reqHeaders := make(http.Header)
  86550. for k, v := range c.header_ {
  86551. reqHeaders[k] = v
  86552. }
  86553. reqHeaders.Set("User-Agent", c.s.userAgent())
  86554. var body io.Reader = nil
  86555. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest)
  86556. if err != nil {
  86557. return nil, err
  86558. }
  86559. reqHeaders.Set("Content-Type", "application/json")
  86560. c.urlParams_.Set("alt", alt)
  86561. c.urlParams_.Set("prettyPrint", "false")
  86562. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/addResourcePolicies")
  86563. urls += "?" + c.urlParams_.Encode()
  86564. req, err := http.NewRequest("POST", urls, body)
  86565. if err != nil {
  86566. return nil, err
  86567. }
  86568. req.Header = reqHeaders
  86569. googleapi.Expand(req.URL, map[string]string{
  86570. "project": c.project,
  86571. "region": c.region,
  86572. "disk": c.disk,
  86573. })
  86574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86575. }
  86576. // Do executes the "compute.regionDisks.addResourcePolicies" call.
  86577. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86578. // status code is an error. Response headers are in either
  86579. // *Operation.ServerResponse.Header or (if a response was returned at
  86580. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86581. // to check whether the returned error was because
  86582. // http.StatusNotModified was returned.
  86583. func (c *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86584. gensupport.SetOptions(c.urlParams_, opts...)
  86585. res, err := c.doRequest("json")
  86586. if res != nil && res.StatusCode == http.StatusNotModified {
  86587. if res.Body != nil {
  86588. res.Body.Close()
  86589. }
  86590. return nil, &googleapi.Error{
  86591. Code: res.StatusCode,
  86592. Header: res.Header,
  86593. }
  86594. }
  86595. if err != nil {
  86596. return nil, err
  86597. }
  86598. defer googleapi.CloseBody(res)
  86599. if err := googleapi.CheckResponse(res); err != nil {
  86600. return nil, err
  86601. }
  86602. ret := &Operation{
  86603. ServerResponse: googleapi.ServerResponse{
  86604. Header: res.Header,
  86605. HTTPStatusCode: res.StatusCode,
  86606. },
  86607. }
  86608. target := &ret
  86609. if err := gensupport.DecodeResponse(target, res); err != nil {
  86610. return nil, err
  86611. }
  86612. return ret, nil
  86613. // {
  86614. // "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.",
  86615. // "httpMethod": "POST",
  86616. // "id": "compute.regionDisks.addResourcePolicies",
  86617. // "parameterOrder": [
  86618. // "project",
  86619. // "region",
  86620. // "disk"
  86621. // ],
  86622. // "parameters": {
  86623. // "disk": {
  86624. // "description": "The disk name for this request.",
  86625. // "location": "path",
  86626. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86627. // "required": true,
  86628. // "type": "string"
  86629. // },
  86630. // "project": {
  86631. // "description": "Project ID for this request.",
  86632. // "location": "path",
  86633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86634. // "required": true,
  86635. // "type": "string"
  86636. // },
  86637. // "region": {
  86638. // "description": "The name of the region for this request.",
  86639. // "location": "path",
  86640. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86641. // "required": true,
  86642. // "type": "string"
  86643. // },
  86644. // "requestId": {
  86645. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86646. // "location": "query",
  86647. // "type": "string"
  86648. // }
  86649. // },
  86650. // "path": "{project}/regions/{region}/disks/{disk}/addResourcePolicies",
  86651. // "request": {
  86652. // "$ref": "RegionDisksAddResourcePoliciesRequest"
  86653. // },
  86654. // "response": {
  86655. // "$ref": "Operation"
  86656. // },
  86657. // "scopes": [
  86658. // "https://www.googleapis.com/auth/cloud-platform",
  86659. // "https://www.googleapis.com/auth/compute"
  86660. // ]
  86661. // }
  86662. }
  86663. // method id "compute.regionDisks.createSnapshot":
  86664. type RegionDisksCreateSnapshotCall struct {
  86665. s *Service
  86666. project string
  86667. region string
  86668. disk string
  86669. snapshot *Snapshot
  86670. urlParams_ gensupport.URLParams
  86671. ctx_ context.Context
  86672. header_ http.Header
  86673. }
  86674. // CreateSnapshot: Creates a snapshot of this regional disk.
  86675. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  86676. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86677. c.project = project
  86678. c.region = region
  86679. c.disk = disk
  86680. c.snapshot = snapshot
  86681. return c
  86682. }
  86683. // RequestId sets the optional parameter "requestId": An optional
  86684. // request ID to identify requests. Specify a unique request ID so that
  86685. // if you must retry your request, the server will know to ignore the
  86686. // request if it has already been completed.
  86687. //
  86688. // For example, consider a situation where you make an initial request
  86689. // and the request times out. If you make the request again with the
  86690. // same request ID, the server can check if original operation with the
  86691. // same request ID was received, and if so, will ignore the second
  86692. // request. This prevents clients from accidentally creating duplicate
  86693. // commitments.
  86694. //
  86695. // The request ID must be a valid UUID with the exception that zero UUID
  86696. // is not supported (00000000-0000-0000-0000-000000000000).
  86697. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  86698. c.urlParams_.Set("requestId", requestId)
  86699. return c
  86700. }
  86701. // Fields allows partial responses to be retrieved. See
  86702. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86703. // for more information.
  86704. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  86705. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86706. return c
  86707. }
  86708. // Context sets the context to be used in this call's Do method. Any
  86709. // pending HTTP request will be aborted if the provided context is
  86710. // canceled.
  86711. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  86712. c.ctx_ = ctx
  86713. return c
  86714. }
  86715. // Header returns an http.Header that can be modified by the caller to
  86716. // add HTTP headers to the request.
  86717. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  86718. if c.header_ == nil {
  86719. c.header_ = make(http.Header)
  86720. }
  86721. return c.header_
  86722. }
  86723. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  86724. reqHeaders := make(http.Header)
  86725. for k, v := range c.header_ {
  86726. reqHeaders[k] = v
  86727. }
  86728. reqHeaders.Set("User-Agent", c.s.userAgent())
  86729. var body io.Reader = nil
  86730. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  86731. if err != nil {
  86732. return nil, err
  86733. }
  86734. reqHeaders.Set("Content-Type", "application/json")
  86735. c.urlParams_.Set("alt", alt)
  86736. c.urlParams_.Set("prettyPrint", "false")
  86737. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  86738. urls += "?" + c.urlParams_.Encode()
  86739. req, err := http.NewRequest("POST", urls, body)
  86740. if err != nil {
  86741. return nil, err
  86742. }
  86743. req.Header = reqHeaders
  86744. googleapi.Expand(req.URL, map[string]string{
  86745. "project": c.project,
  86746. "region": c.region,
  86747. "disk": c.disk,
  86748. })
  86749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86750. }
  86751. // Do executes the "compute.regionDisks.createSnapshot" call.
  86752. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86753. // status code is an error. Response headers are in either
  86754. // *Operation.ServerResponse.Header or (if a response was returned at
  86755. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86756. // to check whether the returned error was because
  86757. // http.StatusNotModified was returned.
  86758. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86759. gensupport.SetOptions(c.urlParams_, opts...)
  86760. res, err := c.doRequest("json")
  86761. if res != nil && res.StatusCode == http.StatusNotModified {
  86762. if res.Body != nil {
  86763. res.Body.Close()
  86764. }
  86765. return nil, &googleapi.Error{
  86766. Code: res.StatusCode,
  86767. Header: res.Header,
  86768. }
  86769. }
  86770. if err != nil {
  86771. return nil, err
  86772. }
  86773. defer googleapi.CloseBody(res)
  86774. if err := googleapi.CheckResponse(res); err != nil {
  86775. return nil, err
  86776. }
  86777. ret := &Operation{
  86778. ServerResponse: googleapi.ServerResponse{
  86779. Header: res.Header,
  86780. HTTPStatusCode: res.StatusCode,
  86781. },
  86782. }
  86783. target := &ret
  86784. if err := gensupport.DecodeResponse(target, res); err != nil {
  86785. return nil, err
  86786. }
  86787. return ret, nil
  86788. // {
  86789. // "description": "Creates a snapshot of this regional disk.",
  86790. // "httpMethod": "POST",
  86791. // "id": "compute.regionDisks.createSnapshot",
  86792. // "parameterOrder": [
  86793. // "project",
  86794. // "region",
  86795. // "disk"
  86796. // ],
  86797. // "parameters": {
  86798. // "disk": {
  86799. // "description": "Name of the regional persistent disk to snapshot.",
  86800. // "location": "path",
  86801. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86802. // "required": true,
  86803. // "type": "string"
  86804. // },
  86805. // "project": {
  86806. // "description": "Project ID for this request.",
  86807. // "location": "path",
  86808. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86809. // "required": true,
  86810. // "type": "string"
  86811. // },
  86812. // "region": {
  86813. // "description": "Name of the region for this request.",
  86814. // "location": "path",
  86815. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86816. // "required": true,
  86817. // "type": "string"
  86818. // },
  86819. // "requestId": {
  86820. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86821. // "location": "query",
  86822. // "type": "string"
  86823. // }
  86824. // },
  86825. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  86826. // "request": {
  86827. // "$ref": "Snapshot"
  86828. // },
  86829. // "response": {
  86830. // "$ref": "Operation"
  86831. // },
  86832. // "scopes": [
  86833. // "https://www.googleapis.com/auth/cloud-platform",
  86834. // "https://www.googleapis.com/auth/compute"
  86835. // ]
  86836. // }
  86837. }
  86838. // method id "compute.regionDisks.delete":
  86839. type RegionDisksDeleteCall struct {
  86840. s *Service
  86841. project string
  86842. region string
  86843. disk string
  86844. urlParams_ gensupport.URLParams
  86845. ctx_ context.Context
  86846. header_ http.Header
  86847. }
  86848. // Delete: Deletes the specified regional persistent disk. Deleting a
  86849. // regional disk removes all the replicas of its data permanently and is
  86850. // irreversible. However, deleting a disk does not delete any snapshots
  86851. // previously made from the disk. You must separately delete snapshots.
  86852. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  86853. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86854. c.project = project
  86855. c.region = region
  86856. c.disk = disk
  86857. return c
  86858. }
  86859. // RequestId sets the optional parameter "requestId": An optional
  86860. // request ID to identify requests. Specify a unique request ID so that
  86861. // if you must retry your request, the server will know to ignore the
  86862. // request if it has already been completed.
  86863. //
  86864. // For example, consider a situation where you make an initial request
  86865. // and the request times out. If you make the request again with the
  86866. // same request ID, the server can check if original operation with the
  86867. // same request ID was received, and if so, will ignore the second
  86868. // request. This prevents clients from accidentally creating duplicate
  86869. // commitments.
  86870. //
  86871. // The request ID must be a valid UUID with the exception that zero UUID
  86872. // is not supported (00000000-0000-0000-0000-000000000000).
  86873. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  86874. c.urlParams_.Set("requestId", requestId)
  86875. return c
  86876. }
  86877. // Fields allows partial responses to be retrieved. See
  86878. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86879. // for more information.
  86880. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  86881. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86882. return c
  86883. }
  86884. // Context sets the context to be used in this call's Do method. Any
  86885. // pending HTTP request will be aborted if the provided context is
  86886. // canceled.
  86887. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  86888. c.ctx_ = ctx
  86889. return c
  86890. }
  86891. // Header returns an http.Header that can be modified by the caller to
  86892. // add HTTP headers to the request.
  86893. func (c *RegionDisksDeleteCall) Header() http.Header {
  86894. if c.header_ == nil {
  86895. c.header_ = make(http.Header)
  86896. }
  86897. return c.header_
  86898. }
  86899. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  86900. reqHeaders := make(http.Header)
  86901. for k, v := range c.header_ {
  86902. reqHeaders[k] = v
  86903. }
  86904. reqHeaders.Set("User-Agent", c.s.userAgent())
  86905. var body io.Reader = nil
  86906. c.urlParams_.Set("alt", alt)
  86907. c.urlParams_.Set("prettyPrint", "false")
  86908. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  86909. urls += "?" + c.urlParams_.Encode()
  86910. req, err := http.NewRequest("DELETE", urls, body)
  86911. if err != nil {
  86912. return nil, err
  86913. }
  86914. req.Header = reqHeaders
  86915. googleapi.Expand(req.URL, map[string]string{
  86916. "project": c.project,
  86917. "region": c.region,
  86918. "disk": c.disk,
  86919. })
  86920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86921. }
  86922. // Do executes the "compute.regionDisks.delete" call.
  86923. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86924. // status code is an error. Response headers are in either
  86925. // *Operation.ServerResponse.Header or (if a response was returned at
  86926. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86927. // to check whether the returned error was because
  86928. // http.StatusNotModified was returned.
  86929. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86930. gensupport.SetOptions(c.urlParams_, opts...)
  86931. res, err := c.doRequest("json")
  86932. if res != nil && res.StatusCode == http.StatusNotModified {
  86933. if res.Body != nil {
  86934. res.Body.Close()
  86935. }
  86936. return nil, &googleapi.Error{
  86937. Code: res.StatusCode,
  86938. Header: res.Header,
  86939. }
  86940. }
  86941. if err != nil {
  86942. return nil, err
  86943. }
  86944. defer googleapi.CloseBody(res)
  86945. if err := googleapi.CheckResponse(res); err != nil {
  86946. return nil, err
  86947. }
  86948. ret := &Operation{
  86949. ServerResponse: googleapi.ServerResponse{
  86950. Header: res.Header,
  86951. HTTPStatusCode: res.StatusCode,
  86952. },
  86953. }
  86954. target := &ret
  86955. if err := gensupport.DecodeResponse(target, res); err != nil {
  86956. return nil, err
  86957. }
  86958. return ret, nil
  86959. // {
  86960. // "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.",
  86961. // "httpMethod": "DELETE",
  86962. // "id": "compute.regionDisks.delete",
  86963. // "parameterOrder": [
  86964. // "project",
  86965. // "region",
  86966. // "disk"
  86967. // ],
  86968. // "parameters": {
  86969. // "disk": {
  86970. // "description": "Name of the regional persistent disk to delete.",
  86971. // "location": "path",
  86972. // "required": true,
  86973. // "type": "string"
  86974. // },
  86975. // "project": {
  86976. // "description": "Project ID for this request.",
  86977. // "location": "path",
  86978. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86979. // "required": true,
  86980. // "type": "string"
  86981. // },
  86982. // "region": {
  86983. // "description": "Name of the region for this request.",
  86984. // "location": "path",
  86985. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86986. // "required": true,
  86987. // "type": "string"
  86988. // },
  86989. // "requestId": {
  86990. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86991. // "location": "query",
  86992. // "type": "string"
  86993. // }
  86994. // },
  86995. // "path": "{project}/regions/{region}/disks/{disk}",
  86996. // "response": {
  86997. // "$ref": "Operation"
  86998. // },
  86999. // "scopes": [
  87000. // "https://www.googleapis.com/auth/cloud-platform",
  87001. // "https://www.googleapis.com/auth/compute"
  87002. // ]
  87003. // }
  87004. }
  87005. // method id "compute.regionDisks.get":
  87006. type RegionDisksGetCall struct {
  87007. s *Service
  87008. project string
  87009. region string
  87010. disk string
  87011. urlParams_ gensupport.URLParams
  87012. ifNoneMatch_ string
  87013. ctx_ context.Context
  87014. header_ http.Header
  87015. }
  87016. // Get: Returns a specified regional persistent disk.
  87017. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  87018. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87019. c.project = project
  87020. c.region = region
  87021. c.disk = disk
  87022. return c
  87023. }
  87024. // Fields allows partial responses to be retrieved. See
  87025. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87026. // for more information.
  87027. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  87028. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87029. return c
  87030. }
  87031. // IfNoneMatch sets the optional parameter which makes the operation
  87032. // fail if the object's ETag matches the given value. This is useful for
  87033. // getting updates only after the object has changed since the last
  87034. // request. Use googleapi.IsNotModified to check whether the response
  87035. // error from Do is the result of In-None-Match.
  87036. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  87037. c.ifNoneMatch_ = entityTag
  87038. return c
  87039. }
  87040. // Context sets the context to be used in this call's Do method. Any
  87041. // pending HTTP request will be aborted if the provided context is
  87042. // canceled.
  87043. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  87044. c.ctx_ = ctx
  87045. return c
  87046. }
  87047. // Header returns an http.Header that can be modified by the caller to
  87048. // add HTTP headers to the request.
  87049. func (c *RegionDisksGetCall) Header() http.Header {
  87050. if c.header_ == nil {
  87051. c.header_ = make(http.Header)
  87052. }
  87053. return c.header_
  87054. }
  87055. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  87056. reqHeaders := make(http.Header)
  87057. for k, v := range c.header_ {
  87058. reqHeaders[k] = v
  87059. }
  87060. reqHeaders.Set("User-Agent", c.s.userAgent())
  87061. if c.ifNoneMatch_ != "" {
  87062. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87063. }
  87064. var body io.Reader = nil
  87065. c.urlParams_.Set("alt", alt)
  87066. c.urlParams_.Set("prettyPrint", "false")
  87067. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  87068. urls += "?" + c.urlParams_.Encode()
  87069. req, err := http.NewRequest("GET", urls, body)
  87070. if err != nil {
  87071. return nil, err
  87072. }
  87073. req.Header = reqHeaders
  87074. googleapi.Expand(req.URL, map[string]string{
  87075. "project": c.project,
  87076. "region": c.region,
  87077. "disk": c.disk,
  87078. })
  87079. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87080. }
  87081. // Do executes the "compute.regionDisks.get" call.
  87082. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  87083. // code is an error. Response headers are in either
  87084. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  87085. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  87086. // whether the returned error was because http.StatusNotModified was
  87087. // returned.
  87088. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  87089. gensupport.SetOptions(c.urlParams_, opts...)
  87090. res, err := c.doRequest("json")
  87091. if res != nil && res.StatusCode == http.StatusNotModified {
  87092. if res.Body != nil {
  87093. res.Body.Close()
  87094. }
  87095. return nil, &googleapi.Error{
  87096. Code: res.StatusCode,
  87097. Header: res.Header,
  87098. }
  87099. }
  87100. if err != nil {
  87101. return nil, err
  87102. }
  87103. defer googleapi.CloseBody(res)
  87104. if err := googleapi.CheckResponse(res); err != nil {
  87105. return nil, err
  87106. }
  87107. ret := &Disk{
  87108. ServerResponse: googleapi.ServerResponse{
  87109. Header: res.Header,
  87110. HTTPStatusCode: res.StatusCode,
  87111. },
  87112. }
  87113. target := &ret
  87114. if err := gensupport.DecodeResponse(target, res); err != nil {
  87115. return nil, err
  87116. }
  87117. return ret, nil
  87118. // {
  87119. // "description": "Returns a specified regional persistent disk.",
  87120. // "httpMethod": "GET",
  87121. // "id": "compute.regionDisks.get",
  87122. // "parameterOrder": [
  87123. // "project",
  87124. // "region",
  87125. // "disk"
  87126. // ],
  87127. // "parameters": {
  87128. // "disk": {
  87129. // "description": "Name of the regional persistent disk to return.",
  87130. // "location": "path",
  87131. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87132. // "required": true,
  87133. // "type": "string"
  87134. // },
  87135. // "project": {
  87136. // "description": "Project ID for this request.",
  87137. // "location": "path",
  87138. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87139. // "required": true,
  87140. // "type": "string"
  87141. // },
  87142. // "region": {
  87143. // "description": "Name of the region for this request.",
  87144. // "location": "path",
  87145. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87146. // "required": true,
  87147. // "type": "string"
  87148. // }
  87149. // },
  87150. // "path": "{project}/regions/{region}/disks/{disk}",
  87151. // "response": {
  87152. // "$ref": "Disk"
  87153. // },
  87154. // "scopes": [
  87155. // "https://www.googleapis.com/auth/cloud-platform",
  87156. // "https://www.googleapis.com/auth/compute",
  87157. // "https://www.googleapis.com/auth/compute.readonly"
  87158. // ]
  87159. // }
  87160. }
  87161. // method id "compute.regionDisks.getIamPolicy":
  87162. type RegionDisksGetIamPolicyCall struct {
  87163. s *Service
  87164. project string
  87165. region string
  87166. resource string
  87167. urlParams_ gensupport.URLParams
  87168. ifNoneMatch_ string
  87169. ctx_ context.Context
  87170. header_ http.Header
  87171. }
  87172. // GetIamPolicy: Gets the access control policy for a resource. May be
  87173. // empty if no such policy or resource exists.
  87174. func (r *RegionDisksService) GetIamPolicy(project string, region string, resource string) *RegionDisksGetIamPolicyCall {
  87175. c := &RegionDisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87176. c.project = project
  87177. c.region = region
  87178. c.resource = resource
  87179. return c
  87180. }
  87181. // Fields allows partial responses to be retrieved. See
  87182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87183. // for more information.
  87184. func (c *RegionDisksGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksGetIamPolicyCall {
  87185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87186. return c
  87187. }
  87188. // IfNoneMatch sets the optional parameter which makes the operation
  87189. // fail if the object's ETag matches the given value. This is useful for
  87190. // getting updates only after the object has changed since the last
  87191. // request. Use googleapi.IsNotModified to check whether the response
  87192. // error from Do is the result of In-None-Match.
  87193. func (c *RegionDisksGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionDisksGetIamPolicyCall {
  87194. c.ifNoneMatch_ = entityTag
  87195. return c
  87196. }
  87197. // Context sets the context to be used in this call's Do method. Any
  87198. // pending HTTP request will be aborted if the provided context is
  87199. // canceled.
  87200. func (c *RegionDisksGetIamPolicyCall) Context(ctx context.Context) *RegionDisksGetIamPolicyCall {
  87201. c.ctx_ = ctx
  87202. return c
  87203. }
  87204. // Header returns an http.Header that can be modified by the caller to
  87205. // add HTTP headers to the request.
  87206. func (c *RegionDisksGetIamPolicyCall) Header() http.Header {
  87207. if c.header_ == nil {
  87208. c.header_ = make(http.Header)
  87209. }
  87210. return c.header_
  87211. }
  87212. func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  87213. reqHeaders := make(http.Header)
  87214. for k, v := range c.header_ {
  87215. reqHeaders[k] = v
  87216. }
  87217. reqHeaders.Set("User-Agent", c.s.userAgent())
  87218. if c.ifNoneMatch_ != "" {
  87219. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87220. }
  87221. var body io.Reader = nil
  87222. c.urlParams_.Set("alt", alt)
  87223. c.urlParams_.Set("prettyPrint", "false")
  87224. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/getIamPolicy")
  87225. urls += "?" + c.urlParams_.Encode()
  87226. req, err := http.NewRequest("GET", urls, body)
  87227. if err != nil {
  87228. return nil, err
  87229. }
  87230. req.Header = reqHeaders
  87231. googleapi.Expand(req.URL, map[string]string{
  87232. "project": c.project,
  87233. "region": c.region,
  87234. "resource": c.resource,
  87235. })
  87236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87237. }
  87238. // Do executes the "compute.regionDisks.getIamPolicy" call.
  87239. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  87240. // code is an error. Response headers are in either
  87241. // *Policy.ServerResponse.Header or (if a response was returned at all)
  87242. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  87243. // check whether the returned error was because http.StatusNotModified
  87244. // was returned.
  87245. func (c *RegionDisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  87246. gensupport.SetOptions(c.urlParams_, opts...)
  87247. res, err := c.doRequest("json")
  87248. if res != nil && res.StatusCode == http.StatusNotModified {
  87249. if res.Body != nil {
  87250. res.Body.Close()
  87251. }
  87252. return nil, &googleapi.Error{
  87253. Code: res.StatusCode,
  87254. Header: res.Header,
  87255. }
  87256. }
  87257. if err != nil {
  87258. return nil, err
  87259. }
  87260. defer googleapi.CloseBody(res)
  87261. if err := googleapi.CheckResponse(res); err != nil {
  87262. return nil, err
  87263. }
  87264. ret := &Policy{
  87265. ServerResponse: googleapi.ServerResponse{
  87266. Header: res.Header,
  87267. HTTPStatusCode: res.StatusCode,
  87268. },
  87269. }
  87270. target := &ret
  87271. if err := gensupport.DecodeResponse(target, res); err != nil {
  87272. return nil, err
  87273. }
  87274. return ret, nil
  87275. // {
  87276. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  87277. // "httpMethod": "GET",
  87278. // "id": "compute.regionDisks.getIamPolicy",
  87279. // "parameterOrder": [
  87280. // "project",
  87281. // "region",
  87282. // "resource"
  87283. // ],
  87284. // "parameters": {
  87285. // "project": {
  87286. // "description": "Project ID for this request.",
  87287. // "location": "path",
  87288. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87289. // "required": true,
  87290. // "type": "string"
  87291. // },
  87292. // "region": {
  87293. // "description": "The name of the region for this request.",
  87294. // "location": "path",
  87295. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87296. // "required": true,
  87297. // "type": "string"
  87298. // },
  87299. // "resource": {
  87300. // "description": "Name or id of the resource 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. // },
  87307. // "path": "{project}/regions/{region}/disks/{resource}/getIamPolicy",
  87308. // "response": {
  87309. // "$ref": "Policy"
  87310. // },
  87311. // "scopes": [
  87312. // "https://www.googleapis.com/auth/cloud-platform",
  87313. // "https://www.googleapis.com/auth/compute",
  87314. // "https://www.googleapis.com/auth/compute.readonly"
  87315. // ]
  87316. // }
  87317. }
  87318. // method id "compute.regionDisks.insert":
  87319. type RegionDisksInsertCall struct {
  87320. s *Service
  87321. project string
  87322. region string
  87323. disk *Disk
  87324. urlParams_ gensupport.URLParams
  87325. ctx_ context.Context
  87326. header_ http.Header
  87327. }
  87328. // Insert: Creates a persistent regional disk in the specified project
  87329. // using the data included in the request.
  87330. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  87331. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87332. c.project = project
  87333. c.region = region
  87334. c.disk = disk
  87335. return c
  87336. }
  87337. // RequestId sets the optional parameter "requestId": An optional
  87338. // request ID to identify requests. Specify a unique request ID so that
  87339. // if you must retry your request, the server will know to ignore the
  87340. // request if it has already been completed.
  87341. //
  87342. // For example, consider a situation where you make an initial request
  87343. // and the request times out. If you make the request again with the
  87344. // same request ID, the server can check if original operation with the
  87345. // same request ID was received, and if so, will ignore the second
  87346. // request. This prevents clients from accidentally creating duplicate
  87347. // commitments.
  87348. //
  87349. // The request ID must be a valid UUID with the exception that zero UUID
  87350. // is not supported (00000000-0000-0000-0000-000000000000).
  87351. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  87352. c.urlParams_.Set("requestId", requestId)
  87353. return c
  87354. }
  87355. // SourceImage sets the optional parameter "sourceImage": Source image
  87356. // to restore onto a disk.
  87357. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  87358. c.urlParams_.Set("sourceImage", sourceImage)
  87359. return c
  87360. }
  87361. // Fields allows partial responses to be retrieved. See
  87362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87363. // for more information.
  87364. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  87365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87366. return c
  87367. }
  87368. // Context sets the context to be used in this call's Do method. Any
  87369. // pending HTTP request will be aborted if the provided context is
  87370. // canceled.
  87371. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  87372. c.ctx_ = ctx
  87373. return c
  87374. }
  87375. // Header returns an http.Header that can be modified by the caller to
  87376. // add HTTP headers to the request.
  87377. func (c *RegionDisksInsertCall) Header() http.Header {
  87378. if c.header_ == nil {
  87379. c.header_ = make(http.Header)
  87380. }
  87381. return c.header_
  87382. }
  87383. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  87384. reqHeaders := make(http.Header)
  87385. for k, v := range c.header_ {
  87386. reqHeaders[k] = v
  87387. }
  87388. reqHeaders.Set("User-Agent", c.s.userAgent())
  87389. var body io.Reader = nil
  87390. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  87391. if err != nil {
  87392. return nil, err
  87393. }
  87394. reqHeaders.Set("Content-Type", "application/json")
  87395. c.urlParams_.Set("alt", alt)
  87396. c.urlParams_.Set("prettyPrint", "false")
  87397. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  87398. urls += "?" + c.urlParams_.Encode()
  87399. req, err := http.NewRequest("POST", urls, body)
  87400. if err != nil {
  87401. return nil, err
  87402. }
  87403. req.Header = reqHeaders
  87404. googleapi.Expand(req.URL, map[string]string{
  87405. "project": c.project,
  87406. "region": c.region,
  87407. })
  87408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87409. }
  87410. // Do executes the "compute.regionDisks.insert" call.
  87411. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87412. // status code is an error. Response headers are in either
  87413. // *Operation.ServerResponse.Header or (if a response was returned at
  87414. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87415. // to check whether the returned error was because
  87416. // http.StatusNotModified was returned.
  87417. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87418. gensupport.SetOptions(c.urlParams_, opts...)
  87419. res, err := c.doRequest("json")
  87420. if res != nil && res.StatusCode == http.StatusNotModified {
  87421. if res.Body != nil {
  87422. res.Body.Close()
  87423. }
  87424. return nil, &googleapi.Error{
  87425. Code: res.StatusCode,
  87426. Header: res.Header,
  87427. }
  87428. }
  87429. if err != nil {
  87430. return nil, err
  87431. }
  87432. defer googleapi.CloseBody(res)
  87433. if err := googleapi.CheckResponse(res); err != nil {
  87434. return nil, err
  87435. }
  87436. ret := &Operation{
  87437. ServerResponse: googleapi.ServerResponse{
  87438. Header: res.Header,
  87439. HTTPStatusCode: res.StatusCode,
  87440. },
  87441. }
  87442. target := &ret
  87443. if err := gensupport.DecodeResponse(target, res); err != nil {
  87444. return nil, err
  87445. }
  87446. return ret, nil
  87447. // {
  87448. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  87449. // "httpMethod": "POST",
  87450. // "id": "compute.regionDisks.insert",
  87451. // "parameterOrder": [
  87452. // "project",
  87453. // "region"
  87454. // ],
  87455. // "parameters": {
  87456. // "project": {
  87457. // "description": "Project ID for this request.",
  87458. // "location": "path",
  87459. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87460. // "required": true,
  87461. // "type": "string"
  87462. // },
  87463. // "region": {
  87464. // "description": "Name of the region for this request.",
  87465. // "location": "path",
  87466. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87467. // "required": true,
  87468. // "type": "string"
  87469. // },
  87470. // "requestId": {
  87471. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87472. // "location": "query",
  87473. // "type": "string"
  87474. // },
  87475. // "sourceImage": {
  87476. // "description": "Optional. Source image to restore onto a disk.",
  87477. // "location": "query",
  87478. // "type": "string"
  87479. // }
  87480. // },
  87481. // "path": "{project}/regions/{region}/disks",
  87482. // "request": {
  87483. // "$ref": "Disk"
  87484. // },
  87485. // "response": {
  87486. // "$ref": "Operation"
  87487. // },
  87488. // "scopes": [
  87489. // "https://www.googleapis.com/auth/cloud-platform",
  87490. // "https://www.googleapis.com/auth/compute"
  87491. // ]
  87492. // }
  87493. }
  87494. // method id "compute.regionDisks.list":
  87495. type RegionDisksListCall struct {
  87496. s *Service
  87497. project string
  87498. region string
  87499. urlParams_ gensupport.URLParams
  87500. ifNoneMatch_ string
  87501. ctx_ context.Context
  87502. header_ http.Header
  87503. }
  87504. // List: Retrieves the list of persistent disks contained within the
  87505. // specified region.
  87506. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  87507. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87508. c.project = project
  87509. c.region = region
  87510. return c
  87511. }
  87512. // Filter sets the optional parameter "filter": A filter expression that
  87513. // filters resources listed in the response. The expression must specify
  87514. // the field name, a comparison operator, and the value that you want to
  87515. // use for filtering. The value must be a string, a number, or a
  87516. // boolean. The comparison operator must be either =, !=, >, or <.
  87517. //
  87518. // For example, if you are filtering Compute Engine instances, you can
  87519. // exclude instances named example-instance by specifying name !=
  87520. // example-instance.
  87521. //
  87522. // You can also filter nested fields. For example, you could specify
  87523. // scheduling.automaticRestart = false to include instances only if they
  87524. // are not scheduled for automatic restarts. You can use filtering on
  87525. // nested fields to filter based on resource labels.
  87526. //
  87527. // To filter on multiple expressions, provide each separate expression
  87528. // within parentheses. For example, (scheduling.automaticRestart = true)
  87529. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87530. // AND expression. However, you can include AND and OR expressions
  87531. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87532. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87533. // true).
  87534. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  87535. c.urlParams_.Set("filter", filter)
  87536. return c
  87537. }
  87538. // MaxResults sets the optional parameter "maxResults": The maximum
  87539. // number of results per page that should be returned. If the number of
  87540. // available results is larger than maxResults, Compute Engine returns a
  87541. // nextPageToken that can be used to get the next page of results in
  87542. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87543. // (Default: 500)
  87544. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  87545. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87546. return c
  87547. }
  87548. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87549. // a certain order. By default, results are returned in alphanumerical
  87550. // order based on the resource name.
  87551. //
  87552. // You can also sort results in descending order based on the creation
  87553. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87554. // based on the creationTimestamp field in reverse chronological order
  87555. // (newest result first). Use this to sort resources like operations so
  87556. // that the newest operation is returned first.
  87557. //
  87558. // Currently, only sorting by name or creationTimestamp desc is
  87559. // supported.
  87560. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  87561. c.urlParams_.Set("orderBy", orderBy)
  87562. return c
  87563. }
  87564. // PageToken sets the optional parameter "pageToken": Specifies a page
  87565. // token to use. Set pageToken to the nextPageToken returned by a
  87566. // previous list request to get the next page of results.
  87567. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  87568. c.urlParams_.Set("pageToken", pageToken)
  87569. return c
  87570. }
  87571. // Fields allows partial responses to be retrieved. See
  87572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87573. // for more information.
  87574. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  87575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87576. return c
  87577. }
  87578. // IfNoneMatch sets the optional parameter which makes the operation
  87579. // fail if the object's ETag matches the given value. This is useful for
  87580. // getting updates only after the object has changed since the last
  87581. // request. Use googleapi.IsNotModified to check whether the response
  87582. // error from Do is the result of In-None-Match.
  87583. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  87584. c.ifNoneMatch_ = entityTag
  87585. return c
  87586. }
  87587. // Context sets the context to be used in this call's Do method. Any
  87588. // pending HTTP request will be aborted if the provided context is
  87589. // canceled.
  87590. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  87591. c.ctx_ = ctx
  87592. return c
  87593. }
  87594. // Header returns an http.Header that can be modified by the caller to
  87595. // add HTTP headers to the request.
  87596. func (c *RegionDisksListCall) Header() http.Header {
  87597. if c.header_ == nil {
  87598. c.header_ = make(http.Header)
  87599. }
  87600. return c.header_
  87601. }
  87602. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  87603. reqHeaders := make(http.Header)
  87604. for k, v := range c.header_ {
  87605. reqHeaders[k] = v
  87606. }
  87607. reqHeaders.Set("User-Agent", c.s.userAgent())
  87608. if c.ifNoneMatch_ != "" {
  87609. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87610. }
  87611. var body io.Reader = nil
  87612. c.urlParams_.Set("alt", alt)
  87613. c.urlParams_.Set("prettyPrint", "false")
  87614. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  87615. urls += "?" + c.urlParams_.Encode()
  87616. req, err := http.NewRequest("GET", urls, body)
  87617. if err != nil {
  87618. return nil, err
  87619. }
  87620. req.Header = reqHeaders
  87621. googleapi.Expand(req.URL, map[string]string{
  87622. "project": c.project,
  87623. "region": c.region,
  87624. })
  87625. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87626. }
  87627. // Do executes the "compute.regionDisks.list" call.
  87628. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  87629. // code is an error. Response headers are in either
  87630. // *DiskList.ServerResponse.Header or (if a response was returned at
  87631. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87632. // to check whether the returned error was because
  87633. // http.StatusNotModified was returned.
  87634. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  87635. gensupport.SetOptions(c.urlParams_, opts...)
  87636. res, err := c.doRequest("json")
  87637. if res != nil && res.StatusCode == http.StatusNotModified {
  87638. if res.Body != nil {
  87639. res.Body.Close()
  87640. }
  87641. return nil, &googleapi.Error{
  87642. Code: res.StatusCode,
  87643. Header: res.Header,
  87644. }
  87645. }
  87646. if err != nil {
  87647. return nil, err
  87648. }
  87649. defer googleapi.CloseBody(res)
  87650. if err := googleapi.CheckResponse(res); err != nil {
  87651. return nil, err
  87652. }
  87653. ret := &DiskList{
  87654. ServerResponse: googleapi.ServerResponse{
  87655. Header: res.Header,
  87656. HTTPStatusCode: res.StatusCode,
  87657. },
  87658. }
  87659. target := &ret
  87660. if err := gensupport.DecodeResponse(target, res); err != nil {
  87661. return nil, err
  87662. }
  87663. return ret, nil
  87664. // {
  87665. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  87666. // "httpMethod": "GET",
  87667. // "id": "compute.regionDisks.list",
  87668. // "parameterOrder": [
  87669. // "project",
  87670. // "region"
  87671. // ],
  87672. // "parameters": {
  87673. // "filter": {
  87674. // "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).",
  87675. // "location": "query",
  87676. // "type": "string"
  87677. // },
  87678. // "maxResults": {
  87679. // "default": "500",
  87680. // "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)",
  87681. // "format": "uint32",
  87682. // "location": "query",
  87683. // "minimum": "0",
  87684. // "type": "integer"
  87685. // },
  87686. // "orderBy": {
  87687. // "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.",
  87688. // "location": "query",
  87689. // "type": "string"
  87690. // },
  87691. // "pageToken": {
  87692. // "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.",
  87693. // "location": "query",
  87694. // "type": "string"
  87695. // },
  87696. // "project": {
  87697. // "description": "Project ID for this request.",
  87698. // "location": "path",
  87699. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87700. // "required": true,
  87701. // "type": "string"
  87702. // },
  87703. // "region": {
  87704. // "description": "Name of the region for this request.",
  87705. // "location": "path",
  87706. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87707. // "required": true,
  87708. // "type": "string"
  87709. // }
  87710. // },
  87711. // "path": "{project}/regions/{region}/disks",
  87712. // "response": {
  87713. // "$ref": "DiskList"
  87714. // },
  87715. // "scopes": [
  87716. // "https://www.googleapis.com/auth/cloud-platform",
  87717. // "https://www.googleapis.com/auth/compute",
  87718. // "https://www.googleapis.com/auth/compute.readonly"
  87719. // ]
  87720. // }
  87721. }
  87722. // Pages invokes f for each page of results.
  87723. // A non-nil error returned from f will halt the iteration.
  87724. // The provided context supersedes any context provided to the Context method.
  87725. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  87726. c.ctx_ = ctx
  87727. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87728. for {
  87729. x, err := c.Do()
  87730. if err != nil {
  87731. return err
  87732. }
  87733. if err := f(x); err != nil {
  87734. return err
  87735. }
  87736. if x.NextPageToken == "" {
  87737. return nil
  87738. }
  87739. c.PageToken(x.NextPageToken)
  87740. }
  87741. }
  87742. // method id "compute.regionDisks.removeResourcePolicies":
  87743. type RegionDisksRemoveResourcePoliciesCall struct {
  87744. s *Service
  87745. project string
  87746. region string
  87747. disk string
  87748. regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest
  87749. urlParams_ gensupport.URLParams
  87750. ctx_ context.Context
  87751. header_ http.Header
  87752. }
  87753. // RemoveResourcePolicies: Removes resource policies from a regional
  87754. // disk.
  87755. func (r *RegionDisksService) RemoveResourcePolicies(project string, region string, disk string, regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest) *RegionDisksRemoveResourcePoliciesCall {
  87756. c := &RegionDisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87757. c.project = project
  87758. c.region = region
  87759. c.disk = disk
  87760. c.regiondisksremoveresourcepoliciesrequest = regiondisksremoveresourcepoliciesrequest
  87761. return c
  87762. }
  87763. // RequestId sets the optional parameter "requestId": An optional
  87764. // request ID to identify requests. Specify a unique request ID so that
  87765. // if you must retry your request, the server will know to ignore the
  87766. // request if it has already been completed.
  87767. //
  87768. // For example, consider a situation where you make an initial request
  87769. // and the request times out. If you make the request again with the
  87770. // same request ID, the server can check if original operation with the
  87771. // same request ID was received, and if so, will ignore the second
  87772. // request. This prevents clients from accidentally creating duplicate
  87773. // commitments.
  87774. //
  87775. // The request ID must be a valid UUID with the exception that zero UUID
  87776. // is not supported (00000000-0000-0000-0000-000000000000).
  87777. func (c *RegionDisksRemoveResourcePoliciesCall) RequestId(requestId string) *RegionDisksRemoveResourcePoliciesCall {
  87778. c.urlParams_.Set("requestId", requestId)
  87779. return c
  87780. }
  87781. // Fields allows partial responses to be retrieved. See
  87782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87783. // for more information.
  87784. func (c *RegionDisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksRemoveResourcePoliciesCall {
  87785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87786. return c
  87787. }
  87788. // Context sets the context to be used in this call's Do method. Any
  87789. // pending HTTP request will be aborted if the provided context is
  87790. // canceled.
  87791. func (c *RegionDisksRemoveResourcePoliciesCall) Context(ctx context.Context) *RegionDisksRemoveResourcePoliciesCall {
  87792. c.ctx_ = ctx
  87793. return c
  87794. }
  87795. // Header returns an http.Header that can be modified by the caller to
  87796. // add HTTP headers to the request.
  87797. func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header {
  87798. if c.header_ == nil {
  87799. c.header_ = make(http.Header)
  87800. }
  87801. return c.header_
  87802. }
  87803. func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  87804. reqHeaders := make(http.Header)
  87805. for k, v := range c.header_ {
  87806. reqHeaders[k] = v
  87807. }
  87808. reqHeaders.Set("User-Agent", c.s.userAgent())
  87809. var body io.Reader = nil
  87810. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest)
  87811. if err != nil {
  87812. return nil, err
  87813. }
  87814. reqHeaders.Set("Content-Type", "application/json")
  87815. c.urlParams_.Set("alt", alt)
  87816. c.urlParams_.Set("prettyPrint", "false")
  87817. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/removeResourcePolicies")
  87818. urls += "?" + c.urlParams_.Encode()
  87819. req, err := http.NewRequest("POST", urls, body)
  87820. if err != nil {
  87821. return nil, err
  87822. }
  87823. req.Header = reqHeaders
  87824. googleapi.Expand(req.URL, map[string]string{
  87825. "project": c.project,
  87826. "region": c.region,
  87827. "disk": c.disk,
  87828. })
  87829. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87830. }
  87831. // Do executes the "compute.regionDisks.removeResourcePolicies" call.
  87832. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87833. // status code is an error. Response headers are in either
  87834. // *Operation.ServerResponse.Header or (if a response was returned at
  87835. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87836. // to check whether the returned error was because
  87837. // http.StatusNotModified was returned.
  87838. func (c *RegionDisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87839. gensupport.SetOptions(c.urlParams_, opts...)
  87840. res, err := c.doRequest("json")
  87841. if res != nil && res.StatusCode == http.StatusNotModified {
  87842. if res.Body != nil {
  87843. res.Body.Close()
  87844. }
  87845. return nil, &googleapi.Error{
  87846. Code: res.StatusCode,
  87847. Header: res.Header,
  87848. }
  87849. }
  87850. if err != nil {
  87851. return nil, err
  87852. }
  87853. defer googleapi.CloseBody(res)
  87854. if err := googleapi.CheckResponse(res); err != nil {
  87855. return nil, err
  87856. }
  87857. ret := &Operation{
  87858. ServerResponse: googleapi.ServerResponse{
  87859. Header: res.Header,
  87860. HTTPStatusCode: res.StatusCode,
  87861. },
  87862. }
  87863. target := &ret
  87864. if err := gensupport.DecodeResponse(target, res); err != nil {
  87865. return nil, err
  87866. }
  87867. return ret, nil
  87868. // {
  87869. // "description": "Removes resource policies from a regional disk.",
  87870. // "httpMethod": "POST",
  87871. // "id": "compute.regionDisks.removeResourcePolicies",
  87872. // "parameterOrder": [
  87873. // "project",
  87874. // "region",
  87875. // "disk"
  87876. // ],
  87877. // "parameters": {
  87878. // "disk": {
  87879. // "description": "The disk name for this request.",
  87880. // "location": "path",
  87881. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87882. // "required": true,
  87883. // "type": "string"
  87884. // },
  87885. // "project": {
  87886. // "description": "Project ID for this request.",
  87887. // "location": "path",
  87888. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87889. // "required": true,
  87890. // "type": "string"
  87891. // },
  87892. // "region": {
  87893. // "description": "The name of the region 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. // "requestId": {
  87900. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87901. // "location": "query",
  87902. // "type": "string"
  87903. // }
  87904. // },
  87905. // "path": "{project}/regions/{region}/disks/{disk}/removeResourcePolicies",
  87906. // "request": {
  87907. // "$ref": "RegionDisksRemoveResourcePoliciesRequest"
  87908. // },
  87909. // "response": {
  87910. // "$ref": "Operation"
  87911. // },
  87912. // "scopes": [
  87913. // "https://www.googleapis.com/auth/cloud-platform",
  87914. // "https://www.googleapis.com/auth/compute"
  87915. // ]
  87916. // }
  87917. }
  87918. // method id "compute.regionDisks.resize":
  87919. type RegionDisksResizeCall struct {
  87920. s *Service
  87921. project string
  87922. region string
  87923. disk string
  87924. regiondisksresizerequest *RegionDisksResizeRequest
  87925. urlParams_ gensupport.URLParams
  87926. ctx_ context.Context
  87927. header_ http.Header
  87928. }
  87929. // Resize: Resizes the specified regional persistent disk.
  87930. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  87931. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87932. c.project = project
  87933. c.region = region
  87934. c.disk = disk
  87935. c.regiondisksresizerequest = regiondisksresizerequest
  87936. return c
  87937. }
  87938. // RequestId sets the optional parameter "requestId": An optional
  87939. // request ID to identify requests. Specify a unique request ID so that
  87940. // if you must retry your request, the server will know to ignore the
  87941. // request if it has already been completed.
  87942. //
  87943. // For example, consider a situation where you make an initial request
  87944. // and the request times out. If you make the request again with the
  87945. // same request ID, the server can check if original operation with the
  87946. // same request ID was received, and if so, will ignore the second
  87947. // request. This prevents clients from accidentally creating duplicate
  87948. // commitments.
  87949. //
  87950. // The request ID must be a valid UUID with the exception that zero UUID
  87951. // is not supported (00000000-0000-0000-0000-000000000000).
  87952. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  87953. c.urlParams_.Set("requestId", requestId)
  87954. return c
  87955. }
  87956. // Fields allows partial responses to be retrieved. See
  87957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87958. // for more information.
  87959. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  87960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87961. return c
  87962. }
  87963. // Context sets the context to be used in this call's Do method. Any
  87964. // pending HTTP request will be aborted if the provided context is
  87965. // canceled.
  87966. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  87967. c.ctx_ = ctx
  87968. return c
  87969. }
  87970. // Header returns an http.Header that can be modified by the caller to
  87971. // add HTTP headers to the request.
  87972. func (c *RegionDisksResizeCall) Header() http.Header {
  87973. if c.header_ == nil {
  87974. c.header_ = make(http.Header)
  87975. }
  87976. return c.header_
  87977. }
  87978. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  87979. reqHeaders := make(http.Header)
  87980. for k, v := range c.header_ {
  87981. reqHeaders[k] = v
  87982. }
  87983. reqHeaders.Set("User-Agent", c.s.userAgent())
  87984. var body io.Reader = nil
  87985. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  87986. if err != nil {
  87987. return nil, err
  87988. }
  87989. reqHeaders.Set("Content-Type", "application/json")
  87990. c.urlParams_.Set("alt", alt)
  87991. c.urlParams_.Set("prettyPrint", "false")
  87992. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  87993. urls += "?" + c.urlParams_.Encode()
  87994. req, err := http.NewRequest("POST", urls, body)
  87995. if err != nil {
  87996. return nil, err
  87997. }
  87998. req.Header = reqHeaders
  87999. googleapi.Expand(req.URL, map[string]string{
  88000. "project": c.project,
  88001. "region": c.region,
  88002. "disk": c.disk,
  88003. })
  88004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88005. }
  88006. // Do executes the "compute.regionDisks.resize" call.
  88007. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88008. // status code is an error. Response headers are in either
  88009. // *Operation.ServerResponse.Header or (if a response was returned at
  88010. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88011. // to check whether the returned error was because
  88012. // http.StatusNotModified was returned.
  88013. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88014. gensupport.SetOptions(c.urlParams_, opts...)
  88015. res, err := c.doRequest("json")
  88016. if res != nil && res.StatusCode == http.StatusNotModified {
  88017. if res.Body != nil {
  88018. res.Body.Close()
  88019. }
  88020. return nil, &googleapi.Error{
  88021. Code: res.StatusCode,
  88022. Header: res.Header,
  88023. }
  88024. }
  88025. if err != nil {
  88026. return nil, err
  88027. }
  88028. defer googleapi.CloseBody(res)
  88029. if err := googleapi.CheckResponse(res); err != nil {
  88030. return nil, err
  88031. }
  88032. ret := &Operation{
  88033. ServerResponse: googleapi.ServerResponse{
  88034. Header: res.Header,
  88035. HTTPStatusCode: res.StatusCode,
  88036. },
  88037. }
  88038. target := &ret
  88039. if err := gensupport.DecodeResponse(target, res); err != nil {
  88040. return nil, err
  88041. }
  88042. return ret, nil
  88043. // {
  88044. // "description": "Resizes the specified regional persistent disk.",
  88045. // "httpMethod": "POST",
  88046. // "id": "compute.regionDisks.resize",
  88047. // "parameterOrder": [
  88048. // "project",
  88049. // "region",
  88050. // "disk"
  88051. // ],
  88052. // "parameters": {
  88053. // "disk": {
  88054. // "description": "Name of the regional persistent disk.",
  88055. // "location": "path",
  88056. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88057. // "required": true,
  88058. // "type": "string"
  88059. // },
  88060. // "project": {
  88061. // "description": "The project ID for this request.",
  88062. // "location": "path",
  88063. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88064. // "required": true,
  88065. // "type": "string"
  88066. // },
  88067. // "region": {
  88068. // "description": "Name of the region for this request.",
  88069. // "location": "path",
  88070. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88071. // "required": true,
  88072. // "type": "string"
  88073. // },
  88074. // "requestId": {
  88075. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88076. // "location": "query",
  88077. // "type": "string"
  88078. // }
  88079. // },
  88080. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  88081. // "request": {
  88082. // "$ref": "RegionDisksResizeRequest"
  88083. // },
  88084. // "response": {
  88085. // "$ref": "Operation"
  88086. // },
  88087. // "scopes": [
  88088. // "https://www.googleapis.com/auth/cloud-platform",
  88089. // "https://www.googleapis.com/auth/compute"
  88090. // ]
  88091. // }
  88092. }
  88093. // method id "compute.regionDisks.setIamPolicy":
  88094. type RegionDisksSetIamPolicyCall struct {
  88095. s *Service
  88096. project string
  88097. region string
  88098. resource string
  88099. regionsetpolicyrequest *RegionSetPolicyRequest
  88100. urlParams_ gensupport.URLParams
  88101. ctx_ context.Context
  88102. header_ http.Header
  88103. }
  88104. // SetIamPolicy: Sets the access control policy on the specified
  88105. // resource. Replaces any existing policy.
  88106. func (r *RegionDisksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionDisksSetIamPolicyCall {
  88107. c := &RegionDisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88108. c.project = project
  88109. c.region = region
  88110. c.resource = resource
  88111. c.regionsetpolicyrequest = regionsetpolicyrequest
  88112. return c
  88113. }
  88114. // Fields allows partial responses to be retrieved. See
  88115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88116. // for more information.
  88117. func (c *RegionDisksSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksSetIamPolicyCall {
  88118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88119. return c
  88120. }
  88121. // Context sets the context to be used in this call's Do method. Any
  88122. // pending HTTP request will be aborted if the provided context is
  88123. // canceled.
  88124. func (c *RegionDisksSetIamPolicyCall) Context(ctx context.Context) *RegionDisksSetIamPolicyCall {
  88125. c.ctx_ = ctx
  88126. return c
  88127. }
  88128. // Header returns an http.Header that can be modified by the caller to
  88129. // add HTTP headers to the request.
  88130. func (c *RegionDisksSetIamPolicyCall) Header() http.Header {
  88131. if c.header_ == nil {
  88132. c.header_ = make(http.Header)
  88133. }
  88134. return c.header_
  88135. }
  88136. func (c *RegionDisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  88137. reqHeaders := make(http.Header)
  88138. for k, v := range c.header_ {
  88139. reqHeaders[k] = v
  88140. }
  88141. reqHeaders.Set("User-Agent", c.s.userAgent())
  88142. var body io.Reader = nil
  88143. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  88144. if err != nil {
  88145. return nil, err
  88146. }
  88147. reqHeaders.Set("Content-Type", "application/json")
  88148. c.urlParams_.Set("alt", alt)
  88149. c.urlParams_.Set("prettyPrint", "false")
  88150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setIamPolicy")
  88151. urls += "?" + c.urlParams_.Encode()
  88152. req, err := http.NewRequest("POST", urls, body)
  88153. if err != nil {
  88154. return nil, err
  88155. }
  88156. req.Header = reqHeaders
  88157. googleapi.Expand(req.URL, map[string]string{
  88158. "project": c.project,
  88159. "region": c.region,
  88160. "resource": c.resource,
  88161. })
  88162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88163. }
  88164. // Do executes the "compute.regionDisks.setIamPolicy" call.
  88165. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  88166. // code is an error. Response headers are in either
  88167. // *Policy.ServerResponse.Header or (if a response was returned at all)
  88168. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  88169. // check whether the returned error was because http.StatusNotModified
  88170. // was returned.
  88171. func (c *RegionDisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  88172. gensupport.SetOptions(c.urlParams_, opts...)
  88173. res, err := c.doRequest("json")
  88174. if res != nil && res.StatusCode == http.StatusNotModified {
  88175. if res.Body != nil {
  88176. res.Body.Close()
  88177. }
  88178. return nil, &googleapi.Error{
  88179. Code: res.StatusCode,
  88180. Header: res.Header,
  88181. }
  88182. }
  88183. if err != nil {
  88184. return nil, err
  88185. }
  88186. defer googleapi.CloseBody(res)
  88187. if err := googleapi.CheckResponse(res); err != nil {
  88188. return nil, err
  88189. }
  88190. ret := &Policy{
  88191. ServerResponse: googleapi.ServerResponse{
  88192. Header: res.Header,
  88193. HTTPStatusCode: res.StatusCode,
  88194. },
  88195. }
  88196. target := &ret
  88197. if err := gensupport.DecodeResponse(target, res); err != nil {
  88198. return nil, err
  88199. }
  88200. return ret, nil
  88201. // {
  88202. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  88203. // "httpMethod": "POST",
  88204. // "id": "compute.regionDisks.setIamPolicy",
  88205. // "parameterOrder": [
  88206. // "project",
  88207. // "region",
  88208. // "resource"
  88209. // ],
  88210. // "parameters": {
  88211. // "project": {
  88212. // "description": "Project ID for this request.",
  88213. // "location": "path",
  88214. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88215. // "required": true,
  88216. // "type": "string"
  88217. // },
  88218. // "region": {
  88219. // "description": "The name of the region for this request.",
  88220. // "location": "path",
  88221. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88222. // "required": true,
  88223. // "type": "string"
  88224. // },
  88225. // "resource": {
  88226. // "description": "Name or id of the resource for this request.",
  88227. // "location": "path",
  88228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88229. // "required": true,
  88230. // "type": "string"
  88231. // }
  88232. // },
  88233. // "path": "{project}/regions/{region}/disks/{resource}/setIamPolicy",
  88234. // "request": {
  88235. // "$ref": "RegionSetPolicyRequest"
  88236. // },
  88237. // "response": {
  88238. // "$ref": "Policy"
  88239. // },
  88240. // "scopes": [
  88241. // "https://www.googleapis.com/auth/cloud-platform",
  88242. // "https://www.googleapis.com/auth/compute"
  88243. // ]
  88244. // }
  88245. }
  88246. // method id "compute.regionDisks.setLabels":
  88247. type RegionDisksSetLabelsCall struct {
  88248. s *Service
  88249. project string
  88250. region string
  88251. resource string
  88252. regionsetlabelsrequest *RegionSetLabelsRequest
  88253. urlParams_ gensupport.URLParams
  88254. ctx_ context.Context
  88255. header_ http.Header
  88256. }
  88257. // SetLabels: Sets the labels on the target regional disk.
  88258. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  88259. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88260. c.project = project
  88261. c.region = region
  88262. c.resource = resource
  88263. c.regionsetlabelsrequest = regionsetlabelsrequest
  88264. return c
  88265. }
  88266. // RequestId sets the optional parameter "requestId": An optional
  88267. // request ID to identify requests. Specify a unique request ID so that
  88268. // if you must retry your request, the server will know to ignore the
  88269. // request if it has already been completed.
  88270. //
  88271. // For example, consider a situation where you make an initial request
  88272. // and the request times out. If you make the request again with the
  88273. // same request ID, the server can check if original operation with the
  88274. // same request ID was received, and if so, will ignore the second
  88275. // request. This prevents clients from accidentally creating duplicate
  88276. // commitments.
  88277. //
  88278. // The request ID must be a valid UUID with the exception that zero UUID
  88279. // is not supported (00000000-0000-0000-0000-000000000000).
  88280. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  88281. c.urlParams_.Set("requestId", requestId)
  88282. return c
  88283. }
  88284. // Fields allows partial responses to be retrieved. See
  88285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88286. // for more information.
  88287. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  88288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88289. return c
  88290. }
  88291. // Context sets the context to be used in this call's Do method. Any
  88292. // pending HTTP request will be aborted if the provided context is
  88293. // canceled.
  88294. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  88295. c.ctx_ = ctx
  88296. return c
  88297. }
  88298. // Header returns an http.Header that can be modified by the caller to
  88299. // add HTTP headers to the request.
  88300. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  88301. if c.header_ == nil {
  88302. c.header_ = make(http.Header)
  88303. }
  88304. return c.header_
  88305. }
  88306. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  88307. reqHeaders := make(http.Header)
  88308. for k, v := range c.header_ {
  88309. reqHeaders[k] = v
  88310. }
  88311. reqHeaders.Set("User-Agent", c.s.userAgent())
  88312. var body io.Reader = nil
  88313. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  88314. if err != nil {
  88315. return nil, err
  88316. }
  88317. reqHeaders.Set("Content-Type", "application/json")
  88318. c.urlParams_.Set("alt", alt)
  88319. c.urlParams_.Set("prettyPrint", "false")
  88320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  88321. urls += "?" + c.urlParams_.Encode()
  88322. req, err := http.NewRequest("POST", urls, body)
  88323. if err != nil {
  88324. return nil, err
  88325. }
  88326. req.Header = reqHeaders
  88327. googleapi.Expand(req.URL, map[string]string{
  88328. "project": c.project,
  88329. "region": c.region,
  88330. "resource": c.resource,
  88331. })
  88332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88333. }
  88334. // Do executes the "compute.regionDisks.setLabels" call.
  88335. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88336. // status code is an error. Response headers are in either
  88337. // *Operation.ServerResponse.Header or (if a response was returned at
  88338. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88339. // to check whether the returned error was because
  88340. // http.StatusNotModified was returned.
  88341. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88342. gensupport.SetOptions(c.urlParams_, opts...)
  88343. res, err := c.doRequest("json")
  88344. if res != nil && res.StatusCode == http.StatusNotModified {
  88345. if res.Body != nil {
  88346. res.Body.Close()
  88347. }
  88348. return nil, &googleapi.Error{
  88349. Code: res.StatusCode,
  88350. Header: res.Header,
  88351. }
  88352. }
  88353. if err != nil {
  88354. return nil, err
  88355. }
  88356. defer googleapi.CloseBody(res)
  88357. if err := googleapi.CheckResponse(res); err != nil {
  88358. return nil, err
  88359. }
  88360. ret := &Operation{
  88361. ServerResponse: googleapi.ServerResponse{
  88362. Header: res.Header,
  88363. HTTPStatusCode: res.StatusCode,
  88364. },
  88365. }
  88366. target := &ret
  88367. if err := gensupport.DecodeResponse(target, res); err != nil {
  88368. return nil, err
  88369. }
  88370. return ret, nil
  88371. // {
  88372. // "description": "Sets the labels on the target regional disk.",
  88373. // "httpMethod": "POST",
  88374. // "id": "compute.regionDisks.setLabels",
  88375. // "parameterOrder": [
  88376. // "project",
  88377. // "region",
  88378. // "resource"
  88379. // ],
  88380. // "parameters": {
  88381. // "project": {
  88382. // "description": "Project ID for this request.",
  88383. // "location": "path",
  88384. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88385. // "required": true,
  88386. // "type": "string"
  88387. // },
  88388. // "region": {
  88389. // "description": "The region for this request.",
  88390. // "location": "path",
  88391. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88392. // "required": true,
  88393. // "type": "string"
  88394. // },
  88395. // "requestId": {
  88396. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88397. // "location": "query",
  88398. // "type": "string"
  88399. // },
  88400. // "resource": {
  88401. // "description": "Name or id of the resource for this request.",
  88402. // "location": "path",
  88403. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88404. // "required": true,
  88405. // "type": "string"
  88406. // }
  88407. // },
  88408. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  88409. // "request": {
  88410. // "$ref": "RegionSetLabelsRequest"
  88411. // },
  88412. // "response": {
  88413. // "$ref": "Operation"
  88414. // },
  88415. // "scopes": [
  88416. // "https://www.googleapis.com/auth/cloud-platform",
  88417. // "https://www.googleapis.com/auth/compute"
  88418. // ]
  88419. // }
  88420. }
  88421. // method id "compute.regionDisks.testIamPermissions":
  88422. type RegionDisksTestIamPermissionsCall struct {
  88423. s *Service
  88424. project string
  88425. region string
  88426. resource string
  88427. testpermissionsrequest *TestPermissionsRequest
  88428. urlParams_ gensupport.URLParams
  88429. ctx_ context.Context
  88430. header_ http.Header
  88431. }
  88432. // TestIamPermissions: Returns permissions that a caller has on the
  88433. // specified resource.
  88434. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  88435. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88436. c.project = project
  88437. c.region = region
  88438. c.resource = resource
  88439. c.testpermissionsrequest = testpermissionsrequest
  88440. return c
  88441. }
  88442. // Fields allows partial responses to be retrieved. See
  88443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88444. // for more information.
  88445. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  88446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88447. return c
  88448. }
  88449. // Context sets the context to be used in this call's Do method. Any
  88450. // pending HTTP request will be aborted if the provided context is
  88451. // canceled.
  88452. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  88453. c.ctx_ = ctx
  88454. return c
  88455. }
  88456. // Header returns an http.Header that can be modified by the caller to
  88457. // add HTTP headers to the request.
  88458. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  88459. if c.header_ == nil {
  88460. c.header_ = make(http.Header)
  88461. }
  88462. return c.header_
  88463. }
  88464. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  88465. reqHeaders := make(http.Header)
  88466. for k, v := range c.header_ {
  88467. reqHeaders[k] = v
  88468. }
  88469. reqHeaders.Set("User-Agent", c.s.userAgent())
  88470. var body io.Reader = nil
  88471. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  88472. if err != nil {
  88473. return nil, err
  88474. }
  88475. reqHeaders.Set("Content-Type", "application/json")
  88476. c.urlParams_.Set("alt", alt)
  88477. c.urlParams_.Set("prettyPrint", "false")
  88478. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  88479. urls += "?" + c.urlParams_.Encode()
  88480. req, err := http.NewRequest("POST", urls, body)
  88481. if err != nil {
  88482. return nil, err
  88483. }
  88484. req.Header = reqHeaders
  88485. googleapi.Expand(req.URL, map[string]string{
  88486. "project": c.project,
  88487. "region": c.region,
  88488. "resource": c.resource,
  88489. })
  88490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88491. }
  88492. // Do executes the "compute.regionDisks.testIamPermissions" call.
  88493. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  88494. // non-2xx status code is an error. Response headers are in either
  88495. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  88496. // returned at all) in error.(*googleapi.Error).Header. Use
  88497. // googleapi.IsNotModified to check whether the returned error was
  88498. // because http.StatusNotModified was returned.
  88499. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  88500. gensupport.SetOptions(c.urlParams_, opts...)
  88501. res, err := c.doRequest("json")
  88502. if res != nil && res.StatusCode == http.StatusNotModified {
  88503. if res.Body != nil {
  88504. res.Body.Close()
  88505. }
  88506. return nil, &googleapi.Error{
  88507. Code: res.StatusCode,
  88508. Header: res.Header,
  88509. }
  88510. }
  88511. if err != nil {
  88512. return nil, err
  88513. }
  88514. defer googleapi.CloseBody(res)
  88515. if err := googleapi.CheckResponse(res); err != nil {
  88516. return nil, err
  88517. }
  88518. ret := &TestPermissionsResponse{
  88519. ServerResponse: googleapi.ServerResponse{
  88520. Header: res.Header,
  88521. HTTPStatusCode: res.StatusCode,
  88522. },
  88523. }
  88524. target := &ret
  88525. if err := gensupport.DecodeResponse(target, res); err != nil {
  88526. return nil, err
  88527. }
  88528. return ret, nil
  88529. // {
  88530. // "description": "Returns permissions that a caller has on the specified resource.",
  88531. // "httpMethod": "POST",
  88532. // "id": "compute.regionDisks.testIamPermissions",
  88533. // "parameterOrder": [
  88534. // "project",
  88535. // "region",
  88536. // "resource"
  88537. // ],
  88538. // "parameters": {
  88539. // "project": {
  88540. // "description": "Project ID for this request.",
  88541. // "location": "path",
  88542. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88543. // "required": true,
  88544. // "type": "string"
  88545. // },
  88546. // "region": {
  88547. // "description": "The name of the region for this request.",
  88548. // "location": "path",
  88549. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88550. // "required": true,
  88551. // "type": "string"
  88552. // },
  88553. // "resource": {
  88554. // "description": "Name or id of the resource for this request.",
  88555. // "location": "path",
  88556. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88557. // "required": true,
  88558. // "type": "string"
  88559. // }
  88560. // },
  88561. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  88562. // "request": {
  88563. // "$ref": "TestPermissionsRequest"
  88564. // },
  88565. // "response": {
  88566. // "$ref": "TestPermissionsResponse"
  88567. // },
  88568. // "scopes": [
  88569. // "https://www.googleapis.com/auth/cloud-platform",
  88570. // "https://www.googleapis.com/auth/compute",
  88571. // "https://www.googleapis.com/auth/compute.readonly"
  88572. // ]
  88573. // }
  88574. }
  88575. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  88576. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  88577. s *Service
  88578. project string
  88579. region string
  88580. instanceGroupManager string
  88581. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  88582. urlParams_ gensupport.URLParams
  88583. ctx_ context.Context
  88584. header_ http.Header
  88585. }
  88586. // AbandonInstances: Flags the specified instances to be immediately
  88587. // removed from the managed instance group. Abandoning an instance does
  88588. // not delete the instance, but it does remove the instance from any
  88589. // target pools that are applied by the managed instance group. This
  88590. // method reduces the targetSize of the managed instance group by the
  88591. // number of instances that you abandon. This operation is marked as
  88592. // DONE when the action is scheduled even if the instances have not yet
  88593. // been removed from the group. You must separately verify the status of
  88594. // the abandoning action with the listmanagedinstances method.
  88595. //
  88596. // If the group is part of a backend service that has enabled connection
  88597. // draining, it can take up to 60 seconds after the connection draining
  88598. // duration has elapsed before the VM instance is removed or
  88599. // deleted.
  88600. //
  88601. // You can specify a maximum of 1000 instances with this method per
  88602. // request.
  88603. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  88604. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88605. c.project = project
  88606. c.region = region
  88607. c.instanceGroupManager = instanceGroupManager
  88608. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  88609. return c
  88610. }
  88611. // RequestId sets the optional parameter "requestId": An optional
  88612. // request ID to identify requests. Specify a unique request ID so that
  88613. // if you must retry your request, the server will know to ignore the
  88614. // request if it has already been completed.
  88615. //
  88616. // For example, consider a situation where you make an initial request
  88617. // and the request times out. If you make the request again with the
  88618. // same request ID, the server can check if original operation with the
  88619. // same request ID was received, and if so, will ignore the second
  88620. // request. This prevents clients from accidentally creating duplicate
  88621. // commitments.
  88622. //
  88623. // The request ID must be a valid UUID with the exception that zero UUID
  88624. // is not supported (00000000-0000-0000-0000-000000000000).
  88625. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  88626. c.urlParams_.Set("requestId", requestId)
  88627. return c
  88628. }
  88629. // Fields allows partial responses to be retrieved. See
  88630. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88631. // for more information.
  88632. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  88633. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88634. return c
  88635. }
  88636. // Context sets the context to be used in this call's Do method. Any
  88637. // pending HTTP request will be aborted if the provided context is
  88638. // canceled.
  88639. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  88640. c.ctx_ = ctx
  88641. return c
  88642. }
  88643. // Header returns an http.Header that can be modified by the caller to
  88644. // add HTTP headers to the request.
  88645. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  88646. if c.header_ == nil {
  88647. c.header_ = make(http.Header)
  88648. }
  88649. return c.header_
  88650. }
  88651. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  88652. reqHeaders := make(http.Header)
  88653. for k, v := range c.header_ {
  88654. reqHeaders[k] = v
  88655. }
  88656. reqHeaders.Set("User-Agent", c.s.userAgent())
  88657. var body io.Reader = nil
  88658. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  88659. if err != nil {
  88660. return nil, err
  88661. }
  88662. reqHeaders.Set("Content-Type", "application/json")
  88663. c.urlParams_.Set("alt", alt)
  88664. c.urlParams_.Set("prettyPrint", "false")
  88665. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  88666. urls += "?" + c.urlParams_.Encode()
  88667. req, err := http.NewRequest("POST", urls, body)
  88668. if err != nil {
  88669. return nil, err
  88670. }
  88671. req.Header = reqHeaders
  88672. googleapi.Expand(req.URL, map[string]string{
  88673. "project": c.project,
  88674. "region": c.region,
  88675. "instanceGroupManager": c.instanceGroupManager,
  88676. })
  88677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88678. }
  88679. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  88680. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88681. // status code is an error. Response headers are in either
  88682. // *Operation.ServerResponse.Header or (if a response was returned at
  88683. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88684. // to check whether the returned error was because
  88685. // http.StatusNotModified was returned.
  88686. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88687. gensupport.SetOptions(c.urlParams_, opts...)
  88688. res, err := c.doRequest("json")
  88689. if res != nil && res.StatusCode == http.StatusNotModified {
  88690. if res.Body != nil {
  88691. res.Body.Close()
  88692. }
  88693. return nil, &googleapi.Error{
  88694. Code: res.StatusCode,
  88695. Header: res.Header,
  88696. }
  88697. }
  88698. if err != nil {
  88699. return nil, err
  88700. }
  88701. defer googleapi.CloseBody(res)
  88702. if err := googleapi.CheckResponse(res); err != nil {
  88703. return nil, err
  88704. }
  88705. ret := &Operation{
  88706. ServerResponse: googleapi.ServerResponse{
  88707. Header: res.Header,
  88708. HTTPStatusCode: res.StatusCode,
  88709. },
  88710. }
  88711. target := &ret
  88712. if err := gensupport.DecodeResponse(target, res); err != nil {
  88713. return nil, err
  88714. }
  88715. return ret, nil
  88716. // {
  88717. // "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.",
  88718. // "httpMethod": "POST",
  88719. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  88720. // "parameterOrder": [
  88721. // "project",
  88722. // "region",
  88723. // "instanceGroupManager"
  88724. // ],
  88725. // "parameters": {
  88726. // "instanceGroupManager": {
  88727. // "description": "Name of the managed instance group.",
  88728. // "location": "path",
  88729. // "required": true,
  88730. // "type": "string"
  88731. // },
  88732. // "project": {
  88733. // "description": "Project ID for this request.",
  88734. // "location": "path",
  88735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88736. // "required": true,
  88737. // "type": "string"
  88738. // },
  88739. // "region": {
  88740. // "description": "Name of the region scoping this request.",
  88741. // "location": "path",
  88742. // "required": true,
  88743. // "type": "string"
  88744. // },
  88745. // "requestId": {
  88746. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88747. // "location": "query",
  88748. // "type": "string"
  88749. // }
  88750. // },
  88751. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  88752. // "request": {
  88753. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  88754. // },
  88755. // "response": {
  88756. // "$ref": "Operation"
  88757. // },
  88758. // "scopes": [
  88759. // "https://www.googleapis.com/auth/cloud-platform",
  88760. // "https://www.googleapis.com/auth/compute"
  88761. // ]
  88762. // }
  88763. }
  88764. // method id "compute.regionInstanceGroupManagers.delete":
  88765. type RegionInstanceGroupManagersDeleteCall struct {
  88766. s *Service
  88767. project string
  88768. region string
  88769. instanceGroupManager string
  88770. urlParams_ gensupport.URLParams
  88771. ctx_ context.Context
  88772. header_ http.Header
  88773. }
  88774. // Delete: Deletes the specified managed instance group and all of the
  88775. // instances in that group.
  88776. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  88777. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88778. c.project = project
  88779. c.region = region
  88780. c.instanceGroupManager = instanceGroupManager
  88781. return c
  88782. }
  88783. // RequestId sets the optional parameter "requestId": An optional
  88784. // request ID to identify requests. Specify a unique request ID so that
  88785. // if you must retry your request, the server will know to ignore the
  88786. // request if it has already been completed.
  88787. //
  88788. // For example, consider a situation where you make an initial request
  88789. // and the request times out. If you make the request again with the
  88790. // same request ID, the server can check if original operation with the
  88791. // same request ID was received, and if so, will ignore the second
  88792. // request. This prevents clients from accidentally creating duplicate
  88793. // commitments.
  88794. //
  88795. // The request ID must be a valid UUID with the exception that zero UUID
  88796. // is not supported (00000000-0000-0000-0000-000000000000).
  88797. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  88798. c.urlParams_.Set("requestId", requestId)
  88799. return c
  88800. }
  88801. // Fields allows partial responses to be retrieved. See
  88802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88803. // for more information.
  88804. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  88805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88806. return c
  88807. }
  88808. // Context sets the context to be used in this call's Do method. Any
  88809. // pending HTTP request will be aborted if the provided context is
  88810. // canceled.
  88811. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  88812. c.ctx_ = ctx
  88813. return c
  88814. }
  88815. // Header returns an http.Header that can be modified by the caller to
  88816. // add HTTP headers to the request.
  88817. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  88818. if c.header_ == nil {
  88819. c.header_ = make(http.Header)
  88820. }
  88821. return c.header_
  88822. }
  88823. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  88824. reqHeaders := make(http.Header)
  88825. for k, v := range c.header_ {
  88826. reqHeaders[k] = v
  88827. }
  88828. reqHeaders.Set("User-Agent", c.s.userAgent())
  88829. var body io.Reader = nil
  88830. c.urlParams_.Set("alt", alt)
  88831. c.urlParams_.Set("prettyPrint", "false")
  88832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  88833. urls += "?" + c.urlParams_.Encode()
  88834. req, err := http.NewRequest("DELETE", urls, body)
  88835. if err != nil {
  88836. return nil, err
  88837. }
  88838. req.Header = reqHeaders
  88839. googleapi.Expand(req.URL, map[string]string{
  88840. "project": c.project,
  88841. "region": c.region,
  88842. "instanceGroupManager": c.instanceGroupManager,
  88843. })
  88844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88845. }
  88846. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  88847. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88848. // status code is an error. Response headers are in either
  88849. // *Operation.ServerResponse.Header or (if a response was returned at
  88850. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88851. // to check whether the returned error was because
  88852. // http.StatusNotModified was returned.
  88853. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88854. gensupport.SetOptions(c.urlParams_, opts...)
  88855. res, err := c.doRequest("json")
  88856. if res != nil && res.StatusCode == http.StatusNotModified {
  88857. if res.Body != nil {
  88858. res.Body.Close()
  88859. }
  88860. return nil, &googleapi.Error{
  88861. Code: res.StatusCode,
  88862. Header: res.Header,
  88863. }
  88864. }
  88865. if err != nil {
  88866. return nil, err
  88867. }
  88868. defer googleapi.CloseBody(res)
  88869. if err := googleapi.CheckResponse(res); err != nil {
  88870. return nil, err
  88871. }
  88872. ret := &Operation{
  88873. ServerResponse: googleapi.ServerResponse{
  88874. Header: res.Header,
  88875. HTTPStatusCode: res.StatusCode,
  88876. },
  88877. }
  88878. target := &ret
  88879. if err := gensupport.DecodeResponse(target, res); err != nil {
  88880. return nil, err
  88881. }
  88882. return ret, nil
  88883. // {
  88884. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  88885. // "httpMethod": "DELETE",
  88886. // "id": "compute.regionInstanceGroupManagers.delete",
  88887. // "parameterOrder": [
  88888. // "project",
  88889. // "region",
  88890. // "instanceGroupManager"
  88891. // ],
  88892. // "parameters": {
  88893. // "instanceGroupManager": {
  88894. // "description": "Name of the managed instance group to delete.",
  88895. // "location": "path",
  88896. // "required": true,
  88897. // "type": "string"
  88898. // },
  88899. // "project": {
  88900. // "description": "Project ID for this request.",
  88901. // "location": "path",
  88902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88903. // "required": true,
  88904. // "type": "string"
  88905. // },
  88906. // "region": {
  88907. // "description": "Name of the region scoping this request.",
  88908. // "location": "path",
  88909. // "required": true,
  88910. // "type": "string"
  88911. // },
  88912. // "requestId": {
  88913. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88914. // "location": "query",
  88915. // "type": "string"
  88916. // }
  88917. // },
  88918. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  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.regionInstanceGroupManagers.deleteInstances":
  88929. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  88930. s *Service
  88931. project string
  88932. region string
  88933. instanceGroupManager string
  88934. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  88935. urlParams_ gensupport.URLParams
  88936. ctx_ context.Context
  88937. header_ http.Header
  88938. }
  88939. // DeleteInstances: Flags the specified instances in the managed
  88940. // instance group to be immediately deleted. The instances are also
  88941. // removed from any target pools of which they were a member. This
  88942. // method reduces the targetSize of the managed instance group by the
  88943. // number of instances that you delete. The deleteInstances operation is
  88944. // marked DONE if the deleteInstances request is successful. The
  88945. // underlying actions take additional time. You must separately verify
  88946. // the status of the deleting action with the listmanagedinstances
  88947. // method.
  88948. //
  88949. // If the group is part of a backend service that has enabled connection
  88950. // draining, it can take up to 60 seconds after the connection draining
  88951. // duration has elapsed before the VM instance is removed or
  88952. // deleted.
  88953. //
  88954. // You can specify a maximum of 1000 instances with this method per
  88955. // request.
  88956. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  88957. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88958. c.project = project
  88959. c.region = region
  88960. c.instanceGroupManager = instanceGroupManager
  88961. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  88962. return c
  88963. }
  88964. // RequestId sets the optional parameter "requestId": An optional
  88965. // request ID to identify requests. Specify a unique request ID so that
  88966. // if you must retry your request, the server will know to ignore the
  88967. // request if it has already been completed.
  88968. //
  88969. // For example, consider a situation where you make an initial request
  88970. // and the request times out. If you make the request again with the
  88971. // same request ID, the server can check if original operation with the
  88972. // same request ID was received, and if so, will ignore the second
  88973. // request. This prevents clients from accidentally creating duplicate
  88974. // commitments.
  88975. //
  88976. // The request ID must be a valid UUID with the exception that zero UUID
  88977. // is not supported (00000000-0000-0000-0000-000000000000).
  88978. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  88979. c.urlParams_.Set("requestId", requestId)
  88980. return c
  88981. }
  88982. // Fields allows partial responses to be retrieved. See
  88983. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88984. // for more information.
  88985. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  88986. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88987. return c
  88988. }
  88989. // Context sets the context to be used in this call's Do method. Any
  88990. // pending HTTP request will be aborted if the provided context is
  88991. // canceled.
  88992. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  88993. c.ctx_ = ctx
  88994. return c
  88995. }
  88996. // Header returns an http.Header that can be modified by the caller to
  88997. // add HTTP headers to the request.
  88998. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  88999. if c.header_ == nil {
  89000. c.header_ = make(http.Header)
  89001. }
  89002. return c.header_
  89003. }
  89004. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  89005. reqHeaders := make(http.Header)
  89006. for k, v := range c.header_ {
  89007. reqHeaders[k] = v
  89008. }
  89009. reqHeaders.Set("User-Agent", c.s.userAgent())
  89010. var body io.Reader = nil
  89011. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  89012. if err != nil {
  89013. return nil, err
  89014. }
  89015. reqHeaders.Set("Content-Type", "application/json")
  89016. c.urlParams_.Set("alt", alt)
  89017. c.urlParams_.Set("prettyPrint", "false")
  89018. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  89019. urls += "?" + c.urlParams_.Encode()
  89020. req, err := http.NewRequest("POST", urls, body)
  89021. if err != nil {
  89022. return nil, err
  89023. }
  89024. req.Header = reqHeaders
  89025. googleapi.Expand(req.URL, map[string]string{
  89026. "project": c.project,
  89027. "region": c.region,
  89028. "instanceGroupManager": c.instanceGroupManager,
  89029. })
  89030. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89031. }
  89032. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  89033. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89034. // status code is an error. Response headers are in either
  89035. // *Operation.ServerResponse.Header or (if a response was returned at
  89036. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89037. // to check whether the returned error was because
  89038. // http.StatusNotModified was returned.
  89039. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89040. gensupport.SetOptions(c.urlParams_, opts...)
  89041. res, err := c.doRequest("json")
  89042. if res != nil && res.StatusCode == http.StatusNotModified {
  89043. if res.Body != nil {
  89044. res.Body.Close()
  89045. }
  89046. return nil, &googleapi.Error{
  89047. Code: res.StatusCode,
  89048. Header: res.Header,
  89049. }
  89050. }
  89051. if err != nil {
  89052. return nil, err
  89053. }
  89054. defer googleapi.CloseBody(res)
  89055. if err := googleapi.CheckResponse(res); err != nil {
  89056. return nil, err
  89057. }
  89058. ret := &Operation{
  89059. ServerResponse: googleapi.ServerResponse{
  89060. Header: res.Header,
  89061. HTTPStatusCode: res.StatusCode,
  89062. },
  89063. }
  89064. target := &ret
  89065. if err := gensupport.DecodeResponse(target, res); err != nil {
  89066. return nil, err
  89067. }
  89068. return ret, nil
  89069. // {
  89070. // "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.",
  89071. // "httpMethod": "POST",
  89072. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  89073. // "parameterOrder": [
  89074. // "project",
  89075. // "region",
  89076. // "instanceGroupManager"
  89077. // ],
  89078. // "parameters": {
  89079. // "instanceGroupManager": {
  89080. // "description": "Name of the managed instance group.",
  89081. // "location": "path",
  89082. // "required": true,
  89083. // "type": "string"
  89084. // },
  89085. // "project": {
  89086. // "description": "Project ID for this request.",
  89087. // "location": "path",
  89088. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89089. // "required": true,
  89090. // "type": "string"
  89091. // },
  89092. // "region": {
  89093. // "description": "Name of the region scoping this request.",
  89094. // "location": "path",
  89095. // "required": true,
  89096. // "type": "string"
  89097. // },
  89098. // "requestId": {
  89099. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89100. // "location": "query",
  89101. // "type": "string"
  89102. // }
  89103. // },
  89104. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  89105. // "request": {
  89106. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  89107. // },
  89108. // "response": {
  89109. // "$ref": "Operation"
  89110. // },
  89111. // "scopes": [
  89112. // "https://www.googleapis.com/auth/cloud-platform",
  89113. // "https://www.googleapis.com/auth/compute"
  89114. // ]
  89115. // }
  89116. }
  89117. // method id "compute.regionInstanceGroupManagers.get":
  89118. type RegionInstanceGroupManagersGetCall struct {
  89119. s *Service
  89120. project string
  89121. region string
  89122. instanceGroupManager string
  89123. urlParams_ gensupport.URLParams
  89124. ifNoneMatch_ string
  89125. ctx_ context.Context
  89126. header_ http.Header
  89127. }
  89128. // Get: Returns all of the details about the specified managed instance
  89129. // group.
  89130. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  89131. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89132. c.project = project
  89133. c.region = region
  89134. c.instanceGroupManager = instanceGroupManager
  89135. return c
  89136. }
  89137. // Fields allows partial responses to be retrieved. See
  89138. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89139. // for more information.
  89140. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  89141. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89142. return c
  89143. }
  89144. // IfNoneMatch sets the optional parameter which makes the operation
  89145. // fail if the object's ETag matches the given value. This is useful for
  89146. // getting updates only after the object has changed since the last
  89147. // request. Use googleapi.IsNotModified to check whether the response
  89148. // error from Do is the result of In-None-Match.
  89149. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  89150. c.ifNoneMatch_ = entityTag
  89151. return c
  89152. }
  89153. // Context sets the context to be used in this call's Do method. Any
  89154. // pending HTTP request will be aborted if the provided context is
  89155. // canceled.
  89156. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  89157. c.ctx_ = ctx
  89158. return c
  89159. }
  89160. // Header returns an http.Header that can be modified by the caller to
  89161. // add HTTP headers to the request.
  89162. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  89163. if c.header_ == nil {
  89164. c.header_ = make(http.Header)
  89165. }
  89166. return c.header_
  89167. }
  89168. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  89169. reqHeaders := make(http.Header)
  89170. for k, v := range c.header_ {
  89171. reqHeaders[k] = v
  89172. }
  89173. reqHeaders.Set("User-Agent", c.s.userAgent())
  89174. if c.ifNoneMatch_ != "" {
  89175. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89176. }
  89177. var body io.Reader = nil
  89178. c.urlParams_.Set("alt", alt)
  89179. c.urlParams_.Set("prettyPrint", "false")
  89180. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  89181. urls += "?" + c.urlParams_.Encode()
  89182. req, err := http.NewRequest("GET", urls, body)
  89183. if err != nil {
  89184. return nil, err
  89185. }
  89186. req.Header = reqHeaders
  89187. googleapi.Expand(req.URL, map[string]string{
  89188. "project": c.project,
  89189. "region": c.region,
  89190. "instanceGroupManager": c.instanceGroupManager,
  89191. })
  89192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89193. }
  89194. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  89195. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  89196. // non-2xx status code is an error. Response headers are in either
  89197. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  89198. // returned at all) in error.(*googleapi.Error).Header. Use
  89199. // googleapi.IsNotModified to check whether the returned error was
  89200. // because http.StatusNotModified was returned.
  89201. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  89202. gensupport.SetOptions(c.urlParams_, opts...)
  89203. res, err := c.doRequest("json")
  89204. if res != nil && res.StatusCode == http.StatusNotModified {
  89205. if res.Body != nil {
  89206. res.Body.Close()
  89207. }
  89208. return nil, &googleapi.Error{
  89209. Code: res.StatusCode,
  89210. Header: res.Header,
  89211. }
  89212. }
  89213. if err != nil {
  89214. return nil, err
  89215. }
  89216. defer googleapi.CloseBody(res)
  89217. if err := googleapi.CheckResponse(res); err != nil {
  89218. return nil, err
  89219. }
  89220. ret := &InstanceGroupManager{
  89221. ServerResponse: googleapi.ServerResponse{
  89222. Header: res.Header,
  89223. HTTPStatusCode: res.StatusCode,
  89224. },
  89225. }
  89226. target := &ret
  89227. if err := gensupport.DecodeResponse(target, res); err != nil {
  89228. return nil, err
  89229. }
  89230. return ret, nil
  89231. // {
  89232. // "description": "Returns all of the details about the specified managed instance group.",
  89233. // "httpMethod": "GET",
  89234. // "id": "compute.regionInstanceGroupManagers.get",
  89235. // "parameterOrder": [
  89236. // "project",
  89237. // "region",
  89238. // "instanceGroupManager"
  89239. // ],
  89240. // "parameters": {
  89241. // "instanceGroupManager": {
  89242. // "description": "Name of the managed instance group to return.",
  89243. // "location": "path",
  89244. // "required": true,
  89245. // "type": "string"
  89246. // },
  89247. // "project": {
  89248. // "description": "Project ID for this request.",
  89249. // "location": "path",
  89250. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89251. // "required": true,
  89252. // "type": "string"
  89253. // },
  89254. // "region": {
  89255. // "description": "Name of the region scoping this request.",
  89256. // "location": "path",
  89257. // "required": true,
  89258. // "type": "string"
  89259. // }
  89260. // },
  89261. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  89262. // "response": {
  89263. // "$ref": "InstanceGroupManager"
  89264. // },
  89265. // "scopes": [
  89266. // "https://www.googleapis.com/auth/cloud-platform",
  89267. // "https://www.googleapis.com/auth/compute",
  89268. // "https://www.googleapis.com/auth/compute.readonly"
  89269. // ]
  89270. // }
  89271. }
  89272. // method id "compute.regionInstanceGroupManagers.insert":
  89273. type RegionInstanceGroupManagersInsertCall struct {
  89274. s *Service
  89275. project string
  89276. region string
  89277. instancegroupmanager *InstanceGroupManager
  89278. urlParams_ gensupport.URLParams
  89279. ctx_ context.Context
  89280. header_ http.Header
  89281. }
  89282. // Insert: Creates a managed instance group using the information that
  89283. // you specify in the request. After the group is created, instances in
  89284. // the group are created using the specified instance template. This
  89285. // operation is marked as DONE when the group is created even if the
  89286. // instances in the group have not yet been created. You must separately
  89287. // verify the status of the individual instances with the
  89288. // listmanagedinstances method.
  89289. //
  89290. // A regional managed instance group can contain up to 2000 instances.
  89291. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  89292. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89293. c.project = project
  89294. c.region = region
  89295. c.instancegroupmanager = instancegroupmanager
  89296. return c
  89297. }
  89298. // RequestId sets the optional parameter "requestId": An optional
  89299. // request ID to identify requests. Specify a unique request ID so that
  89300. // if you must retry your request, the server will know to ignore the
  89301. // request if it has already been completed.
  89302. //
  89303. // For example, consider a situation where you make an initial request
  89304. // and the request times out. If you make the request again with the
  89305. // same request ID, the server can check if original operation with the
  89306. // same request ID was received, and if so, will ignore the second
  89307. // request. This prevents clients from accidentally creating duplicate
  89308. // commitments.
  89309. //
  89310. // The request ID must be a valid UUID with the exception that zero UUID
  89311. // is not supported (00000000-0000-0000-0000-000000000000).
  89312. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  89313. c.urlParams_.Set("requestId", requestId)
  89314. return c
  89315. }
  89316. // Fields allows partial responses to be retrieved. See
  89317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89318. // for more information.
  89319. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  89320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89321. return c
  89322. }
  89323. // Context sets the context to be used in this call's Do method. Any
  89324. // pending HTTP request will be aborted if the provided context is
  89325. // canceled.
  89326. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  89327. c.ctx_ = ctx
  89328. return c
  89329. }
  89330. // Header returns an http.Header that can be modified by the caller to
  89331. // add HTTP headers to the request.
  89332. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  89333. if c.header_ == nil {
  89334. c.header_ = make(http.Header)
  89335. }
  89336. return c.header_
  89337. }
  89338. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  89339. reqHeaders := make(http.Header)
  89340. for k, v := range c.header_ {
  89341. reqHeaders[k] = v
  89342. }
  89343. reqHeaders.Set("User-Agent", c.s.userAgent())
  89344. var body io.Reader = nil
  89345. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  89346. if err != nil {
  89347. return nil, err
  89348. }
  89349. reqHeaders.Set("Content-Type", "application/json")
  89350. c.urlParams_.Set("alt", alt)
  89351. c.urlParams_.Set("prettyPrint", "false")
  89352. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  89353. urls += "?" + c.urlParams_.Encode()
  89354. req, err := http.NewRequest("POST", urls, body)
  89355. if err != nil {
  89356. return nil, err
  89357. }
  89358. req.Header = reqHeaders
  89359. googleapi.Expand(req.URL, map[string]string{
  89360. "project": c.project,
  89361. "region": c.region,
  89362. })
  89363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89364. }
  89365. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  89366. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89367. // status code is an error. Response headers are in either
  89368. // *Operation.ServerResponse.Header or (if a response was returned at
  89369. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89370. // to check whether the returned error was because
  89371. // http.StatusNotModified was returned.
  89372. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89373. gensupport.SetOptions(c.urlParams_, opts...)
  89374. res, err := c.doRequest("json")
  89375. if res != nil && res.StatusCode == http.StatusNotModified {
  89376. if res.Body != nil {
  89377. res.Body.Close()
  89378. }
  89379. return nil, &googleapi.Error{
  89380. Code: res.StatusCode,
  89381. Header: res.Header,
  89382. }
  89383. }
  89384. if err != nil {
  89385. return nil, err
  89386. }
  89387. defer googleapi.CloseBody(res)
  89388. if err := googleapi.CheckResponse(res); err != nil {
  89389. return nil, err
  89390. }
  89391. ret := &Operation{
  89392. ServerResponse: googleapi.ServerResponse{
  89393. Header: res.Header,
  89394. HTTPStatusCode: res.StatusCode,
  89395. },
  89396. }
  89397. target := &ret
  89398. if err := gensupport.DecodeResponse(target, res); err != nil {
  89399. return nil, err
  89400. }
  89401. return ret, nil
  89402. // {
  89403. // "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.",
  89404. // "httpMethod": "POST",
  89405. // "id": "compute.regionInstanceGroupManagers.insert",
  89406. // "parameterOrder": [
  89407. // "project",
  89408. // "region"
  89409. // ],
  89410. // "parameters": {
  89411. // "project": {
  89412. // "description": "Project ID for this request.",
  89413. // "location": "path",
  89414. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89415. // "required": true,
  89416. // "type": "string"
  89417. // },
  89418. // "region": {
  89419. // "description": "Name of the region scoping this request.",
  89420. // "location": "path",
  89421. // "required": true,
  89422. // "type": "string"
  89423. // },
  89424. // "requestId": {
  89425. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89426. // "location": "query",
  89427. // "type": "string"
  89428. // }
  89429. // },
  89430. // "path": "{project}/regions/{region}/instanceGroupManagers",
  89431. // "request": {
  89432. // "$ref": "InstanceGroupManager"
  89433. // },
  89434. // "response": {
  89435. // "$ref": "Operation"
  89436. // },
  89437. // "scopes": [
  89438. // "https://www.googleapis.com/auth/cloud-platform",
  89439. // "https://www.googleapis.com/auth/compute"
  89440. // ]
  89441. // }
  89442. }
  89443. // method id "compute.regionInstanceGroupManagers.list":
  89444. type RegionInstanceGroupManagersListCall struct {
  89445. s *Service
  89446. project string
  89447. region string
  89448. urlParams_ gensupport.URLParams
  89449. ifNoneMatch_ string
  89450. ctx_ context.Context
  89451. header_ http.Header
  89452. }
  89453. // List: Retrieves the list of managed instance groups that are
  89454. // contained within the specified region.
  89455. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  89456. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89457. c.project = project
  89458. c.region = region
  89459. return c
  89460. }
  89461. // Filter sets the optional parameter "filter": A filter expression that
  89462. // filters resources listed in the response. The expression must specify
  89463. // the field name, a comparison operator, and the value that you want to
  89464. // use for filtering. The value must be a string, a number, or a
  89465. // boolean. The comparison operator must be either =, !=, >, or <.
  89466. //
  89467. // For example, if you are filtering Compute Engine instances, you can
  89468. // exclude instances named example-instance by specifying name !=
  89469. // example-instance.
  89470. //
  89471. // You can also filter nested fields. For example, you could specify
  89472. // scheduling.automaticRestart = false to include instances only if they
  89473. // are not scheduled for automatic restarts. You can use filtering on
  89474. // nested fields to filter based on resource labels.
  89475. //
  89476. // To filter on multiple expressions, provide each separate expression
  89477. // within parentheses. For example, (scheduling.automaticRestart = true)
  89478. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  89479. // AND expression. However, you can include AND and OR expressions
  89480. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  89481. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  89482. // true).
  89483. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  89484. c.urlParams_.Set("filter", filter)
  89485. return c
  89486. }
  89487. // MaxResults sets the optional parameter "maxResults": The maximum
  89488. // number of results per page that should be returned. If the number of
  89489. // available results is larger than maxResults, Compute Engine returns a
  89490. // nextPageToken that can be used to get the next page of results in
  89491. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  89492. // (Default: 500)
  89493. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  89494. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  89495. return c
  89496. }
  89497. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  89498. // a certain order. By default, results are returned in alphanumerical
  89499. // order based on the resource name.
  89500. //
  89501. // You can also sort results in descending order based on the creation
  89502. // timestamp using orderBy="creationTimestamp desc". This sorts results
  89503. // based on the creationTimestamp field in reverse chronological order
  89504. // (newest result first). Use this to sort resources like operations so
  89505. // that the newest operation is returned first.
  89506. //
  89507. // Currently, only sorting by name or creationTimestamp desc is
  89508. // supported.
  89509. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  89510. c.urlParams_.Set("orderBy", orderBy)
  89511. return c
  89512. }
  89513. // PageToken sets the optional parameter "pageToken": Specifies a page
  89514. // token to use. Set pageToken to the nextPageToken returned by a
  89515. // previous list request to get the next page of results.
  89516. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  89517. c.urlParams_.Set("pageToken", pageToken)
  89518. return c
  89519. }
  89520. // Fields allows partial responses to be retrieved. See
  89521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89522. // for more information.
  89523. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  89524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89525. return c
  89526. }
  89527. // IfNoneMatch sets the optional parameter which makes the operation
  89528. // fail if the object's ETag matches the given value. This is useful for
  89529. // getting updates only after the object has changed since the last
  89530. // request. Use googleapi.IsNotModified to check whether the response
  89531. // error from Do is the result of In-None-Match.
  89532. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  89533. c.ifNoneMatch_ = entityTag
  89534. return c
  89535. }
  89536. // Context sets the context to be used in this call's Do method. Any
  89537. // pending HTTP request will be aborted if the provided context is
  89538. // canceled.
  89539. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  89540. c.ctx_ = ctx
  89541. return c
  89542. }
  89543. // Header returns an http.Header that can be modified by the caller to
  89544. // add HTTP headers to the request.
  89545. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  89546. if c.header_ == nil {
  89547. c.header_ = make(http.Header)
  89548. }
  89549. return c.header_
  89550. }
  89551. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  89552. reqHeaders := make(http.Header)
  89553. for k, v := range c.header_ {
  89554. reqHeaders[k] = v
  89555. }
  89556. reqHeaders.Set("User-Agent", c.s.userAgent())
  89557. if c.ifNoneMatch_ != "" {
  89558. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89559. }
  89560. var body io.Reader = nil
  89561. c.urlParams_.Set("alt", alt)
  89562. c.urlParams_.Set("prettyPrint", "false")
  89563. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  89564. urls += "?" + c.urlParams_.Encode()
  89565. req, err := http.NewRequest("GET", urls, body)
  89566. if err != nil {
  89567. return nil, err
  89568. }
  89569. req.Header = reqHeaders
  89570. googleapi.Expand(req.URL, map[string]string{
  89571. "project": c.project,
  89572. "region": c.region,
  89573. })
  89574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89575. }
  89576. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  89577. // Exactly one of *RegionInstanceGroupManagerList or error will be
  89578. // non-nil. Any non-2xx status code is an error. Response headers are in
  89579. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  89580. // response was returned at all) in error.(*googleapi.Error).Header. Use
  89581. // googleapi.IsNotModified to check whether the returned error was
  89582. // because http.StatusNotModified was returned.
  89583. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  89584. gensupport.SetOptions(c.urlParams_, opts...)
  89585. res, err := c.doRequest("json")
  89586. if res != nil && res.StatusCode == http.StatusNotModified {
  89587. if res.Body != nil {
  89588. res.Body.Close()
  89589. }
  89590. return nil, &googleapi.Error{
  89591. Code: res.StatusCode,
  89592. Header: res.Header,
  89593. }
  89594. }
  89595. if err != nil {
  89596. return nil, err
  89597. }
  89598. defer googleapi.CloseBody(res)
  89599. if err := googleapi.CheckResponse(res); err != nil {
  89600. return nil, err
  89601. }
  89602. ret := &RegionInstanceGroupManagerList{
  89603. ServerResponse: googleapi.ServerResponse{
  89604. Header: res.Header,
  89605. HTTPStatusCode: res.StatusCode,
  89606. },
  89607. }
  89608. target := &ret
  89609. if err := gensupport.DecodeResponse(target, res); err != nil {
  89610. return nil, err
  89611. }
  89612. return ret, nil
  89613. // {
  89614. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  89615. // "httpMethod": "GET",
  89616. // "id": "compute.regionInstanceGroupManagers.list",
  89617. // "parameterOrder": [
  89618. // "project",
  89619. // "region"
  89620. // ],
  89621. // "parameters": {
  89622. // "filter": {
  89623. // "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).",
  89624. // "location": "query",
  89625. // "type": "string"
  89626. // },
  89627. // "maxResults": {
  89628. // "default": "500",
  89629. // "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)",
  89630. // "format": "uint32",
  89631. // "location": "query",
  89632. // "minimum": "0",
  89633. // "type": "integer"
  89634. // },
  89635. // "orderBy": {
  89636. // "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.",
  89637. // "location": "query",
  89638. // "type": "string"
  89639. // },
  89640. // "pageToken": {
  89641. // "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.",
  89642. // "location": "query",
  89643. // "type": "string"
  89644. // },
  89645. // "project": {
  89646. // "description": "Project ID for this request.",
  89647. // "location": "path",
  89648. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89649. // "required": true,
  89650. // "type": "string"
  89651. // },
  89652. // "region": {
  89653. // "description": "Name of the region scoping this request.",
  89654. // "location": "path",
  89655. // "required": true,
  89656. // "type": "string"
  89657. // }
  89658. // },
  89659. // "path": "{project}/regions/{region}/instanceGroupManagers",
  89660. // "response": {
  89661. // "$ref": "RegionInstanceGroupManagerList"
  89662. // },
  89663. // "scopes": [
  89664. // "https://www.googleapis.com/auth/cloud-platform",
  89665. // "https://www.googleapis.com/auth/compute",
  89666. // "https://www.googleapis.com/auth/compute.readonly"
  89667. // ]
  89668. // }
  89669. }
  89670. // Pages invokes f for each page of results.
  89671. // A non-nil error returned from f will halt the iteration.
  89672. // The provided context supersedes any context provided to the Context method.
  89673. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  89674. c.ctx_ = ctx
  89675. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89676. for {
  89677. x, err := c.Do()
  89678. if err != nil {
  89679. return err
  89680. }
  89681. if err := f(x); err != nil {
  89682. return err
  89683. }
  89684. if x.NextPageToken == "" {
  89685. return nil
  89686. }
  89687. c.PageToken(x.NextPageToken)
  89688. }
  89689. }
  89690. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  89691. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  89692. s *Service
  89693. project string
  89694. region string
  89695. instanceGroupManager string
  89696. urlParams_ gensupport.URLParams
  89697. ctx_ context.Context
  89698. header_ http.Header
  89699. }
  89700. // ListManagedInstances: Lists the instances in the managed instance
  89701. // group and instances that are scheduled to be created. The list
  89702. // includes any current actions that the group has scheduled for its
  89703. // instances.
  89704. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  89705. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89706. c.project = project
  89707. c.region = region
  89708. c.instanceGroupManager = instanceGroupManager
  89709. return c
  89710. }
  89711. // Filter sets the optional parameter "filter": A filter expression that
  89712. // filters resources listed in the response. The expression must specify
  89713. // the field name, a comparison operator, and the value that you want to
  89714. // use for filtering. The value must be a string, a number, or a
  89715. // boolean. The comparison operator must be either =, !=, >, or <.
  89716. //
  89717. // For example, if you are filtering Compute Engine instances, you can
  89718. // exclude instances named example-instance by specifying name !=
  89719. // example-instance.
  89720. //
  89721. // You can also filter nested fields. For example, you could specify
  89722. // scheduling.automaticRestart = false to include instances only if they
  89723. // are not scheduled for automatic restarts. You can use filtering on
  89724. // nested fields to filter based on resource labels.
  89725. //
  89726. // To filter on multiple expressions, provide each separate expression
  89727. // within parentheses. For example, (scheduling.automaticRestart = true)
  89728. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  89729. // AND expression. However, you can include AND and OR expressions
  89730. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  89731. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  89732. // true).
  89733. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  89734. c.urlParams_.Set("filter", filter)
  89735. return c
  89736. }
  89737. // MaxResults sets the optional parameter "maxResults": The maximum
  89738. // number of results per page that should be returned. If the number of
  89739. // available results is larger than maxResults, Compute Engine returns a
  89740. // nextPageToken that can be used to get the next page of results in
  89741. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  89742. // (Default: 500)
  89743. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  89744. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  89745. return c
  89746. }
  89747. // OrderBy sets the optional parameter "order_by": Sorts list results by
  89748. // a certain order. By default, results are returned in alphanumerical
  89749. // order based on the resource name.
  89750. //
  89751. // You can also sort results in descending order based on the creation
  89752. // timestamp using orderBy="creationTimestamp desc". This sorts results
  89753. // based on the creationTimestamp field in reverse chronological order
  89754. // (newest result first). Use this to sort resources like operations so
  89755. // that the newest operation is returned first.
  89756. //
  89757. // Currently, only sorting by name or creationTimestamp desc is
  89758. // supported.
  89759. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  89760. c.urlParams_.Set("order_by", orderBy)
  89761. return c
  89762. }
  89763. // PageToken sets the optional parameter "pageToken": Specifies a page
  89764. // token to use. Set pageToken to the nextPageToken returned by a
  89765. // previous list request to get the next page of results.
  89766. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  89767. c.urlParams_.Set("pageToken", pageToken)
  89768. return c
  89769. }
  89770. // Fields allows partial responses to be retrieved. See
  89771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89772. // for more information.
  89773. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  89774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89775. return c
  89776. }
  89777. // Context sets the context to be used in this call's Do method. Any
  89778. // pending HTTP request will be aborted if the provided context is
  89779. // canceled.
  89780. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  89781. c.ctx_ = ctx
  89782. return c
  89783. }
  89784. // Header returns an http.Header that can be modified by the caller to
  89785. // add HTTP headers to the request.
  89786. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  89787. if c.header_ == nil {
  89788. c.header_ = make(http.Header)
  89789. }
  89790. return c.header_
  89791. }
  89792. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  89793. reqHeaders := make(http.Header)
  89794. for k, v := range c.header_ {
  89795. reqHeaders[k] = v
  89796. }
  89797. reqHeaders.Set("User-Agent", c.s.userAgent())
  89798. var body io.Reader = nil
  89799. c.urlParams_.Set("alt", alt)
  89800. c.urlParams_.Set("prettyPrint", "false")
  89801. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  89802. urls += "?" + c.urlParams_.Encode()
  89803. req, err := http.NewRequest("POST", urls, body)
  89804. if err != nil {
  89805. return nil, err
  89806. }
  89807. req.Header = reqHeaders
  89808. googleapi.Expand(req.URL, map[string]string{
  89809. "project": c.project,
  89810. "region": c.region,
  89811. "instanceGroupManager": c.instanceGroupManager,
  89812. })
  89813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89814. }
  89815. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  89816. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  89817. // error will be non-nil. Any non-2xx status code is an error. Response
  89818. // headers are in either
  89819. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  89820. // r or (if a response was returned at all) in
  89821. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  89822. // whether the returned error was because http.StatusNotModified was
  89823. // returned.
  89824. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  89825. gensupport.SetOptions(c.urlParams_, opts...)
  89826. res, err := c.doRequest("json")
  89827. if res != nil && res.StatusCode == http.StatusNotModified {
  89828. if res.Body != nil {
  89829. res.Body.Close()
  89830. }
  89831. return nil, &googleapi.Error{
  89832. Code: res.StatusCode,
  89833. Header: res.Header,
  89834. }
  89835. }
  89836. if err != nil {
  89837. return nil, err
  89838. }
  89839. defer googleapi.CloseBody(res)
  89840. if err := googleapi.CheckResponse(res); err != nil {
  89841. return nil, err
  89842. }
  89843. ret := &RegionInstanceGroupManagersListInstancesResponse{
  89844. ServerResponse: googleapi.ServerResponse{
  89845. Header: res.Header,
  89846. HTTPStatusCode: res.StatusCode,
  89847. },
  89848. }
  89849. target := &ret
  89850. if err := gensupport.DecodeResponse(target, res); err != nil {
  89851. return nil, err
  89852. }
  89853. return ret, nil
  89854. // {
  89855. // "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.",
  89856. // "httpMethod": "POST",
  89857. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  89858. // "parameterOrder": [
  89859. // "project",
  89860. // "region",
  89861. // "instanceGroupManager"
  89862. // ],
  89863. // "parameters": {
  89864. // "filter": {
  89865. // "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).",
  89866. // "location": "query",
  89867. // "type": "string"
  89868. // },
  89869. // "instanceGroupManager": {
  89870. // "description": "The name of the managed instance group.",
  89871. // "location": "path",
  89872. // "required": true,
  89873. // "type": "string"
  89874. // },
  89875. // "maxResults": {
  89876. // "default": "500",
  89877. // "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)",
  89878. // "format": "uint32",
  89879. // "location": "query",
  89880. // "minimum": "0",
  89881. // "type": "integer"
  89882. // },
  89883. // "order_by": {
  89884. // "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.",
  89885. // "location": "query",
  89886. // "type": "string"
  89887. // },
  89888. // "pageToken": {
  89889. // "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.",
  89890. // "location": "query",
  89891. // "type": "string"
  89892. // },
  89893. // "project": {
  89894. // "description": "Project ID for this request.",
  89895. // "location": "path",
  89896. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89897. // "required": true,
  89898. // "type": "string"
  89899. // },
  89900. // "region": {
  89901. // "description": "Name of the region scoping this request.",
  89902. // "location": "path",
  89903. // "required": true,
  89904. // "type": "string"
  89905. // }
  89906. // },
  89907. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  89908. // "response": {
  89909. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  89910. // },
  89911. // "scopes": [
  89912. // "https://www.googleapis.com/auth/cloud-platform",
  89913. // "https://www.googleapis.com/auth/compute",
  89914. // "https://www.googleapis.com/auth/compute.readonly"
  89915. // ]
  89916. // }
  89917. }
  89918. // Pages invokes f for each page of results.
  89919. // A non-nil error returned from f will halt the iteration.
  89920. // The provided context supersedes any context provided to the Context method.
  89921. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) error) error {
  89922. c.ctx_ = ctx
  89923. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89924. for {
  89925. x, err := c.Do()
  89926. if err != nil {
  89927. return err
  89928. }
  89929. if err := f(x); err != nil {
  89930. return err
  89931. }
  89932. if x.NextPageToken == "" {
  89933. return nil
  89934. }
  89935. c.PageToken(x.NextPageToken)
  89936. }
  89937. }
  89938. // method id "compute.regionInstanceGroupManagers.patch":
  89939. type RegionInstanceGroupManagersPatchCall struct {
  89940. s *Service
  89941. project string
  89942. region string
  89943. instanceGroupManager string
  89944. instancegroupmanager *InstanceGroupManager
  89945. urlParams_ gensupport.URLParams
  89946. ctx_ context.Context
  89947. header_ http.Header
  89948. }
  89949. // Patch: Updates a managed instance group using the information that
  89950. // you specify in the request. This operation is marked as DONE when the
  89951. // group is patched even if the instances in the group are still in the
  89952. // process of being patched. You must separately verify the status of
  89953. // the individual instances with the listmanagedinstances method. This
  89954. // method supports PATCH semantics and uses the JSON merge patch format
  89955. // and processing rules.
  89956. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  89957. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89958. c.project = project
  89959. c.region = region
  89960. c.instanceGroupManager = instanceGroupManager
  89961. c.instancegroupmanager = instancegroupmanager
  89962. return c
  89963. }
  89964. // RequestId sets the optional parameter "requestId": An optional
  89965. // request ID to identify requests. Specify a unique request ID so that
  89966. // if you must retry your request, the server will know to ignore the
  89967. // request if it has already been completed.
  89968. //
  89969. // For example, consider a situation where you make an initial request
  89970. // and the request times out. If you make the request again with the
  89971. // same request ID, the server can check if original operation with the
  89972. // same request ID was received, and if so, will ignore the second
  89973. // request. This prevents clients from accidentally creating duplicate
  89974. // commitments.
  89975. //
  89976. // The request ID must be a valid UUID with the exception that zero UUID
  89977. // is not supported (00000000-0000-0000-0000-000000000000).
  89978. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  89979. c.urlParams_.Set("requestId", requestId)
  89980. return c
  89981. }
  89982. // Fields allows partial responses to be retrieved. See
  89983. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89984. // for more information.
  89985. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  89986. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89987. return c
  89988. }
  89989. // Context sets the context to be used in this call's Do method. Any
  89990. // pending HTTP request will be aborted if the provided context is
  89991. // canceled.
  89992. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  89993. c.ctx_ = ctx
  89994. return c
  89995. }
  89996. // Header returns an http.Header that can be modified by the caller to
  89997. // add HTTP headers to the request.
  89998. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  89999. if c.header_ == nil {
  90000. c.header_ = make(http.Header)
  90001. }
  90002. return c.header_
  90003. }
  90004. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  90005. reqHeaders := make(http.Header)
  90006. for k, v := range c.header_ {
  90007. reqHeaders[k] = v
  90008. }
  90009. reqHeaders.Set("User-Agent", c.s.userAgent())
  90010. var body io.Reader = nil
  90011. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  90012. if err != nil {
  90013. return nil, err
  90014. }
  90015. reqHeaders.Set("Content-Type", "application/json")
  90016. c.urlParams_.Set("alt", alt)
  90017. c.urlParams_.Set("prettyPrint", "false")
  90018. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  90019. urls += "?" + c.urlParams_.Encode()
  90020. req, err := http.NewRequest("PATCH", urls, body)
  90021. if err != nil {
  90022. return nil, err
  90023. }
  90024. req.Header = reqHeaders
  90025. googleapi.Expand(req.URL, map[string]string{
  90026. "project": c.project,
  90027. "region": c.region,
  90028. "instanceGroupManager": c.instanceGroupManager,
  90029. })
  90030. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90031. }
  90032. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  90033. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90034. // status code is an error. Response headers are in either
  90035. // *Operation.ServerResponse.Header or (if a response was returned at
  90036. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90037. // to check whether the returned error was because
  90038. // http.StatusNotModified was returned.
  90039. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90040. gensupport.SetOptions(c.urlParams_, opts...)
  90041. res, err := c.doRequest("json")
  90042. if res != nil && res.StatusCode == http.StatusNotModified {
  90043. if res.Body != nil {
  90044. res.Body.Close()
  90045. }
  90046. return nil, &googleapi.Error{
  90047. Code: res.StatusCode,
  90048. Header: res.Header,
  90049. }
  90050. }
  90051. if err != nil {
  90052. return nil, err
  90053. }
  90054. defer googleapi.CloseBody(res)
  90055. if err := googleapi.CheckResponse(res); err != nil {
  90056. return nil, err
  90057. }
  90058. ret := &Operation{
  90059. ServerResponse: googleapi.ServerResponse{
  90060. Header: res.Header,
  90061. HTTPStatusCode: res.StatusCode,
  90062. },
  90063. }
  90064. target := &ret
  90065. if err := gensupport.DecodeResponse(target, res); err != nil {
  90066. return nil, err
  90067. }
  90068. return ret, nil
  90069. // {
  90070. // "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.",
  90071. // "httpMethod": "PATCH",
  90072. // "id": "compute.regionInstanceGroupManagers.patch",
  90073. // "parameterOrder": [
  90074. // "project",
  90075. // "region",
  90076. // "instanceGroupManager"
  90077. // ],
  90078. // "parameters": {
  90079. // "instanceGroupManager": {
  90080. // "description": "The name of the instance group manager.",
  90081. // "location": "path",
  90082. // "required": true,
  90083. // "type": "string"
  90084. // },
  90085. // "project": {
  90086. // "description": "Project ID for this request.",
  90087. // "location": "path",
  90088. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90089. // "required": true,
  90090. // "type": "string"
  90091. // },
  90092. // "region": {
  90093. // "description": "Name of the region scoping this request.",
  90094. // "location": "path",
  90095. // "required": true,
  90096. // "type": "string"
  90097. // },
  90098. // "requestId": {
  90099. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90100. // "location": "query",
  90101. // "type": "string"
  90102. // }
  90103. // },
  90104. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  90105. // "request": {
  90106. // "$ref": "InstanceGroupManager"
  90107. // },
  90108. // "response": {
  90109. // "$ref": "Operation"
  90110. // },
  90111. // "scopes": [
  90112. // "https://www.googleapis.com/auth/cloud-platform",
  90113. // "https://www.googleapis.com/auth/compute"
  90114. // ]
  90115. // }
  90116. }
  90117. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  90118. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  90119. s *Service
  90120. project string
  90121. region string
  90122. instanceGroupManager string
  90123. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  90124. urlParams_ gensupport.URLParams
  90125. ctx_ context.Context
  90126. header_ http.Header
  90127. }
  90128. // RecreateInstances: Flags the specified instances in the managed
  90129. // instance group to be immediately recreated. The instances are deleted
  90130. // and recreated using the current instance template for the managed
  90131. // instance group. This operation is marked as DONE when the flag is set
  90132. // even if the instances have not yet been recreated. You must
  90133. // separately verify the status of the recreating action with the
  90134. // listmanagedinstances method.
  90135. //
  90136. // If the group is part of a backend service that has enabled connection
  90137. // draining, it can take up to 60 seconds after the connection draining
  90138. // duration has elapsed before the VM instance is removed or
  90139. // deleted.
  90140. //
  90141. // You can specify a maximum of 1000 instances with this method per
  90142. // request.
  90143. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  90144. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90145. c.project = project
  90146. c.region = region
  90147. c.instanceGroupManager = instanceGroupManager
  90148. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  90149. return c
  90150. }
  90151. // RequestId sets the optional parameter "requestId": An optional
  90152. // request ID to identify requests. Specify a unique request ID so that
  90153. // if you must retry your request, the server will know to ignore the
  90154. // request if it has already been completed.
  90155. //
  90156. // For example, consider a situation where you make an initial request
  90157. // and the request times out. If you make the request again with the
  90158. // same request ID, the server can check if original operation with the
  90159. // same request ID was received, and if so, will ignore the second
  90160. // request. This prevents clients from accidentally creating duplicate
  90161. // commitments.
  90162. //
  90163. // The request ID must be a valid UUID with the exception that zero UUID
  90164. // is not supported (00000000-0000-0000-0000-000000000000).
  90165. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  90166. c.urlParams_.Set("requestId", requestId)
  90167. return c
  90168. }
  90169. // Fields allows partial responses to be retrieved. See
  90170. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90171. // for more information.
  90172. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  90173. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90174. return c
  90175. }
  90176. // Context sets the context to be used in this call's Do method. Any
  90177. // pending HTTP request will be aborted if the provided context is
  90178. // canceled.
  90179. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  90180. c.ctx_ = ctx
  90181. return c
  90182. }
  90183. // Header returns an http.Header that can be modified by the caller to
  90184. // add HTTP headers to the request.
  90185. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  90186. if c.header_ == nil {
  90187. c.header_ = make(http.Header)
  90188. }
  90189. return c.header_
  90190. }
  90191. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  90192. reqHeaders := make(http.Header)
  90193. for k, v := range c.header_ {
  90194. reqHeaders[k] = v
  90195. }
  90196. reqHeaders.Set("User-Agent", c.s.userAgent())
  90197. var body io.Reader = nil
  90198. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  90199. if err != nil {
  90200. return nil, err
  90201. }
  90202. reqHeaders.Set("Content-Type", "application/json")
  90203. c.urlParams_.Set("alt", alt)
  90204. c.urlParams_.Set("prettyPrint", "false")
  90205. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  90206. urls += "?" + c.urlParams_.Encode()
  90207. req, err := http.NewRequest("POST", urls, body)
  90208. if err != nil {
  90209. return nil, err
  90210. }
  90211. req.Header = reqHeaders
  90212. googleapi.Expand(req.URL, map[string]string{
  90213. "project": c.project,
  90214. "region": c.region,
  90215. "instanceGroupManager": c.instanceGroupManager,
  90216. })
  90217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90218. }
  90219. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  90220. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90221. // status code is an error. Response headers are in either
  90222. // *Operation.ServerResponse.Header or (if a response was returned at
  90223. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90224. // to check whether the returned error was because
  90225. // http.StatusNotModified was returned.
  90226. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90227. gensupport.SetOptions(c.urlParams_, opts...)
  90228. res, err := c.doRequest("json")
  90229. if res != nil && res.StatusCode == http.StatusNotModified {
  90230. if res.Body != nil {
  90231. res.Body.Close()
  90232. }
  90233. return nil, &googleapi.Error{
  90234. Code: res.StatusCode,
  90235. Header: res.Header,
  90236. }
  90237. }
  90238. if err != nil {
  90239. return nil, err
  90240. }
  90241. defer googleapi.CloseBody(res)
  90242. if err := googleapi.CheckResponse(res); err != nil {
  90243. return nil, err
  90244. }
  90245. ret := &Operation{
  90246. ServerResponse: googleapi.ServerResponse{
  90247. Header: res.Header,
  90248. HTTPStatusCode: res.StatusCode,
  90249. },
  90250. }
  90251. target := &ret
  90252. if err := gensupport.DecodeResponse(target, res); err != nil {
  90253. return nil, err
  90254. }
  90255. return ret, nil
  90256. // {
  90257. // "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.",
  90258. // "httpMethod": "POST",
  90259. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  90260. // "parameterOrder": [
  90261. // "project",
  90262. // "region",
  90263. // "instanceGroupManager"
  90264. // ],
  90265. // "parameters": {
  90266. // "instanceGroupManager": {
  90267. // "description": "Name of the managed instance group.",
  90268. // "location": "path",
  90269. // "required": true,
  90270. // "type": "string"
  90271. // },
  90272. // "project": {
  90273. // "description": "Project ID for this request.",
  90274. // "location": "path",
  90275. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90276. // "required": true,
  90277. // "type": "string"
  90278. // },
  90279. // "region": {
  90280. // "description": "Name of the region scoping this request.",
  90281. // "location": "path",
  90282. // "required": true,
  90283. // "type": "string"
  90284. // },
  90285. // "requestId": {
  90286. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90287. // "location": "query",
  90288. // "type": "string"
  90289. // }
  90290. // },
  90291. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  90292. // "request": {
  90293. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  90294. // },
  90295. // "response": {
  90296. // "$ref": "Operation"
  90297. // },
  90298. // "scopes": [
  90299. // "https://www.googleapis.com/auth/cloud-platform",
  90300. // "https://www.googleapis.com/auth/compute"
  90301. // ]
  90302. // }
  90303. }
  90304. // method id "compute.regionInstanceGroupManagers.resize":
  90305. type RegionInstanceGroupManagersResizeCall struct {
  90306. s *Service
  90307. project string
  90308. region string
  90309. instanceGroupManager string
  90310. urlParams_ gensupport.URLParams
  90311. ctx_ context.Context
  90312. header_ http.Header
  90313. }
  90314. // Resize: Changes the intended size of the managed instance group. If
  90315. // you increase the size, the group creates new instances using the
  90316. // current instance template. If you decrease the size, the group
  90317. // deletes one or more instances.
  90318. //
  90319. // The resize operation is marked DONE if the resize request is
  90320. // successful. The underlying actions take additional time. You must
  90321. // separately verify the status of the creating or deleting actions with
  90322. // the listmanagedinstances method.
  90323. //
  90324. // If the group is part of a backend service that has enabled connection
  90325. // draining, it can take up to 60 seconds after the connection draining
  90326. // duration has elapsed before the VM instance is removed or deleted.
  90327. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  90328. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90329. c.project = project
  90330. c.region = region
  90331. c.instanceGroupManager = instanceGroupManager
  90332. c.urlParams_.Set("size", fmt.Sprint(size))
  90333. return c
  90334. }
  90335. // RequestId sets the optional parameter "requestId": An optional
  90336. // request ID to identify requests. Specify a unique request ID so that
  90337. // if you must retry your request, the server will know to ignore the
  90338. // request if it has already been completed.
  90339. //
  90340. // For example, consider a situation where you make an initial request
  90341. // and the request times out. If you make the request again with the
  90342. // same request ID, the server can check if original operation with the
  90343. // same request ID was received, and if so, will ignore the second
  90344. // request. This prevents clients from accidentally creating duplicate
  90345. // commitments.
  90346. //
  90347. // The request ID must be a valid UUID with the exception that zero UUID
  90348. // is not supported (00000000-0000-0000-0000-000000000000).
  90349. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  90350. c.urlParams_.Set("requestId", requestId)
  90351. return c
  90352. }
  90353. // Fields allows partial responses to be retrieved. See
  90354. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90355. // for more information.
  90356. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  90357. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90358. return c
  90359. }
  90360. // Context sets the context to be used in this call's Do method. Any
  90361. // pending HTTP request will be aborted if the provided context is
  90362. // canceled.
  90363. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  90364. c.ctx_ = ctx
  90365. return c
  90366. }
  90367. // Header returns an http.Header that can be modified by the caller to
  90368. // add HTTP headers to the request.
  90369. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  90370. if c.header_ == nil {
  90371. c.header_ = make(http.Header)
  90372. }
  90373. return c.header_
  90374. }
  90375. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  90376. reqHeaders := make(http.Header)
  90377. for k, v := range c.header_ {
  90378. reqHeaders[k] = v
  90379. }
  90380. reqHeaders.Set("User-Agent", c.s.userAgent())
  90381. var body io.Reader = nil
  90382. c.urlParams_.Set("alt", alt)
  90383. c.urlParams_.Set("prettyPrint", "false")
  90384. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  90385. urls += "?" + c.urlParams_.Encode()
  90386. req, err := http.NewRequest("POST", urls, body)
  90387. if err != nil {
  90388. return nil, err
  90389. }
  90390. req.Header = reqHeaders
  90391. googleapi.Expand(req.URL, map[string]string{
  90392. "project": c.project,
  90393. "region": c.region,
  90394. "instanceGroupManager": c.instanceGroupManager,
  90395. })
  90396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90397. }
  90398. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  90399. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90400. // status code is an error. Response headers are in either
  90401. // *Operation.ServerResponse.Header or (if a response was returned at
  90402. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90403. // to check whether the returned error was because
  90404. // http.StatusNotModified was returned.
  90405. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90406. gensupport.SetOptions(c.urlParams_, opts...)
  90407. res, err := c.doRequest("json")
  90408. if res != nil && res.StatusCode == http.StatusNotModified {
  90409. if res.Body != nil {
  90410. res.Body.Close()
  90411. }
  90412. return nil, &googleapi.Error{
  90413. Code: res.StatusCode,
  90414. Header: res.Header,
  90415. }
  90416. }
  90417. if err != nil {
  90418. return nil, err
  90419. }
  90420. defer googleapi.CloseBody(res)
  90421. if err := googleapi.CheckResponse(res); err != nil {
  90422. return nil, err
  90423. }
  90424. ret := &Operation{
  90425. ServerResponse: googleapi.ServerResponse{
  90426. Header: res.Header,
  90427. HTTPStatusCode: res.StatusCode,
  90428. },
  90429. }
  90430. target := &ret
  90431. if err := gensupport.DecodeResponse(target, res); err != nil {
  90432. return nil, err
  90433. }
  90434. return ret, nil
  90435. // {
  90436. // "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.",
  90437. // "httpMethod": "POST",
  90438. // "id": "compute.regionInstanceGroupManagers.resize",
  90439. // "parameterOrder": [
  90440. // "project",
  90441. // "region",
  90442. // "instanceGroupManager",
  90443. // "size"
  90444. // ],
  90445. // "parameters": {
  90446. // "instanceGroupManager": {
  90447. // "description": "Name of the managed instance group.",
  90448. // "location": "path",
  90449. // "required": true,
  90450. // "type": "string"
  90451. // },
  90452. // "project": {
  90453. // "description": "Project ID for this request.",
  90454. // "location": "path",
  90455. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90456. // "required": true,
  90457. // "type": "string"
  90458. // },
  90459. // "region": {
  90460. // "description": "Name of the region scoping this request.",
  90461. // "location": "path",
  90462. // "required": true,
  90463. // "type": "string"
  90464. // },
  90465. // "requestId": {
  90466. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90467. // "location": "query",
  90468. // "type": "string"
  90469. // },
  90470. // "size": {
  90471. // "description": "Number of instances that should exist in this instance group manager.",
  90472. // "format": "int32",
  90473. // "location": "query",
  90474. // "minimum": "0",
  90475. // "required": true,
  90476. // "type": "integer"
  90477. // }
  90478. // },
  90479. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  90480. // "response": {
  90481. // "$ref": "Operation"
  90482. // },
  90483. // "scopes": [
  90484. // "https://www.googleapis.com/auth/cloud-platform",
  90485. // "https://www.googleapis.com/auth/compute"
  90486. // ]
  90487. // }
  90488. }
  90489. // method id "compute.regionInstanceGroupManagers.setAutoHealingPolicies":
  90490. type RegionInstanceGroupManagersSetAutoHealingPoliciesCall struct {
  90491. s *Service
  90492. project string
  90493. region string
  90494. instanceGroupManager string
  90495. regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest
  90496. urlParams_ gensupport.URLParams
  90497. ctx_ context.Context
  90498. header_ http.Header
  90499. }
  90500. // SetAutoHealingPolicies: Modifies the autohealing policy for the
  90501. // instances in this managed instance group. [Deprecated] This method is
  90502. // deprecated. Please use Patch instead.
  90503. func (r *RegionInstanceGroupManagersService) SetAutoHealingPolicies(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  90504. c := &RegionInstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90505. c.project = project
  90506. c.region = region
  90507. c.instanceGroupManager = instanceGroupManager
  90508. c.regioninstancegroupmanagerssetautohealingrequest = regioninstancegroupmanagerssetautohealingrequest
  90509. return c
  90510. }
  90511. // RequestId sets the optional parameter "requestId": An optional
  90512. // request ID to identify requests. Specify a unique request ID so that
  90513. // if you must retry your request, the server will know to ignore the
  90514. // request if it has already been completed.
  90515. //
  90516. // For example, consider a situation where you make an initial request
  90517. // and the request times out. If you make the request again with the
  90518. // same request ID, the server can check if original operation with the
  90519. // same request ID was received, and if so, will ignore the second
  90520. // request. This prevents clients from accidentally creating duplicate
  90521. // commitments.
  90522. //
  90523. // The request ID must be a valid UUID with the exception that zero UUID
  90524. // is not supported (00000000-0000-0000-0000-000000000000).
  90525. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  90526. c.urlParams_.Set("requestId", requestId)
  90527. return c
  90528. }
  90529. // Fields allows partial responses to be retrieved. See
  90530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90531. // for more information.
  90532. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  90533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90534. return c
  90535. }
  90536. // Context sets the context to be used in this call's Do method. Any
  90537. // pending HTTP request will be aborted if the provided context is
  90538. // canceled.
  90539. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  90540. c.ctx_ = ctx
  90541. return c
  90542. }
  90543. // Header returns an http.Header that can be modified by the caller to
  90544. // add HTTP headers to the request.
  90545. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  90546. if c.header_ == nil {
  90547. c.header_ = make(http.Header)
  90548. }
  90549. return c.header_
  90550. }
  90551. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  90552. reqHeaders := make(http.Header)
  90553. for k, v := range c.header_ {
  90554. reqHeaders[k] = v
  90555. }
  90556. reqHeaders.Set("User-Agent", c.s.userAgent())
  90557. var body io.Reader = nil
  90558. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssetautohealingrequest)
  90559. if err != nil {
  90560. return nil, err
  90561. }
  90562. reqHeaders.Set("Content-Type", "application/json")
  90563. c.urlParams_.Set("alt", alt)
  90564. c.urlParams_.Set("prettyPrint", "false")
  90565. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  90566. urls += "?" + c.urlParams_.Encode()
  90567. req, err := http.NewRequest("POST", urls, body)
  90568. if err != nil {
  90569. return nil, err
  90570. }
  90571. req.Header = reqHeaders
  90572. googleapi.Expand(req.URL, map[string]string{
  90573. "project": c.project,
  90574. "region": c.region,
  90575. "instanceGroupManager": c.instanceGroupManager,
  90576. })
  90577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90578. }
  90579. // Do executes the "compute.regionInstanceGroupManagers.setAutoHealingPolicies" call.
  90580. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90581. // status code is an error. Response headers are in either
  90582. // *Operation.ServerResponse.Header or (if a response was returned at
  90583. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90584. // to check whether the returned error was because
  90585. // http.StatusNotModified was returned.
  90586. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90587. gensupport.SetOptions(c.urlParams_, opts...)
  90588. res, err := c.doRequest("json")
  90589. if res != nil && res.StatusCode == http.StatusNotModified {
  90590. if res.Body != nil {
  90591. res.Body.Close()
  90592. }
  90593. return nil, &googleapi.Error{
  90594. Code: res.StatusCode,
  90595. Header: res.Header,
  90596. }
  90597. }
  90598. if err != nil {
  90599. return nil, err
  90600. }
  90601. defer googleapi.CloseBody(res)
  90602. if err := googleapi.CheckResponse(res); err != nil {
  90603. return nil, err
  90604. }
  90605. ret := &Operation{
  90606. ServerResponse: googleapi.ServerResponse{
  90607. Header: res.Header,
  90608. HTTPStatusCode: res.StatusCode,
  90609. },
  90610. }
  90611. target := &ret
  90612. if err := gensupport.DecodeResponse(target, res); err != nil {
  90613. return nil, err
  90614. }
  90615. return ret, nil
  90616. // {
  90617. // "description": "Modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. Please use Patch instead.",
  90618. // "httpMethod": "POST",
  90619. // "id": "compute.regionInstanceGroupManagers.setAutoHealingPolicies",
  90620. // "parameterOrder": [
  90621. // "project",
  90622. // "region",
  90623. // "instanceGroupManager"
  90624. // ],
  90625. // "parameters": {
  90626. // "instanceGroupManager": {
  90627. // "description": "Name of the managed instance group.",
  90628. // "location": "path",
  90629. // "required": true,
  90630. // "type": "string"
  90631. // },
  90632. // "project": {
  90633. // "description": "Project ID for this request.",
  90634. // "location": "path",
  90635. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90636. // "required": true,
  90637. // "type": "string"
  90638. // },
  90639. // "region": {
  90640. // "description": "Name of the region scoping this request.",
  90641. // "location": "path",
  90642. // "required": true,
  90643. // "type": "string"
  90644. // },
  90645. // "requestId": {
  90646. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90647. // "location": "query",
  90648. // "type": "string"
  90649. // }
  90650. // },
  90651. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  90652. // "request": {
  90653. // "$ref": "RegionInstanceGroupManagersSetAutoHealingRequest"
  90654. // },
  90655. // "response": {
  90656. // "$ref": "Operation"
  90657. // },
  90658. // "scopes": [
  90659. // "https://www.googleapis.com/auth/cloud-platform",
  90660. // "https://www.googleapis.com/auth/compute"
  90661. // ]
  90662. // }
  90663. }
  90664. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  90665. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  90666. s *Service
  90667. project string
  90668. region string
  90669. instanceGroupManager string
  90670. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  90671. urlParams_ gensupport.URLParams
  90672. ctx_ context.Context
  90673. header_ http.Header
  90674. }
  90675. // SetInstanceTemplate: Sets the instance template to use when creating
  90676. // new instances or recreating instances in this group. Existing
  90677. // instances are not affected.
  90678. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  90679. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90680. c.project = project
  90681. c.region = region
  90682. c.instanceGroupManager = instanceGroupManager
  90683. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  90684. return c
  90685. }
  90686. // RequestId sets the optional parameter "requestId": An optional
  90687. // request ID to identify requests. Specify a unique request ID so that
  90688. // if you must retry your request, the server will know to ignore the
  90689. // request if it has already been completed.
  90690. //
  90691. // For example, consider a situation where you make an initial request
  90692. // and the request times out. If you make the request again with the
  90693. // same request ID, the server can check if original operation with the
  90694. // same request ID was received, and if so, will ignore the second
  90695. // request. This prevents clients from accidentally creating duplicate
  90696. // commitments.
  90697. //
  90698. // The request ID must be a valid UUID with the exception that zero UUID
  90699. // is not supported (00000000-0000-0000-0000-000000000000).
  90700. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  90701. c.urlParams_.Set("requestId", requestId)
  90702. return c
  90703. }
  90704. // Fields allows partial responses to be retrieved. See
  90705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90706. // for more information.
  90707. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  90708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90709. return c
  90710. }
  90711. // Context sets the context to be used in this call's Do method. Any
  90712. // pending HTTP request will be aborted if the provided context is
  90713. // canceled.
  90714. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  90715. c.ctx_ = ctx
  90716. return c
  90717. }
  90718. // Header returns an http.Header that can be modified by the caller to
  90719. // add HTTP headers to the request.
  90720. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  90721. if c.header_ == nil {
  90722. c.header_ = make(http.Header)
  90723. }
  90724. return c.header_
  90725. }
  90726. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  90727. reqHeaders := make(http.Header)
  90728. for k, v := range c.header_ {
  90729. reqHeaders[k] = v
  90730. }
  90731. reqHeaders.Set("User-Agent", c.s.userAgent())
  90732. var body io.Reader = nil
  90733. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  90734. if err != nil {
  90735. return nil, err
  90736. }
  90737. reqHeaders.Set("Content-Type", "application/json")
  90738. c.urlParams_.Set("alt", alt)
  90739. c.urlParams_.Set("prettyPrint", "false")
  90740. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  90741. urls += "?" + c.urlParams_.Encode()
  90742. req, err := http.NewRequest("POST", urls, body)
  90743. if err != nil {
  90744. return nil, err
  90745. }
  90746. req.Header = reqHeaders
  90747. googleapi.Expand(req.URL, map[string]string{
  90748. "project": c.project,
  90749. "region": c.region,
  90750. "instanceGroupManager": c.instanceGroupManager,
  90751. })
  90752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90753. }
  90754. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  90755. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90756. // status code is an error. Response headers are in either
  90757. // *Operation.ServerResponse.Header or (if a response was returned at
  90758. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90759. // to check whether the returned error was because
  90760. // http.StatusNotModified was returned.
  90761. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90762. gensupport.SetOptions(c.urlParams_, opts...)
  90763. res, err := c.doRequest("json")
  90764. if res != nil && res.StatusCode == http.StatusNotModified {
  90765. if res.Body != nil {
  90766. res.Body.Close()
  90767. }
  90768. return nil, &googleapi.Error{
  90769. Code: res.StatusCode,
  90770. Header: res.Header,
  90771. }
  90772. }
  90773. if err != nil {
  90774. return nil, err
  90775. }
  90776. defer googleapi.CloseBody(res)
  90777. if err := googleapi.CheckResponse(res); err != nil {
  90778. return nil, err
  90779. }
  90780. ret := &Operation{
  90781. ServerResponse: googleapi.ServerResponse{
  90782. Header: res.Header,
  90783. HTTPStatusCode: res.StatusCode,
  90784. },
  90785. }
  90786. target := &ret
  90787. if err := gensupport.DecodeResponse(target, res); err != nil {
  90788. return nil, err
  90789. }
  90790. return ret, nil
  90791. // {
  90792. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  90793. // "httpMethod": "POST",
  90794. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  90795. // "parameterOrder": [
  90796. // "project",
  90797. // "region",
  90798. // "instanceGroupManager"
  90799. // ],
  90800. // "parameters": {
  90801. // "instanceGroupManager": {
  90802. // "description": "The name of the managed instance group.",
  90803. // "location": "path",
  90804. // "required": true,
  90805. // "type": "string"
  90806. // },
  90807. // "project": {
  90808. // "description": "Project ID for this request.",
  90809. // "location": "path",
  90810. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90811. // "required": true,
  90812. // "type": "string"
  90813. // },
  90814. // "region": {
  90815. // "description": "Name of the region scoping this request.",
  90816. // "location": "path",
  90817. // "required": true,
  90818. // "type": "string"
  90819. // },
  90820. // "requestId": {
  90821. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90822. // "location": "query",
  90823. // "type": "string"
  90824. // }
  90825. // },
  90826. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  90827. // "request": {
  90828. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  90829. // },
  90830. // "response": {
  90831. // "$ref": "Operation"
  90832. // },
  90833. // "scopes": [
  90834. // "https://www.googleapis.com/auth/cloud-platform",
  90835. // "https://www.googleapis.com/auth/compute"
  90836. // ]
  90837. // }
  90838. }
  90839. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  90840. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  90841. s *Service
  90842. project string
  90843. region string
  90844. instanceGroupManager string
  90845. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  90846. urlParams_ gensupport.URLParams
  90847. ctx_ context.Context
  90848. header_ http.Header
  90849. }
  90850. // SetTargetPools: Modifies the target pools to which all new instances
  90851. // in this group are assigned. Existing instances in the group are not
  90852. // affected.
  90853. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  90854. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90855. c.project = project
  90856. c.region = region
  90857. c.instanceGroupManager = instanceGroupManager
  90858. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  90859. return c
  90860. }
  90861. // RequestId sets the optional parameter "requestId": An optional
  90862. // request ID to identify requests. Specify a unique request ID so that
  90863. // if you must retry your request, the server will know to ignore the
  90864. // request if it has already been completed.
  90865. //
  90866. // For example, consider a situation where you make an initial request
  90867. // and the request times out. If you make the request again with the
  90868. // same request ID, the server can check if original operation with the
  90869. // same request ID was received, and if so, will ignore the second
  90870. // request. This prevents clients from accidentally creating duplicate
  90871. // commitments.
  90872. //
  90873. // The request ID must be a valid UUID with the exception that zero UUID
  90874. // is not supported (00000000-0000-0000-0000-000000000000).
  90875. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  90876. c.urlParams_.Set("requestId", requestId)
  90877. return c
  90878. }
  90879. // Fields allows partial responses to be retrieved. See
  90880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90881. // for more information.
  90882. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  90883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90884. return c
  90885. }
  90886. // Context sets the context to be used in this call's Do method. Any
  90887. // pending HTTP request will be aborted if the provided context is
  90888. // canceled.
  90889. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  90890. c.ctx_ = ctx
  90891. return c
  90892. }
  90893. // Header returns an http.Header that can be modified by the caller to
  90894. // add HTTP headers to the request.
  90895. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  90896. if c.header_ == nil {
  90897. c.header_ = make(http.Header)
  90898. }
  90899. return c.header_
  90900. }
  90901. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  90902. reqHeaders := make(http.Header)
  90903. for k, v := range c.header_ {
  90904. reqHeaders[k] = v
  90905. }
  90906. reqHeaders.Set("User-Agent", c.s.userAgent())
  90907. var body io.Reader = nil
  90908. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  90909. if err != nil {
  90910. return nil, err
  90911. }
  90912. reqHeaders.Set("Content-Type", "application/json")
  90913. c.urlParams_.Set("alt", alt)
  90914. c.urlParams_.Set("prettyPrint", "false")
  90915. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  90916. urls += "?" + c.urlParams_.Encode()
  90917. req, err := http.NewRequest("POST", urls, body)
  90918. if err != nil {
  90919. return nil, err
  90920. }
  90921. req.Header = reqHeaders
  90922. googleapi.Expand(req.URL, map[string]string{
  90923. "project": c.project,
  90924. "region": c.region,
  90925. "instanceGroupManager": c.instanceGroupManager,
  90926. })
  90927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90928. }
  90929. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  90930. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90931. // status code is an error. Response headers are in either
  90932. // *Operation.ServerResponse.Header or (if a response was returned at
  90933. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90934. // to check whether the returned error was because
  90935. // http.StatusNotModified was returned.
  90936. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90937. gensupport.SetOptions(c.urlParams_, opts...)
  90938. res, err := c.doRequest("json")
  90939. if res != nil && res.StatusCode == http.StatusNotModified {
  90940. if res.Body != nil {
  90941. res.Body.Close()
  90942. }
  90943. return nil, &googleapi.Error{
  90944. Code: res.StatusCode,
  90945. Header: res.Header,
  90946. }
  90947. }
  90948. if err != nil {
  90949. return nil, err
  90950. }
  90951. defer googleapi.CloseBody(res)
  90952. if err := googleapi.CheckResponse(res); err != nil {
  90953. return nil, err
  90954. }
  90955. ret := &Operation{
  90956. ServerResponse: googleapi.ServerResponse{
  90957. Header: res.Header,
  90958. HTTPStatusCode: res.StatusCode,
  90959. },
  90960. }
  90961. target := &ret
  90962. if err := gensupport.DecodeResponse(target, res); err != nil {
  90963. return nil, err
  90964. }
  90965. return ret, nil
  90966. // {
  90967. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  90968. // "httpMethod": "POST",
  90969. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  90970. // "parameterOrder": [
  90971. // "project",
  90972. // "region",
  90973. // "instanceGroupManager"
  90974. // ],
  90975. // "parameters": {
  90976. // "instanceGroupManager": {
  90977. // "description": "Name of the managed instance group.",
  90978. // "location": "path",
  90979. // "required": true,
  90980. // "type": "string"
  90981. // },
  90982. // "project": {
  90983. // "description": "Project ID for this request.",
  90984. // "location": "path",
  90985. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90986. // "required": true,
  90987. // "type": "string"
  90988. // },
  90989. // "region": {
  90990. // "description": "Name of the region scoping this request.",
  90991. // "location": "path",
  90992. // "required": true,
  90993. // "type": "string"
  90994. // },
  90995. // "requestId": {
  90996. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90997. // "location": "query",
  90998. // "type": "string"
  90999. // }
  91000. // },
  91001. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  91002. // "request": {
  91003. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  91004. // },
  91005. // "response": {
  91006. // "$ref": "Operation"
  91007. // },
  91008. // "scopes": [
  91009. // "https://www.googleapis.com/auth/cloud-platform",
  91010. // "https://www.googleapis.com/auth/compute"
  91011. // ]
  91012. // }
  91013. }
  91014. // method id "compute.regionInstanceGroupManagers.testIamPermissions":
  91015. type RegionInstanceGroupManagersTestIamPermissionsCall struct {
  91016. s *Service
  91017. project string
  91018. region string
  91019. resource string
  91020. testpermissionsrequest *TestPermissionsRequest
  91021. urlParams_ gensupport.URLParams
  91022. ctx_ context.Context
  91023. header_ http.Header
  91024. }
  91025. // TestIamPermissions: Returns permissions that a caller has on the
  91026. // specified resource.
  91027. func (r *RegionInstanceGroupManagersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupManagersTestIamPermissionsCall {
  91028. c := &RegionInstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91029. c.project = project
  91030. c.region = region
  91031. c.resource = resource
  91032. c.testpermissionsrequest = testpermissionsrequest
  91033. return c
  91034. }
  91035. // Fields allows partial responses to be retrieved. See
  91036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91037. // for more information.
  91038. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersTestIamPermissionsCall {
  91039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91040. return c
  91041. }
  91042. // Context sets the context to be used in this call's Do method. Any
  91043. // pending HTTP request will be aborted if the provided context is
  91044. // canceled.
  91045. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupManagersTestIamPermissionsCall {
  91046. c.ctx_ = ctx
  91047. return c
  91048. }
  91049. // Header returns an http.Header that can be modified by the caller to
  91050. // add HTTP headers to the request.
  91051. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  91052. if c.header_ == nil {
  91053. c.header_ = make(http.Header)
  91054. }
  91055. return c.header_
  91056. }
  91057. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  91058. reqHeaders := make(http.Header)
  91059. for k, v := range c.header_ {
  91060. reqHeaders[k] = v
  91061. }
  91062. reqHeaders.Set("User-Agent", c.s.userAgent())
  91063. var body io.Reader = nil
  91064. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  91065. if err != nil {
  91066. return nil, err
  91067. }
  91068. reqHeaders.Set("Content-Type", "application/json")
  91069. c.urlParams_.Set("alt", alt)
  91070. c.urlParams_.Set("prettyPrint", "false")
  91071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions")
  91072. urls += "?" + c.urlParams_.Encode()
  91073. req, err := http.NewRequest("POST", urls, body)
  91074. if err != nil {
  91075. return nil, err
  91076. }
  91077. req.Header = reqHeaders
  91078. googleapi.Expand(req.URL, map[string]string{
  91079. "project": c.project,
  91080. "region": c.region,
  91081. "resource": c.resource,
  91082. })
  91083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91084. }
  91085. // Do executes the "compute.regionInstanceGroupManagers.testIamPermissions" call.
  91086. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  91087. // non-2xx status code is an error. Response headers are in either
  91088. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  91089. // returned at all) in error.(*googleapi.Error).Header. Use
  91090. // googleapi.IsNotModified to check whether the returned error was
  91091. // because http.StatusNotModified was returned.
  91092. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  91093. gensupport.SetOptions(c.urlParams_, opts...)
  91094. res, err := c.doRequest("json")
  91095. if res != nil && res.StatusCode == http.StatusNotModified {
  91096. if res.Body != nil {
  91097. res.Body.Close()
  91098. }
  91099. return nil, &googleapi.Error{
  91100. Code: res.StatusCode,
  91101. Header: res.Header,
  91102. }
  91103. }
  91104. if err != nil {
  91105. return nil, err
  91106. }
  91107. defer googleapi.CloseBody(res)
  91108. if err := googleapi.CheckResponse(res); err != nil {
  91109. return nil, err
  91110. }
  91111. ret := &TestPermissionsResponse{
  91112. ServerResponse: googleapi.ServerResponse{
  91113. Header: res.Header,
  91114. HTTPStatusCode: res.StatusCode,
  91115. },
  91116. }
  91117. target := &ret
  91118. if err := gensupport.DecodeResponse(target, res); err != nil {
  91119. return nil, err
  91120. }
  91121. return ret, nil
  91122. // {
  91123. // "description": "Returns permissions that a caller has on the specified resource.",
  91124. // "httpMethod": "POST",
  91125. // "id": "compute.regionInstanceGroupManagers.testIamPermissions",
  91126. // "parameterOrder": [
  91127. // "project",
  91128. // "region",
  91129. // "resource"
  91130. // ],
  91131. // "parameters": {
  91132. // "project": {
  91133. // "description": "Project ID for this request.",
  91134. // "location": "path",
  91135. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91136. // "required": true,
  91137. // "type": "string"
  91138. // },
  91139. // "region": {
  91140. // "description": "The name of the region for this request.",
  91141. // "location": "path",
  91142. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91143. // "required": true,
  91144. // "type": "string"
  91145. // },
  91146. // "resource": {
  91147. // "description": "Name or id of the resource for this request.",
  91148. // "location": "path",
  91149. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91150. // "required": true,
  91151. // "type": "string"
  91152. // }
  91153. // },
  91154. // "path": "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions",
  91155. // "request": {
  91156. // "$ref": "TestPermissionsRequest"
  91157. // },
  91158. // "response": {
  91159. // "$ref": "TestPermissionsResponse"
  91160. // },
  91161. // "scopes": [
  91162. // "https://www.googleapis.com/auth/cloud-platform",
  91163. // "https://www.googleapis.com/auth/compute",
  91164. // "https://www.googleapis.com/auth/compute.readonly"
  91165. // ]
  91166. // }
  91167. }
  91168. // method id "compute.regionInstanceGroupManagers.update":
  91169. type RegionInstanceGroupManagersUpdateCall struct {
  91170. s *Service
  91171. project string
  91172. region string
  91173. instanceGroupManager string
  91174. instancegroupmanager *InstanceGroupManager
  91175. urlParams_ gensupport.URLParams
  91176. ctx_ context.Context
  91177. header_ http.Header
  91178. }
  91179. // Update: Updates a managed instance group using the information that
  91180. // you specify in the request. This operation is marked as DONE when the
  91181. // group is updated even if the instances in the group have not yet been
  91182. // updated. You must separately verify the status of the individual
  91183. // instances with the listmanagedinstances method.
  91184. func (r *RegionInstanceGroupManagersService) Update(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersUpdateCall {
  91185. c := &RegionInstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91186. c.project = project
  91187. c.region = region
  91188. c.instanceGroupManager = instanceGroupManager
  91189. c.instancegroupmanager = instancegroupmanager
  91190. return c
  91191. }
  91192. // RequestId sets the optional parameter "requestId": An optional
  91193. // request ID to identify requests. Specify a unique request ID so that
  91194. // if you must retry your request, the server will know to ignore the
  91195. // request if it has already been completed.
  91196. //
  91197. // For example, consider a situation where you make an initial request
  91198. // and the request times out. If you make the request again with the
  91199. // same request ID, the server can check if original operation with the
  91200. // same request ID was received, and if so, will ignore the second
  91201. // request. This prevents clients from accidentally creating duplicate
  91202. // commitments.
  91203. //
  91204. // The request ID must be a valid UUID with the exception that zero UUID
  91205. // is not supported (00000000-0000-0000-0000-000000000000).
  91206. func (c *RegionInstanceGroupManagersUpdateCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdateCall {
  91207. c.urlParams_.Set("requestId", requestId)
  91208. return c
  91209. }
  91210. // Fields allows partial responses to be retrieved. See
  91211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91212. // for more information.
  91213. func (c *RegionInstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdateCall {
  91214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91215. return c
  91216. }
  91217. // Context sets the context to be used in this call's Do method. Any
  91218. // pending HTTP request will be aborted if the provided context is
  91219. // canceled.
  91220. func (c *RegionInstanceGroupManagersUpdateCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdateCall {
  91221. c.ctx_ = ctx
  91222. return c
  91223. }
  91224. // Header returns an http.Header that can be modified by the caller to
  91225. // add HTTP headers to the request.
  91226. func (c *RegionInstanceGroupManagersUpdateCall) Header() http.Header {
  91227. if c.header_ == nil {
  91228. c.header_ = make(http.Header)
  91229. }
  91230. return c.header_
  91231. }
  91232. func (c *RegionInstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  91233. reqHeaders := make(http.Header)
  91234. for k, v := range c.header_ {
  91235. reqHeaders[k] = v
  91236. }
  91237. reqHeaders.Set("User-Agent", c.s.userAgent())
  91238. var body io.Reader = nil
  91239. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  91240. if err != nil {
  91241. return nil, err
  91242. }
  91243. reqHeaders.Set("Content-Type", "application/json")
  91244. c.urlParams_.Set("alt", alt)
  91245. c.urlParams_.Set("prettyPrint", "false")
  91246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  91247. urls += "?" + c.urlParams_.Encode()
  91248. req, err := http.NewRequest("PUT", urls, body)
  91249. if err != nil {
  91250. return nil, err
  91251. }
  91252. req.Header = reqHeaders
  91253. googleapi.Expand(req.URL, map[string]string{
  91254. "project": c.project,
  91255. "region": c.region,
  91256. "instanceGroupManager": c.instanceGroupManager,
  91257. })
  91258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91259. }
  91260. // Do executes the "compute.regionInstanceGroupManagers.update" call.
  91261. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91262. // status code is an error. Response headers are in either
  91263. // *Operation.ServerResponse.Header or (if a response was returned at
  91264. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91265. // to check whether the returned error was because
  91266. // http.StatusNotModified was returned.
  91267. func (c *RegionInstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91268. gensupport.SetOptions(c.urlParams_, opts...)
  91269. res, err := c.doRequest("json")
  91270. if res != nil && res.StatusCode == http.StatusNotModified {
  91271. if res.Body != nil {
  91272. res.Body.Close()
  91273. }
  91274. return nil, &googleapi.Error{
  91275. Code: res.StatusCode,
  91276. Header: res.Header,
  91277. }
  91278. }
  91279. if err != nil {
  91280. return nil, err
  91281. }
  91282. defer googleapi.CloseBody(res)
  91283. if err := googleapi.CheckResponse(res); err != nil {
  91284. return nil, err
  91285. }
  91286. ret := &Operation{
  91287. ServerResponse: googleapi.ServerResponse{
  91288. Header: res.Header,
  91289. HTTPStatusCode: res.StatusCode,
  91290. },
  91291. }
  91292. target := &ret
  91293. if err := gensupport.DecodeResponse(target, res); err != nil {
  91294. return nil, err
  91295. }
  91296. return ret, nil
  91297. // {
  91298. // "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.",
  91299. // "httpMethod": "PUT",
  91300. // "id": "compute.regionInstanceGroupManagers.update",
  91301. // "parameterOrder": [
  91302. // "project",
  91303. // "region",
  91304. // "instanceGroupManager"
  91305. // ],
  91306. // "parameters": {
  91307. // "instanceGroupManager": {
  91308. // "description": "The name of the instance group manager.",
  91309. // "location": "path",
  91310. // "required": true,
  91311. // "type": "string"
  91312. // },
  91313. // "project": {
  91314. // "description": "Project ID for this request.",
  91315. // "location": "path",
  91316. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91317. // "required": true,
  91318. // "type": "string"
  91319. // },
  91320. // "region": {
  91321. // "description": "Name of the region scoping this request.",
  91322. // "location": "path",
  91323. // "required": true,
  91324. // "type": "string"
  91325. // },
  91326. // "requestId": {
  91327. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91328. // "location": "query",
  91329. // "type": "string"
  91330. // }
  91331. // },
  91332. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  91333. // "request": {
  91334. // "$ref": "InstanceGroupManager"
  91335. // },
  91336. // "response": {
  91337. // "$ref": "Operation"
  91338. // },
  91339. // "scopes": [
  91340. // "https://www.googleapis.com/auth/cloud-platform",
  91341. // "https://www.googleapis.com/auth/compute"
  91342. // ]
  91343. // }
  91344. }
  91345. // method id "compute.regionInstanceGroups.get":
  91346. type RegionInstanceGroupsGetCall struct {
  91347. s *Service
  91348. project string
  91349. region string
  91350. instanceGroup string
  91351. urlParams_ gensupport.URLParams
  91352. ifNoneMatch_ string
  91353. ctx_ context.Context
  91354. header_ http.Header
  91355. }
  91356. // Get: Returns the specified instance group resource.
  91357. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  91358. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91359. c.project = project
  91360. c.region = region
  91361. c.instanceGroup = instanceGroup
  91362. return c
  91363. }
  91364. // Fields allows partial responses to be retrieved. See
  91365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91366. // for more information.
  91367. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  91368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91369. return c
  91370. }
  91371. // IfNoneMatch sets the optional parameter which makes the operation
  91372. // fail if the object's ETag matches the given value. This is useful for
  91373. // getting updates only after the object has changed since the last
  91374. // request. Use googleapi.IsNotModified to check whether the response
  91375. // error from Do is the result of In-None-Match.
  91376. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  91377. c.ifNoneMatch_ = entityTag
  91378. return c
  91379. }
  91380. // Context sets the context to be used in this call's Do method. Any
  91381. // pending HTTP request will be aborted if the provided context is
  91382. // canceled.
  91383. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  91384. c.ctx_ = ctx
  91385. return c
  91386. }
  91387. // Header returns an http.Header that can be modified by the caller to
  91388. // add HTTP headers to the request.
  91389. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  91390. if c.header_ == nil {
  91391. c.header_ = make(http.Header)
  91392. }
  91393. return c.header_
  91394. }
  91395. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  91396. reqHeaders := make(http.Header)
  91397. for k, v := range c.header_ {
  91398. reqHeaders[k] = v
  91399. }
  91400. reqHeaders.Set("User-Agent", c.s.userAgent())
  91401. if c.ifNoneMatch_ != "" {
  91402. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91403. }
  91404. var body io.Reader = nil
  91405. c.urlParams_.Set("alt", alt)
  91406. c.urlParams_.Set("prettyPrint", "false")
  91407. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  91408. urls += "?" + c.urlParams_.Encode()
  91409. req, err := http.NewRequest("GET", urls, body)
  91410. if err != nil {
  91411. return nil, err
  91412. }
  91413. req.Header = reqHeaders
  91414. googleapi.Expand(req.URL, map[string]string{
  91415. "project": c.project,
  91416. "region": c.region,
  91417. "instanceGroup": c.instanceGroup,
  91418. })
  91419. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91420. }
  91421. // Do executes the "compute.regionInstanceGroups.get" call.
  91422. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  91423. // status code is an error. Response headers are in either
  91424. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  91425. // at all) in error.(*googleapi.Error).Header. Use
  91426. // googleapi.IsNotModified to check whether the returned error was
  91427. // because http.StatusNotModified was returned.
  91428. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  91429. gensupport.SetOptions(c.urlParams_, opts...)
  91430. res, err := c.doRequest("json")
  91431. if res != nil && res.StatusCode == http.StatusNotModified {
  91432. if res.Body != nil {
  91433. res.Body.Close()
  91434. }
  91435. return nil, &googleapi.Error{
  91436. Code: res.StatusCode,
  91437. Header: res.Header,
  91438. }
  91439. }
  91440. if err != nil {
  91441. return nil, err
  91442. }
  91443. defer googleapi.CloseBody(res)
  91444. if err := googleapi.CheckResponse(res); err != nil {
  91445. return nil, err
  91446. }
  91447. ret := &InstanceGroup{
  91448. ServerResponse: googleapi.ServerResponse{
  91449. Header: res.Header,
  91450. HTTPStatusCode: res.StatusCode,
  91451. },
  91452. }
  91453. target := &ret
  91454. if err := gensupport.DecodeResponse(target, res); err != nil {
  91455. return nil, err
  91456. }
  91457. return ret, nil
  91458. // {
  91459. // "description": "Returns the specified instance group resource.",
  91460. // "httpMethod": "GET",
  91461. // "id": "compute.regionInstanceGroups.get",
  91462. // "parameterOrder": [
  91463. // "project",
  91464. // "region",
  91465. // "instanceGroup"
  91466. // ],
  91467. // "parameters": {
  91468. // "instanceGroup": {
  91469. // "description": "Name of the instance group resource to return.",
  91470. // "location": "path",
  91471. // "required": true,
  91472. // "type": "string"
  91473. // },
  91474. // "project": {
  91475. // "description": "Project ID for this request.",
  91476. // "location": "path",
  91477. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91478. // "required": true,
  91479. // "type": "string"
  91480. // },
  91481. // "region": {
  91482. // "description": "Name of the region scoping this request.",
  91483. // "location": "path",
  91484. // "required": true,
  91485. // "type": "string"
  91486. // }
  91487. // },
  91488. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  91489. // "response": {
  91490. // "$ref": "InstanceGroup"
  91491. // },
  91492. // "scopes": [
  91493. // "https://www.googleapis.com/auth/cloud-platform",
  91494. // "https://www.googleapis.com/auth/compute",
  91495. // "https://www.googleapis.com/auth/compute.readonly"
  91496. // ]
  91497. // }
  91498. }
  91499. // method id "compute.regionInstanceGroups.list":
  91500. type RegionInstanceGroupsListCall struct {
  91501. s *Service
  91502. project string
  91503. region string
  91504. urlParams_ gensupport.URLParams
  91505. ifNoneMatch_ string
  91506. ctx_ context.Context
  91507. header_ http.Header
  91508. }
  91509. // List: Retrieves the list of instance group resources contained within
  91510. // the specified region.
  91511. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  91512. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91513. c.project = project
  91514. c.region = region
  91515. return c
  91516. }
  91517. // Filter sets the optional parameter "filter": A filter expression that
  91518. // filters resources listed in the response. The expression must specify
  91519. // the field name, a comparison operator, and the value that you want to
  91520. // use for filtering. The value must be a string, a number, or a
  91521. // boolean. The comparison operator must be either =, !=, >, or <.
  91522. //
  91523. // For example, if you are filtering Compute Engine instances, you can
  91524. // exclude instances named example-instance by specifying name !=
  91525. // example-instance.
  91526. //
  91527. // You can also filter nested fields. For example, you could specify
  91528. // scheduling.automaticRestart = false to include instances only if they
  91529. // are not scheduled for automatic restarts. You can use filtering on
  91530. // nested fields to filter based on resource labels.
  91531. //
  91532. // To filter on multiple expressions, provide each separate expression
  91533. // within parentheses. For example, (scheduling.automaticRestart = true)
  91534. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  91535. // AND expression. However, you can include AND and OR expressions
  91536. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  91537. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  91538. // true).
  91539. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  91540. c.urlParams_.Set("filter", filter)
  91541. return c
  91542. }
  91543. // MaxResults sets the optional parameter "maxResults": The maximum
  91544. // number of results per page that should be returned. If the number of
  91545. // available results is larger than maxResults, Compute Engine returns a
  91546. // nextPageToken that can be used to get the next page of results in
  91547. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91548. // (Default: 500)
  91549. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  91550. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91551. return c
  91552. }
  91553. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91554. // a certain order. By default, results are returned in alphanumerical
  91555. // order based on the resource name.
  91556. //
  91557. // You can also sort results in descending order based on the creation
  91558. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91559. // based on the creationTimestamp field in reverse chronological order
  91560. // (newest result first). Use this to sort resources like operations so
  91561. // that the newest operation is returned first.
  91562. //
  91563. // Currently, only sorting by name or creationTimestamp desc is
  91564. // supported.
  91565. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  91566. c.urlParams_.Set("orderBy", orderBy)
  91567. return c
  91568. }
  91569. // PageToken sets the optional parameter "pageToken": Specifies a page
  91570. // token to use. Set pageToken to the nextPageToken returned by a
  91571. // previous list request to get the next page of results.
  91572. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  91573. c.urlParams_.Set("pageToken", pageToken)
  91574. return c
  91575. }
  91576. // Fields allows partial responses to be retrieved. See
  91577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91578. // for more information.
  91579. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  91580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91581. return c
  91582. }
  91583. // IfNoneMatch sets the optional parameter which makes the operation
  91584. // fail if the object's ETag matches the given value. This is useful for
  91585. // getting updates only after the object has changed since the last
  91586. // request. Use googleapi.IsNotModified to check whether the response
  91587. // error from Do is the result of In-None-Match.
  91588. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  91589. c.ifNoneMatch_ = entityTag
  91590. return c
  91591. }
  91592. // Context sets the context to be used in this call's Do method. Any
  91593. // pending HTTP request will be aborted if the provided context is
  91594. // canceled.
  91595. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  91596. c.ctx_ = ctx
  91597. return c
  91598. }
  91599. // Header returns an http.Header that can be modified by the caller to
  91600. // add HTTP headers to the request.
  91601. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  91602. if c.header_ == nil {
  91603. c.header_ = make(http.Header)
  91604. }
  91605. return c.header_
  91606. }
  91607. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  91608. reqHeaders := make(http.Header)
  91609. for k, v := range c.header_ {
  91610. reqHeaders[k] = v
  91611. }
  91612. reqHeaders.Set("User-Agent", c.s.userAgent())
  91613. if c.ifNoneMatch_ != "" {
  91614. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91615. }
  91616. var body io.Reader = nil
  91617. c.urlParams_.Set("alt", alt)
  91618. c.urlParams_.Set("prettyPrint", "false")
  91619. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  91620. urls += "?" + c.urlParams_.Encode()
  91621. req, err := http.NewRequest("GET", urls, body)
  91622. if err != nil {
  91623. return nil, err
  91624. }
  91625. req.Header = reqHeaders
  91626. googleapi.Expand(req.URL, map[string]string{
  91627. "project": c.project,
  91628. "region": c.region,
  91629. })
  91630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91631. }
  91632. // Do executes the "compute.regionInstanceGroups.list" call.
  91633. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  91634. // non-2xx status code is an error. Response headers are in either
  91635. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  91636. // returned at all) in error.(*googleapi.Error).Header. Use
  91637. // googleapi.IsNotModified to check whether the returned error was
  91638. // because http.StatusNotModified was returned.
  91639. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  91640. gensupport.SetOptions(c.urlParams_, opts...)
  91641. res, err := c.doRequest("json")
  91642. if res != nil && res.StatusCode == http.StatusNotModified {
  91643. if res.Body != nil {
  91644. res.Body.Close()
  91645. }
  91646. return nil, &googleapi.Error{
  91647. Code: res.StatusCode,
  91648. Header: res.Header,
  91649. }
  91650. }
  91651. if err != nil {
  91652. return nil, err
  91653. }
  91654. defer googleapi.CloseBody(res)
  91655. if err := googleapi.CheckResponse(res); err != nil {
  91656. return nil, err
  91657. }
  91658. ret := &RegionInstanceGroupList{
  91659. ServerResponse: googleapi.ServerResponse{
  91660. Header: res.Header,
  91661. HTTPStatusCode: res.StatusCode,
  91662. },
  91663. }
  91664. target := &ret
  91665. if err := gensupport.DecodeResponse(target, res); err != nil {
  91666. return nil, err
  91667. }
  91668. return ret, nil
  91669. // {
  91670. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  91671. // "httpMethod": "GET",
  91672. // "id": "compute.regionInstanceGroups.list",
  91673. // "parameterOrder": [
  91674. // "project",
  91675. // "region"
  91676. // ],
  91677. // "parameters": {
  91678. // "filter": {
  91679. // "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).",
  91680. // "location": "query",
  91681. // "type": "string"
  91682. // },
  91683. // "maxResults": {
  91684. // "default": "500",
  91685. // "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)",
  91686. // "format": "uint32",
  91687. // "location": "query",
  91688. // "minimum": "0",
  91689. // "type": "integer"
  91690. // },
  91691. // "orderBy": {
  91692. // "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.",
  91693. // "location": "query",
  91694. // "type": "string"
  91695. // },
  91696. // "pageToken": {
  91697. // "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.",
  91698. // "location": "query",
  91699. // "type": "string"
  91700. // },
  91701. // "project": {
  91702. // "description": "Project ID for this request.",
  91703. // "location": "path",
  91704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91705. // "required": true,
  91706. // "type": "string"
  91707. // },
  91708. // "region": {
  91709. // "description": "Name of the region scoping this request.",
  91710. // "location": "path",
  91711. // "required": true,
  91712. // "type": "string"
  91713. // }
  91714. // },
  91715. // "path": "{project}/regions/{region}/instanceGroups",
  91716. // "response": {
  91717. // "$ref": "RegionInstanceGroupList"
  91718. // },
  91719. // "scopes": [
  91720. // "https://www.googleapis.com/auth/cloud-platform",
  91721. // "https://www.googleapis.com/auth/compute",
  91722. // "https://www.googleapis.com/auth/compute.readonly"
  91723. // ]
  91724. // }
  91725. }
  91726. // Pages invokes f for each page of results.
  91727. // A non-nil error returned from f will halt the iteration.
  91728. // The provided context supersedes any context provided to the Context method.
  91729. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  91730. c.ctx_ = ctx
  91731. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91732. for {
  91733. x, err := c.Do()
  91734. if err != nil {
  91735. return err
  91736. }
  91737. if err := f(x); err != nil {
  91738. return err
  91739. }
  91740. if x.NextPageToken == "" {
  91741. return nil
  91742. }
  91743. c.PageToken(x.NextPageToken)
  91744. }
  91745. }
  91746. // method id "compute.regionInstanceGroups.listInstances":
  91747. type RegionInstanceGroupsListInstancesCall struct {
  91748. s *Service
  91749. project string
  91750. region string
  91751. instanceGroup string
  91752. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  91753. urlParams_ gensupport.URLParams
  91754. ctx_ context.Context
  91755. header_ http.Header
  91756. }
  91757. // ListInstances: Lists the instances in the specified instance group
  91758. // and displays information about the named ports. Depending on the
  91759. // specified options, this method can list all instances or only the
  91760. // instances that are running.
  91761. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  91762. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91763. c.project = project
  91764. c.region = region
  91765. c.instanceGroup = instanceGroup
  91766. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  91767. return c
  91768. }
  91769. // Filter sets the optional parameter "filter": A filter expression that
  91770. // filters resources listed in the response. The expression must specify
  91771. // the field name, a comparison operator, and the value that you want to
  91772. // use for filtering. The value must be a string, a number, or a
  91773. // boolean. The comparison operator must be either =, !=, >, or <.
  91774. //
  91775. // For example, if you are filtering Compute Engine instances, you can
  91776. // exclude instances named example-instance by specifying name !=
  91777. // example-instance.
  91778. //
  91779. // You can also filter nested fields. For example, you could specify
  91780. // scheduling.automaticRestart = false to include instances only if they
  91781. // are not scheduled for automatic restarts. You can use filtering on
  91782. // nested fields to filter based on resource labels.
  91783. //
  91784. // To filter on multiple expressions, provide each separate expression
  91785. // within parentheses. For example, (scheduling.automaticRestart = true)
  91786. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  91787. // AND expression. However, you can include AND and OR expressions
  91788. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  91789. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  91790. // true).
  91791. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  91792. c.urlParams_.Set("filter", filter)
  91793. return c
  91794. }
  91795. // MaxResults sets the optional parameter "maxResults": The maximum
  91796. // number of results per page that should be returned. If the number of
  91797. // available results is larger than maxResults, Compute Engine returns a
  91798. // nextPageToken that can be used to get the next page of results in
  91799. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91800. // (Default: 500)
  91801. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  91802. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91803. return c
  91804. }
  91805. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91806. // a certain order. By default, results are returned in alphanumerical
  91807. // order based on the resource name.
  91808. //
  91809. // You can also sort results in descending order based on the creation
  91810. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91811. // based on the creationTimestamp field in reverse chronological order
  91812. // (newest result first). Use this to sort resources like operations so
  91813. // that the newest operation is returned first.
  91814. //
  91815. // Currently, only sorting by name or creationTimestamp desc is
  91816. // supported.
  91817. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  91818. c.urlParams_.Set("orderBy", orderBy)
  91819. return c
  91820. }
  91821. // PageToken sets the optional parameter "pageToken": Specifies a page
  91822. // token to use. Set pageToken to the nextPageToken returned by a
  91823. // previous list request to get the next page of results.
  91824. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  91825. c.urlParams_.Set("pageToken", pageToken)
  91826. return c
  91827. }
  91828. // Fields allows partial responses to be retrieved. See
  91829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91830. // for more information.
  91831. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  91832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91833. return c
  91834. }
  91835. // Context sets the context to be used in this call's Do method. Any
  91836. // pending HTTP request will be aborted if the provided context is
  91837. // canceled.
  91838. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  91839. c.ctx_ = ctx
  91840. return c
  91841. }
  91842. // Header returns an http.Header that can be modified by the caller to
  91843. // add HTTP headers to the request.
  91844. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  91845. if c.header_ == nil {
  91846. c.header_ = make(http.Header)
  91847. }
  91848. return c.header_
  91849. }
  91850. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  91851. reqHeaders := make(http.Header)
  91852. for k, v := range c.header_ {
  91853. reqHeaders[k] = v
  91854. }
  91855. reqHeaders.Set("User-Agent", c.s.userAgent())
  91856. var body io.Reader = nil
  91857. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  91858. if err != nil {
  91859. return nil, err
  91860. }
  91861. reqHeaders.Set("Content-Type", "application/json")
  91862. c.urlParams_.Set("alt", alt)
  91863. c.urlParams_.Set("prettyPrint", "false")
  91864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  91865. urls += "?" + c.urlParams_.Encode()
  91866. req, err := http.NewRequest("POST", urls, body)
  91867. if err != nil {
  91868. return nil, err
  91869. }
  91870. req.Header = reqHeaders
  91871. googleapi.Expand(req.URL, map[string]string{
  91872. "project": c.project,
  91873. "region": c.region,
  91874. "instanceGroup": c.instanceGroup,
  91875. })
  91876. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91877. }
  91878. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  91879. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  91880. // non-nil. Any non-2xx status code is an error. Response headers are in
  91881. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  91882. // (if a response was returned at all) in
  91883. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  91884. // whether the returned error was because http.StatusNotModified was
  91885. // returned.
  91886. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  91887. gensupport.SetOptions(c.urlParams_, opts...)
  91888. res, err := c.doRequest("json")
  91889. if res != nil && res.StatusCode == http.StatusNotModified {
  91890. if res.Body != nil {
  91891. res.Body.Close()
  91892. }
  91893. return nil, &googleapi.Error{
  91894. Code: res.StatusCode,
  91895. Header: res.Header,
  91896. }
  91897. }
  91898. if err != nil {
  91899. return nil, err
  91900. }
  91901. defer googleapi.CloseBody(res)
  91902. if err := googleapi.CheckResponse(res); err != nil {
  91903. return nil, err
  91904. }
  91905. ret := &RegionInstanceGroupsListInstances{
  91906. ServerResponse: googleapi.ServerResponse{
  91907. Header: res.Header,
  91908. HTTPStatusCode: res.StatusCode,
  91909. },
  91910. }
  91911. target := &ret
  91912. if err := gensupport.DecodeResponse(target, res); err != nil {
  91913. return nil, err
  91914. }
  91915. return ret, nil
  91916. // {
  91917. // "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.",
  91918. // "httpMethod": "POST",
  91919. // "id": "compute.regionInstanceGroups.listInstances",
  91920. // "parameterOrder": [
  91921. // "project",
  91922. // "region",
  91923. // "instanceGroup"
  91924. // ],
  91925. // "parameters": {
  91926. // "filter": {
  91927. // "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).",
  91928. // "location": "query",
  91929. // "type": "string"
  91930. // },
  91931. // "instanceGroup": {
  91932. // "description": "Name of the regional instance group for which we want to list the instances.",
  91933. // "location": "path",
  91934. // "required": true,
  91935. // "type": "string"
  91936. // },
  91937. // "maxResults": {
  91938. // "default": "500",
  91939. // "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)",
  91940. // "format": "uint32",
  91941. // "location": "query",
  91942. // "minimum": "0",
  91943. // "type": "integer"
  91944. // },
  91945. // "orderBy": {
  91946. // "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.",
  91947. // "location": "query",
  91948. // "type": "string"
  91949. // },
  91950. // "pageToken": {
  91951. // "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.",
  91952. // "location": "query",
  91953. // "type": "string"
  91954. // },
  91955. // "project": {
  91956. // "description": "Project ID for this request.",
  91957. // "location": "path",
  91958. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91959. // "required": true,
  91960. // "type": "string"
  91961. // },
  91962. // "region": {
  91963. // "description": "Name of the region scoping this request.",
  91964. // "location": "path",
  91965. // "required": true,
  91966. // "type": "string"
  91967. // }
  91968. // },
  91969. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  91970. // "request": {
  91971. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  91972. // },
  91973. // "response": {
  91974. // "$ref": "RegionInstanceGroupsListInstances"
  91975. // },
  91976. // "scopes": [
  91977. // "https://www.googleapis.com/auth/cloud-platform",
  91978. // "https://www.googleapis.com/auth/compute",
  91979. // "https://www.googleapis.com/auth/compute.readonly"
  91980. // ]
  91981. // }
  91982. }
  91983. // Pages invokes f for each page of results.
  91984. // A non-nil error returned from f will halt the iteration.
  91985. // The provided context supersedes any context provided to the Context method.
  91986. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  91987. c.ctx_ = ctx
  91988. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91989. for {
  91990. x, err := c.Do()
  91991. if err != nil {
  91992. return err
  91993. }
  91994. if err := f(x); err != nil {
  91995. return err
  91996. }
  91997. if x.NextPageToken == "" {
  91998. return nil
  91999. }
  92000. c.PageToken(x.NextPageToken)
  92001. }
  92002. }
  92003. // method id "compute.regionInstanceGroups.setNamedPorts":
  92004. type RegionInstanceGroupsSetNamedPortsCall struct {
  92005. s *Service
  92006. project string
  92007. region string
  92008. instanceGroup string
  92009. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  92010. urlParams_ gensupport.URLParams
  92011. ctx_ context.Context
  92012. header_ http.Header
  92013. }
  92014. // SetNamedPorts: Sets the named ports for the specified regional
  92015. // instance group.
  92016. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  92017. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92018. c.project = project
  92019. c.region = region
  92020. c.instanceGroup = instanceGroup
  92021. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  92022. return c
  92023. }
  92024. // RequestId sets the optional parameter "requestId": An optional
  92025. // request ID to identify requests. Specify a unique request ID so that
  92026. // if you must retry your request, the server will know to ignore the
  92027. // request if it has already been completed.
  92028. //
  92029. // For example, consider a situation where you make an initial request
  92030. // and the request times out. If you make the request again with the
  92031. // same request ID, the server can check if original operation with the
  92032. // same request ID was received, and if so, will ignore the second
  92033. // request. This prevents clients from accidentally creating duplicate
  92034. // commitments.
  92035. //
  92036. // The request ID must be a valid UUID with the exception that zero UUID
  92037. // is not supported (00000000-0000-0000-0000-000000000000).
  92038. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  92039. c.urlParams_.Set("requestId", requestId)
  92040. return c
  92041. }
  92042. // Fields allows partial responses to be retrieved. See
  92043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92044. // for more information.
  92045. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  92046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92047. return c
  92048. }
  92049. // Context sets the context to be used in this call's Do method. Any
  92050. // pending HTTP request will be aborted if the provided context is
  92051. // canceled.
  92052. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  92053. c.ctx_ = ctx
  92054. return c
  92055. }
  92056. // Header returns an http.Header that can be modified by the caller to
  92057. // add HTTP headers to the request.
  92058. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  92059. if c.header_ == nil {
  92060. c.header_ = make(http.Header)
  92061. }
  92062. return c.header_
  92063. }
  92064. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  92065. reqHeaders := make(http.Header)
  92066. for k, v := range c.header_ {
  92067. reqHeaders[k] = v
  92068. }
  92069. reqHeaders.Set("User-Agent", c.s.userAgent())
  92070. var body io.Reader = nil
  92071. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  92072. if err != nil {
  92073. return nil, err
  92074. }
  92075. reqHeaders.Set("Content-Type", "application/json")
  92076. c.urlParams_.Set("alt", alt)
  92077. c.urlParams_.Set("prettyPrint", "false")
  92078. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  92079. urls += "?" + c.urlParams_.Encode()
  92080. req, err := http.NewRequest("POST", urls, body)
  92081. if err != nil {
  92082. return nil, err
  92083. }
  92084. req.Header = reqHeaders
  92085. googleapi.Expand(req.URL, map[string]string{
  92086. "project": c.project,
  92087. "region": c.region,
  92088. "instanceGroup": c.instanceGroup,
  92089. })
  92090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92091. }
  92092. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  92093. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92094. // status code is an error. Response headers are in either
  92095. // *Operation.ServerResponse.Header or (if a response was returned at
  92096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92097. // to check whether the returned error was because
  92098. // http.StatusNotModified was returned.
  92099. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92100. gensupport.SetOptions(c.urlParams_, opts...)
  92101. res, err := c.doRequest("json")
  92102. if res != nil && res.StatusCode == http.StatusNotModified {
  92103. if res.Body != nil {
  92104. res.Body.Close()
  92105. }
  92106. return nil, &googleapi.Error{
  92107. Code: res.StatusCode,
  92108. Header: res.Header,
  92109. }
  92110. }
  92111. if err != nil {
  92112. return nil, err
  92113. }
  92114. defer googleapi.CloseBody(res)
  92115. if err := googleapi.CheckResponse(res); err != nil {
  92116. return nil, err
  92117. }
  92118. ret := &Operation{
  92119. ServerResponse: googleapi.ServerResponse{
  92120. Header: res.Header,
  92121. HTTPStatusCode: res.StatusCode,
  92122. },
  92123. }
  92124. target := &ret
  92125. if err := gensupport.DecodeResponse(target, res); err != nil {
  92126. return nil, err
  92127. }
  92128. return ret, nil
  92129. // {
  92130. // "description": "Sets the named ports for the specified regional instance group.",
  92131. // "httpMethod": "POST",
  92132. // "id": "compute.regionInstanceGroups.setNamedPorts",
  92133. // "parameterOrder": [
  92134. // "project",
  92135. // "region",
  92136. // "instanceGroup"
  92137. // ],
  92138. // "parameters": {
  92139. // "instanceGroup": {
  92140. // "description": "The name of the regional instance group where the named ports are updated.",
  92141. // "location": "path",
  92142. // "required": true,
  92143. // "type": "string"
  92144. // },
  92145. // "project": {
  92146. // "description": "Project ID for this request.",
  92147. // "location": "path",
  92148. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92149. // "required": true,
  92150. // "type": "string"
  92151. // },
  92152. // "region": {
  92153. // "description": "Name of the region scoping this request.",
  92154. // "location": "path",
  92155. // "required": true,
  92156. // "type": "string"
  92157. // },
  92158. // "requestId": {
  92159. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92160. // "location": "query",
  92161. // "type": "string"
  92162. // }
  92163. // },
  92164. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  92165. // "request": {
  92166. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  92167. // },
  92168. // "response": {
  92169. // "$ref": "Operation"
  92170. // },
  92171. // "scopes": [
  92172. // "https://www.googleapis.com/auth/cloud-platform",
  92173. // "https://www.googleapis.com/auth/compute"
  92174. // ]
  92175. // }
  92176. }
  92177. // method id "compute.regionInstanceGroups.testIamPermissions":
  92178. type RegionInstanceGroupsTestIamPermissionsCall struct {
  92179. s *Service
  92180. project string
  92181. region string
  92182. resource string
  92183. testpermissionsrequest *TestPermissionsRequest
  92184. urlParams_ gensupport.URLParams
  92185. ctx_ context.Context
  92186. header_ http.Header
  92187. }
  92188. // TestIamPermissions: Returns permissions that a caller has on the
  92189. // specified resource.
  92190. func (r *RegionInstanceGroupsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupsTestIamPermissionsCall {
  92191. c := &RegionInstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92192. c.project = project
  92193. c.region = region
  92194. c.resource = resource
  92195. c.testpermissionsrequest = testpermissionsrequest
  92196. return c
  92197. }
  92198. // Fields allows partial responses to be retrieved. See
  92199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92200. // for more information.
  92201. func (c *RegionInstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsTestIamPermissionsCall {
  92202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92203. return c
  92204. }
  92205. // Context sets the context to be used in this call's Do method. Any
  92206. // pending HTTP request will be aborted if the provided context is
  92207. // canceled.
  92208. func (c *RegionInstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupsTestIamPermissionsCall {
  92209. c.ctx_ = ctx
  92210. return c
  92211. }
  92212. // Header returns an http.Header that can be modified by the caller to
  92213. // add HTTP headers to the request.
  92214. func (c *RegionInstanceGroupsTestIamPermissionsCall) Header() http.Header {
  92215. if c.header_ == nil {
  92216. c.header_ = make(http.Header)
  92217. }
  92218. return c.header_
  92219. }
  92220. func (c *RegionInstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  92221. reqHeaders := make(http.Header)
  92222. for k, v := range c.header_ {
  92223. reqHeaders[k] = v
  92224. }
  92225. reqHeaders.Set("User-Agent", c.s.userAgent())
  92226. var body io.Reader = nil
  92227. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  92228. if err != nil {
  92229. return nil, err
  92230. }
  92231. reqHeaders.Set("Content-Type", "application/json")
  92232. c.urlParams_.Set("alt", alt)
  92233. c.urlParams_.Set("prettyPrint", "false")
  92234. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions")
  92235. urls += "?" + c.urlParams_.Encode()
  92236. req, err := http.NewRequest("POST", urls, body)
  92237. if err != nil {
  92238. return nil, err
  92239. }
  92240. req.Header = reqHeaders
  92241. googleapi.Expand(req.URL, map[string]string{
  92242. "project": c.project,
  92243. "region": c.region,
  92244. "resource": c.resource,
  92245. })
  92246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92247. }
  92248. // Do executes the "compute.regionInstanceGroups.testIamPermissions" call.
  92249. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  92250. // non-2xx status code is an error. Response headers are in either
  92251. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  92252. // returned at all) in error.(*googleapi.Error).Header. Use
  92253. // googleapi.IsNotModified to check whether the returned error was
  92254. // because http.StatusNotModified was returned.
  92255. func (c *RegionInstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  92256. gensupport.SetOptions(c.urlParams_, opts...)
  92257. res, err := c.doRequest("json")
  92258. if res != nil && res.StatusCode == http.StatusNotModified {
  92259. if res.Body != nil {
  92260. res.Body.Close()
  92261. }
  92262. return nil, &googleapi.Error{
  92263. Code: res.StatusCode,
  92264. Header: res.Header,
  92265. }
  92266. }
  92267. if err != nil {
  92268. return nil, err
  92269. }
  92270. defer googleapi.CloseBody(res)
  92271. if err := googleapi.CheckResponse(res); err != nil {
  92272. return nil, err
  92273. }
  92274. ret := &TestPermissionsResponse{
  92275. ServerResponse: googleapi.ServerResponse{
  92276. Header: res.Header,
  92277. HTTPStatusCode: res.StatusCode,
  92278. },
  92279. }
  92280. target := &ret
  92281. if err := gensupport.DecodeResponse(target, res); err != nil {
  92282. return nil, err
  92283. }
  92284. return ret, nil
  92285. // {
  92286. // "description": "Returns permissions that a caller has on the specified resource.",
  92287. // "httpMethod": "POST",
  92288. // "id": "compute.regionInstanceGroups.testIamPermissions",
  92289. // "parameterOrder": [
  92290. // "project",
  92291. // "region",
  92292. // "resource"
  92293. // ],
  92294. // "parameters": {
  92295. // "project": {
  92296. // "description": "Project ID for this request.",
  92297. // "location": "path",
  92298. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92299. // "required": true,
  92300. // "type": "string"
  92301. // },
  92302. // "region": {
  92303. // "description": "The name of the region for this request.",
  92304. // "location": "path",
  92305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92306. // "required": true,
  92307. // "type": "string"
  92308. // },
  92309. // "resource": {
  92310. // "description": "Name or id of the resource for this request.",
  92311. // "location": "path",
  92312. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92313. // "required": true,
  92314. // "type": "string"
  92315. // }
  92316. // },
  92317. // "path": "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions",
  92318. // "request": {
  92319. // "$ref": "TestPermissionsRequest"
  92320. // },
  92321. // "response": {
  92322. // "$ref": "TestPermissionsResponse"
  92323. // },
  92324. // "scopes": [
  92325. // "https://www.googleapis.com/auth/cloud-platform",
  92326. // "https://www.googleapis.com/auth/compute",
  92327. // "https://www.googleapis.com/auth/compute.readonly"
  92328. // ]
  92329. // }
  92330. }
  92331. // method id "compute.regionOperations.delete":
  92332. type RegionOperationsDeleteCall struct {
  92333. s *Service
  92334. project string
  92335. region string
  92336. operation string
  92337. urlParams_ gensupport.URLParams
  92338. ctx_ context.Context
  92339. header_ http.Header
  92340. }
  92341. // Delete: Deletes the specified region-specific Operations resource.
  92342. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  92343. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  92344. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92345. c.project = project
  92346. c.region = region
  92347. c.operation = operation
  92348. return c
  92349. }
  92350. // Fields allows partial responses to be retrieved. See
  92351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92352. // for more information.
  92353. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  92354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92355. return c
  92356. }
  92357. // Context sets the context to be used in this call's Do method. Any
  92358. // pending HTTP request will be aborted if the provided context is
  92359. // canceled.
  92360. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  92361. c.ctx_ = ctx
  92362. return c
  92363. }
  92364. // Header returns an http.Header that can be modified by the caller to
  92365. // add HTTP headers to the request.
  92366. func (c *RegionOperationsDeleteCall) Header() http.Header {
  92367. if c.header_ == nil {
  92368. c.header_ = make(http.Header)
  92369. }
  92370. return c.header_
  92371. }
  92372. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  92373. reqHeaders := make(http.Header)
  92374. for k, v := range c.header_ {
  92375. reqHeaders[k] = v
  92376. }
  92377. reqHeaders.Set("User-Agent", c.s.userAgent())
  92378. var body io.Reader = nil
  92379. c.urlParams_.Set("alt", alt)
  92380. c.urlParams_.Set("prettyPrint", "false")
  92381. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  92382. urls += "?" + c.urlParams_.Encode()
  92383. req, err := http.NewRequest("DELETE", urls, body)
  92384. if err != nil {
  92385. return nil, err
  92386. }
  92387. req.Header = reqHeaders
  92388. googleapi.Expand(req.URL, map[string]string{
  92389. "project": c.project,
  92390. "region": c.region,
  92391. "operation": c.operation,
  92392. })
  92393. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92394. }
  92395. // Do executes the "compute.regionOperations.delete" call.
  92396. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  92397. gensupport.SetOptions(c.urlParams_, opts...)
  92398. res, err := c.doRequest("json")
  92399. if err != nil {
  92400. return err
  92401. }
  92402. defer googleapi.CloseBody(res)
  92403. if err := googleapi.CheckResponse(res); err != nil {
  92404. return err
  92405. }
  92406. return nil
  92407. // {
  92408. // "description": "Deletes the specified region-specific Operations resource.",
  92409. // "httpMethod": "DELETE",
  92410. // "id": "compute.regionOperations.delete",
  92411. // "parameterOrder": [
  92412. // "project",
  92413. // "region",
  92414. // "operation"
  92415. // ],
  92416. // "parameters": {
  92417. // "operation": {
  92418. // "description": "Name of the Operations resource to delete.",
  92419. // "location": "path",
  92420. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92421. // "required": true,
  92422. // "type": "string"
  92423. // },
  92424. // "project": {
  92425. // "description": "Project ID for this request.",
  92426. // "location": "path",
  92427. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92428. // "required": true,
  92429. // "type": "string"
  92430. // },
  92431. // "region": {
  92432. // "description": "Name of the region for this request.",
  92433. // "location": "path",
  92434. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92435. // "required": true,
  92436. // "type": "string"
  92437. // }
  92438. // },
  92439. // "path": "{project}/regions/{region}/operations/{operation}",
  92440. // "scopes": [
  92441. // "https://www.googleapis.com/auth/cloud-platform",
  92442. // "https://www.googleapis.com/auth/compute"
  92443. // ]
  92444. // }
  92445. }
  92446. // method id "compute.regionOperations.get":
  92447. type RegionOperationsGetCall struct {
  92448. s *Service
  92449. project string
  92450. region string
  92451. operation string
  92452. urlParams_ gensupport.URLParams
  92453. ifNoneMatch_ string
  92454. ctx_ context.Context
  92455. header_ http.Header
  92456. }
  92457. // Get: Retrieves the specified region-specific Operations resource.
  92458. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  92459. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  92460. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92461. c.project = project
  92462. c.region = region
  92463. c.operation = operation
  92464. return c
  92465. }
  92466. // Fields allows partial responses to be retrieved. See
  92467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92468. // for more information.
  92469. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  92470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92471. return c
  92472. }
  92473. // IfNoneMatch sets the optional parameter which makes the operation
  92474. // fail if the object's ETag matches the given value. This is useful for
  92475. // getting updates only after the object has changed since the last
  92476. // request. Use googleapi.IsNotModified to check whether the response
  92477. // error from Do is the result of In-None-Match.
  92478. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  92479. c.ifNoneMatch_ = entityTag
  92480. return c
  92481. }
  92482. // Context sets the context to be used in this call's Do method. Any
  92483. // pending HTTP request will be aborted if the provided context is
  92484. // canceled.
  92485. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  92486. c.ctx_ = ctx
  92487. return c
  92488. }
  92489. // Header returns an http.Header that can be modified by the caller to
  92490. // add HTTP headers to the request.
  92491. func (c *RegionOperationsGetCall) Header() http.Header {
  92492. if c.header_ == nil {
  92493. c.header_ = make(http.Header)
  92494. }
  92495. return c.header_
  92496. }
  92497. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  92498. reqHeaders := make(http.Header)
  92499. for k, v := range c.header_ {
  92500. reqHeaders[k] = v
  92501. }
  92502. reqHeaders.Set("User-Agent", c.s.userAgent())
  92503. if c.ifNoneMatch_ != "" {
  92504. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92505. }
  92506. var body io.Reader = nil
  92507. c.urlParams_.Set("alt", alt)
  92508. c.urlParams_.Set("prettyPrint", "false")
  92509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  92510. urls += "?" + c.urlParams_.Encode()
  92511. req, err := http.NewRequest("GET", urls, body)
  92512. if err != nil {
  92513. return nil, err
  92514. }
  92515. req.Header = reqHeaders
  92516. googleapi.Expand(req.URL, map[string]string{
  92517. "project": c.project,
  92518. "region": c.region,
  92519. "operation": c.operation,
  92520. })
  92521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92522. }
  92523. // Do executes the "compute.regionOperations.get" call.
  92524. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92525. // status code is an error. Response headers are in either
  92526. // *Operation.ServerResponse.Header or (if a response was returned at
  92527. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92528. // to check whether the returned error was because
  92529. // http.StatusNotModified was returned.
  92530. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92531. gensupport.SetOptions(c.urlParams_, opts...)
  92532. res, err := c.doRequest("json")
  92533. if res != nil && res.StatusCode == http.StatusNotModified {
  92534. if res.Body != nil {
  92535. res.Body.Close()
  92536. }
  92537. return nil, &googleapi.Error{
  92538. Code: res.StatusCode,
  92539. Header: res.Header,
  92540. }
  92541. }
  92542. if err != nil {
  92543. return nil, err
  92544. }
  92545. defer googleapi.CloseBody(res)
  92546. if err := googleapi.CheckResponse(res); err != nil {
  92547. return nil, err
  92548. }
  92549. ret := &Operation{
  92550. ServerResponse: googleapi.ServerResponse{
  92551. Header: res.Header,
  92552. HTTPStatusCode: res.StatusCode,
  92553. },
  92554. }
  92555. target := &ret
  92556. if err := gensupport.DecodeResponse(target, res); err != nil {
  92557. return nil, err
  92558. }
  92559. return ret, nil
  92560. // {
  92561. // "description": "Retrieves the specified region-specific Operations resource.",
  92562. // "httpMethod": "GET",
  92563. // "id": "compute.regionOperations.get",
  92564. // "parameterOrder": [
  92565. // "project",
  92566. // "region",
  92567. // "operation"
  92568. // ],
  92569. // "parameters": {
  92570. // "operation": {
  92571. // "description": "Name of the Operations resource to return.",
  92572. // "location": "path",
  92573. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92574. // "required": true,
  92575. // "type": "string"
  92576. // },
  92577. // "project": {
  92578. // "description": "Project ID for this request.",
  92579. // "location": "path",
  92580. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92581. // "required": true,
  92582. // "type": "string"
  92583. // },
  92584. // "region": {
  92585. // "description": "Name of the region for this request.",
  92586. // "location": "path",
  92587. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92588. // "required": true,
  92589. // "type": "string"
  92590. // }
  92591. // },
  92592. // "path": "{project}/regions/{region}/operations/{operation}",
  92593. // "response": {
  92594. // "$ref": "Operation"
  92595. // },
  92596. // "scopes": [
  92597. // "https://www.googleapis.com/auth/cloud-platform",
  92598. // "https://www.googleapis.com/auth/compute",
  92599. // "https://www.googleapis.com/auth/compute.readonly"
  92600. // ]
  92601. // }
  92602. }
  92603. // method id "compute.regionOperations.list":
  92604. type RegionOperationsListCall struct {
  92605. s *Service
  92606. project string
  92607. region string
  92608. urlParams_ gensupport.URLParams
  92609. ifNoneMatch_ string
  92610. ctx_ context.Context
  92611. header_ http.Header
  92612. }
  92613. // List: Retrieves a list of Operation resources contained within the
  92614. // specified region.
  92615. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  92616. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  92617. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92618. c.project = project
  92619. c.region = region
  92620. return c
  92621. }
  92622. // Filter sets the optional parameter "filter": A filter expression that
  92623. // filters resources listed in the response. The expression must specify
  92624. // the field name, a comparison operator, and the value that you want to
  92625. // use for filtering. The value must be a string, a number, or a
  92626. // boolean. The comparison operator must be either =, !=, >, or <.
  92627. //
  92628. // For example, if you are filtering Compute Engine instances, you can
  92629. // exclude instances named example-instance by specifying name !=
  92630. // example-instance.
  92631. //
  92632. // You can also filter nested fields. For example, you could specify
  92633. // scheduling.automaticRestart = false to include instances only if they
  92634. // are not scheduled for automatic restarts. You can use filtering on
  92635. // nested fields to filter based on resource labels.
  92636. //
  92637. // To filter on multiple expressions, provide each separate expression
  92638. // within parentheses. For example, (scheduling.automaticRestart = true)
  92639. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92640. // AND expression. However, you can include AND and OR expressions
  92641. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92642. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92643. // true).
  92644. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  92645. c.urlParams_.Set("filter", filter)
  92646. return c
  92647. }
  92648. // MaxResults sets the optional parameter "maxResults": The maximum
  92649. // number of results per page that should be returned. If the number of
  92650. // available results is larger than maxResults, Compute Engine returns a
  92651. // nextPageToken that can be used to get the next page of results in
  92652. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92653. // (Default: 500)
  92654. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  92655. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92656. return c
  92657. }
  92658. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92659. // a certain order. By default, results are returned in alphanumerical
  92660. // order based on the resource name.
  92661. //
  92662. // You can also sort results in descending order based on the creation
  92663. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92664. // based on the creationTimestamp field in reverse chronological order
  92665. // (newest result first). Use this to sort resources like operations so
  92666. // that the newest operation is returned first.
  92667. //
  92668. // Currently, only sorting by name or creationTimestamp desc is
  92669. // supported.
  92670. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  92671. c.urlParams_.Set("orderBy", orderBy)
  92672. return c
  92673. }
  92674. // PageToken sets the optional parameter "pageToken": Specifies a page
  92675. // token to use. Set pageToken to the nextPageToken returned by a
  92676. // previous list request to get the next page of results.
  92677. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  92678. c.urlParams_.Set("pageToken", pageToken)
  92679. return c
  92680. }
  92681. // Fields allows partial responses to be retrieved. See
  92682. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92683. // for more information.
  92684. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  92685. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92686. return c
  92687. }
  92688. // IfNoneMatch sets the optional parameter which makes the operation
  92689. // fail if the object's ETag matches the given value. This is useful for
  92690. // getting updates only after the object has changed since the last
  92691. // request. Use googleapi.IsNotModified to check whether the response
  92692. // error from Do is the result of In-None-Match.
  92693. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  92694. c.ifNoneMatch_ = entityTag
  92695. return c
  92696. }
  92697. // Context sets the context to be used in this call's Do method. Any
  92698. // pending HTTP request will be aborted if the provided context is
  92699. // canceled.
  92700. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  92701. c.ctx_ = ctx
  92702. return c
  92703. }
  92704. // Header returns an http.Header that can be modified by the caller to
  92705. // add HTTP headers to the request.
  92706. func (c *RegionOperationsListCall) Header() http.Header {
  92707. if c.header_ == nil {
  92708. c.header_ = make(http.Header)
  92709. }
  92710. return c.header_
  92711. }
  92712. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  92713. reqHeaders := make(http.Header)
  92714. for k, v := range c.header_ {
  92715. reqHeaders[k] = v
  92716. }
  92717. reqHeaders.Set("User-Agent", c.s.userAgent())
  92718. if c.ifNoneMatch_ != "" {
  92719. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92720. }
  92721. var body io.Reader = nil
  92722. c.urlParams_.Set("alt", alt)
  92723. c.urlParams_.Set("prettyPrint", "false")
  92724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  92725. urls += "?" + c.urlParams_.Encode()
  92726. req, err := http.NewRequest("GET", urls, body)
  92727. if err != nil {
  92728. return nil, err
  92729. }
  92730. req.Header = reqHeaders
  92731. googleapi.Expand(req.URL, map[string]string{
  92732. "project": c.project,
  92733. "region": c.region,
  92734. })
  92735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92736. }
  92737. // Do executes the "compute.regionOperations.list" call.
  92738. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  92739. // status code is an error. Response headers are in either
  92740. // *OperationList.ServerResponse.Header or (if a response was returned
  92741. // at all) in error.(*googleapi.Error).Header. Use
  92742. // googleapi.IsNotModified to check whether the returned error was
  92743. // because http.StatusNotModified was returned.
  92744. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  92745. gensupport.SetOptions(c.urlParams_, opts...)
  92746. res, err := c.doRequest("json")
  92747. if res != nil && res.StatusCode == http.StatusNotModified {
  92748. if res.Body != nil {
  92749. res.Body.Close()
  92750. }
  92751. return nil, &googleapi.Error{
  92752. Code: res.StatusCode,
  92753. Header: res.Header,
  92754. }
  92755. }
  92756. if err != nil {
  92757. return nil, err
  92758. }
  92759. defer googleapi.CloseBody(res)
  92760. if err := googleapi.CheckResponse(res); err != nil {
  92761. return nil, err
  92762. }
  92763. ret := &OperationList{
  92764. ServerResponse: googleapi.ServerResponse{
  92765. Header: res.Header,
  92766. HTTPStatusCode: res.StatusCode,
  92767. },
  92768. }
  92769. target := &ret
  92770. if err := gensupport.DecodeResponse(target, res); err != nil {
  92771. return nil, err
  92772. }
  92773. return ret, nil
  92774. // {
  92775. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  92776. // "httpMethod": "GET",
  92777. // "id": "compute.regionOperations.list",
  92778. // "parameterOrder": [
  92779. // "project",
  92780. // "region"
  92781. // ],
  92782. // "parameters": {
  92783. // "filter": {
  92784. // "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).",
  92785. // "location": "query",
  92786. // "type": "string"
  92787. // },
  92788. // "maxResults": {
  92789. // "default": "500",
  92790. // "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)",
  92791. // "format": "uint32",
  92792. // "location": "query",
  92793. // "minimum": "0",
  92794. // "type": "integer"
  92795. // },
  92796. // "orderBy": {
  92797. // "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.",
  92798. // "location": "query",
  92799. // "type": "string"
  92800. // },
  92801. // "pageToken": {
  92802. // "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.",
  92803. // "location": "query",
  92804. // "type": "string"
  92805. // },
  92806. // "project": {
  92807. // "description": "Project ID for this request.",
  92808. // "location": "path",
  92809. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92810. // "required": true,
  92811. // "type": "string"
  92812. // },
  92813. // "region": {
  92814. // "description": "Name of the region for this request.",
  92815. // "location": "path",
  92816. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92817. // "required": true,
  92818. // "type": "string"
  92819. // }
  92820. // },
  92821. // "path": "{project}/regions/{region}/operations",
  92822. // "response": {
  92823. // "$ref": "OperationList"
  92824. // },
  92825. // "scopes": [
  92826. // "https://www.googleapis.com/auth/cloud-platform",
  92827. // "https://www.googleapis.com/auth/compute",
  92828. // "https://www.googleapis.com/auth/compute.readonly"
  92829. // ]
  92830. // }
  92831. }
  92832. // Pages invokes f for each page of results.
  92833. // A non-nil error returned from f will halt the iteration.
  92834. // The provided context supersedes any context provided to the Context method.
  92835. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  92836. c.ctx_ = ctx
  92837. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92838. for {
  92839. x, err := c.Do()
  92840. if err != nil {
  92841. return err
  92842. }
  92843. if err := f(x); err != nil {
  92844. return err
  92845. }
  92846. if x.NextPageToken == "" {
  92847. return nil
  92848. }
  92849. c.PageToken(x.NextPageToken)
  92850. }
  92851. }
  92852. // method id "compute.regions.get":
  92853. type RegionsGetCall struct {
  92854. s *Service
  92855. project string
  92856. region string
  92857. urlParams_ gensupport.URLParams
  92858. ifNoneMatch_ string
  92859. ctx_ context.Context
  92860. header_ http.Header
  92861. }
  92862. // Get: Returns the specified Region resource. Gets a list of available
  92863. // regions by making a list() request.
  92864. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  92865. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  92866. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92867. c.project = project
  92868. c.region = region
  92869. return c
  92870. }
  92871. // Fields allows partial responses to be retrieved. See
  92872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92873. // for more information.
  92874. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  92875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92876. return c
  92877. }
  92878. // IfNoneMatch sets the optional parameter which makes the operation
  92879. // fail if the object's ETag matches the given value. This is useful for
  92880. // getting updates only after the object has changed since the last
  92881. // request. Use googleapi.IsNotModified to check whether the response
  92882. // error from Do is the result of In-None-Match.
  92883. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  92884. c.ifNoneMatch_ = entityTag
  92885. return c
  92886. }
  92887. // Context sets the context to be used in this call's Do method. Any
  92888. // pending HTTP request will be aborted if the provided context is
  92889. // canceled.
  92890. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  92891. c.ctx_ = ctx
  92892. return c
  92893. }
  92894. // Header returns an http.Header that can be modified by the caller to
  92895. // add HTTP headers to the request.
  92896. func (c *RegionsGetCall) Header() http.Header {
  92897. if c.header_ == nil {
  92898. c.header_ = make(http.Header)
  92899. }
  92900. return c.header_
  92901. }
  92902. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  92903. reqHeaders := make(http.Header)
  92904. for k, v := range c.header_ {
  92905. reqHeaders[k] = v
  92906. }
  92907. reqHeaders.Set("User-Agent", c.s.userAgent())
  92908. if c.ifNoneMatch_ != "" {
  92909. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92910. }
  92911. var body io.Reader = nil
  92912. c.urlParams_.Set("alt", alt)
  92913. c.urlParams_.Set("prettyPrint", "false")
  92914. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  92915. urls += "?" + c.urlParams_.Encode()
  92916. req, err := http.NewRequest("GET", urls, body)
  92917. if err != nil {
  92918. return nil, err
  92919. }
  92920. req.Header = reqHeaders
  92921. googleapi.Expand(req.URL, map[string]string{
  92922. "project": c.project,
  92923. "region": c.region,
  92924. })
  92925. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92926. }
  92927. // Do executes the "compute.regions.get" call.
  92928. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  92929. // code is an error. Response headers are in either
  92930. // *Region.ServerResponse.Header or (if a response was returned at all)
  92931. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  92932. // check whether the returned error was because http.StatusNotModified
  92933. // was returned.
  92934. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  92935. gensupport.SetOptions(c.urlParams_, opts...)
  92936. res, err := c.doRequest("json")
  92937. if res != nil && res.StatusCode == http.StatusNotModified {
  92938. if res.Body != nil {
  92939. res.Body.Close()
  92940. }
  92941. return nil, &googleapi.Error{
  92942. Code: res.StatusCode,
  92943. Header: res.Header,
  92944. }
  92945. }
  92946. if err != nil {
  92947. return nil, err
  92948. }
  92949. defer googleapi.CloseBody(res)
  92950. if err := googleapi.CheckResponse(res); err != nil {
  92951. return nil, err
  92952. }
  92953. ret := &Region{
  92954. ServerResponse: googleapi.ServerResponse{
  92955. Header: res.Header,
  92956. HTTPStatusCode: res.StatusCode,
  92957. },
  92958. }
  92959. target := &ret
  92960. if err := gensupport.DecodeResponse(target, res); err != nil {
  92961. return nil, err
  92962. }
  92963. return ret, nil
  92964. // {
  92965. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  92966. // "httpMethod": "GET",
  92967. // "id": "compute.regions.get",
  92968. // "parameterOrder": [
  92969. // "project",
  92970. // "region"
  92971. // ],
  92972. // "parameters": {
  92973. // "project": {
  92974. // "description": "Project ID for this request.",
  92975. // "location": "path",
  92976. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92977. // "required": true,
  92978. // "type": "string"
  92979. // },
  92980. // "region": {
  92981. // "description": "Name of the region resource to return.",
  92982. // "location": "path",
  92983. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92984. // "required": true,
  92985. // "type": "string"
  92986. // }
  92987. // },
  92988. // "path": "{project}/regions/{region}",
  92989. // "response": {
  92990. // "$ref": "Region"
  92991. // },
  92992. // "scopes": [
  92993. // "https://www.googleapis.com/auth/cloud-platform",
  92994. // "https://www.googleapis.com/auth/compute",
  92995. // "https://www.googleapis.com/auth/compute.readonly"
  92996. // ]
  92997. // }
  92998. }
  92999. // method id "compute.regions.list":
  93000. type RegionsListCall struct {
  93001. s *Service
  93002. project string
  93003. urlParams_ gensupport.URLParams
  93004. ifNoneMatch_ string
  93005. ctx_ context.Context
  93006. header_ http.Header
  93007. }
  93008. // List: Retrieves the list of region resources available to the
  93009. // specified project.
  93010. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  93011. func (r *RegionsService) List(project string) *RegionsListCall {
  93012. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93013. c.project = project
  93014. return c
  93015. }
  93016. // Filter sets the optional parameter "filter": A filter expression that
  93017. // filters resources listed in the response. The expression must specify
  93018. // the field name, a comparison operator, and the value that you want to
  93019. // use for filtering. The value must be a string, a number, or a
  93020. // boolean. The comparison operator must be either =, !=, >, or <.
  93021. //
  93022. // For example, if you are filtering Compute Engine instances, you can
  93023. // exclude instances named example-instance by specifying name !=
  93024. // example-instance.
  93025. //
  93026. // You can also filter nested fields. For example, you could specify
  93027. // scheduling.automaticRestart = false to include instances only if they
  93028. // are not scheduled for automatic restarts. You can use filtering on
  93029. // nested fields to filter based on resource labels.
  93030. //
  93031. // To filter on multiple expressions, provide each separate expression
  93032. // within parentheses. For example, (scheduling.automaticRestart = true)
  93033. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93034. // AND expression. However, you can include AND and OR expressions
  93035. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93036. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93037. // true).
  93038. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  93039. c.urlParams_.Set("filter", filter)
  93040. return c
  93041. }
  93042. // MaxResults sets the optional parameter "maxResults": The maximum
  93043. // number of results per page that should be returned. If the number of
  93044. // available results is larger than maxResults, Compute Engine returns a
  93045. // nextPageToken that can be used to get the next page of results in
  93046. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93047. // (Default: 500)
  93048. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  93049. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93050. return c
  93051. }
  93052. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93053. // a certain order. By default, results are returned in alphanumerical
  93054. // order based on the resource name.
  93055. //
  93056. // You can also sort results in descending order based on the creation
  93057. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93058. // based on the creationTimestamp field in reverse chronological order
  93059. // (newest result first). Use this to sort resources like operations so
  93060. // that the newest operation is returned first.
  93061. //
  93062. // Currently, only sorting by name or creationTimestamp desc is
  93063. // supported.
  93064. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  93065. c.urlParams_.Set("orderBy", orderBy)
  93066. return c
  93067. }
  93068. // PageToken sets the optional parameter "pageToken": Specifies a page
  93069. // token to use. Set pageToken to the nextPageToken returned by a
  93070. // previous list request to get the next page of results.
  93071. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  93072. c.urlParams_.Set("pageToken", pageToken)
  93073. return c
  93074. }
  93075. // Fields allows partial responses to be retrieved. See
  93076. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93077. // for more information.
  93078. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  93079. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93080. return c
  93081. }
  93082. // IfNoneMatch sets the optional parameter which makes the operation
  93083. // fail if the object's ETag matches the given value. This is useful for
  93084. // getting updates only after the object has changed since the last
  93085. // request. Use googleapi.IsNotModified to check whether the response
  93086. // error from Do is the result of In-None-Match.
  93087. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  93088. c.ifNoneMatch_ = entityTag
  93089. return c
  93090. }
  93091. // Context sets the context to be used in this call's Do method. Any
  93092. // pending HTTP request will be aborted if the provided context is
  93093. // canceled.
  93094. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  93095. c.ctx_ = ctx
  93096. return c
  93097. }
  93098. // Header returns an http.Header that can be modified by the caller to
  93099. // add HTTP headers to the request.
  93100. func (c *RegionsListCall) Header() http.Header {
  93101. if c.header_ == nil {
  93102. c.header_ = make(http.Header)
  93103. }
  93104. return c.header_
  93105. }
  93106. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  93107. reqHeaders := make(http.Header)
  93108. for k, v := range c.header_ {
  93109. reqHeaders[k] = v
  93110. }
  93111. reqHeaders.Set("User-Agent", c.s.userAgent())
  93112. if c.ifNoneMatch_ != "" {
  93113. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93114. }
  93115. var body io.Reader = nil
  93116. c.urlParams_.Set("alt", alt)
  93117. c.urlParams_.Set("prettyPrint", "false")
  93118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  93119. urls += "?" + c.urlParams_.Encode()
  93120. req, err := http.NewRequest("GET", urls, body)
  93121. if err != nil {
  93122. return nil, err
  93123. }
  93124. req.Header = reqHeaders
  93125. googleapi.Expand(req.URL, map[string]string{
  93126. "project": c.project,
  93127. })
  93128. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93129. }
  93130. // Do executes the "compute.regions.list" call.
  93131. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  93132. // status code is an error. Response headers are in either
  93133. // *RegionList.ServerResponse.Header or (if a response was returned at
  93134. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93135. // to check whether the returned error was because
  93136. // http.StatusNotModified was returned.
  93137. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  93138. gensupport.SetOptions(c.urlParams_, opts...)
  93139. res, err := c.doRequest("json")
  93140. if res != nil && res.StatusCode == http.StatusNotModified {
  93141. if res.Body != nil {
  93142. res.Body.Close()
  93143. }
  93144. return nil, &googleapi.Error{
  93145. Code: res.StatusCode,
  93146. Header: res.Header,
  93147. }
  93148. }
  93149. if err != nil {
  93150. return nil, err
  93151. }
  93152. defer googleapi.CloseBody(res)
  93153. if err := googleapi.CheckResponse(res); err != nil {
  93154. return nil, err
  93155. }
  93156. ret := &RegionList{
  93157. ServerResponse: googleapi.ServerResponse{
  93158. Header: res.Header,
  93159. HTTPStatusCode: res.StatusCode,
  93160. },
  93161. }
  93162. target := &ret
  93163. if err := gensupport.DecodeResponse(target, res); err != nil {
  93164. return nil, err
  93165. }
  93166. return ret, nil
  93167. // {
  93168. // "description": "Retrieves the list of region resources available to the specified project.",
  93169. // "httpMethod": "GET",
  93170. // "id": "compute.regions.list",
  93171. // "parameterOrder": [
  93172. // "project"
  93173. // ],
  93174. // "parameters": {
  93175. // "filter": {
  93176. // "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).",
  93177. // "location": "query",
  93178. // "type": "string"
  93179. // },
  93180. // "maxResults": {
  93181. // "default": "500",
  93182. // "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)",
  93183. // "format": "uint32",
  93184. // "location": "query",
  93185. // "minimum": "0",
  93186. // "type": "integer"
  93187. // },
  93188. // "orderBy": {
  93189. // "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.",
  93190. // "location": "query",
  93191. // "type": "string"
  93192. // },
  93193. // "pageToken": {
  93194. // "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.",
  93195. // "location": "query",
  93196. // "type": "string"
  93197. // },
  93198. // "project": {
  93199. // "description": "Project ID for this request.",
  93200. // "location": "path",
  93201. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93202. // "required": true,
  93203. // "type": "string"
  93204. // }
  93205. // },
  93206. // "path": "{project}/regions",
  93207. // "response": {
  93208. // "$ref": "RegionList"
  93209. // },
  93210. // "scopes": [
  93211. // "https://www.googleapis.com/auth/cloud-platform",
  93212. // "https://www.googleapis.com/auth/compute",
  93213. // "https://www.googleapis.com/auth/compute.readonly"
  93214. // ]
  93215. // }
  93216. }
  93217. // Pages invokes f for each page of results.
  93218. // A non-nil error returned from f will halt the iteration.
  93219. // The provided context supersedes any context provided to the Context method.
  93220. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  93221. c.ctx_ = ctx
  93222. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93223. for {
  93224. x, err := c.Do()
  93225. if err != nil {
  93226. return err
  93227. }
  93228. if err := f(x); err != nil {
  93229. return err
  93230. }
  93231. if x.NextPageToken == "" {
  93232. return nil
  93233. }
  93234. c.PageToken(x.NextPageToken)
  93235. }
  93236. }
  93237. // method id "compute.resourcePolicies.aggregatedList":
  93238. type ResourcePoliciesAggregatedListCall struct {
  93239. s *Service
  93240. project string
  93241. urlParams_ gensupport.URLParams
  93242. ifNoneMatch_ string
  93243. ctx_ context.Context
  93244. header_ http.Header
  93245. }
  93246. // AggregatedList: Retrieves an aggregated list of resource policies.
  93247. func (r *ResourcePoliciesService) AggregatedList(project string) *ResourcePoliciesAggregatedListCall {
  93248. c := &ResourcePoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93249. c.project = project
  93250. return c
  93251. }
  93252. // Filter sets the optional parameter "filter": A filter expression that
  93253. // filters resources listed in the response. The expression must specify
  93254. // the field name, a comparison operator, and the value that you want to
  93255. // use for filtering. The value must be a string, a number, or a
  93256. // boolean. The comparison operator must be either =, !=, >, or <.
  93257. //
  93258. // For example, if you are filtering Compute Engine instances, you can
  93259. // exclude instances named example-instance by specifying name !=
  93260. // example-instance.
  93261. //
  93262. // You can also filter nested fields. For example, you could specify
  93263. // scheduling.automaticRestart = false to include instances only if they
  93264. // are not scheduled for automatic restarts. You can use filtering on
  93265. // nested fields to filter based on resource labels.
  93266. //
  93267. // To filter on multiple expressions, provide each separate expression
  93268. // within parentheses. For example, (scheduling.automaticRestart = true)
  93269. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93270. // AND expression. However, you can include AND and OR expressions
  93271. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93272. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93273. // true).
  93274. func (c *ResourcePoliciesAggregatedListCall) Filter(filter string) *ResourcePoliciesAggregatedListCall {
  93275. c.urlParams_.Set("filter", filter)
  93276. return c
  93277. }
  93278. // MaxResults sets the optional parameter "maxResults": The maximum
  93279. // number of results per page that should be returned. If the number of
  93280. // available results is larger than maxResults, Compute Engine returns a
  93281. // nextPageToken that can be used to get the next page of results in
  93282. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93283. // (Default: 500)
  93284. func (c *ResourcePoliciesAggregatedListCall) MaxResults(maxResults int64) *ResourcePoliciesAggregatedListCall {
  93285. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93286. return c
  93287. }
  93288. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93289. // a certain order. By default, results are returned in alphanumerical
  93290. // order based on the resource name.
  93291. //
  93292. // You can also sort results in descending order based on the creation
  93293. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93294. // based on the creationTimestamp field in reverse chronological order
  93295. // (newest result first). Use this to sort resources like operations so
  93296. // that the newest operation is returned first.
  93297. //
  93298. // Currently, only sorting by name or creationTimestamp desc is
  93299. // supported.
  93300. func (c *ResourcePoliciesAggregatedListCall) OrderBy(orderBy string) *ResourcePoliciesAggregatedListCall {
  93301. c.urlParams_.Set("orderBy", orderBy)
  93302. return c
  93303. }
  93304. // PageToken sets the optional parameter "pageToken": Specifies a page
  93305. // token to use. Set pageToken to the nextPageToken returned by a
  93306. // previous list request to get the next page of results.
  93307. func (c *ResourcePoliciesAggregatedListCall) PageToken(pageToken string) *ResourcePoliciesAggregatedListCall {
  93308. c.urlParams_.Set("pageToken", pageToken)
  93309. return c
  93310. }
  93311. // Fields allows partial responses to be retrieved. See
  93312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93313. // for more information.
  93314. func (c *ResourcePoliciesAggregatedListCall) Fields(s ...googleapi.Field) *ResourcePoliciesAggregatedListCall {
  93315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93316. return c
  93317. }
  93318. // IfNoneMatch sets the optional parameter which makes the operation
  93319. // fail if the object's ETag matches the given value. This is useful for
  93320. // getting updates only after the object has changed since the last
  93321. // request. Use googleapi.IsNotModified to check whether the response
  93322. // error from Do is the result of In-None-Match.
  93323. func (c *ResourcePoliciesAggregatedListCall) IfNoneMatch(entityTag string) *ResourcePoliciesAggregatedListCall {
  93324. c.ifNoneMatch_ = entityTag
  93325. return c
  93326. }
  93327. // Context sets the context to be used in this call's Do method. Any
  93328. // pending HTTP request will be aborted if the provided context is
  93329. // canceled.
  93330. func (c *ResourcePoliciesAggregatedListCall) Context(ctx context.Context) *ResourcePoliciesAggregatedListCall {
  93331. c.ctx_ = ctx
  93332. return c
  93333. }
  93334. // Header returns an http.Header that can be modified by the caller to
  93335. // add HTTP headers to the request.
  93336. func (c *ResourcePoliciesAggregatedListCall) Header() http.Header {
  93337. if c.header_ == nil {
  93338. c.header_ = make(http.Header)
  93339. }
  93340. return c.header_
  93341. }
  93342. func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  93343. reqHeaders := make(http.Header)
  93344. for k, v := range c.header_ {
  93345. reqHeaders[k] = v
  93346. }
  93347. reqHeaders.Set("User-Agent", c.s.userAgent())
  93348. if c.ifNoneMatch_ != "" {
  93349. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93350. }
  93351. var body io.Reader = nil
  93352. c.urlParams_.Set("alt", alt)
  93353. c.urlParams_.Set("prettyPrint", "false")
  93354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/resourcePolicies")
  93355. urls += "?" + c.urlParams_.Encode()
  93356. req, err := http.NewRequest("GET", urls, body)
  93357. if err != nil {
  93358. return nil, err
  93359. }
  93360. req.Header = reqHeaders
  93361. googleapi.Expand(req.URL, map[string]string{
  93362. "project": c.project,
  93363. })
  93364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93365. }
  93366. // Do executes the "compute.resourcePolicies.aggregatedList" call.
  93367. // Exactly one of *ResourcePolicyAggregatedList or error will be
  93368. // non-nil. Any non-2xx status code is an error. Response headers are in
  93369. // either *ResourcePolicyAggregatedList.ServerResponse.Header or (if a
  93370. // response was returned at all) in error.(*googleapi.Error).Header. Use
  93371. // googleapi.IsNotModified to check whether the returned error was
  93372. // because http.StatusNotModified was returned.
  93373. func (c *ResourcePoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyAggregatedList, error) {
  93374. gensupport.SetOptions(c.urlParams_, opts...)
  93375. res, err := c.doRequest("json")
  93376. if res != nil && res.StatusCode == http.StatusNotModified {
  93377. if res.Body != nil {
  93378. res.Body.Close()
  93379. }
  93380. return nil, &googleapi.Error{
  93381. Code: res.StatusCode,
  93382. Header: res.Header,
  93383. }
  93384. }
  93385. if err != nil {
  93386. return nil, err
  93387. }
  93388. defer googleapi.CloseBody(res)
  93389. if err := googleapi.CheckResponse(res); err != nil {
  93390. return nil, err
  93391. }
  93392. ret := &ResourcePolicyAggregatedList{
  93393. ServerResponse: googleapi.ServerResponse{
  93394. Header: res.Header,
  93395. HTTPStatusCode: res.StatusCode,
  93396. },
  93397. }
  93398. target := &ret
  93399. if err := gensupport.DecodeResponse(target, res); err != nil {
  93400. return nil, err
  93401. }
  93402. return ret, nil
  93403. // {
  93404. // "description": "Retrieves an aggregated list of resource policies.",
  93405. // "httpMethod": "GET",
  93406. // "id": "compute.resourcePolicies.aggregatedList",
  93407. // "parameterOrder": [
  93408. // "project"
  93409. // ],
  93410. // "parameters": {
  93411. // "filter": {
  93412. // "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).",
  93413. // "location": "query",
  93414. // "type": "string"
  93415. // },
  93416. // "maxResults": {
  93417. // "default": "500",
  93418. // "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)",
  93419. // "format": "uint32",
  93420. // "location": "query",
  93421. // "minimum": "0",
  93422. // "type": "integer"
  93423. // },
  93424. // "orderBy": {
  93425. // "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.",
  93426. // "location": "query",
  93427. // "type": "string"
  93428. // },
  93429. // "pageToken": {
  93430. // "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.",
  93431. // "location": "query",
  93432. // "type": "string"
  93433. // },
  93434. // "project": {
  93435. // "description": "Project ID for this request.",
  93436. // "location": "path",
  93437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93438. // "required": true,
  93439. // "type": "string"
  93440. // }
  93441. // },
  93442. // "path": "{project}/aggregated/resourcePolicies",
  93443. // "response": {
  93444. // "$ref": "ResourcePolicyAggregatedList"
  93445. // },
  93446. // "scopes": [
  93447. // "https://www.googleapis.com/auth/cloud-platform",
  93448. // "https://www.googleapis.com/auth/compute",
  93449. // "https://www.googleapis.com/auth/compute.readonly"
  93450. // ]
  93451. // }
  93452. }
  93453. // Pages invokes f for each page of results.
  93454. // A non-nil error returned from f will halt the iteration.
  93455. // The provided context supersedes any context provided to the Context method.
  93456. func (c *ResourcePoliciesAggregatedListCall) Pages(ctx context.Context, f func(*ResourcePolicyAggregatedList) error) error {
  93457. c.ctx_ = ctx
  93458. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93459. for {
  93460. x, err := c.Do()
  93461. if err != nil {
  93462. return err
  93463. }
  93464. if err := f(x); err != nil {
  93465. return err
  93466. }
  93467. if x.NextPageToken == "" {
  93468. return nil
  93469. }
  93470. c.PageToken(x.NextPageToken)
  93471. }
  93472. }
  93473. // method id "compute.resourcePolicies.delete":
  93474. type ResourcePoliciesDeleteCall struct {
  93475. s *Service
  93476. project string
  93477. region string
  93478. resourcePolicy string
  93479. urlParams_ gensupport.URLParams
  93480. ctx_ context.Context
  93481. header_ http.Header
  93482. }
  93483. // Delete: Deletes the specified resource policy.
  93484. func (r *ResourcePoliciesService) Delete(project string, region string, resourcePolicy string) *ResourcePoliciesDeleteCall {
  93485. c := &ResourcePoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93486. c.project = project
  93487. c.region = region
  93488. c.resourcePolicy = resourcePolicy
  93489. return c
  93490. }
  93491. // RequestId sets the optional parameter "requestId": An optional
  93492. // request ID to identify requests. Specify a unique request ID so that
  93493. // if you must retry your request, the server will know to ignore the
  93494. // request if it has already been completed.
  93495. //
  93496. // For example, consider a situation where you make an initial request
  93497. // and the request times out. If you make the request again with the
  93498. // same request ID, the server can check if original operation with the
  93499. // same request ID was received, and if so, will ignore the second
  93500. // request. This prevents clients from accidentally creating duplicate
  93501. // commitments.
  93502. //
  93503. // The request ID must be a valid UUID with the exception that zero UUID
  93504. // is not supported (00000000-0000-0000-0000-000000000000).
  93505. func (c *ResourcePoliciesDeleteCall) RequestId(requestId string) *ResourcePoliciesDeleteCall {
  93506. c.urlParams_.Set("requestId", requestId)
  93507. return c
  93508. }
  93509. // Fields allows partial responses to be retrieved. See
  93510. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93511. // for more information.
  93512. func (c *ResourcePoliciesDeleteCall) Fields(s ...googleapi.Field) *ResourcePoliciesDeleteCall {
  93513. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93514. return c
  93515. }
  93516. // Context sets the context to be used in this call's Do method. Any
  93517. // pending HTTP request will be aborted if the provided context is
  93518. // canceled.
  93519. func (c *ResourcePoliciesDeleteCall) Context(ctx context.Context) *ResourcePoliciesDeleteCall {
  93520. c.ctx_ = ctx
  93521. return c
  93522. }
  93523. // Header returns an http.Header that can be modified by the caller to
  93524. // add HTTP headers to the request.
  93525. func (c *ResourcePoliciesDeleteCall) Header() http.Header {
  93526. if c.header_ == nil {
  93527. c.header_ = make(http.Header)
  93528. }
  93529. return c.header_
  93530. }
  93531. func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  93532. reqHeaders := make(http.Header)
  93533. for k, v := range c.header_ {
  93534. reqHeaders[k] = v
  93535. }
  93536. reqHeaders.Set("User-Agent", c.s.userAgent())
  93537. var body io.Reader = nil
  93538. c.urlParams_.Set("alt", alt)
  93539. c.urlParams_.Set("prettyPrint", "false")
  93540. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  93541. urls += "?" + c.urlParams_.Encode()
  93542. req, err := http.NewRequest("DELETE", urls, body)
  93543. if err != nil {
  93544. return nil, err
  93545. }
  93546. req.Header = reqHeaders
  93547. googleapi.Expand(req.URL, map[string]string{
  93548. "project": c.project,
  93549. "region": c.region,
  93550. "resourcePolicy": c.resourcePolicy,
  93551. })
  93552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93553. }
  93554. // Do executes the "compute.resourcePolicies.delete" call.
  93555. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93556. // status code is an error. Response headers are in either
  93557. // *Operation.ServerResponse.Header or (if a response was returned at
  93558. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93559. // to check whether the returned error was because
  93560. // http.StatusNotModified was returned.
  93561. func (c *ResourcePoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93562. gensupport.SetOptions(c.urlParams_, opts...)
  93563. res, err := c.doRequest("json")
  93564. if res != nil && res.StatusCode == http.StatusNotModified {
  93565. if res.Body != nil {
  93566. res.Body.Close()
  93567. }
  93568. return nil, &googleapi.Error{
  93569. Code: res.StatusCode,
  93570. Header: res.Header,
  93571. }
  93572. }
  93573. if err != nil {
  93574. return nil, err
  93575. }
  93576. defer googleapi.CloseBody(res)
  93577. if err := googleapi.CheckResponse(res); err != nil {
  93578. return nil, err
  93579. }
  93580. ret := &Operation{
  93581. ServerResponse: googleapi.ServerResponse{
  93582. Header: res.Header,
  93583. HTTPStatusCode: res.StatusCode,
  93584. },
  93585. }
  93586. target := &ret
  93587. if err := gensupport.DecodeResponse(target, res); err != nil {
  93588. return nil, err
  93589. }
  93590. return ret, nil
  93591. // {
  93592. // "description": "Deletes the specified resource policy.",
  93593. // "httpMethod": "DELETE",
  93594. // "id": "compute.resourcePolicies.delete",
  93595. // "parameterOrder": [
  93596. // "project",
  93597. // "region",
  93598. // "resourcePolicy"
  93599. // ],
  93600. // "parameters": {
  93601. // "project": {
  93602. // "description": "Project ID for this request.",
  93603. // "location": "path",
  93604. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93605. // "required": true,
  93606. // "type": "string"
  93607. // },
  93608. // "region": {
  93609. // "description": "Name of the region for this request.",
  93610. // "location": "path",
  93611. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93612. // "required": true,
  93613. // "type": "string"
  93614. // },
  93615. // "requestId": {
  93616. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93617. // "location": "query",
  93618. // "type": "string"
  93619. // },
  93620. // "resourcePolicy": {
  93621. // "description": "Name of the resource policy to delete.",
  93622. // "location": "path",
  93623. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93624. // "required": true,
  93625. // "type": "string"
  93626. // }
  93627. // },
  93628. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  93629. // "response": {
  93630. // "$ref": "Operation"
  93631. // },
  93632. // "scopes": [
  93633. // "https://www.googleapis.com/auth/cloud-platform",
  93634. // "https://www.googleapis.com/auth/compute"
  93635. // ]
  93636. // }
  93637. }
  93638. // method id "compute.resourcePolicies.get":
  93639. type ResourcePoliciesGetCall struct {
  93640. s *Service
  93641. project string
  93642. region string
  93643. resourcePolicy string
  93644. urlParams_ gensupport.URLParams
  93645. ifNoneMatch_ string
  93646. ctx_ context.Context
  93647. header_ http.Header
  93648. }
  93649. // Get: Retrieves all information of the specified resource policy.
  93650. func (r *ResourcePoliciesService) Get(project string, region string, resourcePolicy string) *ResourcePoliciesGetCall {
  93651. c := &ResourcePoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93652. c.project = project
  93653. c.region = region
  93654. c.resourcePolicy = resourcePolicy
  93655. return c
  93656. }
  93657. // Fields allows partial responses to be retrieved. See
  93658. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93659. // for more information.
  93660. func (c *ResourcePoliciesGetCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetCall {
  93661. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93662. return c
  93663. }
  93664. // IfNoneMatch sets the optional parameter which makes the operation
  93665. // fail if the object's ETag matches the given value. This is useful for
  93666. // getting updates only after the object has changed since the last
  93667. // request. Use googleapi.IsNotModified to check whether the response
  93668. // error from Do is the result of In-None-Match.
  93669. func (c *ResourcePoliciesGetCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetCall {
  93670. c.ifNoneMatch_ = entityTag
  93671. return c
  93672. }
  93673. // Context sets the context to be used in this call's Do method. Any
  93674. // pending HTTP request will be aborted if the provided context is
  93675. // canceled.
  93676. func (c *ResourcePoliciesGetCall) Context(ctx context.Context) *ResourcePoliciesGetCall {
  93677. c.ctx_ = ctx
  93678. return c
  93679. }
  93680. // Header returns an http.Header that can be modified by the caller to
  93681. // add HTTP headers to the request.
  93682. func (c *ResourcePoliciesGetCall) Header() http.Header {
  93683. if c.header_ == nil {
  93684. c.header_ = make(http.Header)
  93685. }
  93686. return c.header_
  93687. }
  93688. func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  93689. reqHeaders := make(http.Header)
  93690. for k, v := range c.header_ {
  93691. reqHeaders[k] = v
  93692. }
  93693. reqHeaders.Set("User-Agent", c.s.userAgent())
  93694. if c.ifNoneMatch_ != "" {
  93695. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93696. }
  93697. var body io.Reader = nil
  93698. c.urlParams_.Set("alt", alt)
  93699. c.urlParams_.Set("prettyPrint", "false")
  93700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  93701. urls += "?" + c.urlParams_.Encode()
  93702. req, err := http.NewRequest("GET", urls, body)
  93703. if err != nil {
  93704. return nil, err
  93705. }
  93706. req.Header = reqHeaders
  93707. googleapi.Expand(req.URL, map[string]string{
  93708. "project": c.project,
  93709. "region": c.region,
  93710. "resourcePolicy": c.resourcePolicy,
  93711. })
  93712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93713. }
  93714. // Do executes the "compute.resourcePolicies.get" call.
  93715. // Exactly one of *ResourcePolicy or error will be non-nil. Any non-2xx
  93716. // status code is an error. Response headers are in either
  93717. // *ResourcePolicy.ServerResponse.Header or (if a response was returned
  93718. // at all) in error.(*googleapi.Error).Header. Use
  93719. // googleapi.IsNotModified to check whether the returned error was
  93720. // because http.StatusNotModified was returned.
  93721. func (c *ResourcePoliciesGetCall) Do(opts ...googleapi.CallOption) (*ResourcePolicy, error) {
  93722. gensupport.SetOptions(c.urlParams_, opts...)
  93723. res, err := c.doRequest("json")
  93724. if res != nil && res.StatusCode == http.StatusNotModified {
  93725. if res.Body != nil {
  93726. res.Body.Close()
  93727. }
  93728. return nil, &googleapi.Error{
  93729. Code: res.StatusCode,
  93730. Header: res.Header,
  93731. }
  93732. }
  93733. if err != nil {
  93734. return nil, err
  93735. }
  93736. defer googleapi.CloseBody(res)
  93737. if err := googleapi.CheckResponse(res); err != nil {
  93738. return nil, err
  93739. }
  93740. ret := &ResourcePolicy{
  93741. ServerResponse: googleapi.ServerResponse{
  93742. Header: res.Header,
  93743. HTTPStatusCode: res.StatusCode,
  93744. },
  93745. }
  93746. target := &ret
  93747. if err := gensupport.DecodeResponse(target, res); err != nil {
  93748. return nil, err
  93749. }
  93750. return ret, nil
  93751. // {
  93752. // "description": "Retrieves all information of the specified resource policy.",
  93753. // "httpMethod": "GET",
  93754. // "id": "compute.resourcePolicies.get",
  93755. // "parameterOrder": [
  93756. // "project",
  93757. // "region",
  93758. // "resourcePolicy"
  93759. // ],
  93760. // "parameters": {
  93761. // "project": {
  93762. // "description": "Project ID for this request.",
  93763. // "location": "path",
  93764. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93765. // "required": true,
  93766. // "type": "string"
  93767. // },
  93768. // "region": {
  93769. // "description": "Name of the region for this request.",
  93770. // "location": "path",
  93771. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93772. // "required": true,
  93773. // "type": "string"
  93774. // },
  93775. // "resourcePolicy": {
  93776. // "description": "Name of the resource policy to retrieve.",
  93777. // "location": "path",
  93778. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93779. // "required": true,
  93780. // "type": "string"
  93781. // }
  93782. // },
  93783. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  93784. // "response": {
  93785. // "$ref": "ResourcePolicy"
  93786. // },
  93787. // "scopes": [
  93788. // "https://www.googleapis.com/auth/cloud-platform",
  93789. // "https://www.googleapis.com/auth/compute",
  93790. // "https://www.googleapis.com/auth/compute.readonly"
  93791. // ]
  93792. // }
  93793. }
  93794. // method id "compute.resourcePolicies.insert":
  93795. type ResourcePoliciesInsertCall struct {
  93796. s *Service
  93797. project string
  93798. region string
  93799. resourcepolicy *ResourcePolicy
  93800. urlParams_ gensupport.URLParams
  93801. ctx_ context.Context
  93802. header_ http.Header
  93803. }
  93804. // Insert: Creates a new resource policy.
  93805. func (r *ResourcePoliciesService) Insert(project string, region string, resourcepolicy *ResourcePolicy) *ResourcePoliciesInsertCall {
  93806. c := &ResourcePoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93807. c.project = project
  93808. c.region = region
  93809. c.resourcepolicy = resourcepolicy
  93810. return c
  93811. }
  93812. // RequestId sets the optional parameter "requestId": An optional
  93813. // request ID to identify requests. Specify a unique request ID so that
  93814. // if you must retry your request, the server will know to ignore the
  93815. // request if it has already been completed.
  93816. //
  93817. // For example, consider a situation where you make an initial request
  93818. // and the request times out. If you make the request again with the
  93819. // same request ID, the server can check if original operation with the
  93820. // same request ID was received, and if so, will ignore the second
  93821. // request. This prevents clients from accidentally creating duplicate
  93822. // commitments.
  93823. //
  93824. // The request ID must be a valid UUID with the exception that zero UUID
  93825. // is not supported (00000000-0000-0000-0000-000000000000).
  93826. func (c *ResourcePoliciesInsertCall) RequestId(requestId string) *ResourcePoliciesInsertCall {
  93827. c.urlParams_.Set("requestId", requestId)
  93828. return c
  93829. }
  93830. // Fields allows partial responses to be retrieved. See
  93831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93832. // for more information.
  93833. func (c *ResourcePoliciesInsertCall) Fields(s ...googleapi.Field) *ResourcePoliciesInsertCall {
  93834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93835. return c
  93836. }
  93837. // Context sets the context to be used in this call's Do method. Any
  93838. // pending HTTP request will be aborted if the provided context is
  93839. // canceled.
  93840. func (c *ResourcePoliciesInsertCall) Context(ctx context.Context) *ResourcePoliciesInsertCall {
  93841. c.ctx_ = ctx
  93842. return c
  93843. }
  93844. // Header returns an http.Header that can be modified by the caller to
  93845. // add HTTP headers to the request.
  93846. func (c *ResourcePoliciesInsertCall) Header() http.Header {
  93847. if c.header_ == nil {
  93848. c.header_ = make(http.Header)
  93849. }
  93850. return c.header_
  93851. }
  93852. func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  93853. reqHeaders := make(http.Header)
  93854. for k, v := range c.header_ {
  93855. reqHeaders[k] = v
  93856. }
  93857. reqHeaders.Set("User-Agent", c.s.userAgent())
  93858. var body io.Reader = nil
  93859. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy)
  93860. if err != nil {
  93861. return nil, err
  93862. }
  93863. reqHeaders.Set("Content-Type", "application/json")
  93864. c.urlParams_.Set("alt", alt)
  93865. c.urlParams_.Set("prettyPrint", "false")
  93866. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  93867. urls += "?" + c.urlParams_.Encode()
  93868. req, err := http.NewRequest("POST", urls, body)
  93869. if err != nil {
  93870. return nil, err
  93871. }
  93872. req.Header = reqHeaders
  93873. googleapi.Expand(req.URL, map[string]string{
  93874. "project": c.project,
  93875. "region": c.region,
  93876. })
  93877. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93878. }
  93879. // Do executes the "compute.resourcePolicies.insert" call.
  93880. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93881. // status code is an error. Response headers are in either
  93882. // *Operation.ServerResponse.Header or (if a response was returned at
  93883. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93884. // to check whether the returned error was because
  93885. // http.StatusNotModified was returned.
  93886. func (c *ResourcePoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93887. gensupport.SetOptions(c.urlParams_, opts...)
  93888. res, err := c.doRequest("json")
  93889. if res != nil && res.StatusCode == http.StatusNotModified {
  93890. if res.Body != nil {
  93891. res.Body.Close()
  93892. }
  93893. return nil, &googleapi.Error{
  93894. Code: res.StatusCode,
  93895. Header: res.Header,
  93896. }
  93897. }
  93898. if err != nil {
  93899. return nil, err
  93900. }
  93901. defer googleapi.CloseBody(res)
  93902. if err := googleapi.CheckResponse(res); err != nil {
  93903. return nil, err
  93904. }
  93905. ret := &Operation{
  93906. ServerResponse: googleapi.ServerResponse{
  93907. Header: res.Header,
  93908. HTTPStatusCode: res.StatusCode,
  93909. },
  93910. }
  93911. target := &ret
  93912. if err := gensupport.DecodeResponse(target, res); err != nil {
  93913. return nil, err
  93914. }
  93915. return ret, nil
  93916. // {
  93917. // "description": "Creates a new resource policy.",
  93918. // "httpMethod": "POST",
  93919. // "id": "compute.resourcePolicies.insert",
  93920. // "parameterOrder": [
  93921. // "project",
  93922. // "region"
  93923. // ],
  93924. // "parameters": {
  93925. // "project": {
  93926. // "description": "Project ID for this request.",
  93927. // "location": "path",
  93928. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93929. // "required": true,
  93930. // "type": "string"
  93931. // },
  93932. // "region": {
  93933. // "description": "Name of the region for this request.",
  93934. // "location": "path",
  93935. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93936. // "required": true,
  93937. // "type": "string"
  93938. // },
  93939. // "requestId": {
  93940. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93941. // "location": "query",
  93942. // "type": "string"
  93943. // }
  93944. // },
  93945. // "path": "{project}/regions/{region}/resourcePolicies",
  93946. // "request": {
  93947. // "$ref": "ResourcePolicy"
  93948. // },
  93949. // "response": {
  93950. // "$ref": "Operation"
  93951. // },
  93952. // "scopes": [
  93953. // "https://www.googleapis.com/auth/cloud-platform",
  93954. // "https://www.googleapis.com/auth/compute"
  93955. // ]
  93956. // }
  93957. }
  93958. // method id "compute.resourcePolicies.list":
  93959. type ResourcePoliciesListCall struct {
  93960. s *Service
  93961. project string
  93962. region string
  93963. urlParams_ gensupport.URLParams
  93964. ifNoneMatch_ string
  93965. ctx_ context.Context
  93966. header_ http.Header
  93967. }
  93968. // List: A list all the resource policies that have been configured for
  93969. // the specified project in specified region.
  93970. func (r *ResourcePoliciesService) List(project string, region string) *ResourcePoliciesListCall {
  93971. c := &ResourcePoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93972. c.project = project
  93973. c.region = region
  93974. return c
  93975. }
  93976. // Filter sets the optional parameter "filter": A filter expression that
  93977. // filters resources listed in the response. The expression must specify
  93978. // the field name, a comparison operator, and the value that you want to
  93979. // use for filtering. The value must be a string, a number, or a
  93980. // boolean. The comparison operator must be either =, !=, >, or <.
  93981. //
  93982. // For example, if you are filtering Compute Engine instances, you can
  93983. // exclude instances named example-instance by specifying name !=
  93984. // example-instance.
  93985. //
  93986. // You can also filter nested fields. For example, you could specify
  93987. // scheduling.automaticRestart = false to include instances only if they
  93988. // are not scheduled for automatic restarts. You can use filtering on
  93989. // nested fields to filter based on resource labels.
  93990. //
  93991. // To filter on multiple expressions, provide each separate expression
  93992. // within parentheses. For example, (scheduling.automaticRestart = true)
  93993. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93994. // AND expression. However, you can include AND and OR expressions
  93995. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93996. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93997. // true).
  93998. func (c *ResourcePoliciesListCall) Filter(filter string) *ResourcePoliciesListCall {
  93999. c.urlParams_.Set("filter", filter)
  94000. return c
  94001. }
  94002. // MaxResults sets the optional parameter "maxResults": The maximum
  94003. // number of results per page that should be returned. If the number of
  94004. // available results is larger than maxResults, Compute Engine returns a
  94005. // nextPageToken that can be used to get the next page of results in
  94006. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94007. // (Default: 500)
  94008. func (c *ResourcePoliciesListCall) MaxResults(maxResults int64) *ResourcePoliciesListCall {
  94009. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94010. return c
  94011. }
  94012. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94013. // a certain order. By default, results are returned in alphanumerical
  94014. // order based on the resource name.
  94015. //
  94016. // You can also sort results in descending order based on the creation
  94017. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94018. // based on the creationTimestamp field in reverse chronological order
  94019. // (newest result first). Use this to sort resources like operations so
  94020. // that the newest operation is returned first.
  94021. //
  94022. // Currently, only sorting by name or creationTimestamp desc is
  94023. // supported.
  94024. func (c *ResourcePoliciesListCall) OrderBy(orderBy string) *ResourcePoliciesListCall {
  94025. c.urlParams_.Set("orderBy", orderBy)
  94026. return c
  94027. }
  94028. // PageToken sets the optional parameter "pageToken": Specifies a page
  94029. // token to use. Set pageToken to the nextPageToken returned by a
  94030. // previous list request to get the next page of results.
  94031. func (c *ResourcePoliciesListCall) PageToken(pageToken string) *ResourcePoliciesListCall {
  94032. c.urlParams_.Set("pageToken", pageToken)
  94033. return c
  94034. }
  94035. // Fields allows partial responses to be retrieved. See
  94036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94037. // for more information.
  94038. func (c *ResourcePoliciesListCall) Fields(s ...googleapi.Field) *ResourcePoliciesListCall {
  94039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94040. return c
  94041. }
  94042. // IfNoneMatch sets the optional parameter which makes the operation
  94043. // fail if the object's ETag matches the given value. This is useful for
  94044. // getting updates only after the object has changed since the last
  94045. // request. Use googleapi.IsNotModified to check whether the response
  94046. // error from Do is the result of In-None-Match.
  94047. func (c *ResourcePoliciesListCall) IfNoneMatch(entityTag string) *ResourcePoliciesListCall {
  94048. c.ifNoneMatch_ = entityTag
  94049. return c
  94050. }
  94051. // Context sets the context to be used in this call's Do method. Any
  94052. // pending HTTP request will be aborted if the provided context is
  94053. // canceled.
  94054. func (c *ResourcePoliciesListCall) Context(ctx context.Context) *ResourcePoliciesListCall {
  94055. c.ctx_ = ctx
  94056. return c
  94057. }
  94058. // Header returns an http.Header that can be modified by the caller to
  94059. // add HTTP headers to the request.
  94060. func (c *ResourcePoliciesListCall) Header() http.Header {
  94061. if c.header_ == nil {
  94062. c.header_ = make(http.Header)
  94063. }
  94064. return c.header_
  94065. }
  94066. func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) {
  94067. reqHeaders := make(http.Header)
  94068. for k, v := range c.header_ {
  94069. reqHeaders[k] = v
  94070. }
  94071. reqHeaders.Set("User-Agent", c.s.userAgent())
  94072. if c.ifNoneMatch_ != "" {
  94073. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94074. }
  94075. var body io.Reader = nil
  94076. c.urlParams_.Set("alt", alt)
  94077. c.urlParams_.Set("prettyPrint", "false")
  94078. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  94079. urls += "?" + c.urlParams_.Encode()
  94080. req, err := http.NewRequest("GET", urls, body)
  94081. if err != nil {
  94082. return nil, err
  94083. }
  94084. req.Header = reqHeaders
  94085. googleapi.Expand(req.URL, map[string]string{
  94086. "project": c.project,
  94087. "region": c.region,
  94088. })
  94089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94090. }
  94091. // Do executes the "compute.resourcePolicies.list" call.
  94092. // Exactly one of *ResourcePolicyList or error will be non-nil. Any
  94093. // non-2xx status code is an error. Response headers are in either
  94094. // *ResourcePolicyList.ServerResponse.Header or (if a response was
  94095. // returned at all) in error.(*googleapi.Error).Header. Use
  94096. // googleapi.IsNotModified to check whether the returned error was
  94097. // because http.StatusNotModified was returned.
  94098. func (c *ResourcePoliciesListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyList, error) {
  94099. gensupport.SetOptions(c.urlParams_, opts...)
  94100. res, err := c.doRequest("json")
  94101. if res != nil && res.StatusCode == http.StatusNotModified {
  94102. if res.Body != nil {
  94103. res.Body.Close()
  94104. }
  94105. return nil, &googleapi.Error{
  94106. Code: res.StatusCode,
  94107. Header: res.Header,
  94108. }
  94109. }
  94110. if err != nil {
  94111. return nil, err
  94112. }
  94113. defer googleapi.CloseBody(res)
  94114. if err := googleapi.CheckResponse(res); err != nil {
  94115. return nil, err
  94116. }
  94117. ret := &ResourcePolicyList{
  94118. ServerResponse: googleapi.ServerResponse{
  94119. Header: res.Header,
  94120. HTTPStatusCode: res.StatusCode,
  94121. },
  94122. }
  94123. target := &ret
  94124. if err := gensupport.DecodeResponse(target, res); err != nil {
  94125. return nil, err
  94126. }
  94127. return ret, nil
  94128. // {
  94129. // "description": "A list all the resource policies that have been configured for the specified project in specified region.",
  94130. // "httpMethod": "GET",
  94131. // "id": "compute.resourcePolicies.list",
  94132. // "parameterOrder": [
  94133. // "project",
  94134. // "region"
  94135. // ],
  94136. // "parameters": {
  94137. // "filter": {
  94138. // "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).",
  94139. // "location": "query",
  94140. // "type": "string"
  94141. // },
  94142. // "maxResults": {
  94143. // "default": "500",
  94144. // "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)",
  94145. // "format": "uint32",
  94146. // "location": "query",
  94147. // "minimum": "0",
  94148. // "type": "integer"
  94149. // },
  94150. // "orderBy": {
  94151. // "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.",
  94152. // "location": "query",
  94153. // "type": "string"
  94154. // },
  94155. // "pageToken": {
  94156. // "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.",
  94157. // "location": "query",
  94158. // "type": "string"
  94159. // },
  94160. // "project": {
  94161. // "description": "Project ID for this request.",
  94162. // "location": "path",
  94163. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94164. // "required": true,
  94165. // "type": "string"
  94166. // },
  94167. // "region": {
  94168. // "description": "Name of the region for this request.",
  94169. // "location": "path",
  94170. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94171. // "required": true,
  94172. // "type": "string"
  94173. // }
  94174. // },
  94175. // "path": "{project}/regions/{region}/resourcePolicies",
  94176. // "response": {
  94177. // "$ref": "ResourcePolicyList"
  94178. // },
  94179. // "scopes": [
  94180. // "https://www.googleapis.com/auth/cloud-platform",
  94181. // "https://www.googleapis.com/auth/compute",
  94182. // "https://www.googleapis.com/auth/compute.readonly"
  94183. // ]
  94184. // }
  94185. }
  94186. // Pages invokes f for each page of results.
  94187. // A non-nil error returned from f will halt the iteration.
  94188. // The provided context supersedes any context provided to the Context method.
  94189. func (c *ResourcePoliciesListCall) Pages(ctx context.Context, f func(*ResourcePolicyList) error) error {
  94190. c.ctx_ = ctx
  94191. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94192. for {
  94193. x, err := c.Do()
  94194. if err != nil {
  94195. return err
  94196. }
  94197. if err := f(x); err != nil {
  94198. return err
  94199. }
  94200. if x.NextPageToken == "" {
  94201. return nil
  94202. }
  94203. c.PageToken(x.NextPageToken)
  94204. }
  94205. }
  94206. // method id "compute.resourcePolicies.testIamPermissions":
  94207. type ResourcePoliciesTestIamPermissionsCall struct {
  94208. s *Service
  94209. project string
  94210. region string
  94211. resource string
  94212. testpermissionsrequest *TestPermissionsRequest
  94213. urlParams_ gensupport.URLParams
  94214. ctx_ context.Context
  94215. header_ http.Header
  94216. }
  94217. // TestIamPermissions: Returns permissions that a caller has on the
  94218. // specified resource.
  94219. func (r *ResourcePoliciesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ResourcePoliciesTestIamPermissionsCall {
  94220. c := &ResourcePoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94221. c.project = project
  94222. c.region = region
  94223. c.resource = resource
  94224. c.testpermissionsrequest = testpermissionsrequest
  94225. return c
  94226. }
  94227. // Fields allows partial responses to be retrieved. See
  94228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94229. // for more information.
  94230. func (c *ResourcePoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ResourcePoliciesTestIamPermissionsCall {
  94231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94232. return c
  94233. }
  94234. // Context sets the context to be used in this call's Do method. Any
  94235. // pending HTTP request will be aborted if the provided context is
  94236. // canceled.
  94237. func (c *ResourcePoliciesTestIamPermissionsCall) Context(ctx context.Context) *ResourcePoliciesTestIamPermissionsCall {
  94238. c.ctx_ = ctx
  94239. return c
  94240. }
  94241. // Header returns an http.Header that can be modified by the caller to
  94242. // add HTTP headers to the request.
  94243. func (c *ResourcePoliciesTestIamPermissionsCall) Header() http.Header {
  94244. if c.header_ == nil {
  94245. c.header_ = make(http.Header)
  94246. }
  94247. return c.header_
  94248. }
  94249. func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  94250. reqHeaders := make(http.Header)
  94251. for k, v := range c.header_ {
  94252. reqHeaders[k] = v
  94253. }
  94254. reqHeaders.Set("User-Agent", c.s.userAgent())
  94255. var body io.Reader = nil
  94256. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  94257. if err != nil {
  94258. return nil, err
  94259. }
  94260. reqHeaders.Set("Content-Type", "application/json")
  94261. c.urlParams_.Set("alt", alt)
  94262. c.urlParams_.Set("prettyPrint", "false")
  94263. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions")
  94264. urls += "?" + c.urlParams_.Encode()
  94265. req, err := http.NewRequest("POST", urls, body)
  94266. if err != nil {
  94267. return nil, err
  94268. }
  94269. req.Header = reqHeaders
  94270. googleapi.Expand(req.URL, map[string]string{
  94271. "project": c.project,
  94272. "region": c.region,
  94273. "resource": c.resource,
  94274. })
  94275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94276. }
  94277. // Do executes the "compute.resourcePolicies.testIamPermissions" call.
  94278. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  94279. // non-2xx status code is an error. Response headers are in either
  94280. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  94281. // returned at all) in error.(*googleapi.Error).Header. Use
  94282. // googleapi.IsNotModified to check whether the returned error was
  94283. // because http.StatusNotModified was returned.
  94284. func (c *ResourcePoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  94285. gensupport.SetOptions(c.urlParams_, opts...)
  94286. res, err := c.doRequest("json")
  94287. if res != nil && res.StatusCode == http.StatusNotModified {
  94288. if res.Body != nil {
  94289. res.Body.Close()
  94290. }
  94291. return nil, &googleapi.Error{
  94292. Code: res.StatusCode,
  94293. Header: res.Header,
  94294. }
  94295. }
  94296. if err != nil {
  94297. return nil, err
  94298. }
  94299. defer googleapi.CloseBody(res)
  94300. if err := googleapi.CheckResponse(res); err != nil {
  94301. return nil, err
  94302. }
  94303. ret := &TestPermissionsResponse{
  94304. ServerResponse: googleapi.ServerResponse{
  94305. Header: res.Header,
  94306. HTTPStatusCode: res.StatusCode,
  94307. },
  94308. }
  94309. target := &ret
  94310. if err := gensupport.DecodeResponse(target, res); err != nil {
  94311. return nil, err
  94312. }
  94313. return ret, nil
  94314. // {
  94315. // "description": "Returns permissions that a caller has on the specified resource.",
  94316. // "httpMethod": "POST",
  94317. // "id": "compute.resourcePolicies.testIamPermissions",
  94318. // "parameterOrder": [
  94319. // "project",
  94320. // "region",
  94321. // "resource"
  94322. // ],
  94323. // "parameters": {
  94324. // "project": {
  94325. // "description": "Project ID for this request.",
  94326. // "location": "path",
  94327. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94328. // "required": true,
  94329. // "type": "string"
  94330. // },
  94331. // "region": {
  94332. // "description": "The name of the region for this request.",
  94333. // "location": "path",
  94334. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94335. // "required": true,
  94336. // "type": "string"
  94337. // },
  94338. // "resource": {
  94339. // "description": "Name or id of the resource for this request.",
  94340. // "location": "path",
  94341. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94342. // "required": true,
  94343. // "type": "string"
  94344. // }
  94345. // },
  94346. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions",
  94347. // "request": {
  94348. // "$ref": "TestPermissionsRequest"
  94349. // },
  94350. // "response": {
  94351. // "$ref": "TestPermissionsResponse"
  94352. // },
  94353. // "scopes": [
  94354. // "https://www.googleapis.com/auth/cloud-platform",
  94355. // "https://www.googleapis.com/auth/compute",
  94356. // "https://www.googleapis.com/auth/compute.readonly"
  94357. // ]
  94358. // }
  94359. }
  94360. // method id "compute.routers.aggregatedList":
  94361. type RoutersAggregatedListCall struct {
  94362. s *Service
  94363. project string
  94364. urlParams_ gensupport.URLParams
  94365. ifNoneMatch_ string
  94366. ctx_ context.Context
  94367. header_ http.Header
  94368. }
  94369. // AggregatedList: Retrieves an aggregated list of routers.
  94370. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  94371. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94372. c.project = project
  94373. return c
  94374. }
  94375. // Filter sets the optional parameter "filter": A filter expression that
  94376. // filters resources listed in the response. The expression must specify
  94377. // the field name, a comparison operator, and the value that you want to
  94378. // use for filtering. The value must be a string, a number, or a
  94379. // boolean. The comparison operator must be either =, !=, >, or <.
  94380. //
  94381. // For example, if you are filtering Compute Engine instances, you can
  94382. // exclude instances named example-instance by specifying name !=
  94383. // example-instance.
  94384. //
  94385. // You can also filter nested fields. For example, you could specify
  94386. // scheduling.automaticRestart = false to include instances only if they
  94387. // are not scheduled for automatic restarts. You can use filtering on
  94388. // nested fields to filter based on resource labels.
  94389. //
  94390. // To filter on multiple expressions, provide each separate expression
  94391. // within parentheses. For example, (scheduling.automaticRestart = true)
  94392. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94393. // AND expression. However, you can include AND and OR expressions
  94394. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94395. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94396. // true).
  94397. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  94398. c.urlParams_.Set("filter", filter)
  94399. return c
  94400. }
  94401. // MaxResults sets the optional parameter "maxResults": The maximum
  94402. // number of results per page that should be returned. If the number of
  94403. // available results is larger than maxResults, Compute Engine returns a
  94404. // nextPageToken that can be used to get the next page of results in
  94405. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94406. // (Default: 500)
  94407. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  94408. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94409. return c
  94410. }
  94411. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94412. // a certain order. By default, results are returned in alphanumerical
  94413. // order based on the resource name.
  94414. //
  94415. // You can also sort results in descending order based on the creation
  94416. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94417. // based on the creationTimestamp field in reverse chronological order
  94418. // (newest result first). Use this to sort resources like operations so
  94419. // that the newest operation is returned first.
  94420. //
  94421. // Currently, only sorting by name or creationTimestamp desc is
  94422. // supported.
  94423. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  94424. c.urlParams_.Set("orderBy", orderBy)
  94425. return c
  94426. }
  94427. // PageToken sets the optional parameter "pageToken": Specifies a page
  94428. // token to use. Set pageToken to the nextPageToken returned by a
  94429. // previous list request to get the next page of results.
  94430. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  94431. c.urlParams_.Set("pageToken", pageToken)
  94432. return c
  94433. }
  94434. // Fields allows partial responses to be retrieved. See
  94435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94436. // for more information.
  94437. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  94438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94439. return c
  94440. }
  94441. // IfNoneMatch sets the optional parameter which makes the operation
  94442. // fail if the object's ETag matches the given value. This is useful for
  94443. // getting updates only after the object has changed since the last
  94444. // request. Use googleapi.IsNotModified to check whether the response
  94445. // error from Do is the result of In-None-Match.
  94446. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  94447. c.ifNoneMatch_ = entityTag
  94448. return c
  94449. }
  94450. // Context sets the context to be used in this call's Do method. Any
  94451. // pending HTTP request will be aborted if the provided context is
  94452. // canceled.
  94453. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  94454. c.ctx_ = ctx
  94455. return c
  94456. }
  94457. // Header returns an http.Header that can be modified by the caller to
  94458. // add HTTP headers to the request.
  94459. func (c *RoutersAggregatedListCall) Header() http.Header {
  94460. if c.header_ == nil {
  94461. c.header_ = make(http.Header)
  94462. }
  94463. return c.header_
  94464. }
  94465. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  94466. reqHeaders := make(http.Header)
  94467. for k, v := range c.header_ {
  94468. reqHeaders[k] = v
  94469. }
  94470. reqHeaders.Set("User-Agent", c.s.userAgent())
  94471. if c.ifNoneMatch_ != "" {
  94472. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94473. }
  94474. var body io.Reader = nil
  94475. c.urlParams_.Set("alt", alt)
  94476. c.urlParams_.Set("prettyPrint", "false")
  94477. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  94478. urls += "?" + c.urlParams_.Encode()
  94479. req, err := http.NewRequest("GET", urls, body)
  94480. if err != nil {
  94481. return nil, err
  94482. }
  94483. req.Header = reqHeaders
  94484. googleapi.Expand(req.URL, map[string]string{
  94485. "project": c.project,
  94486. })
  94487. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94488. }
  94489. // Do executes the "compute.routers.aggregatedList" call.
  94490. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  94491. // non-2xx status code is an error. Response headers are in either
  94492. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  94493. // returned at all) in error.(*googleapi.Error).Header. Use
  94494. // googleapi.IsNotModified to check whether the returned error was
  94495. // because http.StatusNotModified was returned.
  94496. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  94497. gensupport.SetOptions(c.urlParams_, opts...)
  94498. res, err := c.doRequest("json")
  94499. if res != nil && res.StatusCode == http.StatusNotModified {
  94500. if res.Body != nil {
  94501. res.Body.Close()
  94502. }
  94503. return nil, &googleapi.Error{
  94504. Code: res.StatusCode,
  94505. Header: res.Header,
  94506. }
  94507. }
  94508. if err != nil {
  94509. return nil, err
  94510. }
  94511. defer googleapi.CloseBody(res)
  94512. if err := googleapi.CheckResponse(res); err != nil {
  94513. return nil, err
  94514. }
  94515. ret := &RouterAggregatedList{
  94516. ServerResponse: googleapi.ServerResponse{
  94517. Header: res.Header,
  94518. HTTPStatusCode: res.StatusCode,
  94519. },
  94520. }
  94521. target := &ret
  94522. if err := gensupport.DecodeResponse(target, res); err != nil {
  94523. return nil, err
  94524. }
  94525. return ret, nil
  94526. // {
  94527. // "description": "Retrieves an aggregated list of routers.",
  94528. // "httpMethod": "GET",
  94529. // "id": "compute.routers.aggregatedList",
  94530. // "parameterOrder": [
  94531. // "project"
  94532. // ],
  94533. // "parameters": {
  94534. // "filter": {
  94535. // "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).",
  94536. // "location": "query",
  94537. // "type": "string"
  94538. // },
  94539. // "maxResults": {
  94540. // "default": "500",
  94541. // "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)",
  94542. // "format": "uint32",
  94543. // "location": "query",
  94544. // "minimum": "0",
  94545. // "type": "integer"
  94546. // },
  94547. // "orderBy": {
  94548. // "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.",
  94549. // "location": "query",
  94550. // "type": "string"
  94551. // },
  94552. // "pageToken": {
  94553. // "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.",
  94554. // "location": "query",
  94555. // "type": "string"
  94556. // },
  94557. // "project": {
  94558. // "description": "Project ID for this request.",
  94559. // "location": "path",
  94560. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94561. // "required": true,
  94562. // "type": "string"
  94563. // }
  94564. // },
  94565. // "path": "{project}/aggregated/routers",
  94566. // "response": {
  94567. // "$ref": "RouterAggregatedList"
  94568. // },
  94569. // "scopes": [
  94570. // "https://www.googleapis.com/auth/cloud-platform",
  94571. // "https://www.googleapis.com/auth/compute",
  94572. // "https://www.googleapis.com/auth/compute.readonly"
  94573. // ]
  94574. // }
  94575. }
  94576. // Pages invokes f for each page of results.
  94577. // A non-nil error returned from f will halt the iteration.
  94578. // The provided context supersedes any context provided to the Context method.
  94579. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  94580. c.ctx_ = ctx
  94581. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94582. for {
  94583. x, err := c.Do()
  94584. if err != nil {
  94585. return err
  94586. }
  94587. if err := f(x); err != nil {
  94588. return err
  94589. }
  94590. if x.NextPageToken == "" {
  94591. return nil
  94592. }
  94593. c.PageToken(x.NextPageToken)
  94594. }
  94595. }
  94596. // method id "compute.routers.delete":
  94597. type RoutersDeleteCall struct {
  94598. s *Service
  94599. project string
  94600. region string
  94601. router string
  94602. urlParams_ gensupport.URLParams
  94603. ctx_ context.Context
  94604. header_ http.Header
  94605. }
  94606. // Delete: Deletes the specified Router resource.
  94607. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  94608. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94609. c.project = project
  94610. c.region = region
  94611. c.router = router
  94612. return c
  94613. }
  94614. // RequestId sets the optional parameter "requestId": An optional
  94615. // request ID to identify requests. Specify a unique request ID so that
  94616. // if you must retry your request, the server will know to ignore the
  94617. // request if it has already been completed.
  94618. //
  94619. // For example, consider a situation where you make an initial request
  94620. // and the request times out. If you make the request again with the
  94621. // same request ID, the server can check if original operation with the
  94622. // same request ID was received, and if so, will ignore the second
  94623. // request. This prevents clients from accidentally creating duplicate
  94624. // commitments.
  94625. //
  94626. // The request ID must be a valid UUID with the exception that zero UUID
  94627. // is not supported (00000000-0000-0000-0000-000000000000).
  94628. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  94629. c.urlParams_.Set("requestId", requestId)
  94630. return c
  94631. }
  94632. // Fields allows partial responses to be retrieved. See
  94633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94634. // for more information.
  94635. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  94636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94637. return c
  94638. }
  94639. // Context sets the context to be used in this call's Do method. Any
  94640. // pending HTTP request will be aborted if the provided context is
  94641. // canceled.
  94642. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  94643. c.ctx_ = ctx
  94644. return c
  94645. }
  94646. // Header returns an http.Header that can be modified by the caller to
  94647. // add HTTP headers to the request.
  94648. func (c *RoutersDeleteCall) Header() http.Header {
  94649. if c.header_ == nil {
  94650. c.header_ = make(http.Header)
  94651. }
  94652. return c.header_
  94653. }
  94654. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  94655. reqHeaders := make(http.Header)
  94656. for k, v := range c.header_ {
  94657. reqHeaders[k] = v
  94658. }
  94659. reqHeaders.Set("User-Agent", c.s.userAgent())
  94660. var body io.Reader = nil
  94661. c.urlParams_.Set("alt", alt)
  94662. c.urlParams_.Set("prettyPrint", "false")
  94663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  94664. urls += "?" + c.urlParams_.Encode()
  94665. req, err := http.NewRequest("DELETE", urls, body)
  94666. if err != nil {
  94667. return nil, err
  94668. }
  94669. req.Header = reqHeaders
  94670. googleapi.Expand(req.URL, map[string]string{
  94671. "project": c.project,
  94672. "region": c.region,
  94673. "router": c.router,
  94674. })
  94675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94676. }
  94677. // Do executes the "compute.routers.delete" call.
  94678. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94679. // status code is an error. Response headers are in either
  94680. // *Operation.ServerResponse.Header or (if a response was returned at
  94681. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94682. // to check whether the returned error was because
  94683. // http.StatusNotModified was returned.
  94684. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94685. gensupport.SetOptions(c.urlParams_, opts...)
  94686. res, err := c.doRequest("json")
  94687. if res != nil && res.StatusCode == http.StatusNotModified {
  94688. if res.Body != nil {
  94689. res.Body.Close()
  94690. }
  94691. return nil, &googleapi.Error{
  94692. Code: res.StatusCode,
  94693. Header: res.Header,
  94694. }
  94695. }
  94696. if err != nil {
  94697. return nil, err
  94698. }
  94699. defer googleapi.CloseBody(res)
  94700. if err := googleapi.CheckResponse(res); err != nil {
  94701. return nil, err
  94702. }
  94703. ret := &Operation{
  94704. ServerResponse: googleapi.ServerResponse{
  94705. Header: res.Header,
  94706. HTTPStatusCode: res.StatusCode,
  94707. },
  94708. }
  94709. target := &ret
  94710. if err := gensupport.DecodeResponse(target, res); err != nil {
  94711. return nil, err
  94712. }
  94713. return ret, nil
  94714. // {
  94715. // "description": "Deletes the specified Router resource.",
  94716. // "httpMethod": "DELETE",
  94717. // "id": "compute.routers.delete",
  94718. // "parameterOrder": [
  94719. // "project",
  94720. // "region",
  94721. // "router"
  94722. // ],
  94723. // "parameters": {
  94724. // "project": {
  94725. // "description": "Project ID for this request.",
  94726. // "location": "path",
  94727. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94728. // "required": true,
  94729. // "type": "string"
  94730. // },
  94731. // "region": {
  94732. // "description": "Name of the region for this request.",
  94733. // "location": "path",
  94734. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94735. // "required": true,
  94736. // "type": "string"
  94737. // },
  94738. // "requestId": {
  94739. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94740. // "location": "query",
  94741. // "type": "string"
  94742. // },
  94743. // "router": {
  94744. // "description": "Name of the Router resource to delete.",
  94745. // "location": "path",
  94746. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94747. // "required": true,
  94748. // "type": "string"
  94749. // }
  94750. // },
  94751. // "path": "{project}/regions/{region}/routers/{router}",
  94752. // "response": {
  94753. // "$ref": "Operation"
  94754. // },
  94755. // "scopes": [
  94756. // "https://www.googleapis.com/auth/cloud-platform",
  94757. // "https://www.googleapis.com/auth/compute"
  94758. // ]
  94759. // }
  94760. }
  94761. // method id "compute.routers.get":
  94762. type RoutersGetCall struct {
  94763. s *Service
  94764. project string
  94765. region string
  94766. router string
  94767. urlParams_ gensupport.URLParams
  94768. ifNoneMatch_ string
  94769. ctx_ context.Context
  94770. header_ http.Header
  94771. }
  94772. // Get: Returns the specified Router resource. Gets a list of available
  94773. // routers by making a list() request.
  94774. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  94775. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94776. c.project = project
  94777. c.region = region
  94778. c.router = router
  94779. return c
  94780. }
  94781. // Fields allows partial responses to be retrieved. See
  94782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94783. // for more information.
  94784. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  94785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94786. return c
  94787. }
  94788. // IfNoneMatch sets the optional parameter which makes the operation
  94789. // fail if the object's ETag matches the given value. This is useful for
  94790. // getting updates only after the object has changed since the last
  94791. // request. Use googleapi.IsNotModified to check whether the response
  94792. // error from Do is the result of In-None-Match.
  94793. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  94794. c.ifNoneMatch_ = entityTag
  94795. return c
  94796. }
  94797. // Context sets the context to be used in this call's Do method. Any
  94798. // pending HTTP request will be aborted if the provided context is
  94799. // canceled.
  94800. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  94801. c.ctx_ = ctx
  94802. return c
  94803. }
  94804. // Header returns an http.Header that can be modified by the caller to
  94805. // add HTTP headers to the request.
  94806. func (c *RoutersGetCall) Header() http.Header {
  94807. if c.header_ == nil {
  94808. c.header_ = make(http.Header)
  94809. }
  94810. return c.header_
  94811. }
  94812. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  94813. reqHeaders := make(http.Header)
  94814. for k, v := range c.header_ {
  94815. reqHeaders[k] = v
  94816. }
  94817. reqHeaders.Set("User-Agent", c.s.userAgent())
  94818. if c.ifNoneMatch_ != "" {
  94819. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94820. }
  94821. var body io.Reader = nil
  94822. c.urlParams_.Set("alt", alt)
  94823. c.urlParams_.Set("prettyPrint", "false")
  94824. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  94825. urls += "?" + c.urlParams_.Encode()
  94826. req, err := http.NewRequest("GET", urls, body)
  94827. if err != nil {
  94828. return nil, err
  94829. }
  94830. req.Header = reqHeaders
  94831. googleapi.Expand(req.URL, map[string]string{
  94832. "project": c.project,
  94833. "region": c.region,
  94834. "router": c.router,
  94835. })
  94836. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94837. }
  94838. // Do executes the "compute.routers.get" call.
  94839. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  94840. // code is an error. Response headers are in either
  94841. // *Router.ServerResponse.Header or (if a response was returned at all)
  94842. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  94843. // check whether the returned error was because http.StatusNotModified
  94844. // was returned.
  94845. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  94846. gensupport.SetOptions(c.urlParams_, opts...)
  94847. res, err := c.doRequest("json")
  94848. if res != nil && res.StatusCode == http.StatusNotModified {
  94849. if res.Body != nil {
  94850. res.Body.Close()
  94851. }
  94852. return nil, &googleapi.Error{
  94853. Code: res.StatusCode,
  94854. Header: res.Header,
  94855. }
  94856. }
  94857. if err != nil {
  94858. return nil, err
  94859. }
  94860. defer googleapi.CloseBody(res)
  94861. if err := googleapi.CheckResponse(res); err != nil {
  94862. return nil, err
  94863. }
  94864. ret := &Router{
  94865. ServerResponse: googleapi.ServerResponse{
  94866. Header: res.Header,
  94867. HTTPStatusCode: res.StatusCode,
  94868. },
  94869. }
  94870. target := &ret
  94871. if err := gensupport.DecodeResponse(target, res); err != nil {
  94872. return nil, err
  94873. }
  94874. return ret, nil
  94875. // {
  94876. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  94877. // "httpMethod": "GET",
  94878. // "id": "compute.routers.get",
  94879. // "parameterOrder": [
  94880. // "project",
  94881. // "region",
  94882. // "router"
  94883. // ],
  94884. // "parameters": {
  94885. // "project": {
  94886. // "description": "Project ID for this request.",
  94887. // "location": "path",
  94888. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94889. // "required": true,
  94890. // "type": "string"
  94891. // },
  94892. // "region": {
  94893. // "description": "Name of the region for this request.",
  94894. // "location": "path",
  94895. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94896. // "required": true,
  94897. // "type": "string"
  94898. // },
  94899. // "router": {
  94900. // "description": "Name of the Router resource to return.",
  94901. // "location": "path",
  94902. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94903. // "required": true,
  94904. // "type": "string"
  94905. // }
  94906. // },
  94907. // "path": "{project}/regions/{region}/routers/{router}",
  94908. // "response": {
  94909. // "$ref": "Router"
  94910. // },
  94911. // "scopes": [
  94912. // "https://www.googleapis.com/auth/cloud-platform",
  94913. // "https://www.googleapis.com/auth/compute",
  94914. // "https://www.googleapis.com/auth/compute.readonly"
  94915. // ]
  94916. // }
  94917. }
  94918. // method id "compute.routers.getNatMappingInfo":
  94919. type RoutersGetNatMappingInfoCall struct {
  94920. s *Service
  94921. project string
  94922. region string
  94923. router string
  94924. urlParams_ gensupport.URLParams
  94925. ifNoneMatch_ string
  94926. ctx_ context.Context
  94927. header_ http.Header
  94928. }
  94929. // GetNatMappingInfo: Retrieves runtime Nat mapping information of VM
  94930. // endpoints.
  94931. func (r *RoutersService) GetNatMappingInfo(project string, region string, router string) *RoutersGetNatMappingInfoCall {
  94932. c := &RoutersGetNatMappingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94933. c.project = project
  94934. c.region = region
  94935. c.router = router
  94936. return c
  94937. }
  94938. // Filter sets the optional parameter "filter": A filter expression that
  94939. // filters resources listed in the response. The expression must specify
  94940. // the field name, a comparison operator, and the value that you want to
  94941. // use for filtering. The value must be a string, a number, or a
  94942. // boolean. The comparison operator must be either =, !=, >, or <.
  94943. //
  94944. // For example, if you are filtering Compute Engine instances, you can
  94945. // exclude instances named example-instance by specifying name !=
  94946. // example-instance.
  94947. //
  94948. // You can also filter nested fields. For example, you could specify
  94949. // scheduling.automaticRestart = false to include instances only if they
  94950. // are not scheduled for automatic restarts. You can use filtering on
  94951. // nested fields to filter based on resource labels.
  94952. //
  94953. // To filter on multiple expressions, provide each separate expression
  94954. // within parentheses. For example, (scheduling.automaticRestart = true)
  94955. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94956. // AND expression. However, you can include AND and OR expressions
  94957. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94958. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94959. // true).
  94960. func (c *RoutersGetNatMappingInfoCall) Filter(filter string) *RoutersGetNatMappingInfoCall {
  94961. c.urlParams_.Set("filter", filter)
  94962. return c
  94963. }
  94964. // MaxResults sets the optional parameter "maxResults": The maximum
  94965. // number of results per page that should be returned. If the number of
  94966. // available results is larger than maxResults, Compute Engine returns a
  94967. // nextPageToken that can be used to get the next page of results in
  94968. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94969. // (Default: 500)
  94970. func (c *RoutersGetNatMappingInfoCall) MaxResults(maxResults int64) *RoutersGetNatMappingInfoCall {
  94971. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94972. return c
  94973. }
  94974. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94975. // a certain order. By default, results are returned in alphanumerical
  94976. // order based on the resource name.
  94977. //
  94978. // You can also sort results in descending order based on the creation
  94979. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94980. // based on the creationTimestamp field in reverse chronological order
  94981. // (newest result first). Use this to sort resources like operations so
  94982. // that the newest operation is returned first.
  94983. //
  94984. // Currently, only sorting by name or creationTimestamp desc is
  94985. // supported.
  94986. func (c *RoutersGetNatMappingInfoCall) OrderBy(orderBy string) *RoutersGetNatMappingInfoCall {
  94987. c.urlParams_.Set("orderBy", orderBy)
  94988. return c
  94989. }
  94990. // PageToken sets the optional parameter "pageToken": Specifies a page
  94991. // token to use. Set pageToken to the nextPageToken returned by a
  94992. // previous list request to get the next page of results.
  94993. func (c *RoutersGetNatMappingInfoCall) PageToken(pageToken string) *RoutersGetNatMappingInfoCall {
  94994. c.urlParams_.Set("pageToken", pageToken)
  94995. return c
  94996. }
  94997. // Fields allows partial responses to be retrieved. See
  94998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94999. // for more information.
  95000. func (c *RoutersGetNatMappingInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatMappingInfoCall {
  95001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95002. return c
  95003. }
  95004. // IfNoneMatch sets the optional parameter which makes the operation
  95005. // fail if the object's ETag matches the given value. This is useful for
  95006. // getting updates only after the object has changed since the last
  95007. // request. Use googleapi.IsNotModified to check whether the response
  95008. // error from Do is the result of In-None-Match.
  95009. func (c *RoutersGetNatMappingInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatMappingInfoCall {
  95010. c.ifNoneMatch_ = entityTag
  95011. return c
  95012. }
  95013. // Context sets the context to be used in this call's Do method. Any
  95014. // pending HTTP request will be aborted if the provided context is
  95015. // canceled.
  95016. func (c *RoutersGetNatMappingInfoCall) Context(ctx context.Context) *RoutersGetNatMappingInfoCall {
  95017. c.ctx_ = ctx
  95018. return c
  95019. }
  95020. // Header returns an http.Header that can be modified by the caller to
  95021. // add HTTP headers to the request.
  95022. func (c *RoutersGetNatMappingInfoCall) Header() http.Header {
  95023. if c.header_ == nil {
  95024. c.header_ = make(http.Header)
  95025. }
  95026. return c.header_
  95027. }
  95028. func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, error) {
  95029. reqHeaders := make(http.Header)
  95030. for k, v := range c.header_ {
  95031. reqHeaders[k] = v
  95032. }
  95033. reqHeaders.Set("User-Agent", c.s.userAgent())
  95034. if c.ifNoneMatch_ != "" {
  95035. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95036. }
  95037. var body io.Reader = nil
  95038. c.urlParams_.Set("alt", alt)
  95039. c.urlParams_.Set("prettyPrint", "false")
  95040. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getNatMappingInfo")
  95041. urls += "?" + c.urlParams_.Encode()
  95042. req, err := http.NewRequest("GET", urls, body)
  95043. if err != nil {
  95044. return nil, err
  95045. }
  95046. req.Header = reqHeaders
  95047. googleapi.Expand(req.URL, map[string]string{
  95048. "project": c.project,
  95049. "region": c.region,
  95050. "router": c.router,
  95051. })
  95052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95053. }
  95054. // Do executes the "compute.routers.getNatMappingInfo" call.
  95055. // Exactly one of *VmEndpointNatMappingsList or error will be non-nil.
  95056. // Any non-2xx status code is an error. Response headers are in either
  95057. // *VmEndpointNatMappingsList.ServerResponse.Header or (if a response
  95058. // was returned at all) in error.(*googleapi.Error).Header. Use
  95059. // googleapi.IsNotModified to check whether the returned error was
  95060. // because http.StatusNotModified was returned.
  95061. func (c *RoutersGetNatMappingInfoCall) Do(opts ...googleapi.CallOption) (*VmEndpointNatMappingsList, error) {
  95062. gensupport.SetOptions(c.urlParams_, opts...)
  95063. res, err := c.doRequest("json")
  95064. if res != nil && res.StatusCode == http.StatusNotModified {
  95065. if res.Body != nil {
  95066. res.Body.Close()
  95067. }
  95068. return nil, &googleapi.Error{
  95069. Code: res.StatusCode,
  95070. Header: res.Header,
  95071. }
  95072. }
  95073. if err != nil {
  95074. return nil, err
  95075. }
  95076. defer googleapi.CloseBody(res)
  95077. if err := googleapi.CheckResponse(res); err != nil {
  95078. return nil, err
  95079. }
  95080. ret := &VmEndpointNatMappingsList{
  95081. ServerResponse: googleapi.ServerResponse{
  95082. Header: res.Header,
  95083. HTTPStatusCode: res.StatusCode,
  95084. },
  95085. }
  95086. target := &ret
  95087. if err := gensupport.DecodeResponse(target, res); err != nil {
  95088. return nil, err
  95089. }
  95090. return ret, nil
  95091. // {
  95092. // "description": "Retrieves runtime Nat mapping information of VM endpoints.",
  95093. // "httpMethod": "GET",
  95094. // "id": "compute.routers.getNatMappingInfo",
  95095. // "parameterOrder": [
  95096. // "project",
  95097. // "region",
  95098. // "router"
  95099. // ],
  95100. // "parameters": {
  95101. // "filter": {
  95102. // "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).",
  95103. // "location": "query",
  95104. // "type": "string"
  95105. // },
  95106. // "maxResults": {
  95107. // "default": "500",
  95108. // "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)",
  95109. // "format": "uint32",
  95110. // "location": "query",
  95111. // "minimum": "0",
  95112. // "type": "integer"
  95113. // },
  95114. // "orderBy": {
  95115. // "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.",
  95116. // "location": "query",
  95117. // "type": "string"
  95118. // },
  95119. // "pageToken": {
  95120. // "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.",
  95121. // "location": "query",
  95122. // "type": "string"
  95123. // },
  95124. // "project": {
  95125. // "description": "Project ID for this request.",
  95126. // "location": "path",
  95127. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95128. // "required": true,
  95129. // "type": "string"
  95130. // },
  95131. // "region": {
  95132. // "description": "Name of the region for this request.",
  95133. // "location": "path",
  95134. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95135. // "required": true,
  95136. // "type": "string"
  95137. // },
  95138. // "router": {
  95139. // "description": "Name of the Router resource to query for Nat Mapping information of VM endpoints.",
  95140. // "location": "path",
  95141. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95142. // "required": true,
  95143. // "type": "string"
  95144. // }
  95145. // },
  95146. // "path": "{project}/regions/{region}/routers/{router}/getNatMappingInfo",
  95147. // "response": {
  95148. // "$ref": "VmEndpointNatMappingsList"
  95149. // },
  95150. // "scopes": [
  95151. // "https://www.googleapis.com/auth/cloud-platform",
  95152. // "https://www.googleapis.com/auth/compute",
  95153. // "https://www.googleapis.com/auth/compute.readonly"
  95154. // ]
  95155. // }
  95156. }
  95157. // Pages invokes f for each page of results.
  95158. // A non-nil error returned from f will halt the iteration.
  95159. // The provided context supersedes any context provided to the Context method.
  95160. func (c *RoutersGetNatMappingInfoCall) Pages(ctx context.Context, f func(*VmEndpointNatMappingsList) error) error {
  95161. c.ctx_ = ctx
  95162. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95163. for {
  95164. x, err := c.Do()
  95165. if err != nil {
  95166. return err
  95167. }
  95168. if err := f(x); err != nil {
  95169. return err
  95170. }
  95171. if x.NextPageToken == "" {
  95172. return nil
  95173. }
  95174. c.PageToken(x.NextPageToken)
  95175. }
  95176. }
  95177. // method id "compute.routers.getRouterStatus":
  95178. type RoutersGetRouterStatusCall struct {
  95179. s *Service
  95180. project string
  95181. region string
  95182. router string
  95183. urlParams_ gensupport.URLParams
  95184. ifNoneMatch_ string
  95185. ctx_ context.Context
  95186. header_ http.Header
  95187. }
  95188. // GetRouterStatus: Retrieves runtime information of the specified
  95189. // router.
  95190. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  95191. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95192. c.project = project
  95193. c.region = region
  95194. c.router = router
  95195. return c
  95196. }
  95197. // Fields allows partial responses to be retrieved. See
  95198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95199. // for more information.
  95200. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  95201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95202. return c
  95203. }
  95204. // IfNoneMatch sets the optional parameter which makes the operation
  95205. // fail if the object's ETag matches the given value. This is useful for
  95206. // getting updates only after the object has changed since the last
  95207. // request. Use googleapi.IsNotModified to check whether the response
  95208. // error from Do is the result of In-None-Match.
  95209. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  95210. c.ifNoneMatch_ = entityTag
  95211. return c
  95212. }
  95213. // Context sets the context to be used in this call's Do method. Any
  95214. // pending HTTP request will be aborted if the provided context is
  95215. // canceled.
  95216. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  95217. c.ctx_ = ctx
  95218. return c
  95219. }
  95220. // Header returns an http.Header that can be modified by the caller to
  95221. // add HTTP headers to the request.
  95222. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  95223. if c.header_ == nil {
  95224. c.header_ = make(http.Header)
  95225. }
  95226. return c.header_
  95227. }
  95228. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  95229. reqHeaders := make(http.Header)
  95230. for k, v := range c.header_ {
  95231. reqHeaders[k] = v
  95232. }
  95233. reqHeaders.Set("User-Agent", c.s.userAgent())
  95234. if c.ifNoneMatch_ != "" {
  95235. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95236. }
  95237. var body io.Reader = nil
  95238. c.urlParams_.Set("alt", alt)
  95239. c.urlParams_.Set("prettyPrint", "false")
  95240. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  95241. urls += "?" + c.urlParams_.Encode()
  95242. req, err := http.NewRequest("GET", urls, body)
  95243. if err != nil {
  95244. return nil, err
  95245. }
  95246. req.Header = reqHeaders
  95247. googleapi.Expand(req.URL, map[string]string{
  95248. "project": c.project,
  95249. "region": c.region,
  95250. "router": c.router,
  95251. })
  95252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95253. }
  95254. // Do executes the "compute.routers.getRouterStatus" call.
  95255. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  95256. // non-2xx status code is an error. Response headers are in either
  95257. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  95258. // returned at all) in error.(*googleapi.Error).Header. Use
  95259. // googleapi.IsNotModified to check whether the returned error was
  95260. // because http.StatusNotModified was returned.
  95261. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  95262. gensupport.SetOptions(c.urlParams_, opts...)
  95263. res, err := c.doRequest("json")
  95264. if res != nil && res.StatusCode == http.StatusNotModified {
  95265. if res.Body != nil {
  95266. res.Body.Close()
  95267. }
  95268. return nil, &googleapi.Error{
  95269. Code: res.StatusCode,
  95270. Header: res.Header,
  95271. }
  95272. }
  95273. if err != nil {
  95274. return nil, err
  95275. }
  95276. defer googleapi.CloseBody(res)
  95277. if err := googleapi.CheckResponse(res); err != nil {
  95278. return nil, err
  95279. }
  95280. ret := &RouterStatusResponse{
  95281. ServerResponse: googleapi.ServerResponse{
  95282. Header: res.Header,
  95283. HTTPStatusCode: res.StatusCode,
  95284. },
  95285. }
  95286. target := &ret
  95287. if err := gensupport.DecodeResponse(target, res); err != nil {
  95288. return nil, err
  95289. }
  95290. return ret, nil
  95291. // {
  95292. // "description": "Retrieves runtime information of the specified router.",
  95293. // "httpMethod": "GET",
  95294. // "id": "compute.routers.getRouterStatus",
  95295. // "parameterOrder": [
  95296. // "project",
  95297. // "region",
  95298. // "router"
  95299. // ],
  95300. // "parameters": {
  95301. // "project": {
  95302. // "description": "Project ID for this request.",
  95303. // "location": "path",
  95304. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95305. // "required": true,
  95306. // "type": "string"
  95307. // },
  95308. // "region": {
  95309. // "description": "Name of the region for this request.",
  95310. // "location": "path",
  95311. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95312. // "required": true,
  95313. // "type": "string"
  95314. // },
  95315. // "router": {
  95316. // "description": "Name of the Router resource to query.",
  95317. // "location": "path",
  95318. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95319. // "required": true,
  95320. // "type": "string"
  95321. // }
  95322. // },
  95323. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  95324. // "response": {
  95325. // "$ref": "RouterStatusResponse"
  95326. // },
  95327. // "scopes": [
  95328. // "https://www.googleapis.com/auth/cloud-platform",
  95329. // "https://www.googleapis.com/auth/compute",
  95330. // "https://www.googleapis.com/auth/compute.readonly"
  95331. // ]
  95332. // }
  95333. }
  95334. // method id "compute.routers.insert":
  95335. type RoutersInsertCall struct {
  95336. s *Service
  95337. project string
  95338. region string
  95339. router *Router
  95340. urlParams_ gensupport.URLParams
  95341. ctx_ context.Context
  95342. header_ http.Header
  95343. }
  95344. // Insert: Creates a Router resource in the specified project and region
  95345. // using the data included in the request.
  95346. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  95347. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95348. c.project = project
  95349. c.region = region
  95350. c.router = router
  95351. return c
  95352. }
  95353. // RequestId sets the optional parameter "requestId": An optional
  95354. // request ID to identify requests. Specify a unique request ID so that
  95355. // if you must retry your request, the server will know to ignore the
  95356. // request if it has already been completed.
  95357. //
  95358. // For example, consider a situation where you make an initial request
  95359. // and the request times out. If you make the request again with the
  95360. // same request ID, the server can check if original operation with the
  95361. // same request ID was received, and if so, will ignore the second
  95362. // request. This prevents clients from accidentally creating duplicate
  95363. // commitments.
  95364. //
  95365. // The request ID must be a valid UUID with the exception that zero UUID
  95366. // is not supported (00000000-0000-0000-0000-000000000000).
  95367. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  95368. c.urlParams_.Set("requestId", requestId)
  95369. return c
  95370. }
  95371. // Fields allows partial responses to be retrieved. See
  95372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95373. // for more information.
  95374. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  95375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95376. return c
  95377. }
  95378. // Context sets the context to be used in this call's Do method. Any
  95379. // pending HTTP request will be aborted if the provided context is
  95380. // canceled.
  95381. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  95382. c.ctx_ = ctx
  95383. return c
  95384. }
  95385. // Header returns an http.Header that can be modified by the caller to
  95386. // add HTTP headers to the request.
  95387. func (c *RoutersInsertCall) Header() http.Header {
  95388. if c.header_ == nil {
  95389. c.header_ = make(http.Header)
  95390. }
  95391. return c.header_
  95392. }
  95393. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  95394. reqHeaders := make(http.Header)
  95395. for k, v := range c.header_ {
  95396. reqHeaders[k] = v
  95397. }
  95398. reqHeaders.Set("User-Agent", c.s.userAgent())
  95399. var body io.Reader = nil
  95400. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  95401. if err != nil {
  95402. return nil, err
  95403. }
  95404. reqHeaders.Set("Content-Type", "application/json")
  95405. c.urlParams_.Set("alt", alt)
  95406. c.urlParams_.Set("prettyPrint", "false")
  95407. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  95408. urls += "?" + c.urlParams_.Encode()
  95409. req, err := http.NewRequest("POST", urls, body)
  95410. if err != nil {
  95411. return nil, err
  95412. }
  95413. req.Header = reqHeaders
  95414. googleapi.Expand(req.URL, map[string]string{
  95415. "project": c.project,
  95416. "region": c.region,
  95417. })
  95418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95419. }
  95420. // Do executes the "compute.routers.insert" call.
  95421. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95422. // status code is an error. Response headers are in either
  95423. // *Operation.ServerResponse.Header or (if a response was returned at
  95424. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95425. // to check whether the returned error was because
  95426. // http.StatusNotModified was returned.
  95427. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95428. gensupport.SetOptions(c.urlParams_, opts...)
  95429. res, err := c.doRequest("json")
  95430. if res != nil && res.StatusCode == http.StatusNotModified {
  95431. if res.Body != nil {
  95432. res.Body.Close()
  95433. }
  95434. return nil, &googleapi.Error{
  95435. Code: res.StatusCode,
  95436. Header: res.Header,
  95437. }
  95438. }
  95439. if err != nil {
  95440. return nil, err
  95441. }
  95442. defer googleapi.CloseBody(res)
  95443. if err := googleapi.CheckResponse(res); err != nil {
  95444. return nil, err
  95445. }
  95446. ret := &Operation{
  95447. ServerResponse: googleapi.ServerResponse{
  95448. Header: res.Header,
  95449. HTTPStatusCode: res.StatusCode,
  95450. },
  95451. }
  95452. target := &ret
  95453. if err := gensupport.DecodeResponse(target, res); err != nil {
  95454. return nil, err
  95455. }
  95456. return ret, nil
  95457. // {
  95458. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  95459. // "httpMethod": "POST",
  95460. // "id": "compute.routers.insert",
  95461. // "parameterOrder": [
  95462. // "project",
  95463. // "region"
  95464. // ],
  95465. // "parameters": {
  95466. // "project": {
  95467. // "description": "Project ID for this request.",
  95468. // "location": "path",
  95469. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95470. // "required": true,
  95471. // "type": "string"
  95472. // },
  95473. // "region": {
  95474. // "description": "Name of the region for this request.",
  95475. // "location": "path",
  95476. // "pattern": "[a-z](?:[-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}/regions/{region}/routers",
  95487. // "request": {
  95488. // "$ref": "Router"
  95489. // },
  95490. // "response": {
  95491. // "$ref": "Operation"
  95492. // },
  95493. // "scopes": [
  95494. // "https://www.googleapis.com/auth/cloud-platform",
  95495. // "https://www.googleapis.com/auth/compute"
  95496. // ]
  95497. // }
  95498. }
  95499. // method id "compute.routers.list":
  95500. type RoutersListCall struct {
  95501. s *Service
  95502. project string
  95503. region string
  95504. urlParams_ gensupport.URLParams
  95505. ifNoneMatch_ string
  95506. ctx_ context.Context
  95507. header_ http.Header
  95508. }
  95509. // List: Retrieves a list of Router resources available to the specified
  95510. // project.
  95511. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  95512. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95513. c.project = project
  95514. c.region = region
  95515. return c
  95516. }
  95517. // Filter sets the optional parameter "filter": A filter expression that
  95518. // filters resources listed in the response. The expression must specify
  95519. // the field name, a comparison operator, and the value that you want to
  95520. // use for filtering. The value must be a string, a number, or a
  95521. // boolean. The comparison operator must be either =, !=, >, or <.
  95522. //
  95523. // For example, if you are filtering Compute Engine instances, you can
  95524. // exclude instances named example-instance by specifying name !=
  95525. // example-instance.
  95526. //
  95527. // You can also filter nested fields. For example, you could specify
  95528. // scheduling.automaticRestart = false to include instances only if they
  95529. // are not scheduled for automatic restarts. You can use filtering on
  95530. // nested fields to filter based on resource labels.
  95531. //
  95532. // To filter on multiple expressions, provide each separate expression
  95533. // within parentheses. For example, (scheduling.automaticRestart = true)
  95534. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95535. // AND expression. However, you can include AND and OR expressions
  95536. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95537. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95538. // true).
  95539. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  95540. c.urlParams_.Set("filter", filter)
  95541. return c
  95542. }
  95543. // MaxResults sets the optional parameter "maxResults": The maximum
  95544. // number of results per page that should be returned. If the number of
  95545. // available results is larger than maxResults, Compute Engine returns a
  95546. // nextPageToken that can be used to get the next page of results in
  95547. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95548. // (Default: 500)
  95549. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  95550. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95551. return c
  95552. }
  95553. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95554. // a certain order. By default, results are returned in alphanumerical
  95555. // order based on the resource name.
  95556. //
  95557. // You can also sort results in descending order based on the creation
  95558. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95559. // based on the creationTimestamp field in reverse chronological order
  95560. // (newest result first). Use this to sort resources like operations so
  95561. // that the newest operation is returned first.
  95562. //
  95563. // Currently, only sorting by name or creationTimestamp desc is
  95564. // supported.
  95565. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  95566. c.urlParams_.Set("orderBy", orderBy)
  95567. return c
  95568. }
  95569. // PageToken sets the optional parameter "pageToken": Specifies a page
  95570. // token to use. Set pageToken to the nextPageToken returned by a
  95571. // previous list request to get the next page of results.
  95572. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  95573. c.urlParams_.Set("pageToken", pageToken)
  95574. return c
  95575. }
  95576. // Fields allows partial responses to be retrieved. See
  95577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95578. // for more information.
  95579. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  95580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95581. return c
  95582. }
  95583. // IfNoneMatch sets the optional parameter which makes the operation
  95584. // fail if the object's ETag matches the given value. This is useful for
  95585. // getting updates only after the object has changed since the last
  95586. // request. Use googleapi.IsNotModified to check whether the response
  95587. // error from Do is the result of In-None-Match.
  95588. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  95589. c.ifNoneMatch_ = entityTag
  95590. return c
  95591. }
  95592. // Context sets the context to be used in this call's Do method. Any
  95593. // pending HTTP request will be aborted if the provided context is
  95594. // canceled.
  95595. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  95596. c.ctx_ = ctx
  95597. return c
  95598. }
  95599. // Header returns an http.Header that can be modified by the caller to
  95600. // add HTTP headers to the request.
  95601. func (c *RoutersListCall) Header() http.Header {
  95602. if c.header_ == nil {
  95603. c.header_ = make(http.Header)
  95604. }
  95605. return c.header_
  95606. }
  95607. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  95608. reqHeaders := make(http.Header)
  95609. for k, v := range c.header_ {
  95610. reqHeaders[k] = v
  95611. }
  95612. reqHeaders.Set("User-Agent", c.s.userAgent())
  95613. if c.ifNoneMatch_ != "" {
  95614. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95615. }
  95616. var body io.Reader = nil
  95617. c.urlParams_.Set("alt", alt)
  95618. c.urlParams_.Set("prettyPrint", "false")
  95619. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  95620. urls += "?" + c.urlParams_.Encode()
  95621. req, err := http.NewRequest("GET", urls, body)
  95622. if err != nil {
  95623. return nil, err
  95624. }
  95625. req.Header = reqHeaders
  95626. googleapi.Expand(req.URL, map[string]string{
  95627. "project": c.project,
  95628. "region": c.region,
  95629. })
  95630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95631. }
  95632. // Do executes the "compute.routers.list" call.
  95633. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  95634. // status code is an error. Response headers are in either
  95635. // *RouterList.ServerResponse.Header or (if a response was returned at
  95636. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95637. // to check whether the returned error was because
  95638. // http.StatusNotModified was returned.
  95639. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  95640. gensupport.SetOptions(c.urlParams_, opts...)
  95641. res, err := c.doRequest("json")
  95642. if res != nil && res.StatusCode == http.StatusNotModified {
  95643. if res.Body != nil {
  95644. res.Body.Close()
  95645. }
  95646. return nil, &googleapi.Error{
  95647. Code: res.StatusCode,
  95648. Header: res.Header,
  95649. }
  95650. }
  95651. if err != nil {
  95652. return nil, err
  95653. }
  95654. defer googleapi.CloseBody(res)
  95655. if err := googleapi.CheckResponse(res); err != nil {
  95656. return nil, err
  95657. }
  95658. ret := &RouterList{
  95659. ServerResponse: googleapi.ServerResponse{
  95660. Header: res.Header,
  95661. HTTPStatusCode: res.StatusCode,
  95662. },
  95663. }
  95664. target := &ret
  95665. if err := gensupport.DecodeResponse(target, res); err != nil {
  95666. return nil, err
  95667. }
  95668. return ret, nil
  95669. // {
  95670. // "description": "Retrieves a list of Router resources available to the specified project.",
  95671. // "httpMethod": "GET",
  95672. // "id": "compute.routers.list",
  95673. // "parameterOrder": [
  95674. // "project",
  95675. // "region"
  95676. // ],
  95677. // "parameters": {
  95678. // "filter": {
  95679. // "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).",
  95680. // "location": "query",
  95681. // "type": "string"
  95682. // },
  95683. // "maxResults": {
  95684. // "default": "500",
  95685. // "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)",
  95686. // "format": "uint32",
  95687. // "location": "query",
  95688. // "minimum": "0",
  95689. // "type": "integer"
  95690. // },
  95691. // "orderBy": {
  95692. // "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.",
  95693. // "location": "query",
  95694. // "type": "string"
  95695. // },
  95696. // "pageToken": {
  95697. // "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.",
  95698. // "location": "query",
  95699. // "type": "string"
  95700. // },
  95701. // "project": {
  95702. // "description": "Project ID for this request.",
  95703. // "location": "path",
  95704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95705. // "required": true,
  95706. // "type": "string"
  95707. // },
  95708. // "region": {
  95709. // "description": "Name of the region for this request.",
  95710. // "location": "path",
  95711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95712. // "required": true,
  95713. // "type": "string"
  95714. // }
  95715. // },
  95716. // "path": "{project}/regions/{region}/routers",
  95717. // "response": {
  95718. // "$ref": "RouterList"
  95719. // },
  95720. // "scopes": [
  95721. // "https://www.googleapis.com/auth/cloud-platform",
  95722. // "https://www.googleapis.com/auth/compute",
  95723. // "https://www.googleapis.com/auth/compute.readonly"
  95724. // ]
  95725. // }
  95726. }
  95727. // Pages invokes f for each page of results.
  95728. // A non-nil error returned from f will halt the iteration.
  95729. // The provided context supersedes any context provided to the Context method.
  95730. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  95731. c.ctx_ = ctx
  95732. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95733. for {
  95734. x, err := c.Do()
  95735. if err != nil {
  95736. return err
  95737. }
  95738. if err := f(x); err != nil {
  95739. return err
  95740. }
  95741. if x.NextPageToken == "" {
  95742. return nil
  95743. }
  95744. c.PageToken(x.NextPageToken)
  95745. }
  95746. }
  95747. // method id "compute.routers.patch":
  95748. type RoutersPatchCall struct {
  95749. s *Service
  95750. project string
  95751. region string
  95752. router string
  95753. router2 *Router
  95754. urlParams_ gensupport.URLParams
  95755. ctx_ context.Context
  95756. header_ http.Header
  95757. }
  95758. // Patch: Patches the specified Router resource with the data included
  95759. // in the request. This method supports PATCH semantics and uses JSON
  95760. // merge patch format and processing rules.
  95761. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  95762. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95763. c.project = project
  95764. c.region = region
  95765. c.router = router
  95766. c.router2 = router2
  95767. return c
  95768. }
  95769. // RequestId sets the optional parameter "requestId": An optional
  95770. // request ID to identify requests. Specify a unique request ID so that
  95771. // if you must retry your request, the server will know to ignore the
  95772. // request if it has already been completed.
  95773. //
  95774. // For example, consider a situation where you make an initial request
  95775. // and the request times out. If you make the request again with the
  95776. // same request ID, the server can check if original operation with the
  95777. // same request ID was received, and if so, will ignore the second
  95778. // request. This prevents clients from accidentally creating duplicate
  95779. // commitments.
  95780. //
  95781. // The request ID must be a valid UUID with the exception that zero UUID
  95782. // is not supported (00000000-0000-0000-0000-000000000000).
  95783. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  95784. c.urlParams_.Set("requestId", requestId)
  95785. return c
  95786. }
  95787. // Fields allows partial responses to be retrieved. See
  95788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95789. // for more information.
  95790. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  95791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95792. return c
  95793. }
  95794. // Context sets the context to be used in this call's Do method. Any
  95795. // pending HTTP request will be aborted if the provided context is
  95796. // canceled.
  95797. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  95798. c.ctx_ = ctx
  95799. return c
  95800. }
  95801. // Header returns an http.Header that can be modified by the caller to
  95802. // add HTTP headers to the request.
  95803. func (c *RoutersPatchCall) Header() http.Header {
  95804. if c.header_ == nil {
  95805. c.header_ = make(http.Header)
  95806. }
  95807. return c.header_
  95808. }
  95809. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  95810. reqHeaders := make(http.Header)
  95811. for k, v := range c.header_ {
  95812. reqHeaders[k] = v
  95813. }
  95814. reqHeaders.Set("User-Agent", c.s.userAgent())
  95815. var body io.Reader = nil
  95816. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  95817. if err != nil {
  95818. return nil, err
  95819. }
  95820. reqHeaders.Set("Content-Type", "application/json")
  95821. c.urlParams_.Set("alt", alt)
  95822. c.urlParams_.Set("prettyPrint", "false")
  95823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  95824. urls += "?" + c.urlParams_.Encode()
  95825. req, err := http.NewRequest("PATCH", urls, body)
  95826. if err != nil {
  95827. return nil, err
  95828. }
  95829. req.Header = reqHeaders
  95830. googleapi.Expand(req.URL, map[string]string{
  95831. "project": c.project,
  95832. "region": c.region,
  95833. "router": c.router,
  95834. })
  95835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95836. }
  95837. // Do executes the "compute.routers.patch" call.
  95838. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95839. // status code is an error. Response headers are in either
  95840. // *Operation.ServerResponse.Header or (if a response was returned at
  95841. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95842. // to check whether the returned error was because
  95843. // http.StatusNotModified was returned.
  95844. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95845. gensupport.SetOptions(c.urlParams_, opts...)
  95846. res, err := c.doRequest("json")
  95847. if res != nil && res.StatusCode == http.StatusNotModified {
  95848. if res.Body != nil {
  95849. res.Body.Close()
  95850. }
  95851. return nil, &googleapi.Error{
  95852. Code: res.StatusCode,
  95853. Header: res.Header,
  95854. }
  95855. }
  95856. if err != nil {
  95857. return nil, err
  95858. }
  95859. defer googleapi.CloseBody(res)
  95860. if err := googleapi.CheckResponse(res); err != nil {
  95861. return nil, err
  95862. }
  95863. ret := &Operation{
  95864. ServerResponse: googleapi.ServerResponse{
  95865. Header: res.Header,
  95866. HTTPStatusCode: res.StatusCode,
  95867. },
  95868. }
  95869. target := &ret
  95870. if err := gensupport.DecodeResponse(target, res); err != nil {
  95871. return nil, err
  95872. }
  95873. return ret, nil
  95874. // {
  95875. // "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.",
  95876. // "httpMethod": "PATCH",
  95877. // "id": "compute.routers.patch",
  95878. // "parameterOrder": [
  95879. // "project",
  95880. // "region",
  95881. // "router"
  95882. // ],
  95883. // "parameters": {
  95884. // "project": {
  95885. // "description": "Project ID for this request.",
  95886. // "location": "path",
  95887. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95888. // "required": true,
  95889. // "type": "string"
  95890. // },
  95891. // "region": {
  95892. // "description": "Name of the region for this request.",
  95893. // "location": "path",
  95894. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95895. // "required": true,
  95896. // "type": "string"
  95897. // },
  95898. // "requestId": {
  95899. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95900. // "location": "query",
  95901. // "type": "string"
  95902. // },
  95903. // "router": {
  95904. // "description": "Name of the Router resource to patch.",
  95905. // "location": "path",
  95906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95907. // "required": true,
  95908. // "type": "string"
  95909. // }
  95910. // },
  95911. // "path": "{project}/regions/{region}/routers/{router}",
  95912. // "request": {
  95913. // "$ref": "Router"
  95914. // },
  95915. // "response": {
  95916. // "$ref": "Operation"
  95917. // },
  95918. // "scopes": [
  95919. // "https://www.googleapis.com/auth/cloud-platform",
  95920. // "https://www.googleapis.com/auth/compute"
  95921. // ]
  95922. // }
  95923. }
  95924. // method id "compute.routers.preview":
  95925. type RoutersPreviewCall struct {
  95926. s *Service
  95927. project string
  95928. region string
  95929. router string
  95930. router2 *Router
  95931. urlParams_ gensupport.URLParams
  95932. ctx_ context.Context
  95933. header_ http.Header
  95934. }
  95935. // Preview: Preview fields auto-generated during router create and
  95936. // update operations. Calling this method does NOT create or update the
  95937. // router.
  95938. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  95939. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95940. c.project = project
  95941. c.region = region
  95942. c.router = router
  95943. c.router2 = router2
  95944. return c
  95945. }
  95946. // Fields allows partial responses to be retrieved. See
  95947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95948. // for more information.
  95949. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  95950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95951. return c
  95952. }
  95953. // Context sets the context to be used in this call's Do method. Any
  95954. // pending HTTP request will be aborted if the provided context is
  95955. // canceled.
  95956. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  95957. c.ctx_ = ctx
  95958. return c
  95959. }
  95960. // Header returns an http.Header that can be modified by the caller to
  95961. // add HTTP headers to the request.
  95962. func (c *RoutersPreviewCall) Header() http.Header {
  95963. if c.header_ == nil {
  95964. c.header_ = make(http.Header)
  95965. }
  95966. return c.header_
  95967. }
  95968. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  95969. reqHeaders := make(http.Header)
  95970. for k, v := range c.header_ {
  95971. reqHeaders[k] = v
  95972. }
  95973. reqHeaders.Set("User-Agent", c.s.userAgent())
  95974. var body io.Reader = nil
  95975. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  95976. if err != nil {
  95977. return nil, err
  95978. }
  95979. reqHeaders.Set("Content-Type", "application/json")
  95980. c.urlParams_.Set("alt", alt)
  95981. c.urlParams_.Set("prettyPrint", "false")
  95982. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  95983. urls += "?" + c.urlParams_.Encode()
  95984. req, err := http.NewRequest("POST", urls, body)
  95985. if err != nil {
  95986. return nil, err
  95987. }
  95988. req.Header = reqHeaders
  95989. googleapi.Expand(req.URL, map[string]string{
  95990. "project": c.project,
  95991. "region": c.region,
  95992. "router": c.router,
  95993. })
  95994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95995. }
  95996. // Do executes the "compute.routers.preview" call.
  95997. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  95998. // non-2xx status code is an error. Response headers are in either
  95999. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  96000. // returned at all) in error.(*googleapi.Error).Header. Use
  96001. // googleapi.IsNotModified to check whether the returned error was
  96002. // because http.StatusNotModified was returned.
  96003. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  96004. gensupport.SetOptions(c.urlParams_, opts...)
  96005. res, err := c.doRequest("json")
  96006. if res != nil && res.StatusCode == http.StatusNotModified {
  96007. if res.Body != nil {
  96008. res.Body.Close()
  96009. }
  96010. return nil, &googleapi.Error{
  96011. Code: res.StatusCode,
  96012. Header: res.Header,
  96013. }
  96014. }
  96015. if err != nil {
  96016. return nil, err
  96017. }
  96018. defer googleapi.CloseBody(res)
  96019. if err := googleapi.CheckResponse(res); err != nil {
  96020. return nil, err
  96021. }
  96022. ret := &RoutersPreviewResponse{
  96023. ServerResponse: googleapi.ServerResponse{
  96024. Header: res.Header,
  96025. HTTPStatusCode: res.StatusCode,
  96026. },
  96027. }
  96028. target := &ret
  96029. if err := gensupport.DecodeResponse(target, res); err != nil {
  96030. return nil, err
  96031. }
  96032. return ret, nil
  96033. // {
  96034. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  96035. // "httpMethod": "POST",
  96036. // "id": "compute.routers.preview",
  96037. // "parameterOrder": [
  96038. // "project",
  96039. // "region",
  96040. // "router"
  96041. // ],
  96042. // "parameters": {
  96043. // "project": {
  96044. // "description": "Project ID for this request.",
  96045. // "location": "path",
  96046. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96047. // "required": true,
  96048. // "type": "string"
  96049. // },
  96050. // "region": {
  96051. // "description": "Name of the region for this request.",
  96052. // "location": "path",
  96053. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96054. // "required": true,
  96055. // "type": "string"
  96056. // },
  96057. // "router": {
  96058. // "description": "Name of the Router resource to query.",
  96059. // "location": "path",
  96060. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96061. // "required": true,
  96062. // "type": "string"
  96063. // }
  96064. // },
  96065. // "path": "{project}/regions/{region}/routers/{router}/preview",
  96066. // "request": {
  96067. // "$ref": "Router"
  96068. // },
  96069. // "response": {
  96070. // "$ref": "RoutersPreviewResponse"
  96071. // },
  96072. // "scopes": [
  96073. // "https://www.googleapis.com/auth/cloud-platform",
  96074. // "https://www.googleapis.com/auth/compute",
  96075. // "https://www.googleapis.com/auth/compute.readonly"
  96076. // ]
  96077. // }
  96078. }
  96079. // method id "compute.routers.testIamPermissions":
  96080. type RoutersTestIamPermissionsCall struct {
  96081. s *Service
  96082. project string
  96083. region string
  96084. resource string
  96085. testpermissionsrequest *TestPermissionsRequest
  96086. urlParams_ gensupport.URLParams
  96087. ctx_ context.Context
  96088. header_ http.Header
  96089. }
  96090. // TestIamPermissions: Returns permissions that a caller has on the
  96091. // specified resource.
  96092. func (r *RoutersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutersTestIamPermissionsCall {
  96093. c := &RoutersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96094. c.project = project
  96095. c.region = region
  96096. c.resource = resource
  96097. c.testpermissionsrequest = testpermissionsrequest
  96098. return c
  96099. }
  96100. // Fields allows partial responses to be retrieved. See
  96101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96102. // for more information.
  96103. func (c *RoutersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutersTestIamPermissionsCall {
  96104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96105. return c
  96106. }
  96107. // Context sets the context to be used in this call's Do method. Any
  96108. // pending HTTP request will be aborted if the provided context is
  96109. // canceled.
  96110. func (c *RoutersTestIamPermissionsCall) Context(ctx context.Context) *RoutersTestIamPermissionsCall {
  96111. c.ctx_ = ctx
  96112. return c
  96113. }
  96114. // Header returns an http.Header that can be modified by the caller to
  96115. // add HTTP headers to the request.
  96116. func (c *RoutersTestIamPermissionsCall) Header() http.Header {
  96117. if c.header_ == nil {
  96118. c.header_ = make(http.Header)
  96119. }
  96120. return c.header_
  96121. }
  96122. func (c *RoutersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  96123. reqHeaders := make(http.Header)
  96124. for k, v := range c.header_ {
  96125. reqHeaders[k] = v
  96126. }
  96127. reqHeaders.Set("User-Agent", c.s.userAgent())
  96128. var body io.Reader = nil
  96129. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  96130. if err != nil {
  96131. return nil, err
  96132. }
  96133. reqHeaders.Set("Content-Type", "application/json")
  96134. c.urlParams_.Set("alt", alt)
  96135. c.urlParams_.Set("prettyPrint", "false")
  96136. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{resource}/testIamPermissions")
  96137. urls += "?" + c.urlParams_.Encode()
  96138. req, err := http.NewRequest("POST", urls, body)
  96139. if err != nil {
  96140. return nil, err
  96141. }
  96142. req.Header = reqHeaders
  96143. googleapi.Expand(req.URL, map[string]string{
  96144. "project": c.project,
  96145. "region": c.region,
  96146. "resource": c.resource,
  96147. })
  96148. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96149. }
  96150. // Do executes the "compute.routers.testIamPermissions" call.
  96151. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  96152. // non-2xx status code is an error. Response headers are in either
  96153. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  96154. // returned at all) in error.(*googleapi.Error).Header. Use
  96155. // googleapi.IsNotModified to check whether the returned error was
  96156. // because http.StatusNotModified was returned.
  96157. func (c *RoutersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  96158. gensupport.SetOptions(c.urlParams_, opts...)
  96159. res, err := c.doRequest("json")
  96160. if res != nil && res.StatusCode == http.StatusNotModified {
  96161. if res.Body != nil {
  96162. res.Body.Close()
  96163. }
  96164. return nil, &googleapi.Error{
  96165. Code: res.StatusCode,
  96166. Header: res.Header,
  96167. }
  96168. }
  96169. if err != nil {
  96170. return nil, err
  96171. }
  96172. defer googleapi.CloseBody(res)
  96173. if err := googleapi.CheckResponse(res); err != nil {
  96174. return nil, err
  96175. }
  96176. ret := &TestPermissionsResponse{
  96177. ServerResponse: googleapi.ServerResponse{
  96178. Header: res.Header,
  96179. HTTPStatusCode: res.StatusCode,
  96180. },
  96181. }
  96182. target := &ret
  96183. if err := gensupport.DecodeResponse(target, res); err != nil {
  96184. return nil, err
  96185. }
  96186. return ret, nil
  96187. // {
  96188. // "description": "Returns permissions that a caller has on the specified resource.",
  96189. // "httpMethod": "POST",
  96190. // "id": "compute.routers.testIamPermissions",
  96191. // "parameterOrder": [
  96192. // "project",
  96193. // "region",
  96194. // "resource"
  96195. // ],
  96196. // "parameters": {
  96197. // "project": {
  96198. // "description": "Project ID for this request.",
  96199. // "location": "path",
  96200. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96201. // "required": true,
  96202. // "type": "string"
  96203. // },
  96204. // "region": {
  96205. // "description": "The name of the region for this request.",
  96206. // "location": "path",
  96207. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96208. // "required": true,
  96209. // "type": "string"
  96210. // },
  96211. // "resource": {
  96212. // "description": "Name or id of the resource for this request.",
  96213. // "location": "path",
  96214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96215. // "required": true,
  96216. // "type": "string"
  96217. // }
  96218. // },
  96219. // "path": "{project}/regions/{region}/routers/{resource}/testIamPermissions",
  96220. // "request": {
  96221. // "$ref": "TestPermissionsRequest"
  96222. // },
  96223. // "response": {
  96224. // "$ref": "TestPermissionsResponse"
  96225. // },
  96226. // "scopes": [
  96227. // "https://www.googleapis.com/auth/cloud-platform",
  96228. // "https://www.googleapis.com/auth/compute",
  96229. // "https://www.googleapis.com/auth/compute.readonly"
  96230. // ]
  96231. // }
  96232. }
  96233. // method id "compute.routers.update":
  96234. type RoutersUpdateCall struct {
  96235. s *Service
  96236. project string
  96237. region string
  96238. router string
  96239. router2 *Router
  96240. urlParams_ gensupport.URLParams
  96241. ctx_ context.Context
  96242. header_ http.Header
  96243. }
  96244. // Update: Updates the specified Router resource with the data included
  96245. // in the request.
  96246. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  96247. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96248. c.project = project
  96249. c.region = region
  96250. c.router = router
  96251. c.router2 = router2
  96252. return c
  96253. }
  96254. // RequestId sets the optional parameter "requestId": An optional
  96255. // request ID to identify requests. Specify a unique request ID so that
  96256. // if you must retry your request, the server will know to ignore the
  96257. // request if it has already been completed.
  96258. //
  96259. // For example, consider a situation where you make an initial request
  96260. // and the request times out. If you make the request again with the
  96261. // same request ID, the server can check if original operation with the
  96262. // same request ID was received, and if so, will ignore the second
  96263. // request. This prevents clients from accidentally creating duplicate
  96264. // commitments.
  96265. //
  96266. // The request ID must be a valid UUID with the exception that zero UUID
  96267. // is not supported (00000000-0000-0000-0000-000000000000).
  96268. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  96269. c.urlParams_.Set("requestId", requestId)
  96270. return c
  96271. }
  96272. // Fields allows partial responses to be retrieved. See
  96273. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96274. // for more information.
  96275. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  96276. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96277. return c
  96278. }
  96279. // Context sets the context to be used in this call's Do method. Any
  96280. // pending HTTP request will be aborted if the provided context is
  96281. // canceled.
  96282. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  96283. c.ctx_ = ctx
  96284. return c
  96285. }
  96286. // Header returns an http.Header that can be modified by the caller to
  96287. // add HTTP headers to the request.
  96288. func (c *RoutersUpdateCall) Header() http.Header {
  96289. if c.header_ == nil {
  96290. c.header_ = make(http.Header)
  96291. }
  96292. return c.header_
  96293. }
  96294. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  96295. reqHeaders := make(http.Header)
  96296. for k, v := range c.header_ {
  96297. reqHeaders[k] = v
  96298. }
  96299. reqHeaders.Set("User-Agent", c.s.userAgent())
  96300. var body io.Reader = nil
  96301. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  96302. if err != nil {
  96303. return nil, err
  96304. }
  96305. reqHeaders.Set("Content-Type", "application/json")
  96306. c.urlParams_.Set("alt", alt)
  96307. c.urlParams_.Set("prettyPrint", "false")
  96308. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  96309. urls += "?" + c.urlParams_.Encode()
  96310. req, err := http.NewRequest("PUT", urls, body)
  96311. if err != nil {
  96312. return nil, err
  96313. }
  96314. req.Header = reqHeaders
  96315. googleapi.Expand(req.URL, map[string]string{
  96316. "project": c.project,
  96317. "region": c.region,
  96318. "router": c.router,
  96319. })
  96320. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96321. }
  96322. // Do executes the "compute.routers.update" call.
  96323. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96324. // status code is an error. Response headers are in either
  96325. // *Operation.ServerResponse.Header or (if a response was returned at
  96326. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96327. // to check whether the returned error was because
  96328. // http.StatusNotModified was returned.
  96329. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96330. gensupport.SetOptions(c.urlParams_, opts...)
  96331. res, err := c.doRequest("json")
  96332. if res != nil && res.StatusCode == http.StatusNotModified {
  96333. if res.Body != nil {
  96334. res.Body.Close()
  96335. }
  96336. return nil, &googleapi.Error{
  96337. Code: res.StatusCode,
  96338. Header: res.Header,
  96339. }
  96340. }
  96341. if err != nil {
  96342. return nil, err
  96343. }
  96344. defer googleapi.CloseBody(res)
  96345. if err := googleapi.CheckResponse(res); err != nil {
  96346. return nil, err
  96347. }
  96348. ret := &Operation{
  96349. ServerResponse: googleapi.ServerResponse{
  96350. Header: res.Header,
  96351. HTTPStatusCode: res.StatusCode,
  96352. },
  96353. }
  96354. target := &ret
  96355. if err := gensupport.DecodeResponse(target, res); err != nil {
  96356. return nil, err
  96357. }
  96358. return ret, nil
  96359. // {
  96360. // "description": "Updates the specified Router resource with the data included in the request.",
  96361. // "httpMethod": "PUT",
  96362. // "id": "compute.routers.update",
  96363. // "parameterOrder": [
  96364. // "project",
  96365. // "region",
  96366. // "router"
  96367. // ],
  96368. // "parameters": {
  96369. // "project": {
  96370. // "description": "Project ID for this request.",
  96371. // "location": "path",
  96372. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96373. // "required": true,
  96374. // "type": "string"
  96375. // },
  96376. // "region": {
  96377. // "description": "Name of the region for this request.",
  96378. // "location": "path",
  96379. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96380. // "required": true,
  96381. // "type": "string"
  96382. // },
  96383. // "requestId": {
  96384. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96385. // "location": "query",
  96386. // "type": "string"
  96387. // },
  96388. // "router": {
  96389. // "description": "Name of the Router resource to update.",
  96390. // "location": "path",
  96391. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96392. // "required": true,
  96393. // "type": "string"
  96394. // }
  96395. // },
  96396. // "path": "{project}/regions/{region}/routers/{router}",
  96397. // "request": {
  96398. // "$ref": "Router"
  96399. // },
  96400. // "response": {
  96401. // "$ref": "Operation"
  96402. // },
  96403. // "scopes": [
  96404. // "https://www.googleapis.com/auth/cloud-platform",
  96405. // "https://www.googleapis.com/auth/compute"
  96406. // ]
  96407. // }
  96408. }
  96409. // method id "compute.routes.delete":
  96410. type RoutesDeleteCall struct {
  96411. s *Service
  96412. project string
  96413. route string
  96414. urlParams_ gensupport.URLParams
  96415. ctx_ context.Context
  96416. header_ http.Header
  96417. }
  96418. // Delete: Deletes the specified Route resource.
  96419. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  96420. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  96421. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96422. c.project = project
  96423. c.route = route
  96424. return c
  96425. }
  96426. // RequestId sets the optional parameter "requestId": An optional
  96427. // request ID to identify requests. Specify a unique request ID so that
  96428. // if you must retry your request, the server will know to ignore the
  96429. // request if it has already been completed.
  96430. //
  96431. // For example, consider a situation where you make an initial request
  96432. // and the request times out. If you make the request again with the
  96433. // same request ID, the server can check if original operation with the
  96434. // same request ID was received, and if so, will ignore the second
  96435. // request. This prevents clients from accidentally creating duplicate
  96436. // commitments.
  96437. //
  96438. // The request ID must be a valid UUID with the exception that zero UUID
  96439. // is not supported (00000000-0000-0000-0000-000000000000).
  96440. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  96441. c.urlParams_.Set("requestId", requestId)
  96442. return c
  96443. }
  96444. // Fields allows partial responses to be retrieved. See
  96445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96446. // for more information.
  96447. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  96448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96449. return c
  96450. }
  96451. // Context sets the context to be used in this call's Do method. Any
  96452. // pending HTTP request will be aborted if the provided context is
  96453. // canceled.
  96454. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  96455. c.ctx_ = ctx
  96456. return c
  96457. }
  96458. // Header returns an http.Header that can be modified by the caller to
  96459. // add HTTP headers to the request.
  96460. func (c *RoutesDeleteCall) Header() http.Header {
  96461. if c.header_ == nil {
  96462. c.header_ = make(http.Header)
  96463. }
  96464. return c.header_
  96465. }
  96466. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  96467. reqHeaders := make(http.Header)
  96468. for k, v := range c.header_ {
  96469. reqHeaders[k] = v
  96470. }
  96471. reqHeaders.Set("User-Agent", c.s.userAgent())
  96472. var body io.Reader = nil
  96473. c.urlParams_.Set("alt", alt)
  96474. c.urlParams_.Set("prettyPrint", "false")
  96475. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  96476. urls += "?" + c.urlParams_.Encode()
  96477. req, err := http.NewRequest("DELETE", urls, body)
  96478. if err != nil {
  96479. return nil, err
  96480. }
  96481. req.Header = reqHeaders
  96482. googleapi.Expand(req.URL, map[string]string{
  96483. "project": c.project,
  96484. "route": c.route,
  96485. })
  96486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96487. }
  96488. // Do executes the "compute.routes.delete" call.
  96489. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96490. // status code is an error. Response headers are in either
  96491. // *Operation.ServerResponse.Header or (if a response was returned at
  96492. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96493. // to check whether the returned error was because
  96494. // http.StatusNotModified was returned.
  96495. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96496. gensupport.SetOptions(c.urlParams_, opts...)
  96497. res, err := c.doRequest("json")
  96498. if res != nil && res.StatusCode == http.StatusNotModified {
  96499. if res.Body != nil {
  96500. res.Body.Close()
  96501. }
  96502. return nil, &googleapi.Error{
  96503. Code: res.StatusCode,
  96504. Header: res.Header,
  96505. }
  96506. }
  96507. if err != nil {
  96508. return nil, err
  96509. }
  96510. defer googleapi.CloseBody(res)
  96511. if err := googleapi.CheckResponse(res); err != nil {
  96512. return nil, err
  96513. }
  96514. ret := &Operation{
  96515. ServerResponse: googleapi.ServerResponse{
  96516. Header: res.Header,
  96517. HTTPStatusCode: res.StatusCode,
  96518. },
  96519. }
  96520. target := &ret
  96521. if err := gensupport.DecodeResponse(target, res); err != nil {
  96522. return nil, err
  96523. }
  96524. return ret, nil
  96525. // {
  96526. // "description": "Deletes the specified Route resource.",
  96527. // "httpMethod": "DELETE",
  96528. // "id": "compute.routes.delete",
  96529. // "parameterOrder": [
  96530. // "project",
  96531. // "route"
  96532. // ],
  96533. // "parameters": {
  96534. // "project": {
  96535. // "description": "Project ID for this request.",
  96536. // "location": "path",
  96537. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96538. // "required": true,
  96539. // "type": "string"
  96540. // },
  96541. // "requestId": {
  96542. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96543. // "location": "query",
  96544. // "type": "string"
  96545. // },
  96546. // "route": {
  96547. // "description": "Name of the Route resource to delete.",
  96548. // "location": "path",
  96549. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96550. // "required": true,
  96551. // "type": "string"
  96552. // }
  96553. // },
  96554. // "path": "{project}/global/routes/{route}",
  96555. // "response": {
  96556. // "$ref": "Operation"
  96557. // },
  96558. // "scopes": [
  96559. // "https://www.googleapis.com/auth/cloud-platform",
  96560. // "https://www.googleapis.com/auth/compute"
  96561. // ]
  96562. // }
  96563. }
  96564. // method id "compute.routes.get":
  96565. type RoutesGetCall struct {
  96566. s *Service
  96567. project string
  96568. route string
  96569. urlParams_ gensupport.URLParams
  96570. ifNoneMatch_ string
  96571. ctx_ context.Context
  96572. header_ http.Header
  96573. }
  96574. // Get: Returns the specified Route resource. Gets a list of available
  96575. // routes by making a list() request.
  96576. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  96577. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  96578. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96579. c.project = project
  96580. c.route = route
  96581. return c
  96582. }
  96583. // Fields allows partial responses to be retrieved. See
  96584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96585. // for more information.
  96586. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  96587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96588. return c
  96589. }
  96590. // IfNoneMatch sets the optional parameter which makes the operation
  96591. // fail if the object's ETag matches the given value. This is useful for
  96592. // getting updates only after the object has changed since the last
  96593. // request. Use googleapi.IsNotModified to check whether the response
  96594. // error from Do is the result of In-None-Match.
  96595. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  96596. c.ifNoneMatch_ = entityTag
  96597. return c
  96598. }
  96599. // Context sets the context to be used in this call's Do method. Any
  96600. // pending HTTP request will be aborted if the provided context is
  96601. // canceled.
  96602. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  96603. c.ctx_ = ctx
  96604. return c
  96605. }
  96606. // Header returns an http.Header that can be modified by the caller to
  96607. // add HTTP headers to the request.
  96608. func (c *RoutesGetCall) Header() http.Header {
  96609. if c.header_ == nil {
  96610. c.header_ = make(http.Header)
  96611. }
  96612. return c.header_
  96613. }
  96614. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  96615. reqHeaders := make(http.Header)
  96616. for k, v := range c.header_ {
  96617. reqHeaders[k] = v
  96618. }
  96619. reqHeaders.Set("User-Agent", c.s.userAgent())
  96620. if c.ifNoneMatch_ != "" {
  96621. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96622. }
  96623. var body io.Reader = nil
  96624. c.urlParams_.Set("alt", alt)
  96625. c.urlParams_.Set("prettyPrint", "false")
  96626. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  96627. urls += "?" + c.urlParams_.Encode()
  96628. req, err := http.NewRequest("GET", urls, body)
  96629. if err != nil {
  96630. return nil, err
  96631. }
  96632. req.Header = reqHeaders
  96633. googleapi.Expand(req.URL, map[string]string{
  96634. "project": c.project,
  96635. "route": c.route,
  96636. })
  96637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96638. }
  96639. // Do executes the "compute.routes.get" call.
  96640. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  96641. // code is an error. Response headers are in either
  96642. // *Route.ServerResponse.Header or (if a response was returned at all)
  96643. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  96644. // check whether the returned error was because http.StatusNotModified
  96645. // was returned.
  96646. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  96647. gensupport.SetOptions(c.urlParams_, opts...)
  96648. res, err := c.doRequest("json")
  96649. if res != nil && res.StatusCode == http.StatusNotModified {
  96650. if res.Body != nil {
  96651. res.Body.Close()
  96652. }
  96653. return nil, &googleapi.Error{
  96654. Code: res.StatusCode,
  96655. Header: res.Header,
  96656. }
  96657. }
  96658. if err != nil {
  96659. return nil, err
  96660. }
  96661. defer googleapi.CloseBody(res)
  96662. if err := googleapi.CheckResponse(res); err != nil {
  96663. return nil, err
  96664. }
  96665. ret := &Route{
  96666. ServerResponse: googleapi.ServerResponse{
  96667. Header: res.Header,
  96668. HTTPStatusCode: res.StatusCode,
  96669. },
  96670. }
  96671. target := &ret
  96672. if err := gensupport.DecodeResponse(target, res); err != nil {
  96673. return nil, err
  96674. }
  96675. return ret, nil
  96676. // {
  96677. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  96678. // "httpMethod": "GET",
  96679. // "id": "compute.routes.get",
  96680. // "parameterOrder": [
  96681. // "project",
  96682. // "route"
  96683. // ],
  96684. // "parameters": {
  96685. // "project": {
  96686. // "description": "Project ID for this request.",
  96687. // "location": "path",
  96688. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96689. // "required": true,
  96690. // "type": "string"
  96691. // },
  96692. // "route": {
  96693. // "description": "Name of the Route resource to return.",
  96694. // "location": "path",
  96695. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96696. // "required": true,
  96697. // "type": "string"
  96698. // }
  96699. // },
  96700. // "path": "{project}/global/routes/{route}",
  96701. // "response": {
  96702. // "$ref": "Route"
  96703. // },
  96704. // "scopes": [
  96705. // "https://www.googleapis.com/auth/cloud-platform",
  96706. // "https://www.googleapis.com/auth/compute",
  96707. // "https://www.googleapis.com/auth/compute.readonly"
  96708. // ]
  96709. // }
  96710. }
  96711. // method id "compute.routes.insert":
  96712. type RoutesInsertCall struct {
  96713. s *Service
  96714. project string
  96715. route *Route
  96716. urlParams_ gensupport.URLParams
  96717. ctx_ context.Context
  96718. header_ http.Header
  96719. }
  96720. // Insert: Creates a Route resource in the specified project using the
  96721. // data included in the request.
  96722. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  96723. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  96724. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96725. c.project = project
  96726. c.route = route
  96727. return c
  96728. }
  96729. // RequestId sets the optional parameter "requestId": An optional
  96730. // request ID to identify requests. Specify a unique request ID so that
  96731. // if you must retry your request, the server will know to ignore the
  96732. // request if it has already been completed.
  96733. //
  96734. // For example, consider a situation where you make an initial request
  96735. // and the request times out. If you make the request again with the
  96736. // same request ID, the server can check if original operation with the
  96737. // same request ID was received, and if so, will ignore the second
  96738. // request. This prevents clients from accidentally creating duplicate
  96739. // commitments.
  96740. //
  96741. // The request ID must be a valid UUID with the exception that zero UUID
  96742. // is not supported (00000000-0000-0000-0000-000000000000).
  96743. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  96744. c.urlParams_.Set("requestId", requestId)
  96745. return c
  96746. }
  96747. // Fields allows partial responses to be retrieved. See
  96748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96749. // for more information.
  96750. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  96751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96752. return c
  96753. }
  96754. // Context sets the context to be used in this call's Do method. Any
  96755. // pending HTTP request will be aborted if the provided context is
  96756. // canceled.
  96757. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  96758. c.ctx_ = ctx
  96759. return c
  96760. }
  96761. // Header returns an http.Header that can be modified by the caller to
  96762. // add HTTP headers to the request.
  96763. func (c *RoutesInsertCall) Header() http.Header {
  96764. if c.header_ == nil {
  96765. c.header_ = make(http.Header)
  96766. }
  96767. return c.header_
  96768. }
  96769. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  96770. reqHeaders := make(http.Header)
  96771. for k, v := range c.header_ {
  96772. reqHeaders[k] = v
  96773. }
  96774. reqHeaders.Set("User-Agent", c.s.userAgent())
  96775. var body io.Reader = nil
  96776. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  96777. if err != nil {
  96778. return nil, err
  96779. }
  96780. reqHeaders.Set("Content-Type", "application/json")
  96781. c.urlParams_.Set("alt", alt)
  96782. c.urlParams_.Set("prettyPrint", "false")
  96783. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  96784. urls += "?" + c.urlParams_.Encode()
  96785. req, err := http.NewRequest("POST", urls, body)
  96786. if err != nil {
  96787. return nil, err
  96788. }
  96789. req.Header = reqHeaders
  96790. googleapi.Expand(req.URL, map[string]string{
  96791. "project": c.project,
  96792. })
  96793. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96794. }
  96795. // Do executes the "compute.routes.insert" call.
  96796. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96797. // status code is an error. Response headers are in either
  96798. // *Operation.ServerResponse.Header or (if a response was returned at
  96799. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96800. // to check whether the returned error was because
  96801. // http.StatusNotModified was returned.
  96802. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96803. gensupport.SetOptions(c.urlParams_, opts...)
  96804. res, err := c.doRequest("json")
  96805. if res != nil && res.StatusCode == http.StatusNotModified {
  96806. if res.Body != nil {
  96807. res.Body.Close()
  96808. }
  96809. return nil, &googleapi.Error{
  96810. Code: res.StatusCode,
  96811. Header: res.Header,
  96812. }
  96813. }
  96814. if err != nil {
  96815. return nil, err
  96816. }
  96817. defer googleapi.CloseBody(res)
  96818. if err := googleapi.CheckResponse(res); err != nil {
  96819. return nil, err
  96820. }
  96821. ret := &Operation{
  96822. ServerResponse: googleapi.ServerResponse{
  96823. Header: res.Header,
  96824. HTTPStatusCode: res.StatusCode,
  96825. },
  96826. }
  96827. target := &ret
  96828. if err := gensupport.DecodeResponse(target, res); err != nil {
  96829. return nil, err
  96830. }
  96831. return ret, nil
  96832. // {
  96833. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  96834. // "httpMethod": "POST",
  96835. // "id": "compute.routes.insert",
  96836. // "parameterOrder": [
  96837. // "project"
  96838. // ],
  96839. // "parameters": {
  96840. // "project": {
  96841. // "description": "Project ID for this request.",
  96842. // "location": "path",
  96843. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96844. // "required": true,
  96845. // "type": "string"
  96846. // },
  96847. // "requestId": {
  96848. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96849. // "location": "query",
  96850. // "type": "string"
  96851. // }
  96852. // },
  96853. // "path": "{project}/global/routes",
  96854. // "request": {
  96855. // "$ref": "Route"
  96856. // },
  96857. // "response": {
  96858. // "$ref": "Operation"
  96859. // },
  96860. // "scopes": [
  96861. // "https://www.googleapis.com/auth/cloud-platform",
  96862. // "https://www.googleapis.com/auth/compute"
  96863. // ]
  96864. // }
  96865. }
  96866. // method id "compute.routes.list":
  96867. type RoutesListCall struct {
  96868. s *Service
  96869. project string
  96870. urlParams_ gensupport.URLParams
  96871. ifNoneMatch_ string
  96872. ctx_ context.Context
  96873. header_ http.Header
  96874. }
  96875. // List: Retrieves the list of Route resources available to the
  96876. // specified project.
  96877. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  96878. func (r *RoutesService) List(project string) *RoutesListCall {
  96879. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96880. c.project = project
  96881. return c
  96882. }
  96883. // Filter sets the optional parameter "filter": A filter expression that
  96884. // filters resources listed in the response. The expression must specify
  96885. // the field name, a comparison operator, and the value that you want to
  96886. // use for filtering. The value must be a string, a number, or a
  96887. // boolean. The comparison operator must be either =, !=, >, or <.
  96888. //
  96889. // For example, if you are filtering Compute Engine instances, you can
  96890. // exclude instances named example-instance by specifying name !=
  96891. // example-instance.
  96892. //
  96893. // You can also filter nested fields. For example, you could specify
  96894. // scheduling.automaticRestart = false to include instances only if they
  96895. // are not scheduled for automatic restarts. You can use filtering on
  96896. // nested fields to filter based on resource labels.
  96897. //
  96898. // To filter on multiple expressions, provide each separate expression
  96899. // within parentheses. For example, (scheduling.automaticRestart = true)
  96900. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96901. // AND expression. However, you can include AND and OR expressions
  96902. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96903. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96904. // true).
  96905. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  96906. c.urlParams_.Set("filter", filter)
  96907. return c
  96908. }
  96909. // MaxResults sets the optional parameter "maxResults": The maximum
  96910. // number of results per page that should be returned. If the number of
  96911. // available results is larger than maxResults, Compute Engine returns a
  96912. // nextPageToken that can be used to get the next page of results in
  96913. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96914. // (Default: 500)
  96915. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  96916. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96917. return c
  96918. }
  96919. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  96920. // a certain order. By default, results are returned in alphanumerical
  96921. // order based on the resource name.
  96922. //
  96923. // You can also sort results in descending order based on the creation
  96924. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96925. // based on the creationTimestamp field in reverse chronological order
  96926. // (newest result first). Use this to sort resources like operations so
  96927. // that the newest operation is returned first.
  96928. //
  96929. // Currently, only sorting by name or creationTimestamp desc is
  96930. // supported.
  96931. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  96932. c.urlParams_.Set("orderBy", orderBy)
  96933. return c
  96934. }
  96935. // PageToken sets the optional parameter "pageToken": Specifies a page
  96936. // token to use. Set pageToken to the nextPageToken returned by a
  96937. // previous list request to get the next page of results.
  96938. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  96939. c.urlParams_.Set("pageToken", pageToken)
  96940. return c
  96941. }
  96942. // Fields allows partial responses to be retrieved. See
  96943. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96944. // for more information.
  96945. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  96946. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96947. return c
  96948. }
  96949. // IfNoneMatch sets the optional parameter which makes the operation
  96950. // fail if the object's ETag matches the given value. This is useful for
  96951. // getting updates only after the object has changed since the last
  96952. // request. Use googleapi.IsNotModified to check whether the response
  96953. // error from Do is the result of In-None-Match.
  96954. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  96955. c.ifNoneMatch_ = entityTag
  96956. return c
  96957. }
  96958. // Context sets the context to be used in this call's Do method. Any
  96959. // pending HTTP request will be aborted if the provided context is
  96960. // canceled.
  96961. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  96962. c.ctx_ = ctx
  96963. return c
  96964. }
  96965. // Header returns an http.Header that can be modified by the caller to
  96966. // add HTTP headers to the request.
  96967. func (c *RoutesListCall) Header() http.Header {
  96968. if c.header_ == nil {
  96969. c.header_ = make(http.Header)
  96970. }
  96971. return c.header_
  96972. }
  96973. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  96974. reqHeaders := make(http.Header)
  96975. for k, v := range c.header_ {
  96976. reqHeaders[k] = v
  96977. }
  96978. reqHeaders.Set("User-Agent", c.s.userAgent())
  96979. if c.ifNoneMatch_ != "" {
  96980. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96981. }
  96982. var body io.Reader = nil
  96983. c.urlParams_.Set("alt", alt)
  96984. c.urlParams_.Set("prettyPrint", "false")
  96985. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  96986. urls += "?" + c.urlParams_.Encode()
  96987. req, err := http.NewRequest("GET", urls, body)
  96988. if err != nil {
  96989. return nil, err
  96990. }
  96991. req.Header = reqHeaders
  96992. googleapi.Expand(req.URL, map[string]string{
  96993. "project": c.project,
  96994. })
  96995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96996. }
  96997. // Do executes the "compute.routes.list" call.
  96998. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  96999. // status code is an error. Response headers are in either
  97000. // *RouteList.ServerResponse.Header or (if a response was returned at
  97001. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97002. // to check whether the returned error was because
  97003. // http.StatusNotModified was returned.
  97004. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  97005. gensupport.SetOptions(c.urlParams_, opts...)
  97006. res, err := c.doRequest("json")
  97007. if res != nil && res.StatusCode == http.StatusNotModified {
  97008. if res.Body != nil {
  97009. res.Body.Close()
  97010. }
  97011. return nil, &googleapi.Error{
  97012. Code: res.StatusCode,
  97013. Header: res.Header,
  97014. }
  97015. }
  97016. if err != nil {
  97017. return nil, err
  97018. }
  97019. defer googleapi.CloseBody(res)
  97020. if err := googleapi.CheckResponse(res); err != nil {
  97021. return nil, err
  97022. }
  97023. ret := &RouteList{
  97024. ServerResponse: googleapi.ServerResponse{
  97025. Header: res.Header,
  97026. HTTPStatusCode: res.StatusCode,
  97027. },
  97028. }
  97029. target := &ret
  97030. if err := gensupport.DecodeResponse(target, res); err != nil {
  97031. return nil, err
  97032. }
  97033. return ret, nil
  97034. // {
  97035. // "description": "Retrieves the list of Route resources available to the specified project.",
  97036. // "httpMethod": "GET",
  97037. // "id": "compute.routes.list",
  97038. // "parameterOrder": [
  97039. // "project"
  97040. // ],
  97041. // "parameters": {
  97042. // "filter": {
  97043. // "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).",
  97044. // "location": "query",
  97045. // "type": "string"
  97046. // },
  97047. // "maxResults": {
  97048. // "default": "500",
  97049. // "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)",
  97050. // "format": "uint32",
  97051. // "location": "query",
  97052. // "minimum": "0",
  97053. // "type": "integer"
  97054. // },
  97055. // "orderBy": {
  97056. // "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.",
  97057. // "location": "query",
  97058. // "type": "string"
  97059. // },
  97060. // "pageToken": {
  97061. // "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.",
  97062. // "location": "query",
  97063. // "type": "string"
  97064. // },
  97065. // "project": {
  97066. // "description": "Project ID for this request.",
  97067. // "location": "path",
  97068. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97069. // "required": true,
  97070. // "type": "string"
  97071. // }
  97072. // },
  97073. // "path": "{project}/global/routes",
  97074. // "response": {
  97075. // "$ref": "RouteList"
  97076. // },
  97077. // "scopes": [
  97078. // "https://www.googleapis.com/auth/cloud-platform",
  97079. // "https://www.googleapis.com/auth/compute",
  97080. // "https://www.googleapis.com/auth/compute.readonly"
  97081. // ]
  97082. // }
  97083. }
  97084. // Pages invokes f for each page of results.
  97085. // A non-nil error returned from f will halt the iteration.
  97086. // The provided context supersedes any context provided to the Context method.
  97087. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  97088. c.ctx_ = ctx
  97089. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  97090. for {
  97091. x, err := c.Do()
  97092. if err != nil {
  97093. return err
  97094. }
  97095. if err := f(x); err != nil {
  97096. return err
  97097. }
  97098. if x.NextPageToken == "" {
  97099. return nil
  97100. }
  97101. c.PageToken(x.NextPageToken)
  97102. }
  97103. }
  97104. // method id "compute.routes.testIamPermissions":
  97105. type RoutesTestIamPermissionsCall struct {
  97106. s *Service
  97107. project string
  97108. resource string
  97109. testpermissionsrequest *TestPermissionsRequest
  97110. urlParams_ gensupport.URLParams
  97111. ctx_ context.Context
  97112. header_ http.Header
  97113. }
  97114. // TestIamPermissions: Returns permissions that a caller has on the
  97115. // specified resource.
  97116. func (r *RoutesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutesTestIamPermissionsCall {
  97117. c := &RoutesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97118. c.project = project
  97119. c.resource = resource
  97120. c.testpermissionsrequest = testpermissionsrequest
  97121. return c
  97122. }
  97123. // Fields allows partial responses to be retrieved. See
  97124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97125. // for more information.
  97126. func (c *RoutesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutesTestIamPermissionsCall {
  97127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97128. return c
  97129. }
  97130. // Context sets the context to be used in this call's Do method. Any
  97131. // pending HTTP request will be aborted if the provided context is
  97132. // canceled.
  97133. func (c *RoutesTestIamPermissionsCall) Context(ctx context.Context) *RoutesTestIamPermissionsCall {
  97134. c.ctx_ = ctx
  97135. return c
  97136. }
  97137. // Header returns an http.Header that can be modified by the caller to
  97138. // add HTTP headers to the request.
  97139. func (c *RoutesTestIamPermissionsCall) Header() http.Header {
  97140. if c.header_ == nil {
  97141. c.header_ = make(http.Header)
  97142. }
  97143. return c.header_
  97144. }
  97145. func (c *RoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  97146. reqHeaders := make(http.Header)
  97147. for k, v := range c.header_ {
  97148. reqHeaders[k] = v
  97149. }
  97150. reqHeaders.Set("User-Agent", c.s.userAgent())
  97151. var body io.Reader = nil
  97152. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  97153. if err != nil {
  97154. return nil, err
  97155. }
  97156. reqHeaders.Set("Content-Type", "application/json")
  97157. c.urlParams_.Set("alt", alt)
  97158. c.urlParams_.Set("prettyPrint", "false")
  97159. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{resource}/testIamPermissions")
  97160. urls += "?" + c.urlParams_.Encode()
  97161. req, err := http.NewRequest("POST", urls, body)
  97162. if err != nil {
  97163. return nil, err
  97164. }
  97165. req.Header = reqHeaders
  97166. googleapi.Expand(req.URL, map[string]string{
  97167. "project": c.project,
  97168. "resource": c.resource,
  97169. })
  97170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97171. }
  97172. // Do executes the "compute.routes.testIamPermissions" call.
  97173. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  97174. // non-2xx status code is an error. Response headers are in either
  97175. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  97176. // returned at all) in error.(*googleapi.Error).Header. Use
  97177. // googleapi.IsNotModified to check whether the returned error was
  97178. // because http.StatusNotModified was returned.
  97179. func (c *RoutesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  97180. gensupport.SetOptions(c.urlParams_, opts...)
  97181. res, err := c.doRequest("json")
  97182. if res != nil && res.StatusCode == http.StatusNotModified {
  97183. if res.Body != nil {
  97184. res.Body.Close()
  97185. }
  97186. return nil, &googleapi.Error{
  97187. Code: res.StatusCode,
  97188. Header: res.Header,
  97189. }
  97190. }
  97191. if err != nil {
  97192. return nil, err
  97193. }
  97194. defer googleapi.CloseBody(res)
  97195. if err := googleapi.CheckResponse(res); err != nil {
  97196. return nil, err
  97197. }
  97198. ret := &TestPermissionsResponse{
  97199. ServerResponse: googleapi.ServerResponse{
  97200. Header: res.Header,
  97201. HTTPStatusCode: res.StatusCode,
  97202. },
  97203. }
  97204. target := &ret
  97205. if err := gensupport.DecodeResponse(target, res); err != nil {
  97206. return nil, err
  97207. }
  97208. return ret, nil
  97209. // {
  97210. // "description": "Returns permissions that a caller has on the specified resource.",
  97211. // "httpMethod": "POST",
  97212. // "id": "compute.routes.testIamPermissions",
  97213. // "parameterOrder": [
  97214. // "project",
  97215. // "resource"
  97216. // ],
  97217. // "parameters": {
  97218. // "project": {
  97219. // "description": "Project ID for this request.",
  97220. // "location": "path",
  97221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97222. // "required": true,
  97223. // "type": "string"
  97224. // },
  97225. // "resource": {
  97226. // "description": "Name or id of the resource for this request.",
  97227. // "location": "path",
  97228. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97229. // "required": true,
  97230. // "type": "string"
  97231. // }
  97232. // },
  97233. // "path": "{project}/global/routes/{resource}/testIamPermissions",
  97234. // "request": {
  97235. // "$ref": "TestPermissionsRequest"
  97236. // },
  97237. // "response": {
  97238. // "$ref": "TestPermissionsResponse"
  97239. // },
  97240. // "scopes": [
  97241. // "https://www.googleapis.com/auth/cloud-platform",
  97242. // "https://www.googleapis.com/auth/compute",
  97243. // "https://www.googleapis.com/auth/compute.readonly"
  97244. // ]
  97245. // }
  97246. }
  97247. // method id "compute.securityPolicies.addRule":
  97248. type SecurityPoliciesAddRuleCall struct {
  97249. s *Service
  97250. project string
  97251. securityPolicy string
  97252. securitypolicyrule *SecurityPolicyRule
  97253. urlParams_ gensupport.URLParams
  97254. ctx_ context.Context
  97255. header_ http.Header
  97256. }
  97257. // AddRule: Inserts a rule into a security policy.
  97258. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  97259. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97260. c.project = project
  97261. c.securityPolicy = securityPolicy
  97262. c.securitypolicyrule = securitypolicyrule
  97263. return c
  97264. }
  97265. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  97266. // request will not be committed.
  97267. func (c *SecurityPoliciesAddRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesAddRuleCall {
  97268. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  97269. return c
  97270. }
  97271. // Fields allows partial responses to be retrieved. See
  97272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97273. // for more information.
  97274. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  97275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97276. return c
  97277. }
  97278. // Context sets the context to be used in this call's Do method. Any
  97279. // pending HTTP request will be aborted if the provided context is
  97280. // canceled.
  97281. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  97282. c.ctx_ = ctx
  97283. return c
  97284. }
  97285. // Header returns an http.Header that can be modified by the caller to
  97286. // add HTTP headers to the request.
  97287. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  97288. if c.header_ == nil {
  97289. c.header_ = make(http.Header)
  97290. }
  97291. return c.header_
  97292. }
  97293. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  97294. reqHeaders := make(http.Header)
  97295. for k, v := range c.header_ {
  97296. reqHeaders[k] = v
  97297. }
  97298. reqHeaders.Set("User-Agent", c.s.userAgent())
  97299. var body io.Reader = nil
  97300. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  97301. if err != nil {
  97302. return nil, err
  97303. }
  97304. reqHeaders.Set("Content-Type", "application/json")
  97305. c.urlParams_.Set("alt", alt)
  97306. c.urlParams_.Set("prettyPrint", "false")
  97307. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  97308. urls += "?" + c.urlParams_.Encode()
  97309. req, err := http.NewRequest("POST", urls, body)
  97310. if err != nil {
  97311. return nil, err
  97312. }
  97313. req.Header = reqHeaders
  97314. googleapi.Expand(req.URL, map[string]string{
  97315. "project": c.project,
  97316. "securityPolicy": c.securityPolicy,
  97317. })
  97318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97319. }
  97320. // Do executes the "compute.securityPolicies.addRule" call.
  97321. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97322. // status code is an error. Response headers are in either
  97323. // *Operation.ServerResponse.Header or (if a response was returned at
  97324. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97325. // to check whether the returned error was because
  97326. // http.StatusNotModified was returned.
  97327. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97328. gensupport.SetOptions(c.urlParams_, opts...)
  97329. res, err := c.doRequest("json")
  97330. if res != nil && res.StatusCode == http.StatusNotModified {
  97331. if res.Body != nil {
  97332. res.Body.Close()
  97333. }
  97334. return nil, &googleapi.Error{
  97335. Code: res.StatusCode,
  97336. Header: res.Header,
  97337. }
  97338. }
  97339. if err != nil {
  97340. return nil, err
  97341. }
  97342. defer googleapi.CloseBody(res)
  97343. if err := googleapi.CheckResponse(res); err != nil {
  97344. return nil, err
  97345. }
  97346. ret := &Operation{
  97347. ServerResponse: googleapi.ServerResponse{
  97348. Header: res.Header,
  97349. HTTPStatusCode: res.StatusCode,
  97350. },
  97351. }
  97352. target := &ret
  97353. if err := gensupport.DecodeResponse(target, res); err != nil {
  97354. return nil, err
  97355. }
  97356. return ret, nil
  97357. // {
  97358. // "description": "Inserts a rule into a security policy.",
  97359. // "httpMethod": "POST",
  97360. // "id": "compute.securityPolicies.addRule",
  97361. // "parameterOrder": [
  97362. // "project",
  97363. // "securityPolicy"
  97364. // ],
  97365. // "parameters": {
  97366. // "project": {
  97367. // "description": "Project ID for this request.",
  97368. // "location": "path",
  97369. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97370. // "required": true,
  97371. // "type": "string"
  97372. // },
  97373. // "securityPolicy": {
  97374. // "description": "Name of the security policy to update.",
  97375. // "location": "path",
  97376. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97377. // "required": true,
  97378. // "type": "string"
  97379. // },
  97380. // "validateOnly": {
  97381. // "description": "If true, the request will not be committed.",
  97382. // "location": "query",
  97383. // "type": "boolean"
  97384. // }
  97385. // },
  97386. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  97387. // "request": {
  97388. // "$ref": "SecurityPolicyRule"
  97389. // },
  97390. // "response": {
  97391. // "$ref": "Operation"
  97392. // },
  97393. // "scopes": [
  97394. // "https://www.googleapis.com/auth/cloud-platform",
  97395. // "https://www.googleapis.com/auth/compute"
  97396. // ]
  97397. // }
  97398. }
  97399. // method id "compute.securityPolicies.delete":
  97400. type SecurityPoliciesDeleteCall struct {
  97401. s *Service
  97402. project string
  97403. securityPolicy string
  97404. urlParams_ gensupport.URLParams
  97405. ctx_ context.Context
  97406. header_ http.Header
  97407. }
  97408. // Delete: Deletes the specified policy.
  97409. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  97410. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97411. c.project = project
  97412. c.securityPolicy = securityPolicy
  97413. return c
  97414. }
  97415. // RequestId sets the optional parameter "requestId": An optional
  97416. // request ID to identify requests. Specify a unique request ID so that
  97417. // if you must retry your request, the server will know to ignore the
  97418. // request if it has already been completed.
  97419. //
  97420. // For example, consider a situation where you make an initial request
  97421. // and the request times out. If you make the request again with the
  97422. // same request ID, the server can check if original operation with the
  97423. // same request ID was received, and if so, will ignore the second
  97424. // request. This prevents clients from accidentally creating duplicate
  97425. // commitments.
  97426. //
  97427. // The request ID must be a valid UUID with the exception that zero UUID
  97428. // is not supported (00000000-0000-0000-0000-000000000000).
  97429. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  97430. c.urlParams_.Set("requestId", requestId)
  97431. return c
  97432. }
  97433. // Fields allows partial responses to be retrieved. See
  97434. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97435. // for more information.
  97436. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  97437. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97438. return c
  97439. }
  97440. // Context sets the context to be used in this call's Do method. Any
  97441. // pending HTTP request will be aborted if the provided context is
  97442. // canceled.
  97443. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  97444. c.ctx_ = ctx
  97445. return c
  97446. }
  97447. // Header returns an http.Header that can be modified by the caller to
  97448. // add HTTP headers to the request.
  97449. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  97450. if c.header_ == nil {
  97451. c.header_ = make(http.Header)
  97452. }
  97453. return c.header_
  97454. }
  97455. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  97456. reqHeaders := make(http.Header)
  97457. for k, v := range c.header_ {
  97458. reqHeaders[k] = v
  97459. }
  97460. reqHeaders.Set("User-Agent", c.s.userAgent())
  97461. var body io.Reader = nil
  97462. c.urlParams_.Set("alt", alt)
  97463. c.urlParams_.Set("prettyPrint", "false")
  97464. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  97465. urls += "?" + c.urlParams_.Encode()
  97466. req, err := http.NewRequest("DELETE", urls, body)
  97467. if err != nil {
  97468. return nil, err
  97469. }
  97470. req.Header = reqHeaders
  97471. googleapi.Expand(req.URL, map[string]string{
  97472. "project": c.project,
  97473. "securityPolicy": c.securityPolicy,
  97474. })
  97475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97476. }
  97477. // Do executes the "compute.securityPolicies.delete" call.
  97478. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97479. // status code is an error. Response headers are in either
  97480. // *Operation.ServerResponse.Header or (if a response was returned at
  97481. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97482. // to check whether the returned error was because
  97483. // http.StatusNotModified was returned.
  97484. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97485. gensupport.SetOptions(c.urlParams_, opts...)
  97486. res, err := c.doRequest("json")
  97487. if res != nil && res.StatusCode == http.StatusNotModified {
  97488. if res.Body != nil {
  97489. res.Body.Close()
  97490. }
  97491. return nil, &googleapi.Error{
  97492. Code: res.StatusCode,
  97493. Header: res.Header,
  97494. }
  97495. }
  97496. if err != nil {
  97497. return nil, err
  97498. }
  97499. defer googleapi.CloseBody(res)
  97500. if err := googleapi.CheckResponse(res); err != nil {
  97501. return nil, err
  97502. }
  97503. ret := &Operation{
  97504. ServerResponse: googleapi.ServerResponse{
  97505. Header: res.Header,
  97506. HTTPStatusCode: res.StatusCode,
  97507. },
  97508. }
  97509. target := &ret
  97510. if err := gensupport.DecodeResponse(target, res); err != nil {
  97511. return nil, err
  97512. }
  97513. return ret, nil
  97514. // {
  97515. // "description": "Deletes the specified policy.",
  97516. // "httpMethod": "DELETE",
  97517. // "id": "compute.securityPolicies.delete",
  97518. // "parameterOrder": [
  97519. // "project",
  97520. // "securityPolicy"
  97521. // ],
  97522. // "parameters": {
  97523. // "project": {
  97524. // "description": "Project ID for this request.",
  97525. // "location": "path",
  97526. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97527. // "required": true,
  97528. // "type": "string"
  97529. // },
  97530. // "requestId": {
  97531. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97532. // "location": "query",
  97533. // "type": "string"
  97534. // },
  97535. // "securityPolicy": {
  97536. // "description": "Name of the security policy to delete.",
  97537. // "location": "path",
  97538. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97539. // "required": true,
  97540. // "type": "string"
  97541. // }
  97542. // },
  97543. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  97544. // "response": {
  97545. // "$ref": "Operation"
  97546. // },
  97547. // "scopes": [
  97548. // "https://www.googleapis.com/auth/cloud-platform",
  97549. // "https://www.googleapis.com/auth/compute"
  97550. // ]
  97551. // }
  97552. }
  97553. // method id "compute.securityPolicies.get":
  97554. type SecurityPoliciesGetCall struct {
  97555. s *Service
  97556. project string
  97557. securityPolicy string
  97558. urlParams_ gensupport.URLParams
  97559. ifNoneMatch_ string
  97560. ctx_ context.Context
  97561. header_ http.Header
  97562. }
  97563. // Get: List all of the ordered rules present in a single specified
  97564. // policy.
  97565. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  97566. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97567. c.project = project
  97568. c.securityPolicy = securityPolicy
  97569. return c
  97570. }
  97571. // Fields allows partial responses to be retrieved. See
  97572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97573. // for more information.
  97574. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  97575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97576. return c
  97577. }
  97578. // IfNoneMatch sets the optional parameter which makes the operation
  97579. // fail if the object's ETag matches the given value. This is useful for
  97580. // getting updates only after the object has changed since the last
  97581. // request. Use googleapi.IsNotModified to check whether the response
  97582. // error from Do is the result of In-None-Match.
  97583. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  97584. c.ifNoneMatch_ = entityTag
  97585. return c
  97586. }
  97587. // Context sets the context to be used in this call's Do method. Any
  97588. // pending HTTP request will be aborted if the provided context is
  97589. // canceled.
  97590. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  97591. c.ctx_ = ctx
  97592. return c
  97593. }
  97594. // Header returns an http.Header that can be modified by the caller to
  97595. // add HTTP headers to the request.
  97596. func (c *SecurityPoliciesGetCall) Header() http.Header {
  97597. if c.header_ == nil {
  97598. c.header_ = make(http.Header)
  97599. }
  97600. return c.header_
  97601. }
  97602. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  97603. reqHeaders := make(http.Header)
  97604. for k, v := range c.header_ {
  97605. reqHeaders[k] = v
  97606. }
  97607. reqHeaders.Set("User-Agent", c.s.userAgent())
  97608. if c.ifNoneMatch_ != "" {
  97609. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97610. }
  97611. var body io.Reader = nil
  97612. c.urlParams_.Set("alt", alt)
  97613. c.urlParams_.Set("prettyPrint", "false")
  97614. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  97615. urls += "?" + c.urlParams_.Encode()
  97616. req, err := http.NewRequest("GET", urls, body)
  97617. if err != nil {
  97618. return nil, err
  97619. }
  97620. req.Header = reqHeaders
  97621. googleapi.Expand(req.URL, map[string]string{
  97622. "project": c.project,
  97623. "securityPolicy": c.securityPolicy,
  97624. })
  97625. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97626. }
  97627. // Do executes the "compute.securityPolicies.get" call.
  97628. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  97629. // status code is an error. Response headers are in either
  97630. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  97631. // at all) in error.(*googleapi.Error).Header. Use
  97632. // googleapi.IsNotModified to check whether the returned error was
  97633. // because http.StatusNotModified was returned.
  97634. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  97635. gensupport.SetOptions(c.urlParams_, opts...)
  97636. res, err := c.doRequest("json")
  97637. if res != nil && res.StatusCode == http.StatusNotModified {
  97638. if res.Body != nil {
  97639. res.Body.Close()
  97640. }
  97641. return nil, &googleapi.Error{
  97642. Code: res.StatusCode,
  97643. Header: res.Header,
  97644. }
  97645. }
  97646. if err != nil {
  97647. return nil, err
  97648. }
  97649. defer googleapi.CloseBody(res)
  97650. if err := googleapi.CheckResponse(res); err != nil {
  97651. return nil, err
  97652. }
  97653. ret := &SecurityPolicy{
  97654. ServerResponse: googleapi.ServerResponse{
  97655. Header: res.Header,
  97656. HTTPStatusCode: res.StatusCode,
  97657. },
  97658. }
  97659. target := &ret
  97660. if err := gensupport.DecodeResponse(target, res); err != nil {
  97661. return nil, err
  97662. }
  97663. return ret, nil
  97664. // {
  97665. // "description": "List all of the ordered rules present in a single specified policy.",
  97666. // "httpMethod": "GET",
  97667. // "id": "compute.securityPolicies.get",
  97668. // "parameterOrder": [
  97669. // "project",
  97670. // "securityPolicy"
  97671. // ],
  97672. // "parameters": {
  97673. // "project": {
  97674. // "description": "Project ID for this request.",
  97675. // "location": "path",
  97676. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97677. // "required": true,
  97678. // "type": "string"
  97679. // },
  97680. // "securityPolicy": {
  97681. // "description": "Name of the security policy to get.",
  97682. // "location": "path",
  97683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97684. // "required": true,
  97685. // "type": "string"
  97686. // }
  97687. // },
  97688. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  97689. // "response": {
  97690. // "$ref": "SecurityPolicy"
  97691. // },
  97692. // "scopes": [
  97693. // "https://www.googleapis.com/auth/cloud-platform",
  97694. // "https://www.googleapis.com/auth/compute",
  97695. // "https://www.googleapis.com/auth/compute.readonly"
  97696. // ]
  97697. // }
  97698. }
  97699. // method id "compute.securityPolicies.getRule":
  97700. type SecurityPoliciesGetRuleCall struct {
  97701. s *Service
  97702. project string
  97703. securityPolicy string
  97704. urlParams_ gensupport.URLParams
  97705. ifNoneMatch_ string
  97706. ctx_ context.Context
  97707. header_ http.Header
  97708. }
  97709. // GetRule: Gets a rule at the specified priority.
  97710. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  97711. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97712. c.project = project
  97713. c.securityPolicy = securityPolicy
  97714. return c
  97715. }
  97716. // Priority sets the optional parameter "priority": The priority of the
  97717. // rule to get from the security policy.
  97718. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  97719. c.urlParams_.Set("priority", fmt.Sprint(priority))
  97720. return c
  97721. }
  97722. // Fields allows partial responses to be retrieved. See
  97723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97724. // for more information.
  97725. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  97726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97727. return c
  97728. }
  97729. // IfNoneMatch sets the optional parameter which makes the operation
  97730. // fail if the object's ETag matches the given value. This is useful for
  97731. // getting updates only after the object has changed since the last
  97732. // request. Use googleapi.IsNotModified to check whether the response
  97733. // error from Do is the result of In-None-Match.
  97734. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  97735. c.ifNoneMatch_ = entityTag
  97736. return c
  97737. }
  97738. // Context sets the context to be used in this call's Do method. Any
  97739. // pending HTTP request will be aborted if the provided context is
  97740. // canceled.
  97741. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  97742. c.ctx_ = ctx
  97743. return c
  97744. }
  97745. // Header returns an http.Header that can be modified by the caller to
  97746. // add HTTP headers to the request.
  97747. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  97748. if c.header_ == nil {
  97749. c.header_ = make(http.Header)
  97750. }
  97751. return c.header_
  97752. }
  97753. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  97754. reqHeaders := make(http.Header)
  97755. for k, v := range c.header_ {
  97756. reqHeaders[k] = v
  97757. }
  97758. reqHeaders.Set("User-Agent", c.s.userAgent())
  97759. if c.ifNoneMatch_ != "" {
  97760. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97761. }
  97762. var body io.Reader = nil
  97763. c.urlParams_.Set("alt", alt)
  97764. c.urlParams_.Set("prettyPrint", "false")
  97765. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  97766. urls += "?" + c.urlParams_.Encode()
  97767. req, err := http.NewRequest("GET", urls, body)
  97768. if err != nil {
  97769. return nil, err
  97770. }
  97771. req.Header = reqHeaders
  97772. googleapi.Expand(req.URL, map[string]string{
  97773. "project": c.project,
  97774. "securityPolicy": c.securityPolicy,
  97775. })
  97776. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97777. }
  97778. // Do executes the "compute.securityPolicies.getRule" call.
  97779. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  97780. // non-2xx status code is an error. Response headers are in either
  97781. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  97782. // returned at all) in error.(*googleapi.Error).Header. Use
  97783. // googleapi.IsNotModified to check whether the returned error was
  97784. // because http.StatusNotModified was returned.
  97785. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  97786. gensupport.SetOptions(c.urlParams_, opts...)
  97787. res, err := c.doRequest("json")
  97788. if res != nil && res.StatusCode == http.StatusNotModified {
  97789. if res.Body != nil {
  97790. res.Body.Close()
  97791. }
  97792. return nil, &googleapi.Error{
  97793. Code: res.StatusCode,
  97794. Header: res.Header,
  97795. }
  97796. }
  97797. if err != nil {
  97798. return nil, err
  97799. }
  97800. defer googleapi.CloseBody(res)
  97801. if err := googleapi.CheckResponse(res); err != nil {
  97802. return nil, err
  97803. }
  97804. ret := &SecurityPolicyRule{
  97805. ServerResponse: googleapi.ServerResponse{
  97806. Header: res.Header,
  97807. HTTPStatusCode: res.StatusCode,
  97808. },
  97809. }
  97810. target := &ret
  97811. if err := gensupport.DecodeResponse(target, res); err != nil {
  97812. return nil, err
  97813. }
  97814. return ret, nil
  97815. // {
  97816. // "description": "Gets a rule at the specified priority.",
  97817. // "httpMethod": "GET",
  97818. // "id": "compute.securityPolicies.getRule",
  97819. // "parameterOrder": [
  97820. // "project",
  97821. // "securityPolicy"
  97822. // ],
  97823. // "parameters": {
  97824. // "priority": {
  97825. // "description": "The priority of the rule to get from the security policy.",
  97826. // "format": "int32",
  97827. // "location": "query",
  97828. // "type": "integer"
  97829. // },
  97830. // "project": {
  97831. // "description": "Project ID for this request.",
  97832. // "location": "path",
  97833. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97834. // "required": true,
  97835. // "type": "string"
  97836. // },
  97837. // "securityPolicy": {
  97838. // "description": "Name of the security policy to which the queried rule belongs.",
  97839. // "location": "path",
  97840. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97841. // "required": true,
  97842. // "type": "string"
  97843. // }
  97844. // },
  97845. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  97846. // "response": {
  97847. // "$ref": "SecurityPolicyRule"
  97848. // },
  97849. // "scopes": [
  97850. // "https://www.googleapis.com/auth/cloud-platform",
  97851. // "https://www.googleapis.com/auth/compute",
  97852. // "https://www.googleapis.com/auth/compute.readonly"
  97853. // ]
  97854. // }
  97855. }
  97856. // method id "compute.securityPolicies.insert":
  97857. type SecurityPoliciesInsertCall struct {
  97858. s *Service
  97859. project string
  97860. securitypolicy *SecurityPolicy
  97861. urlParams_ gensupport.URLParams
  97862. ctx_ context.Context
  97863. header_ http.Header
  97864. }
  97865. // Insert: Creates a new policy in the specified project using the data
  97866. // included in the request.
  97867. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  97868. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97869. c.project = project
  97870. c.securitypolicy = securitypolicy
  97871. return c
  97872. }
  97873. // RequestId sets the optional parameter "requestId": An optional
  97874. // request ID to identify requests. Specify a unique request ID so that
  97875. // if you must retry your request, the server will know to ignore the
  97876. // request if it has already been completed.
  97877. //
  97878. // For example, consider a situation where you make an initial request
  97879. // and the request times out. If you make the request again with the
  97880. // same request ID, the server can check if original operation with the
  97881. // same request ID was received, and if so, will ignore the second
  97882. // request. This prevents clients from accidentally creating duplicate
  97883. // commitments.
  97884. //
  97885. // The request ID must be a valid UUID with the exception that zero UUID
  97886. // is not supported (00000000-0000-0000-0000-000000000000).
  97887. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  97888. c.urlParams_.Set("requestId", requestId)
  97889. return c
  97890. }
  97891. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  97892. // request will not be committed.
  97893. func (c *SecurityPoliciesInsertCall) ValidateOnly(validateOnly bool) *SecurityPoliciesInsertCall {
  97894. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  97895. return c
  97896. }
  97897. // Fields allows partial responses to be retrieved. See
  97898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97899. // for more information.
  97900. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  97901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97902. return c
  97903. }
  97904. // Context sets the context to be used in this call's Do method. Any
  97905. // pending HTTP request will be aborted if the provided context is
  97906. // canceled.
  97907. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  97908. c.ctx_ = ctx
  97909. return c
  97910. }
  97911. // Header returns an http.Header that can be modified by the caller to
  97912. // add HTTP headers to the request.
  97913. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  97914. if c.header_ == nil {
  97915. c.header_ = make(http.Header)
  97916. }
  97917. return c.header_
  97918. }
  97919. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  97920. reqHeaders := make(http.Header)
  97921. for k, v := range c.header_ {
  97922. reqHeaders[k] = v
  97923. }
  97924. reqHeaders.Set("User-Agent", c.s.userAgent())
  97925. var body io.Reader = nil
  97926. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  97927. if err != nil {
  97928. return nil, err
  97929. }
  97930. reqHeaders.Set("Content-Type", "application/json")
  97931. c.urlParams_.Set("alt", alt)
  97932. c.urlParams_.Set("prettyPrint", "false")
  97933. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  97934. urls += "?" + c.urlParams_.Encode()
  97935. req, err := http.NewRequest("POST", urls, body)
  97936. if err != nil {
  97937. return nil, err
  97938. }
  97939. req.Header = reqHeaders
  97940. googleapi.Expand(req.URL, map[string]string{
  97941. "project": c.project,
  97942. })
  97943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97944. }
  97945. // Do executes the "compute.securityPolicies.insert" call.
  97946. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97947. // status code is an error. Response headers are in either
  97948. // *Operation.ServerResponse.Header or (if a response was returned at
  97949. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97950. // to check whether the returned error was because
  97951. // http.StatusNotModified was returned.
  97952. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97953. gensupport.SetOptions(c.urlParams_, opts...)
  97954. res, err := c.doRequest("json")
  97955. if res != nil && res.StatusCode == http.StatusNotModified {
  97956. if res.Body != nil {
  97957. res.Body.Close()
  97958. }
  97959. return nil, &googleapi.Error{
  97960. Code: res.StatusCode,
  97961. Header: res.Header,
  97962. }
  97963. }
  97964. if err != nil {
  97965. return nil, err
  97966. }
  97967. defer googleapi.CloseBody(res)
  97968. if err := googleapi.CheckResponse(res); err != nil {
  97969. return nil, err
  97970. }
  97971. ret := &Operation{
  97972. ServerResponse: googleapi.ServerResponse{
  97973. Header: res.Header,
  97974. HTTPStatusCode: res.StatusCode,
  97975. },
  97976. }
  97977. target := &ret
  97978. if err := gensupport.DecodeResponse(target, res); err != nil {
  97979. return nil, err
  97980. }
  97981. return ret, nil
  97982. // {
  97983. // "description": "Creates a new policy in the specified project using the data included in the request.",
  97984. // "httpMethod": "POST",
  97985. // "id": "compute.securityPolicies.insert",
  97986. // "parameterOrder": [
  97987. // "project"
  97988. // ],
  97989. // "parameters": {
  97990. // "project": {
  97991. // "description": "Project ID for this request.",
  97992. // "location": "path",
  97993. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97994. // "required": true,
  97995. // "type": "string"
  97996. // },
  97997. // "requestId": {
  97998. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97999. // "location": "query",
  98000. // "type": "string"
  98001. // },
  98002. // "validateOnly": {
  98003. // "description": "If true, the request will not be committed.",
  98004. // "location": "query",
  98005. // "type": "boolean"
  98006. // }
  98007. // },
  98008. // "path": "{project}/global/securityPolicies",
  98009. // "request": {
  98010. // "$ref": "SecurityPolicy"
  98011. // },
  98012. // "response": {
  98013. // "$ref": "Operation"
  98014. // },
  98015. // "scopes": [
  98016. // "https://www.googleapis.com/auth/cloud-platform",
  98017. // "https://www.googleapis.com/auth/compute"
  98018. // ]
  98019. // }
  98020. }
  98021. // method id "compute.securityPolicies.list":
  98022. type SecurityPoliciesListCall struct {
  98023. s *Service
  98024. project string
  98025. urlParams_ gensupport.URLParams
  98026. ifNoneMatch_ string
  98027. ctx_ context.Context
  98028. header_ http.Header
  98029. }
  98030. // List: List all the policies that have been configured for the
  98031. // specified project.
  98032. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  98033. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98034. c.project = project
  98035. return c
  98036. }
  98037. // Filter sets the optional parameter "filter": A filter expression that
  98038. // filters resources listed in the response. The expression must specify
  98039. // the field name, a comparison operator, and the value that you want to
  98040. // use for filtering. The value must be a string, a number, or a
  98041. // boolean. The comparison operator must be either =, !=, >, or <.
  98042. //
  98043. // For example, if you are filtering Compute Engine instances, you can
  98044. // exclude instances named example-instance by specifying name !=
  98045. // example-instance.
  98046. //
  98047. // You can also filter nested fields. For example, you could specify
  98048. // scheduling.automaticRestart = false to include instances only if they
  98049. // are not scheduled for automatic restarts. You can use filtering on
  98050. // nested fields to filter based on resource labels.
  98051. //
  98052. // To filter on multiple expressions, provide each separate expression
  98053. // within parentheses. For example, (scheduling.automaticRestart = true)
  98054. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  98055. // AND expression. However, you can include AND and OR expressions
  98056. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  98057. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  98058. // true).
  98059. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  98060. c.urlParams_.Set("filter", filter)
  98061. return c
  98062. }
  98063. // MaxResults sets the optional parameter "maxResults": The maximum
  98064. // number of results per page that should be returned. If the number of
  98065. // available results is larger than maxResults, Compute Engine returns a
  98066. // nextPageToken that can be used to get the next page of results in
  98067. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  98068. // (Default: 500)
  98069. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  98070. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  98071. return c
  98072. }
  98073. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  98074. // a certain order. By default, results are returned in alphanumerical
  98075. // order based on the resource name.
  98076. //
  98077. // You can also sort results in descending order based on the creation
  98078. // timestamp using orderBy="creationTimestamp desc". This sorts results
  98079. // based on the creationTimestamp field in reverse chronological order
  98080. // (newest result first). Use this to sort resources like operations so
  98081. // that the newest operation is returned first.
  98082. //
  98083. // Currently, only sorting by name or creationTimestamp desc is
  98084. // supported.
  98085. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  98086. c.urlParams_.Set("orderBy", orderBy)
  98087. return c
  98088. }
  98089. // PageToken sets the optional parameter "pageToken": Specifies a page
  98090. // token to use. Set pageToken to the nextPageToken returned by a
  98091. // previous list request to get the next page of results.
  98092. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  98093. c.urlParams_.Set("pageToken", pageToken)
  98094. return c
  98095. }
  98096. // Fields allows partial responses to be retrieved. See
  98097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98098. // for more information.
  98099. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  98100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98101. return c
  98102. }
  98103. // IfNoneMatch sets the optional parameter which makes the operation
  98104. // fail if the object's ETag matches the given value. This is useful for
  98105. // getting updates only after the object has changed since the last
  98106. // request. Use googleapi.IsNotModified to check whether the response
  98107. // error from Do is the result of In-None-Match.
  98108. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  98109. c.ifNoneMatch_ = entityTag
  98110. return c
  98111. }
  98112. // Context sets the context to be used in this call's Do method. Any
  98113. // pending HTTP request will be aborted if the provided context is
  98114. // canceled.
  98115. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  98116. c.ctx_ = ctx
  98117. return c
  98118. }
  98119. // Header returns an http.Header that can be modified by the caller to
  98120. // add HTTP headers to the request.
  98121. func (c *SecurityPoliciesListCall) Header() http.Header {
  98122. if c.header_ == nil {
  98123. c.header_ = make(http.Header)
  98124. }
  98125. return c.header_
  98126. }
  98127. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  98128. reqHeaders := make(http.Header)
  98129. for k, v := range c.header_ {
  98130. reqHeaders[k] = v
  98131. }
  98132. reqHeaders.Set("User-Agent", c.s.userAgent())
  98133. if c.ifNoneMatch_ != "" {
  98134. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98135. }
  98136. var body io.Reader = nil
  98137. c.urlParams_.Set("alt", alt)
  98138. c.urlParams_.Set("prettyPrint", "false")
  98139. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  98140. urls += "?" + c.urlParams_.Encode()
  98141. req, err := http.NewRequest("GET", urls, body)
  98142. if err != nil {
  98143. return nil, err
  98144. }
  98145. req.Header = reqHeaders
  98146. googleapi.Expand(req.URL, map[string]string{
  98147. "project": c.project,
  98148. })
  98149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98150. }
  98151. // Do executes the "compute.securityPolicies.list" call.
  98152. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  98153. // non-2xx status code is an error. Response headers are in either
  98154. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  98155. // returned at all) in error.(*googleapi.Error).Header. Use
  98156. // googleapi.IsNotModified to check whether the returned error was
  98157. // because http.StatusNotModified was returned.
  98158. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  98159. gensupport.SetOptions(c.urlParams_, opts...)
  98160. res, err := c.doRequest("json")
  98161. if res != nil && res.StatusCode == http.StatusNotModified {
  98162. if res.Body != nil {
  98163. res.Body.Close()
  98164. }
  98165. return nil, &googleapi.Error{
  98166. Code: res.StatusCode,
  98167. Header: res.Header,
  98168. }
  98169. }
  98170. if err != nil {
  98171. return nil, err
  98172. }
  98173. defer googleapi.CloseBody(res)
  98174. if err := googleapi.CheckResponse(res); err != nil {
  98175. return nil, err
  98176. }
  98177. ret := &SecurityPolicyList{
  98178. ServerResponse: googleapi.ServerResponse{
  98179. Header: res.Header,
  98180. HTTPStatusCode: res.StatusCode,
  98181. },
  98182. }
  98183. target := &ret
  98184. if err := gensupport.DecodeResponse(target, res); err != nil {
  98185. return nil, err
  98186. }
  98187. return ret, nil
  98188. // {
  98189. // "description": "List all the policies that have been configured for the specified project.",
  98190. // "httpMethod": "GET",
  98191. // "id": "compute.securityPolicies.list",
  98192. // "parameterOrder": [
  98193. // "project"
  98194. // ],
  98195. // "parameters": {
  98196. // "filter": {
  98197. // "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).",
  98198. // "location": "query",
  98199. // "type": "string"
  98200. // },
  98201. // "maxResults": {
  98202. // "default": "500",
  98203. // "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)",
  98204. // "format": "uint32",
  98205. // "location": "query",
  98206. // "minimum": "0",
  98207. // "type": "integer"
  98208. // },
  98209. // "orderBy": {
  98210. // "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.",
  98211. // "location": "query",
  98212. // "type": "string"
  98213. // },
  98214. // "pageToken": {
  98215. // "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.",
  98216. // "location": "query",
  98217. // "type": "string"
  98218. // },
  98219. // "project": {
  98220. // "description": "Project ID for this request.",
  98221. // "location": "path",
  98222. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98223. // "required": true,
  98224. // "type": "string"
  98225. // }
  98226. // },
  98227. // "path": "{project}/global/securityPolicies",
  98228. // "response": {
  98229. // "$ref": "SecurityPolicyList"
  98230. // },
  98231. // "scopes": [
  98232. // "https://www.googleapis.com/auth/cloud-platform",
  98233. // "https://www.googleapis.com/auth/compute",
  98234. // "https://www.googleapis.com/auth/compute.readonly"
  98235. // ]
  98236. // }
  98237. }
  98238. // Pages invokes f for each page of results.
  98239. // A non-nil error returned from f will halt the iteration.
  98240. // The provided context supersedes any context provided to the Context method.
  98241. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  98242. c.ctx_ = ctx
  98243. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  98244. for {
  98245. x, err := c.Do()
  98246. if err != nil {
  98247. return err
  98248. }
  98249. if err := f(x); err != nil {
  98250. return err
  98251. }
  98252. if x.NextPageToken == "" {
  98253. return nil
  98254. }
  98255. c.PageToken(x.NextPageToken)
  98256. }
  98257. }
  98258. // method id "compute.securityPolicies.listPreconfiguredExpressionSets":
  98259. type SecurityPoliciesListPreconfiguredExpressionSetsCall struct {
  98260. s *Service
  98261. project string
  98262. urlParams_ gensupport.URLParams
  98263. ifNoneMatch_ string
  98264. ctx_ context.Context
  98265. header_ http.Header
  98266. }
  98267. // ListPreconfiguredExpressionSets: Gets the current list of
  98268. // preconfigured Web Application Firewall (WAF) expressions.
  98269. func (r *SecurityPoliciesService) ListPreconfiguredExpressionSets(project string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  98270. c := &SecurityPoliciesListPreconfiguredExpressionSetsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98271. c.project = project
  98272. return c
  98273. }
  98274. // Filter sets the optional parameter "filter": A filter expression that
  98275. // filters resources listed in the response. The expression must specify
  98276. // the field name, a comparison operator, and the value that you want to
  98277. // use for filtering. The value must be a string, a number, or a
  98278. // boolean. The comparison operator must be either =, !=, >, or <.
  98279. //
  98280. // For example, if you are filtering Compute Engine instances, you can
  98281. // exclude instances named example-instance by specifying name !=
  98282. // example-instance.
  98283. //
  98284. // You can also filter nested fields. For example, you could specify
  98285. // scheduling.automaticRestart = false to include instances only if they
  98286. // are not scheduled for automatic restarts. You can use filtering on
  98287. // nested fields to filter based on resource labels.
  98288. //
  98289. // To filter on multiple expressions, provide each separate expression
  98290. // within parentheses. For example, (scheduling.automaticRestart = true)
  98291. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  98292. // AND expression. However, you can include AND and OR expressions
  98293. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  98294. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  98295. // true).
  98296. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Filter(filter string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  98297. c.urlParams_.Set("filter", filter)
  98298. return c
  98299. }
  98300. // MaxResults sets the optional parameter "maxResults": The maximum
  98301. // number of results per page that should be returned. If the number of
  98302. // available results is larger than maxResults, Compute Engine returns a
  98303. // nextPageToken that can be used to get the next page of results in
  98304. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  98305. // (Default: 500)
  98306. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) MaxResults(maxResults int64) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  98307. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  98308. return c
  98309. }
  98310. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  98311. // a certain order. By default, results are returned in alphanumerical
  98312. // order based on the resource name.
  98313. //
  98314. // You can also sort results in descending order based on the creation
  98315. // timestamp using orderBy="creationTimestamp desc". This sorts results
  98316. // based on the creationTimestamp field in reverse chronological order
  98317. // (newest result first). Use this to sort resources like operations so
  98318. // that the newest operation is returned first.
  98319. //
  98320. // Currently, only sorting by name or creationTimestamp desc is
  98321. // supported.
  98322. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) OrderBy(orderBy string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  98323. c.urlParams_.Set("orderBy", orderBy)
  98324. return c
  98325. }
  98326. // PageToken sets the optional parameter "pageToken": Specifies a page
  98327. // token to use. Set pageToken to the nextPageToken returned by a
  98328. // previous list request to get the next page of results.
  98329. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) PageToken(pageToken string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  98330. c.urlParams_.Set("pageToken", pageToken)
  98331. return c
  98332. }
  98333. // Fields allows partial responses to be retrieved. See
  98334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98335. // for more information.
  98336. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Fields(s ...googleapi.Field) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  98337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98338. return c
  98339. }
  98340. // IfNoneMatch sets the optional parameter which makes the operation
  98341. // fail if the object's ETag matches the given value. This is useful for
  98342. // getting updates only after the object has changed since the last
  98343. // request. Use googleapi.IsNotModified to check whether the response
  98344. // error from Do is the result of In-None-Match.
  98345. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) IfNoneMatch(entityTag string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  98346. c.ifNoneMatch_ = entityTag
  98347. return c
  98348. }
  98349. // Context sets the context to be used in this call's Do method. Any
  98350. // pending HTTP request will be aborted if the provided context is
  98351. // canceled.
  98352. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Context(ctx context.Context) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  98353. c.ctx_ = ctx
  98354. return c
  98355. }
  98356. // Header returns an http.Header that can be modified by the caller to
  98357. // add HTTP headers to the request.
  98358. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Header() http.Header {
  98359. if c.header_ == nil {
  98360. c.header_ = make(http.Header)
  98361. }
  98362. return c.header_
  98363. }
  98364. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt string) (*http.Response, error) {
  98365. reqHeaders := make(http.Header)
  98366. for k, v := range c.header_ {
  98367. reqHeaders[k] = v
  98368. }
  98369. reqHeaders.Set("User-Agent", c.s.userAgent())
  98370. if c.ifNoneMatch_ != "" {
  98371. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98372. }
  98373. var body io.Reader = nil
  98374. c.urlParams_.Set("alt", alt)
  98375. c.urlParams_.Set("prettyPrint", "false")
  98376. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/listPreconfiguredExpressionSets")
  98377. urls += "?" + c.urlParams_.Encode()
  98378. req, err := http.NewRequest("GET", urls, body)
  98379. if err != nil {
  98380. return nil, err
  98381. }
  98382. req.Header = reqHeaders
  98383. googleapi.Expand(req.URL, map[string]string{
  98384. "project": c.project,
  98385. })
  98386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98387. }
  98388. // Do executes the "compute.securityPolicies.listPreconfiguredExpressionSets" call.
  98389. // Exactly one of
  98390. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse or error
  98391. // will be non-nil. Any non-2xx status code is an error. Response
  98392. // headers are in either
  98393. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse.ServerRespons
  98394. // e.Header or (if a response was returned at all) in
  98395. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  98396. // whether the returned error was because http.StatusNotModified was
  98397. // returned.
  98398. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Do(opts ...googleapi.CallOption) (*SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) {
  98399. gensupport.SetOptions(c.urlParams_, opts...)
  98400. res, err := c.doRequest("json")
  98401. if res != nil && res.StatusCode == http.StatusNotModified {
  98402. if res.Body != nil {
  98403. res.Body.Close()
  98404. }
  98405. return nil, &googleapi.Error{
  98406. Code: res.StatusCode,
  98407. Header: res.Header,
  98408. }
  98409. }
  98410. if err != nil {
  98411. return nil, err
  98412. }
  98413. defer googleapi.CloseBody(res)
  98414. if err := googleapi.CheckResponse(res); err != nil {
  98415. return nil, err
  98416. }
  98417. ret := &SecurityPoliciesListPreconfiguredExpressionSetsResponse{
  98418. ServerResponse: googleapi.ServerResponse{
  98419. Header: res.Header,
  98420. HTTPStatusCode: res.StatusCode,
  98421. },
  98422. }
  98423. target := &ret
  98424. if err := gensupport.DecodeResponse(target, res); err != nil {
  98425. return nil, err
  98426. }
  98427. return ret, nil
  98428. // {
  98429. // "description": "Gets the current list of preconfigured Web Application Firewall (WAF) expressions.",
  98430. // "httpMethod": "GET",
  98431. // "id": "compute.securityPolicies.listPreconfiguredExpressionSets",
  98432. // "parameterOrder": [
  98433. // "project"
  98434. // ],
  98435. // "parameters": {
  98436. // "filter": {
  98437. // "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).",
  98438. // "location": "query",
  98439. // "type": "string"
  98440. // },
  98441. // "maxResults": {
  98442. // "default": "500",
  98443. // "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)",
  98444. // "format": "uint32",
  98445. // "location": "query",
  98446. // "minimum": "0",
  98447. // "type": "integer"
  98448. // },
  98449. // "orderBy": {
  98450. // "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.",
  98451. // "location": "query",
  98452. // "type": "string"
  98453. // },
  98454. // "pageToken": {
  98455. // "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.",
  98456. // "location": "query",
  98457. // "type": "string"
  98458. // },
  98459. // "project": {
  98460. // "description": "Project ID for this request.",
  98461. // "location": "path",
  98462. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98463. // "required": true,
  98464. // "type": "string"
  98465. // }
  98466. // },
  98467. // "path": "{project}/global/securityPolicies/listPreconfiguredExpressionSets",
  98468. // "response": {
  98469. // "$ref": "SecurityPoliciesListPreconfiguredExpressionSetsResponse"
  98470. // },
  98471. // "scopes": [
  98472. // "https://www.googleapis.com/auth/cloud-platform",
  98473. // "https://www.googleapis.com/auth/compute"
  98474. // ]
  98475. // }
  98476. }
  98477. // method id "compute.securityPolicies.patch":
  98478. type SecurityPoliciesPatchCall struct {
  98479. s *Service
  98480. project string
  98481. securityPolicy string
  98482. securitypolicy *SecurityPolicy
  98483. urlParams_ gensupport.URLParams
  98484. ctx_ context.Context
  98485. header_ http.Header
  98486. }
  98487. // Patch: Patches the specified policy with the data included in the
  98488. // request.
  98489. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  98490. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98491. c.project = project
  98492. c.securityPolicy = securityPolicy
  98493. c.securitypolicy = securitypolicy
  98494. return c
  98495. }
  98496. // RequestId sets the optional parameter "requestId": An optional
  98497. // request ID to identify requests. Specify a unique request ID so that
  98498. // if you must retry your request, the server will know to ignore the
  98499. // request if it has already been completed.
  98500. //
  98501. // For example, consider a situation where you make an initial request
  98502. // and the request times out. If you make the request again with the
  98503. // same request ID, the server can check if original operation with the
  98504. // same request ID was received, and if so, will ignore the second
  98505. // request. This prevents clients from accidentally creating duplicate
  98506. // commitments.
  98507. //
  98508. // The request ID must be a valid UUID with the exception that zero UUID
  98509. // is not supported (00000000-0000-0000-0000-000000000000).
  98510. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  98511. c.urlParams_.Set("requestId", requestId)
  98512. return c
  98513. }
  98514. // Fields allows partial responses to be retrieved. See
  98515. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98516. // for more information.
  98517. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  98518. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98519. return c
  98520. }
  98521. // Context sets the context to be used in this call's Do method. Any
  98522. // pending HTTP request will be aborted if the provided context is
  98523. // canceled.
  98524. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  98525. c.ctx_ = ctx
  98526. return c
  98527. }
  98528. // Header returns an http.Header that can be modified by the caller to
  98529. // add HTTP headers to the request.
  98530. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  98531. if c.header_ == nil {
  98532. c.header_ = make(http.Header)
  98533. }
  98534. return c.header_
  98535. }
  98536. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  98537. reqHeaders := make(http.Header)
  98538. for k, v := range c.header_ {
  98539. reqHeaders[k] = v
  98540. }
  98541. reqHeaders.Set("User-Agent", c.s.userAgent())
  98542. var body io.Reader = nil
  98543. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  98544. if err != nil {
  98545. return nil, err
  98546. }
  98547. reqHeaders.Set("Content-Type", "application/json")
  98548. c.urlParams_.Set("alt", alt)
  98549. c.urlParams_.Set("prettyPrint", "false")
  98550. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  98551. urls += "?" + c.urlParams_.Encode()
  98552. req, err := http.NewRequest("PATCH", urls, body)
  98553. if err != nil {
  98554. return nil, err
  98555. }
  98556. req.Header = reqHeaders
  98557. googleapi.Expand(req.URL, map[string]string{
  98558. "project": c.project,
  98559. "securityPolicy": c.securityPolicy,
  98560. })
  98561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98562. }
  98563. // Do executes the "compute.securityPolicies.patch" call.
  98564. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98565. // status code is an error. Response headers are in either
  98566. // *Operation.ServerResponse.Header or (if a response was returned at
  98567. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98568. // to check whether the returned error was because
  98569. // http.StatusNotModified was returned.
  98570. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98571. gensupport.SetOptions(c.urlParams_, opts...)
  98572. res, err := c.doRequest("json")
  98573. if res != nil && res.StatusCode == http.StatusNotModified {
  98574. if res.Body != nil {
  98575. res.Body.Close()
  98576. }
  98577. return nil, &googleapi.Error{
  98578. Code: res.StatusCode,
  98579. Header: res.Header,
  98580. }
  98581. }
  98582. if err != nil {
  98583. return nil, err
  98584. }
  98585. defer googleapi.CloseBody(res)
  98586. if err := googleapi.CheckResponse(res); err != nil {
  98587. return nil, err
  98588. }
  98589. ret := &Operation{
  98590. ServerResponse: googleapi.ServerResponse{
  98591. Header: res.Header,
  98592. HTTPStatusCode: res.StatusCode,
  98593. },
  98594. }
  98595. target := &ret
  98596. if err := gensupport.DecodeResponse(target, res); err != nil {
  98597. return nil, err
  98598. }
  98599. return ret, nil
  98600. // {
  98601. // "description": "Patches the specified policy with the data included in the request.",
  98602. // "httpMethod": "PATCH",
  98603. // "id": "compute.securityPolicies.patch",
  98604. // "parameterOrder": [
  98605. // "project",
  98606. // "securityPolicy"
  98607. // ],
  98608. // "parameters": {
  98609. // "project": {
  98610. // "description": "Project ID for this request.",
  98611. // "location": "path",
  98612. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98613. // "required": true,
  98614. // "type": "string"
  98615. // },
  98616. // "requestId": {
  98617. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98618. // "location": "query",
  98619. // "type": "string"
  98620. // },
  98621. // "securityPolicy": {
  98622. // "description": "Name of the security policy to update.",
  98623. // "location": "path",
  98624. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98625. // "required": true,
  98626. // "type": "string"
  98627. // }
  98628. // },
  98629. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  98630. // "request": {
  98631. // "$ref": "SecurityPolicy"
  98632. // },
  98633. // "response": {
  98634. // "$ref": "Operation"
  98635. // },
  98636. // "scopes": [
  98637. // "https://www.googleapis.com/auth/cloud-platform",
  98638. // "https://www.googleapis.com/auth/compute"
  98639. // ]
  98640. // }
  98641. }
  98642. // method id "compute.securityPolicies.patchRule":
  98643. type SecurityPoliciesPatchRuleCall struct {
  98644. s *Service
  98645. project string
  98646. securityPolicy string
  98647. securitypolicyrule *SecurityPolicyRule
  98648. urlParams_ gensupport.URLParams
  98649. ctx_ context.Context
  98650. header_ http.Header
  98651. }
  98652. // PatchRule: Patches a rule at the specified priority.
  98653. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  98654. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98655. c.project = project
  98656. c.securityPolicy = securityPolicy
  98657. c.securitypolicyrule = securitypolicyrule
  98658. return c
  98659. }
  98660. // Priority sets the optional parameter "priority": The priority of the
  98661. // rule to patch.
  98662. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  98663. c.urlParams_.Set("priority", fmt.Sprint(priority))
  98664. return c
  98665. }
  98666. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  98667. // request will not be committed.
  98668. func (c *SecurityPoliciesPatchRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesPatchRuleCall {
  98669. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  98670. return c
  98671. }
  98672. // Fields allows partial responses to be retrieved. See
  98673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98674. // for more information.
  98675. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  98676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98677. return c
  98678. }
  98679. // Context sets the context to be used in this call's Do method. Any
  98680. // pending HTTP request will be aborted if the provided context is
  98681. // canceled.
  98682. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  98683. c.ctx_ = ctx
  98684. return c
  98685. }
  98686. // Header returns an http.Header that can be modified by the caller to
  98687. // add HTTP headers to the request.
  98688. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  98689. if c.header_ == nil {
  98690. c.header_ = make(http.Header)
  98691. }
  98692. return c.header_
  98693. }
  98694. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  98695. reqHeaders := make(http.Header)
  98696. for k, v := range c.header_ {
  98697. reqHeaders[k] = v
  98698. }
  98699. reqHeaders.Set("User-Agent", c.s.userAgent())
  98700. var body io.Reader = nil
  98701. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  98702. if err != nil {
  98703. return nil, err
  98704. }
  98705. reqHeaders.Set("Content-Type", "application/json")
  98706. c.urlParams_.Set("alt", alt)
  98707. c.urlParams_.Set("prettyPrint", "false")
  98708. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  98709. urls += "?" + c.urlParams_.Encode()
  98710. req, err := http.NewRequest("POST", urls, body)
  98711. if err != nil {
  98712. return nil, err
  98713. }
  98714. req.Header = reqHeaders
  98715. googleapi.Expand(req.URL, map[string]string{
  98716. "project": c.project,
  98717. "securityPolicy": c.securityPolicy,
  98718. })
  98719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98720. }
  98721. // Do executes the "compute.securityPolicies.patchRule" call.
  98722. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98723. // status code is an error. Response headers are in either
  98724. // *Operation.ServerResponse.Header or (if a response was returned at
  98725. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98726. // to check whether the returned error was because
  98727. // http.StatusNotModified was returned.
  98728. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98729. gensupport.SetOptions(c.urlParams_, opts...)
  98730. res, err := c.doRequest("json")
  98731. if res != nil && res.StatusCode == http.StatusNotModified {
  98732. if res.Body != nil {
  98733. res.Body.Close()
  98734. }
  98735. return nil, &googleapi.Error{
  98736. Code: res.StatusCode,
  98737. Header: res.Header,
  98738. }
  98739. }
  98740. if err != nil {
  98741. return nil, err
  98742. }
  98743. defer googleapi.CloseBody(res)
  98744. if err := googleapi.CheckResponse(res); err != nil {
  98745. return nil, err
  98746. }
  98747. ret := &Operation{
  98748. ServerResponse: googleapi.ServerResponse{
  98749. Header: res.Header,
  98750. HTTPStatusCode: res.StatusCode,
  98751. },
  98752. }
  98753. target := &ret
  98754. if err := gensupport.DecodeResponse(target, res); err != nil {
  98755. return nil, err
  98756. }
  98757. return ret, nil
  98758. // {
  98759. // "description": "Patches a rule at the specified priority.",
  98760. // "httpMethod": "POST",
  98761. // "id": "compute.securityPolicies.patchRule",
  98762. // "parameterOrder": [
  98763. // "project",
  98764. // "securityPolicy"
  98765. // ],
  98766. // "parameters": {
  98767. // "priority": {
  98768. // "description": "The priority of the rule to patch.",
  98769. // "format": "int32",
  98770. // "location": "query",
  98771. // "type": "integer"
  98772. // },
  98773. // "project": {
  98774. // "description": "Project ID for this request.",
  98775. // "location": "path",
  98776. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98777. // "required": true,
  98778. // "type": "string"
  98779. // },
  98780. // "securityPolicy": {
  98781. // "description": "Name of the security policy to update.",
  98782. // "location": "path",
  98783. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98784. // "required": true,
  98785. // "type": "string"
  98786. // },
  98787. // "validateOnly": {
  98788. // "description": "If true, the request will not be committed.",
  98789. // "location": "query",
  98790. // "type": "boolean"
  98791. // }
  98792. // },
  98793. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  98794. // "request": {
  98795. // "$ref": "SecurityPolicyRule"
  98796. // },
  98797. // "response": {
  98798. // "$ref": "Operation"
  98799. // },
  98800. // "scopes": [
  98801. // "https://www.googleapis.com/auth/cloud-platform",
  98802. // "https://www.googleapis.com/auth/compute"
  98803. // ]
  98804. // }
  98805. }
  98806. // method id "compute.securityPolicies.removeRule":
  98807. type SecurityPoliciesRemoveRuleCall struct {
  98808. s *Service
  98809. project string
  98810. securityPolicy string
  98811. urlParams_ gensupport.URLParams
  98812. ctx_ context.Context
  98813. header_ http.Header
  98814. }
  98815. // RemoveRule: Deletes a rule at the specified priority.
  98816. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  98817. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98818. c.project = project
  98819. c.securityPolicy = securityPolicy
  98820. return c
  98821. }
  98822. // Priority sets the optional parameter "priority": The priority of the
  98823. // rule to remove from the security policy.
  98824. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  98825. c.urlParams_.Set("priority", fmt.Sprint(priority))
  98826. return c
  98827. }
  98828. // Fields allows partial responses to be retrieved. See
  98829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98830. // for more information.
  98831. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  98832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98833. return c
  98834. }
  98835. // Context sets the context to be used in this call's Do method. Any
  98836. // pending HTTP request will be aborted if the provided context is
  98837. // canceled.
  98838. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  98839. c.ctx_ = ctx
  98840. return c
  98841. }
  98842. // Header returns an http.Header that can be modified by the caller to
  98843. // add HTTP headers to the request.
  98844. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  98845. if c.header_ == nil {
  98846. c.header_ = make(http.Header)
  98847. }
  98848. return c.header_
  98849. }
  98850. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  98851. reqHeaders := make(http.Header)
  98852. for k, v := range c.header_ {
  98853. reqHeaders[k] = v
  98854. }
  98855. reqHeaders.Set("User-Agent", c.s.userAgent())
  98856. var body io.Reader = nil
  98857. c.urlParams_.Set("alt", alt)
  98858. c.urlParams_.Set("prettyPrint", "false")
  98859. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  98860. urls += "?" + c.urlParams_.Encode()
  98861. req, err := http.NewRequest("POST", urls, body)
  98862. if err != nil {
  98863. return nil, err
  98864. }
  98865. req.Header = reqHeaders
  98866. googleapi.Expand(req.URL, map[string]string{
  98867. "project": c.project,
  98868. "securityPolicy": c.securityPolicy,
  98869. })
  98870. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98871. }
  98872. // Do executes the "compute.securityPolicies.removeRule" call.
  98873. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98874. // status code is an error. Response headers are in either
  98875. // *Operation.ServerResponse.Header or (if a response was returned at
  98876. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98877. // to check whether the returned error was because
  98878. // http.StatusNotModified was returned.
  98879. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98880. gensupport.SetOptions(c.urlParams_, opts...)
  98881. res, err := c.doRequest("json")
  98882. if res != nil && res.StatusCode == http.StatusNotModified {
  98883. if res.Body != nil {
  98884. res.Body.Close()
  98885. }
  98886. return nil, &googleapi.Error{
  98887. Code: res.StatusCode,
  98888. Header: res.Header,
  98889. }
  98890. }
  98891. if err != nil {
  98892. return nil, err
  98893. }
  98894. defer googleapi.CloseBody(res)
  98895. if err := googleapi.CheckResponse(res); err != nil {
  98896. return nil, err
  98897. }
  98898. ret := &Operation{
  98899. ServerResponse: googleapi.ServerResponse{
  98900. Header: res.Header,
  98901. HTTPStatusCode: res.StatusCode,
  98902. },
  98903. }
  98904. target := &ret
  98905. if err := gensupport.DecodeResponse(target, res); err != nil {
  98906. return nil, err
  98907. }
  98908. return ret, nil
  98909. // {
  98910. // "description": "Deletes a rule at the specified priority.",
  98911. // "httpMethod": "POST",
  98912. // "id": "compute.securityPolicies.removeRule",
  98913. // "parameterOrder": [
  98914. // "project",
  98915. // "securityPolicy"
  98916. // ],
  98917. // "parameters": {
  98918. // "priority": {
  98919. // "description": "The priority of the rule to remove from the security policy.",
  98920. // "format": "int32",
  98921. // "location": "query",
  98922. // "type": "integer"
  98923. // },
  98924. // "project": {
  98925. // "description": "Project ID for this request.",
  98926. // "location": "path",
  98927. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98928. // "required": true,
  98929. // "type": "string"
  98930. // },
  98931. // "securityPolicy": {
  98932. // "description": "Name of the security policy to update.",
  98933. // "location": "path",
  98934. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98935. // "required": true,
  98936. // "type": "string"
  98937. // }
  98938. // },
  98939. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  98940. // "response": {
  98941. // "$ref": "Operation"
  98942. // },
  98943. // "scopes": [
  98944. // "https://www.googleapis.com/auth/cloud-platform",
  98945. // "https://www.googleapis.com/auth/compute"
  98946. // ]
  98947. // }
  98948. }
  98949. // method id "compute.securityPolicies.setLabels":
  98950. type SecurityPoliciesSetLabelsCall struct {
  98951. s *Service
  98952. project string
  98953. resource string
  98954. globalsetlabelsrequest *GlobalSetLabelsRequest
  98955. urlParams_ gensupport.URLParams
  98956. ctx_ context.Context
  98957. header_ http.Header
  98958. }
  98959. // SetLabels: Sets the labels on a security policy. To learn more about
  98960. // labels, read the Labeling Resources documentation.
  98961. func (r *SecurityPoliciesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SecurityPoliciesSetLabelsCall {
  98962. c := &SecurityPoliciesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98963. c.project = project
  98964. c.resource = resource
  98965. c.globalsetlabelsrequest = globalsetlabelsrequest
  98966. return c
  98967. }
  98968. // Fields allows partial responses to be retrieved. See
  98969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98970. // for more information.
  98971. func (c *SecurityPoliciesSetLabelsCall) Fields(s ...googleapi.Field) *SecurityPoliciesSetLabelsCall {
  98972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98973. return c
  98974. }
  98975. // Context sets the context to be used in this call's Do method. Any
  98976. // pending HTTP request will be aborted if the provided context is
  98977. // canceled.
  98978. func (c *SecurityPoliciesSetLabelsCall) Context(ctx context.Context) *SecurityPoliciesSetLabelsCall {
  98979. c.ctx_ = ctx
  98980. return c
  98981. }
  98982. // Header returns an http.Header that can be modified by the caller to
  98983. // add HTTP headers to the request.
  98984. func (c *SecurityPoliciesSetLabelsCall) Header() http.Header {
  98985. if c.header_ == nil {
  98986. c.header_ = make(http.Header)
  98987. }
  98988. return c.header_
  98989. }
  98990. func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  98991. reqHeaders := make(http.Header)
  98992. for k, v := range c.header_ {
  98993. reqHeaders[k] = v
  98994. }
  98995. reqHeaders.Set("User-Agent", c.s.userAgent())
  98996. var body io.Reader = nil
  98997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  98998. if err != nil {
  98999. return nil, err
  99000. }
  99001. reqHeaders.Set("Content-Type", "application/json")
  99002. c.urlParams_.Set("alt", alt)
  99003. c.urlParams_.Set("prettyPrint", "false")
  99004. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/setLabels")
  99005. urls += "?" + c.urlParams_.Encode()
  99006. req, err := http.NewRequest("POST", urls, body)
  99007. if err != nil {
  99008. return nil, err
  99009. }
  99010. req.Header = reqHeaders
  99011. googleapi.Expand(req.URL, map[string]string{
  99012. "project": c.project,
  99013. "resource": c.resource,
  99014. })
  99015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99016. }
  99017. // Do executes the "compute.securityPolicies.setLabels" call.
  99018. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99019. // status code is an error. Response headers are in either
  99020. // *Operation.ServerResponse.Header or (if a response was returned at
  99021. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99022. // to check whether the returned error was because
  99023. // http.StatusNotModified was returned.
  99024. func (c *SecurityPoliciesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99025. gensupport.SetOptions(c.urlParams_, opts...)
  99026. res, err := c.doRequest("json")
  99027. if res != nil && res.StatusCode == http.StatusNotModified {
  99028. if res.Body != nil {
  99029. res.Body.Close()
  99030. }
  99031. return nil, &googleapi.Error{
  99032. Code: res.StatusCode,
  99033. Header: res.Header,
  99034. }
  99035. }
  99036. if err != nil {
  99037. return nil, err
  99038. }
  99039. defer googleapi.CloseBody(res)
  99040. if err := googleapi.CheckResponse(res); err != nil {
  99041. return nil, err
  99042. }
  99043. ret := &Operation{
  99044. ServerResponse: googleapi.ServerResponse{
  99045. Header: res.Header,
  99046. HTTPStatusCode: res.StatusCode,
  99047. },
  99048. }
  99049. target := &ret
  99050. if err := gensupport.DecodeResponse(target, res); err != nil {
  99051. return nil, err
  99052. }
  99053. return ret, nil
  99054. // {
  99055. // "description": "Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.",
  99056. // "httpMethod": "POST",
  99057. // "id": "compute.securityPolicies.setLabels",
  99058. // "parameterOrder": [
  99059. // "project",
  99060. // "resource"
  99061. // ],
  99062. // "parameters": {
  99063. // "project": {
  99064. // "description": "Project ID for this request.",
  99065. // "location": "path",
  99066. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99067. // "required": true,
  99068. // "type": "string"
  99069. // },
  99070. // "resource": {
  99071. // "description": "Name or id of the resource for this request.",
  99072. // "location": "path",
  99073. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99074. // "required": true,
  99075. // "type": "string"
  99076. // }
  99077. // },
  99078. // "path": "{project}/global/securityPolicies/{resource}/setLabels",
  99079. // "request": {
  99080. // "$ref": "GlobalSetLabelsRequest"
  99081. // },
  99082. // "response": {
  99083. // "$ref": "Operation"
  99084. // },
  99085. // "scopes": [
  99086. // "https://www.googleapis.com/auth/cloud-platform",
  99087. // "https://www.googleapis.com/auth/compute"
  99088. // ]
  99089. // }
  99090. }
  99091. // method id "compute.securityPolicies.testIamPermissions":
  99092. type SecurityPoliciesTestIamPermissionsCall struct {
  99093. s *Service
  99094. project string
  99095. resource string
  99096. testpermissionsrequest *TestPermissionsRequest
  99097. urlParams_ gensupport.URLParams
  99098. ctx_ context.Context
  99099. header_ http.Header
  99100. }
  99101. // TestIamPermissions: Returns permissions that a caller has on the
  99102. // specified resource.
  99103. func (r *SecurityPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SecurityPoliciesTestIamPermissionsCall {
  99104. c := &SecurityPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99105. c.project = project
  99106. c.resource = resource
  99107. c.testpermissionsrequest = testpermissionsrequest
  99108. return c
  99109. }
  99110. // Fields allows partial responses to be retrieved. See
  99111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99112. // for more information.
  99113. func (c *SecurityPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SecurityPoliciesTestIamPermissionsCall {
  99114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99115. return c
  99116. }
  99117. // Context sets the context to be used in this call's Do method. Any
  99118. // pending HTTP request will be aborted if the provided context is
  99119. // canceled.
  99120. func (c *SecurityPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SecurityPoliciesTestIamPermissionsCall {
  99121. c.ctx_ = ctx
  99122. return c
  99123. }
  99124. // Header returns an http.Header that can be modified by the caller to
  99125. // add HTTP headers to the request.
  99126. func (c *SecurityPoliciesTestIamPermissionsCall) Header() http.Header {
  99127. if c.header_ == nil {
  99128. c.header_ = make(http.Header)
  99129. }
  99130. return c.header_
  99131. }
  99132. func (c *SecurityPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  99133. reqHeaders := make(http.Header)
  99134. for k, v := range c.header_ {
  99135. reqHeaders[k] = v
  99136. }
  99137. reqHeaders.Set("User-Agent", c.s.userAgent())
  99138. var body io.Reader = nil
  99139. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  99140. if err != nil {
  99141. return nil, err
  99142. }
  99143. reqHeaders.Set("Content-Type", "application/json")
  99144. c.urlParams_.Set("alt", alt)
  99145. c.urlParams_.Set("prettyPrint", "false")
  99146. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/testIamPermissions")
  99147. urls += "?" + c.urlParams_.Encode()
  99148. req, err := http.NewRequest("POST", urls, body)
  99149. if err != nil {
  99150. return nil, err
  99151. }
  99152. req.Header = reqHeaders
  99153. googleapi.Expand(req.URL, map[string]string{
  99154. "project": c.project,
  99155. "resource": c.resource,
  99156. })
  99157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99158. }
  99159. // Do executes the "compute.securityPolicies.testIamPermissions" call.
  99160. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  99161. // non-2xx status code is an error. Response headers are in either
  99162. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  99163. // returned at all) in error.(*googleapi.Error).Header. Use
  99164. // googleapi.IsNotModified to check whether the returned error was
  99165. // because http.StatusNotModified was returned.
  99166. func (c *SecurityPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  99167. gensupport.SetOptions(c.urlParams_, opts...)
  99168. res, err := c.doRequest("json")
  99169. if res != nil && res.StatusCode == http.StatusNotModified {
  99170. if res.Body != nil {
  99171. res.Body.Close()
  99172. }
  99173. return nil, &googleapi.Error{
  99174. Code: res.StatusCode,
  99175. Header: res.Header,
  99176. }
  99177. }
  99178. if err != nil {
  99179. return nil, err
  99180. }
  99181. defer googleapi.CloseBody(res)
  99182. if err := googleapi.CheckResponse(res); err != nil {
  99183. return nil, err
  99184. }
  99185. ret := &TestPermissionsResponse{
  99186. ServerResponse: googleapi.ServerResponse{
  99187. Header: res.Header,
  99188. HTTPStatusCode: res.StatusCode,
  99189. },
  99190. }
  99191. target := &ret
  99192. if err := gensupport.DecodeResponse(target, res); err != nil {
  99193. return nil, err
  99194. }
  99195. return ret, nil
  99196. // {
  99197. // "description": "Returns permissions that a caller has on the specified resource.",
  99198. // "httpMethod": "POST",
  99199. // "id": "compute.securityPolicies.testIamPermissions",
  99200. // "parameterOrder": [
  99201. // "project",
  99202. // "resource"
  99203. // ],
  99204. // "parameters": {
  99205. // "project": {
  99206. // "description": "Project ID for this request.",
  99207. // "location": "path",
  99208. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99209. // "required": true,
  99210. // "type": "string"
  99211. // },
  99212. // "resource": {
  99213. // "description": "Name or id of the resource for this request.",
  99214. // "location": "path",
  99215. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99216. // "required": true,
  99217. // "type": "string"
  99218. // }
  99219. // },
  99220. // "path": "{project}/global/securityPolicies/{resource}/testIamPermissions",
  99221. // "request": {
  99222. // "$ref": "TestPermissionsRequest"
  99223. // },
  99224. // "response": {
  99225. // "$ref": "TestPermissionsResponse"
  99226. // },
  99227. // "scopes": [
  99228. // "https://www.googleapis.com/auth/cloud-platform",
  99229. // "https://www.googleapis.com/auth/compute",
  99230. // "https://www.googleapis.com/auth/compute.readonly"
  99231. // ]
  99232. // }
  99233. }
  99234. // method id "compute.snapshots.delete":
  99235. type SnapshotsDeleteCall struct {
  99236. s *Service
  99237. project string
  99238. snapshot string
  99239. urlParams_ gensupport.URLParams
  99240. ctx_ context.Context
  99241. header_ http.Header
  99242. }
  99243. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  99244. // deleting a single snapshot might not necessarily delete all the data
  99245. // on that snapshot. If any data on the snapshot that is marked for
  99246. // deletion is needed for subsequent snapshots, the data will be moved
  99247. // to the next corresponding snapshot.
  99248. //
  99249. // For more information, see Deleting snapshots.
  99250. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  99251. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  99252. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99253. c.project = project
  99254. c.snapshot = snapshot
  99255. return c
  99256. }
  99257. // RequestId sets the optional parameter "requestId": An optional
  99258. // request ID to identify requests. Specify a unique request ID so that
  99259. // if you must retry your request, the server will know to ignore the
  99260. // request if it has already been completed.
  99261. //
  99262. // For example, consider a situation where you make an initial request
  99263. // and the request times out. If you make the request again with the
  99264. // same request ID, the server can check if original operation with the
  99265. // same request ID was received, and if so, will ignore the second
  99266. // request. This prevents clients from accidentally creating duplicate
  99267. // commitments.
  99268. //
  99269. // The request ID must be a valid UUID with the exception that zero UUID
  99270. // is not supported (00000000-0000-0000-0000-000000000000).
  99271. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  99272. c.urlParams_.Set("requestId", requestId)
  99273. return c
  99274. }
  99275. // Fields allows partial responses to be retrieved. See
  99276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99277. // for more information.
  99278. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  99279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99280. return c
  99281. }
  99282. // Context sets the context to be used in this call's Do method. Any
  99283. // pending HTTP request will be aborted if the provided context is
  99284. // canceled.
  99285. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  99286. c.ctx_ = ctx
  99287. return c
  99288. }
  99289. // Header returns an http.Header that can be modified by the caller to
  99290. // add HTTP headers to the request.
  99291. func (c *SnapshotsDeleteCall) Header() http.Header {
  99292. if c.header_ == nil {
  99293. c.header_ = make(http.Header)
  99294. }
  99295. return c.header_
  99296. }
  99297. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  99298. reqHeaders := make(http.Header)
  99299. for k, v := range c.header_ {
  99300. reqHeaders[k] = v
  99301. }
  99302. reqHeaders.Set("User-Agent", c.s.userAgent())
  99303. var body io.Reader = nil
  99304. c.urlParams_.Set("alt", alt)
  99305. c.urlParams_.Set("prettyPrint", "false")
  99306. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  99307. urls += "?" + c.urlParams_.Encode()
  99308. req, err := http.NewRequest("DELETE", urls, body)
  99309. if err != nil {
  99310. return nil, err
  99311. }
  99312. req.Header = reqHeaders
  99313. googleapi.Expand(req.URL, map[string]string{
  99314. "project": c.project,
  99315. "snapshot": c.snapshot,
  99316. })
  99317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99318. }
  99319. // Do executes the "compute.snapshots.delete" call.
  99320. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99321. // status code is an error. Response headers are in either
  99322. // *Operation.ServerResponse.Header or (if a response was returned at
  99323. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99324. // to check whether the returned error was because
  99325. // http.StatusNotModified was returned.
  99326. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99327. gensupport.SetOptions(c.urlParams_, opts...)
  99328. res, err := c.doRequest("json")
  99329. if res != nil && res.StatusCode == http.StatusNotModified {
  99330. if res.Body != nil {
  99331. res.Body.Close()
  99332. }
  99333. return nil, &googleapi.Error{
  99334. Code: res.StatusCode,
  99335. Header: res.Header,
  99336. }
  99337. }
  99338. if err != nil {
  99339. return nil, err
  99340. }
  99341. defer googleapi.CloseBody(res)
  99342. if err := googleapi.CheckResponse(res); err != nil {
  99343. return nil, err
  99344. }
  99345. ret := &Operation{
  99346. ServerResponse: googleapi.ServerResponse{
  99347. Header: res.Header,
  99348. HTTPStatusCode: res.StatusCode,
  99349. },
  99350. }
  99351. target := &ret
  99352. if err := gensupport.DecodeResponse(target, res); err != nil {
  99353. return nil, err
  99354. }
  99355. return ret, nil
  99356. // {
  99357. // "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.",
  99358. // "httpMethod": "DELETE",
  99359. // "id": "compute.snapshots.delete",
  99360. // "parameterOrder": [
  99361. // "project",
  99362. // "snapshot"
  99363. // ],
  99364. // "parameters": {
  99365. // "project": {
  99366. // "description": "Project ID for this request.",
  99367. // "location": "path",
  99368. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99369. // "required": true,
  99370. // "type": "string"
  99371. // },
  99372. // "requestId": {
  99373. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99374. // "location": "query",
  99375. // "type": "string"
  99376. // },
  99377. // "snapshot": {
  99378. // "description": "Name of the Snapshot resource to delete.",
  99379. // "location": "path",
  99380. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99381. // "required": true,
  99382. // "type": "string"
  99383. // }
  99384. // },
  99385. // "path": "{project}/global/snapshots/{snapshot}",
  99386. // "response": {
  99387. // "$ref": "Operation"
  99388. // },
  99389. // "scopes": [
  99390. // "https://www.googleapis.com/auth/cloud-platform",
  99391. // "https://www.googleapis.com/auth/compute"
  99392. // ]
  99393. // }
  99394. }
  99395. // method id "compute.snapshots.get":
  99396. type SnapshotsGetCall struct {
  99397. s *Service
  99398. project string
  99399. snapshot string
  99400. urlParams_ gensupport.URLParams
  99401. ifNoneMatch_ string
  99402. ctx_ context.Context
  99403. header_ http.Header
  99404. }
  99405. // Get: Returns the specified Snapshot resource. Gets a list of
  99406. // available snapshots by making a list() request.
  99407. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  99408. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  99409. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99410. c.project = project
  99411. c.snapshot = snapshot
  99412. return c
  99413. }
  99414. // Fields allows partial responses to be retrieved. See
  99415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99416. // for more information.
  99417. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  99418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99419. return c
  99420. }
  99421. // IfNoneMatch sets the optional parameter which makes the operation
  99422. // fail if the object's ETag matches the given value. This is useful for
  99423. // getting updates only after the object has changed since the last
  99424. // request. Use googleapi.IsNotModified to check whether the response
  99425. // error from Do is the result of In-None-Match.
  99426. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  99427. c.ifNoneMatch_ = entityTag
  99428. return c
  99429. }
  99430. // Context sets the context to be used in this call's Do method. Any
  99431. // pending HTTP request will be aborted if the provided context is
  99432. // canceled.
  99433. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  99434. c.ctx_ = ctx
  99435. return c
  99436. }
  99437. // Header returns an http.Header that can be modified by the caller to
  99438. // add HTTP headers to the request.
  99439. func (c *SnapshotsGetCall) Header() http.Header {
  99440. if c.header_ == nil {
  99441. c.header_ = make(http.Header)
  99442. }
  99443. return c.header_
  99444. }
  99445. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  99446. reqHeaders := make(http.Header)
  99447. for k, v := range c.header_ {
  99448. reqHeaders[k] = v
  99449. }
  99450. reqHeaders.Set("User-Agent", c.s.userAgent())
  99451. if c.ifNoneMatch_ != "" {
  99452. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99453. }
  99454. var body io.Reader = nil
  99455. c.urlParams_.Set("alt", alt)
  99456. c.urlParams_.Set("prettyPrint", "false")
  99457. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  99458. urls += "?" + c.urlParams_.Encode()
  99459. req, err := http.NewRequest("GET", urls, body)
  99460. if err != nil {
  99461. return nil, err
  99462. }
  99463. req.Header = reqHeaders
  99464. googleapi.Expand(req.URL, map[string]string{
  99465. "project": c.project,
  99466. "snapshot": c.snapshot,
  99467. })
  99468. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99469. }
  99470. // Do executes the "compute.snapshots.get" call.
  99471. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  99472. // code is an error. Response headers are in either
  99473. // *Snapshot.ServerResponse.Header or (if a response was returned at
  99474. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99475. // to check whether the returned error was because
  99476. // http.StatusNotModified was returned.
  99477. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  99478. gensupport.SetOptions(c.urlParams_, opts...)
  99479. res, err := c.doRequest("json")
  99480. if res != nil && res.StatusCode == http.StatusNotModified {
  99481. if res.Body != nil {
  99482. res.Body.Close()
  99483. }
  99484. return nil, &googleapi.Error{
  99485. Code: res.StatusCode,
  99486. Header: res.Header,
  99487. }
  99488. }
  99489. if err != nil {
  99490. return nil, err
  99491. }
  99492. defer googleapi.CloseBody(res)
  99493. if err := googleapi.CheckResponse(res); err != nil {
  99494. return nil, err
  99495. }
  99496. ret := &Snapshot{
  99497. ServerResponse: googleapi.ServerResponse{
  99498. Header: res.Header,
  99499. HTTPStatusCode: res.StatusCode,
  99500. },
  99501. }
  99502. target := &ret
  99503. if err := gensupport.DecodeResponse(target, res); err != nil {
  99504. return nil, err
  99505. }
  99506. return ret, nil
  99507. // {
  99508. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  99509. // "httpMethod": "GET",
  99510. // "id": "compute.snapshots.get",
  99511. // "parameterOrder": [
  99512. // "project",
  99513. // "snapshot"
  99514. // ],
  99515. // "parameters": {
  99516. // "project": {
  99517. // "description": "Project ID for this request.",
  99518. // "location": "path",
  99519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99520. // "required": true,
  99521. // "type": "string"
  99522. // },
  99523. // "snapshot": {
  99524. // "description": "Name of the Snapshot resource to return.",
  99525. // "location": "path",
  99526. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99527. // "required": true,
  99528. // "type": "string"
  99529. // }
  99530. // },
  99531. // "path": "{project}/global/snapshots/{snapshot}",
  99532. // "response": {
  99533. // "$ref": "Snapshot"
  99534. // },
  99535. // "scopes": [
  99536. // "https://www.googleapis.com/auth/cloud-platform",
  99537. // "https://www.googleapis.com/auth/compute",
  99538. // "https://www.googleapis.com/auth/compute.readonly"
  99539. // ]
  99540. // }
  99541. }
  99542. // method id "compute.snapshots.getIamPolicy":
  99543. type SnapshotsGetIamPolicyCall struct {
  99544. s *Service
  99545. project string
  99546. resource string
  99547. urlParams_ gensupport.URLParams
  99548. ifNoneMatch_ string
  99549. ctx_ context.Context
  99550. header_ http.Header
  99551. }
  99552. // GetIamPolicy: Gets the access control policy for a resource. May be
  99553. // empty if no such policy or resource exists.
  99554. func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
  99555. c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99556. c.project = project
  99557. c.resource = resource
  99558. return c
  99559. }
  99560. // Fields allows partial responses to be retrieved. See
  99561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99562. // for more information.
  99563. func (c *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
  99564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99565. return c
  99566. }
  99567. // IfNoneMatch sets the optional parameter which makes the operation
  99568. // fail if the object's ETag matches the given value. This is useful for
  99569. // getting updates only after the object has changed since the last
  99570. // request. Use googleapi.IsNotModified to check whether the response
  99571. // error from Do is the result of In-None-Match.
  99572. func (c *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
  99573. c.ifNoneMatch_ = entityTag
  99574. return c
  99575. }
  99576. // Context sets the context to be used in this call's Do method. Any
  99577. // pending HTTP request will be aborted if the provided context is
  99578. // canceled.
  99579. func (c *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
  99580. c.ctx_ = ctx
  99581. return c
  99582. }
  99583. // Header returns an http.Header that can be modified by the caller to
  99584. // add HTTP headers to the request.
  99585. func (c *SnapshotsGetIamPolicyCall) Header() http.Header {
  99586. if c.header_ == nil {
  99587. c.header_ = make(http.Header)
  99588. }
  99589. return c.header_
  99590. }
  99591. func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  99592. reqHeaders := make(http.Header)
  99593. for k, v := range c.header_ {
  99594. reqHeaders[k] = v
  99595. }
  99596. reqHeaders.Set("User-Agent", c.s.userAgent())
  99597. if c.ifNoneMatch_ != "" {
  99598. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99599. }
  99600. var body io.Reader = nil
  99601. c.urlParams_.Set("alt", alt)
  99602. c.urlParams_.Set("prettyPrint", "false")
  99603. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/getIamPolicy")
  99604. urls += "?" + c.urlParams_.Encode()
  99605. req, err := http.NewRequest("GET", urls, body)
  99606. if err != nil {
  99607. return nil, err
  99608. }
  99609. req.Header = reqHeaders
  99610. googleapi.Expand(req.URL, map[string]string{
  99611. "project": c.project,
  99612. "resource": c.resource,
  99613. })
  99614. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99615. }
  99616. // Do executes the "compute.snapshots.getIamPolicy" call.
  99617. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  99618. // code is an error. Response headers are in either
  99619. // *Policy.ServerResponse.Header or (if a response was returned at all)
  99620. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  99621. // check whether the returned error was because http.StatusNotModified
  99622. // was returned.
  99623. func (c *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  99624. gensupport.SetOptions(c.urlParams_, opts...)
  99625. res, err := c.doRequest("json")
  99626. if res != nil && res.StatusCode == http.StatusNotModified {
  99627. if res.Body != nil {
  99628. res.Body.Close()
  99629. }
  99630. return nil, &googleapi.Error{
  99631. Code: res.StatusCode,
  99632. Header: res.Header,
  99633. }
  99634. }
  99635. if err != nil {
  99636. return nil, err
  99637. }
  99638. defer googleapi.CloseBody(res)
  99639. if err := googleapi.CheckResponse(res); err != nil {
  99640. return nil, err
  99641. }
  99642. ret := &Policy{
  99643. ServerResponse: googleapi.ServerResponse{
  99644. Header: res.Header,
  99645. HTTPStatusCode: res.StatusCode,
  99646. },
  99647. }
  99648. target := &ret
  99649. if err := gensupport.DecodeResponse(target, res); err != nil {
  99650. return nil, err
  99651. }
  99652. return ret, nil
  99653. // {
  99654. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  99655. // "httpMethod": "GET",
  99656. // "id": "compute.snapshots.getIamPolicy",
  99657. // "parameterOrder": [
  99658. // "project",
  99659. // "resource"
  99660. // ],
  99661. // "parameters": {
  99662. // "project": {
  99663. // "description": "Project ID for this request.",
  99664. // "location": "path",
  99665. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99666. // "required": true,
  99667. // "type": "string"
  99668. // },
  99669. // "resource": {
  99670. // "description": "Name or id of the resource for this request.",
  99671. // "location": "path",
  99672. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99673. // "required": true,
  99674. // "type": "string"
  99675. // }
  99676. // },
  99677. // "path": "{project}/global/snapshots/{resource}/getIamPolicy",
  99678. // "response": {
  99679. // "$ref": "Policy"
  99680. // },
  99681. // "scopes": [
  99682. // "https://www.googleapis.com/auth/cloud-platform",
  99683. // "https://www.googleapis.com/auth/compute",
  99684. // "https://www.googleapis.com/auth/compute.readonly"
  99685. // ]
  99686. // }
  99687. }
  99688. // method id "compute.snapshots.list":
  99689. type SnapshotsListCall struct {
  99690. s *Service
  99691. project string
  99692. urlParams_ gensupport.URLParams
  99693. ifNoneMatch_ string
  99694. ctx_ context.Context
  99695. header_ http.Header
  99696. }
  99697. // List: Retrieves the list of Snapshot resources contained within the
  99698. // specified project.
  99699. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  99700. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  99701. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99702. c.project = project
  99703. return c
  99704. }
  99705. // Filter sets the optional parameter "filter": A filter expression that
  99706. // filters resources listed in the response. The expression must specify
  99707. // the field name, a comparison operator, and the value that you want to
  99708. // use for filtering. The value must be a string, a number, or a
  99709. // boolean. The comparison operator must be either =, !=, >, or <.
  99710. //
  99711. // For example, if you are filtering Compute Engine instances, you can
  99712. // exclude instances named example-instance by specifying name !=
  99713. // example-instance.
  99714. //
  99715. // You can also filter nested fields. For example, you could specify
  99716. // scheduling.automaticRestart = false to include instances only if they
  99717. // are not scheduled for automatic restarts. You can use filtering on
  99718. // nested fields to filter based on resource labels.
  99719. //
  99720. // To filter on multiple expressions, provide each separate expression
  99721. // within parentheses. For example, (scheduling.automaticRestart = true)
  99722. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99723. // AND expression. However, you can include AND and OR expressions
  99724. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99725. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99726. // true).
  99727. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  99728. c.urlParams_.Set("filter", filter)
  99729. return c
  99730. }
  99731. // MaxResults sets the optional parameter "maxResults": The maximum
  99732. // number of results per page that should be returned. If the number of
  99733. // available results is larger than maxResults, Compute Engine returns a
  99734. // nextPageToken that can be used to get the next page of results in
  99735. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99736. // (Default: 500)
  99737. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  99738. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99739. return c
  99740. }
  99741. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99742. // a certain order. By default, results are returned in alphanumerical
  99743. // order based on the resource name.
  99744. //
  99745. // You can also sort results in descending order based on the creation
  99746. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99747. // based on the creationTimestamp field in reverse chronological order
  99748. // (newest result first). Use this to sort resources like operations so
  99749. // that the newest operation is returned first.
  99750. //
  99751. // Currently, only sorting by name or creationTimestamp desc is
  99752. // supported.
  99753. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  99754. c.urlParams_.Set("orderBy", orderBy)
  99755. return c
  99756. }
  99757. // PageToken sets the optional parameter "pageToken": Specifies a page
  99758. // token to use. Set pageToken to the nextPageToken returned by a
  99759. // previous list request to get the next page of results.
  99760. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  99761. c.urlParams_.Set("pageToken", pageToken)
  99762. return c
  99763. }
  99764. // Fields allows partial responses to be retrieved. See
  99765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99766. // for more information.
  99767. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  99768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99769. return c
  99770. }
  99771. // IfNoneMatch sets the optional parameter which makes the operation
  99772. // fail if the object's ETag matches the given value. This is useful for
  99773. // getting updates only after the object has changed since the last
  99774. // request. Use googleapi.IsNotModified to check whether the response
  99775. // error from Do is the result of In-None-Match.
  99776. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  99777. c.ifNoneMatch_ = entityTag
  99778. return c
  99779. }
  99780. // Context sets the context to be used in this call's Do method. Any
  99781. // pending HTTP request will be aborted if the provided context is
  99782. // canceled.
  99783. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  99784. c.ctx_ = ctx
  99785. return c
  99786. }
  99787. // Header returns an http.Header that can be modified by the caller to
  99788. // add HTTP headers to the request.
  99789. func (c *SnapshotsListCall) Header() http.Header {
  99790. if c.header_ == nil {
  99791. c.header_ = make(http.Header)
  99792. }
  99793. return c.header_
  99794. }
  99795. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  99796. reqHeaders := make(http.Header)
  99797. for k, v := range c.header_ {
  99798. reqHeaders[k] = v
  99799. }
  99800. reqHeaders.Set("User-Agent", c.s.userAgent())
  99801. if c.ifNoneMatch_ != "" {
  99802. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99803. }
  99804. var body io.Reader = nil
  99805. c.urlParams_.Set("alt", alt)
  99806. c.urlParams_.Set("prettyPrint", "false")
  99807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  99808. urls += "?" + c.urlParams_.Encode()
  99809. req, err := http.NewRequest("GET", urls, body)
  99810. if err != nil {
  99811. return nil, err
  99812. }
  99813. req.Header = reqHeaders
  99814. googleapi.Expand(req.URL, map[string]string{
  99815. "project": c.project,
  99816. })
  99817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99818. }
  99819. // Do executes the "compute.snapshots.list" call.
  99820. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  99821. // status code is an error. Response headers are in either
  99822. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  99823. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99824. // to check whether the returned error was because
  99825. // http.StatusNotModified was returned.
  99826. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  99827. gensupport.SetOptions(c.urlParams_, opts...)
  99828. res, err := c.doRequest("json")
  99829. if res != nil && res.StatusCode == http.StatusNotModified {
  99830. if res.Body != nil {
  99831. res.Body.Close()
  99832. }
  99833. return nil, &googleapi.Error{
  99834. Code: res.StatusCode,
  99835. Header: res.Header,
  99836. }
  99837. }
  99838. if err != nil {
  99839. return nil, err
  99840. }
  99841. defer googleapi.CloseBody(res)
  99842. if err := googleapi.CheckResponse(res); err != nil {
  99843. return nil, err
  99844. }
  99845. ret := &SnapshotList{
  99846. ServerResponse: googleapi.ServerResponse{
  99847. Header: res.Header,
  99848. HTTPStatusCode: res.StatusCode,
  99849. },
  99850. }
  99851. target := &ret
  99852. if err := gensupport.DecodeResponse(target, res); err != nil {
  99853. return nil, err
  99854. }
  99855. return ret, nil
  99856. // {
  99857. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  99858. // "httpMethod": "GET",
  99859. // "id": "compute.snapshots.list",
  99860. // "parameterOrder": [
  99861. // "project"
  99862. // ],
  99863. // "parameters": {
  99864. // "filter": {
  99865. // "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).",
  99866. // "location": "query",
  99867. // "type": "string"
  99868. // },
  99869. // "maxResults": {
  99870. // "default": "500",
  99871. // "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)",
  99872. // "format": "uint32",
  99873. // "location": "query",
  99874. // "minimum": "0",
  99875. // "type": "integer"
  99876. // },
  99877. // "orderBy": {
  99878. // "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.",
  99879. // "location": "query",
  99880. // "type": "string"
  99881. // },
  99882. // "pageToken": {
  99883. // "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.",
  99884. // "location": "query",
  99885. // "type": "string"
  99886. // },
  99887. // "project": {
  99888. // "description": "Project ID for this request.",
  99889. // "location": "path",
  99890. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99891. // "required": true,
  99892. // "type": "string"
  99893. // }
  99894. // },
  99895. // "path": "{project}/global/snapshots",
  99896. // "response": {
  99897. // "$ref": "SnapshotList"
  99898. // },
  99899. // "scopes": [
  99900. // "https://www.googleapis.com/auth/cloud-platform",
  99901. // "https://www.googleapis.com/auth/compute",
  99902. // "https://www.googleapis.com/auth/compute.readonly"
  99903. // ]
  99904. // }
  99905. }
  99906. // Pages invokes f for each page of results.
  99907. // A non-nil error returned from f will halt the iteration.
  99908. // The provided context supersedes any context provided to the Context method.
  99909. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  99910. c.ctx_ = ctx
  99911. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  99912. for {
  99913. x, err := c.Do()
  99914. if err != nil {
  99915. return err
  99916. }
  99917. if err := f(x); err != nil {
  99918. return err
  99919. }
  99920. if x.NextPageToken == "" {
  99921. return nil
  99922. }
  99923. c.PageToken(x.NextPageToken)
  99924. }
  99925. }
  99926. // method id "compute.snapshots.setIamPolicy":
  99927. type SnapshotsSetIamPolicyCall struct {
  99928. s *Service
  99929. project string
  99930. resource string
  99931. globalsetpolicyrequest *GlobalSetPolicyRequest
  99932. urlParams_ gensupport.URLParams
  99933. ctx_ context.Context
  99934. header_ http.Header
  99935. }
  99936. // SetIamPolicy: Sets the access control policy on the specified
  99937. // resource. Replaces any existing policy.
  99938. func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
  99939. c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99940. c.project = project
  99941. c.resource = resource
  99942. c.globalsetpolicyrequest = globalsetpolicyrequest
  99943. return c
  99944. }
  99945. // Fields allows partial responses to be retrieved. See
  99946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99947. // for more information.
  99948. func (c *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
  99949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99950. return c
  99951. }
  99952. // Context sets the context to be used in this call's Do method. Any
  99953. // pending HTTP request will be aborted if the provided context is
  99954. // canceled.
  99955. func (c *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
  99956. c.ctx_ = ctx
  99957. return c
  99958. }
  99959. // Header returns an http.Header that can be modified by the caller to
  99960. // add HTTP headers to the request.
  99961. func (c *SnapshotsSetIamPolicyCall) Header() http.Header {
  99962. if c.header_ == nil {
  99963. c.header_ = make(http.Header)
  99964. }
  99965. return c.header_
  99966. }
  99967. func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  99968. reqHeaders := make(http.Header)
  99969. for k, v := range c.header_ {
  99970. reqHeaders[k] = v
  99971. }
  99972. reqHeaders.Set("User-Agent", c.s.userAgent())
  99973. var body io.Reader = nil
  99974. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  99975. if err != nil {
  99976. return nil, err
  99977. }
  99978. reqHeaders.Set("Content-Type", "application/json")
  99979. c.urlParams_.Set("alt", alt)
  99980. c.urlParams_.Set("prettyPrint", "false")
  99981. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setIamPolicy")
  99982. urls += "?" + c.urlParams_.Encode()
  99983. req, err := http.NewRequest("POST", urls, body)
  99984. if err != nil {
  99985. return nil, err
  99986. }
  99987. req.Header = reqHeaders
  99988. googleapi.Expand(req.URL, map[string]string{
  99989. "project": c.project,
  99990. "resource": c.resource,
  99991. })
  99992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99993. }
  99994. // Do executes the "compute.snapshots.setIamPolicy" call.
  99995. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  99996. // code is an error. Response headers are in either
  99997. // *Policy.ServerResponse.Header or (if a response was returned at all)
  99998. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  99999. // check whether the returned error was because http.StatusNotModified
  100000. // was returned.
  100001. func (c *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  100002. gensupport.SetOptions(c.urlParams_, opts...)
  100003. res, err := c.doRequest("json")
  100004. if res != nil && res.StatusCode == http.StatusNotModified {
  100005. if res.Body != nil {
  100006. res.Body.Close()
  100007. }
  100008. return nil, &googleapi.Error{
  100009. Code: res.StatusCode,
  100010. Header: res.Header,
  100011. }
  100012. }
  100013. if err != nil {
  100014. return nil, err
  100015. }
  100016. defer googleapi.CloseBody(res)
  100017. if err := googleapi.CheckResponse(res); err != nil {
  100018. return nil, err
  100019. }
  100020. ret := &Policy{
  100021. ServerResponse: googleapi.ServerResponse{
  100022. Header: res.Header,
  100023. HTTPStatusCode: res.StatusCode,
  100024. },
  100025. }
  100026. target := &ret
  100027. if err := gensupport.DecodeResponse(target, res); err != nil {
  100028. return nil, err
  100029. }
  100030. return ret, nil
  100031. // {
  100032. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  100033. // "httpMethod": "POST",
  100034. // "id": "compute.snapshots.setIamPolicy",
  100035. // "parameterOrder": [
  100036. // "project",
  100037. // "resource"
  100038. // ],
  100039. // "parameters": {
  100040. // "project": {
  100041. // "description": "Project ID for this request.",
  100042. // "location": "path",
  100043. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100044. // "required": true,
  100045. // "type": "string"
  100046. // },
  100047. // "resource": {
  100048. // "description": "Name or id of the resource for this request.",
  100049. // "location": "path",
  100050. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100051. // "required": true,
  100052. // "type": "string"
  100053. // }
  100054. // },
  100055. // "path": "{project}/global/snapshots/{resource}/setIamPolicy",
  100056. // "request": {
  100057. // "$ref": "GlobalSetPolicyRequest"
  100058. // },
  100059. // "response": {
  100060. // "$ref": "Policy"
  100061. // },
  100062. // "scopes": [
  100063. // "https://www.googleapis.com/auth/cloud-platform",
  100064. // "https://www.googleapis.com/auth/compute"
  100065. // ]
  100066. // }
  100067. }
  100068. // method id "compute.snapshots.setLabels":
  100069. type SnapshotsSetLabelsCall struct {
  100070. s *Service
  100071. project string
  100072. resource string
  100073. globalsetlabelsrequest *GlobalSetLabelsRequest
  100074. urlParams_ gensupport.URLParams
  100075. ctx_ context.Context
  100076. header_ http.Header
  100077. }
  100078. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  100079. // read the Labeling Resources documentation.
  100080. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  100081. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100082. c.project = project
  100083. c.resource = resource
  100084. c.globalsetlabelsrequest = globalsetlabelsrequest
  100085. return c
  100086. }
  100087. // Fields allows partial responses to be retrieved. See
  100088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100089. // for more information.
  100090. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  100091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100092. return c
  100093. }
  100094. // Context sets the context to be used in this call's Do method. Any
  100095. // pending HTTP request will be aborted if the provided context is
  100096. // canceled.
  100097. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  100098. c.ctx_ = ctx
  100099. return c
  100100. }
  100101. // Header returns an http.Header that can be modified by the caller to
  100102. // add HTTP headers to the request.
  100103. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  100104. if c.header_ == nil {
  100105. c.header_ = make(http.Header)
  100106. }
  100107. return c.header_
  100108. }
  100109. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  100110. reqHeaders := make(http.Header)
  100111. for k, v := range c.header_ {
  100112. reqHeaders[k] = v
  100113. }
  100114. reqHeaders.Set("User-Agent", c.s.userAgent())
  100115. var body io.Reader = nil
  100116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  100117. if err != nil {
  100118. return nil, err
  100119. }
  100120. reqHeaders.Set("Content-Type", "application/json")
  100121. c.urlParams_.Set("alt", alt)
  100122. c.urlParams_.Set("prettyPrint", "false")
  100123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  100124. urls += "?" + c.urlParams_.Encode()
  100125. req, err := http.NewRequest("POST", urls, body)
  100126. if err != nil {
  100127. return nil, err
  100128. }
  100129. req.Header = reqHeaders
  100130. googleapi.Expand(req.URL, map[string]string{
  100131. "project": c.project,
  100132. "resource": c.resource,
  100133. })
  100134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100135. }
  100136. // Do executes the "compute.snapshots.setLabels" call.
  100137. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100138. // status code is an error. Response headers are in either
  100139. // *Operation.ServerResponse.Header or (if a response was returned at
  100140. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100141. // to check whether the returned error was because
  100142. // http.StatusNotModified was returned.
  100143. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100144. gensupport.SetOptions(c.urlParams_, opts...)
  100145. res, err := c.doRequest("json")
  100146. if res != nil && res.StatusCode == http.StatusNotModified {
  100147. if res.Body != nil {
  100148. res.Body.Close()
  100149. }
  100150. return nil, &googleapi.Error{
  100151. Code: res.StatusCode,
  100152. Header: res.Header,
  100153. }
  100154. }
  100155. if err != nil {
  100156. return nil, err
  100157. }
  100158. defer googleapi.CloseBody(res)
  100159. if err := googleapi.CheckResponse(res); err != nil {
  100160. return nil, err
  100161. }
  100162. ret := &Operation{
  100163. ServerResponse: googleapi.ServerResponse{
  100164. Header: res.Header,
  100165. HTTPStatusCode: res.StatusCode,
  100166. },
  100167. }
  100168. target := &ret
  100169. if err := gensupport.DecodeResponse(target, res); err != nil {
  100170. return nil, err
  100171. }
  100172. return ret, nil
  100173. // {
  100174. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  100175. // "httpMethod": "POST",
  100176. // "id": "compute.snapshots.setLabels",
  100177. // "parameterOrder": [
  100178. // "project",
  100179. // "resource"
  100180. // ],
  100181. // "parameters": {
  100182. // "project": {
  100183. // "description": "Project ID for this request.",
  100184. // "location": "path",
  100185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100186. // "required": true,
  100187. // "type": "string"
  100188. // },
  100189. // "resource": {
  100190. // "description": "Name or id of the resource for this request.",
  100191. // "location": "path",
  100192. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100193. // "required": true,
  100194. // "type": "string"
  100195. // }
  100196. // },
  100197. // "path": "{project}/global/snapshots/{resource}/setLabels",
  100198. // "request": {
  100199. // "$ref": "GlobalSetLabelsRequest"
  100200. // },
  100201. // "response": {
  100202. // "$ref": "Operation"
  100203. // },
  100204. // "scopes": [
  100205. // "https://www.googleapis.com/auth/cloud-platform",
  100206. // "https://www.googleapis.com/auth/compute"
  100207. // ]
  100208. // }
  100209. }
  100210. // method id "compute.snapshots.testIamPermissions":
  100211. type SnapshotsTestIamPermissionsCall struct {
  100212. s *Service
  100213. project string
  100214. resource string
  100215. testpermissionsrequest *TestPermissionsRequest
  100216. urlParams_ gensupport.URLParams
  100217. ctx_ context.Context
  100218. header_ http.Header
  100219. }
  100220. // TestIamPermissions: Returns permissions that a caller has on the
  100221. // specified resource.
  100222. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  100223. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100224. c.project = project
  100225. c.resource = resource
  100226. c.testpermissionsrequest = testpermissionsrequest
  100227. return c
  100228. }
  100229. // Fields allows partial responses to be retrieved. See
  100230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100231. // for more information.
  100232. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  100233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100234. return c
  100235. }
  100236. // Context sets the context to be used in this call's Do method. Any
  100237. // pending HTTP request will be aborted if the provided context is
  100238. // canceled.
  100239. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  100240. c.ctx_ = ctx
  100241. return c
  100242. }
  100243. // Header returns an http.Header that can be modified by the caller to
  100244. // add HTTP headers to the request.
  100245. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  100246. if c.header_ == nil {
  100247. c.header_ = make(http.Header)
  100248. }
  100249. return c.header_
  100250. }
  100251. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  100252. reqHeaders := make(http.Header)
  100253. for k, v := range c.header_ {
  100254. reqHeaders[k] = v
  100255. }
  100256. reqHeaders.Set("User-Agent", c.s.userAgent())
  100257. var body io.Reader = nil
  100258. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  100259. if err != nil {
  100260. return nil, err
  100261. }
  100262. reqHeaders.Set("Content-Type", "application/json")
  100263. c.urlParams_.Set("alt", alt)
  100264. c.urlParams_.Set("prettyPrint", "false")
  100265. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  100266. urls += "?" + c.urlParams_.Encode()
  100267. req, err := http.NewRequest("POST", urls, body)
  100268. if err != nil {
  100269. return nil, err
  100270. }
  100271. req.Header = reqHeaders
  100272. googleapi.Expand(req.URL, map[string]string{
  100273. "project": c.project,
  100274. "resource": c.resource,
  100275. })
  100276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100277. }
  100278. // Do executes the "compute.snapshots.testIamPermissions" call.
  100279. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  100280. // non-2xx status code is an error. Response headers are in either
  100281. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  100282. // returned at all) in error.(*googleapi.Error).Header. Use
  100283. // googleapi.IsNotModified to check whether the returned error was
  100284. // because http.StatusNotModified was returned.
  100285. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  100286. gensupport.SetOptions(c.urlParams_, opts...)
  100287. res, err := c.doRequest("json")
  100288. if res != nil && res.StatusCode == http.StatusNotModified {
  100289. if res.Body != nil {
  100290. res.Body.Close()
  100291. }
  100292. return nil, &googleapi.Error{
  100293. Code: res.StatusCode,
  100294. Header: res.Header,
  100295. }
  100296. }
  100297. if err != nil {
  100298. return nil, err
  100299. }
  100300. defer googleapi.CloseBody(res)
  100301. if err := googleapi.CheckResponse(res); err != nil {
  100302. return nil, err
  100303. }
  100304. ret := &TestPermissionsResponse{
  100305. ServerResponse: googleapi.ServerResponse{
  100306. Header: res.Header,
  100307. HTTPStatusCode: res.StatusCode,
  100308. },
  100309. }
  100310. target := &ret
  100311. if err := gensupport.DecodeResponse(target, res); err != nil {
  100312. return nil, err
  100313. }
  100314. return ret, nil
  100315. // {
  100316. // "description": "Returns permissions that a caller has on the specified resource.",
  100317. // "httpMethod": "POST",
  100318. // "id": "compute.snapshots.testIamPermissions",
  100319. // "parameterOrder": [
  100320. // "project",
  100321. // "resource"
  100322. // ],
  100323. // "parameters": {
  100324. // "project": {
  100325. // "description": "Project ID for this request.",
  100326. // "location": "path",
  100327. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100328. // "required": true,
  100329. // "type": "string"
  100330. // },
  100331. // "resource": {
  100332. // "description": "Name or id of the resource for this request.",
  100333. // "location": "path",
  100334. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100335. // "required": true,
  100336. // "type": "string"
  100337. // }
  100338. // },
  100339. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  100340. // "request": {
  100341. // "$ref": "TestPermissionsRequest"
  100342. // },
  100343. // "response": {
  100344. // "$ref": "TestPermissionsResponse"
  100345. // },
  100346. // "scopes": [
  100347. // "https://www.googleapis.com/auth/cloud-platform",
  100348. // "https://www.googleapis.com/auth/compute",
  100349. // "https://www.googleapis.com/auth/compute.readonly"
  100350. // ]
  100351. // }
  100352. }
  100353. // method id "compute.sslCertificates.delete":
  100354. type SslCertificatesDeleteCall struct {
  100355. s *Service
  100356. project string
  100357. sslCertificate string
  100358. urlParams_ gensupport.URLParams
  100359. ctx_ context.Context
  100360. header_ http.Header
  100361. }
  100362. // Delete: Deletes the specified SslCertificate resource.
  100363. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  100364. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100365. c.project = project
  100366. c.sslCertificate = sslCertificate
  100367. return c
  100368. }
  100369. // RequestId sets the optional parameter "requestId": An optional
  100370. // request ID to identify requests. Specify a unique request ID so that
  100371. // if you must retry your request, the server will know to ignore the
  100372. // request if it has already been completed.
  100373. //
  100374. // For example, consider a situation where you make an initial request
  100375. // and the request times out. If you make the request again with the
  100376. // same request ID, the server can check if original operation with the
  100377. // same request ID was received, and if so, will ignore the second
  100378. // request. This prevents clients from accidentally creating duplicate
  100379. // commitments.
  100380. //
  100381. // The request ID must be a valid UUID with the exception that zero UUID
  100382. // is not supported (00000000-0000-0000-0000-000000000000).
  100383. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  100384. c.urlParams_.Set("requestId", requestId)
  100385. return c
  100386. }
  100387. // Fields allows partial responses to be retrieved. See
  100388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100389. // for more information.
  100390. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  100391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100392. return c
  100393. }
  100394. // Context sets the context to be used in this call's Do method. Any
  100395. // pending HTTP request will be aborted if the provided context is
  100396. // canceled.
  100397. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  100398. c.ctx_ = ctx
  100399. return c
  100400. }
  100401. // Header returns an http.Header that can be modified by the caller to
  100402. // add HTTP headers to the request.
  100403. func (c *SslCertificatesDeleteCall) Header() http.Header {
  100404. if c.header_ == nil {
  100405. c.header_ = make(http.Header)
  100406. }
  100407. return c.header_
  100408. }
  100409. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  100410. reqHeaders := make(http.Header)
  100411. for k, v := range c.header_ {
  100412. reqHeaders[k] = v
  100413. }
  100414. reqHeaders.Set("User-Agent", c.s.userAgent())
  100415. var body io.Reader = nil
  100416. c.urlParams_.Set("alt", alt)
  100417. c.urlParams_.Set("prettyPrint", "false")
  100418. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  100419. urls += "?" + c.urlParams_.Encode()
  100420. req, err := http.NewRequest("DELETE", urls, body)
  100421. if err != nil {
  100422. return nil, err
  100423. }
  100424. req.Header = reqHeaders
  100425. googleapi.Expand(req.URL, map[string]string{
  100426. "project": c.project,
  100427. "sslCertificate": c.sslCertificate,
  100428. })
  100429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100430. }
  100431. // Do executes the "compute.sslCertificates.delete" call.
  100432. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100433. // status code is an error. Response headers are in either
  100434. // *Operation.ServerResponse.Header or (if a response was returned at
  100435. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100436. // to check whether the returned error was because
  100437. // http.StatusNotModified was returned.
  100438. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100439. gensupport.SetOptions(c.urlParams_, opts...)
  100440. res, err := c.doRequest("json")
  100441. if res != nil && res.StatusCode == http.StatusNotModified {
  100442. if res.Body != nil {
  100443. res.Body.Close()
  100444. }
  100445. return nil, &googleapi.Error{
  100446. Code: res.StatusCode,
  100447. Header: res.Header,
  100448. }
  100449. }
  100450. if err != nil {
  100451. return nil, err
  100452. }
  100453. defer googleapi.CloseBody(res)
  100454. if err := googleapi.CheckResponse(res); err != nil {
  100455. return nil, err
  100456. }
  100457. ret := &Operation{
  100458. ServerResponse: googleapi.ServerResponse{
  100459. Header: res.Header,
  100460. HTTPStatusCode: res.StatusCode,
  100461. },
  100462. }
  100463. target := &ret
  100464. if err := gensupport.DecodeResponse(target, res); err != nil {
  100465. return nil, err
  100466. }
  100467. return ret, nil
  100468. // {
  100469. // "description": "Deletes the specified SslCertificate resource.",
  100470. // "httpMethod": "DELETE",
  100471. // "id": "compute.sslCertificates.delete",
  100472. // "parameterOrder": [
  100473. // "project",
  100474. // "sslCertificate"
  100475. // ],
  100476. // "parameters": {
  100477. // "project": {
  100478. // "description": "Project ID for this request.",
  100479. // "location": "path",
  100480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100481. // "required": true,
  100482. // "type": "string"
  100483. // },
  100484. // "requestId": {
  100485. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100486. // "location": "query",
  100487. // "type": "string"
  100488. // },
  100489. // "sslCertificate": {
  100490. // "description": "Name of the SslCertificate resource to delete.",
  100491. // "location": "path",
  100492. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100493. // "required": true,
  100494. // "type": "string"
  100495. // }
  100496. // },
  100497. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  100498. // "response": {
  100499. // "$ref": "Operation"
  100500. // },
  100501. // "scopes": [
  100502. // "https://www.googleapis.com/auth/cloud-platform",
  100503. // "https://www.googleapis.com/auth/compute"
  100504. // ]
  100505. // }
  100506. }
  100507. // method id "compute.sslCertificates.get":
  100508. type SslCertificatesGetCall struct {
  100509. s *Service
  100510. project string
  100511. sslCertificate string
  100512. urlParams_ gensupport.URLParams
  100513. ifNoneMatch_ string
  100514. ctx_ context.Context
  100515. header_ http.Header
  100516. }
  100517. // Get: Returns the specified SslCertificate resource. Gets a list of
  100518. // available SSL certificates by making a list() request.
  100519. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  100520. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100521. c.project = project
  100522. c.sslCertificate = sslCertificate
  100523. return c
  100524. }
  100525. // Fields allows partial responses to be retrieved. See
  100526. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100527. // for more information.
  100528. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  100529. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100530. return c
  100531. }
  100532. // IfNoneMatch sets the optional parameter which makes the operation
  100533. // fail if the object's ETag matches the given value. This is useful for
  100534. // getting updates only after the object has changed since the last
  100535. // request. Use googleapi.IsNotModified to check whether the response
  100536. // error from Do is the result of In-None-Match.
  100537. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  100538. c.ifNoneMatch_ = entityTag
  100539. return c
  100540. }
  100541. // Context sets the context to be used in this call's Do method. Any
  100542. // pending HTTP request will be aborted if the provided context is
  100543. // canceled.
  100544. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  100545. c.ctx_ = ctx
  100546. return c
  100547. }
  100548. // Header returns an http.Header that can be modified by the caller to
  100549. // add HTTP headers to the request.
  100550. func (c *SslCertificatesGetCall) Header() http.Header {
  100551. if c.header_ == nil {
  100552. c.header_ = make(http.Header)
  100553. }
  100554. return c.header_
  100555. }
  100556. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  100557. reqHeaders := make(http.Header)
  100558. for k, v := range c.header_ {
  100559. reqHeaders[k] = v
  100560. }
  100561. reqHeaders.Set("User-Agent", c.s.userAgent())
  100562. if c.ifNoneMatch_ != "" {
  100563. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100564. }
  100565. var body io.Reader = nil
  100566. c.urlParams_.Set("alt", alt)
  100567. c.urlParams_.Set("prettyPrint", "false")
  100568. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  100569. urls += "?" + c.urlParams_.Encode()
  100570. req, err := http.NewRequest("GET", urls, body)
  100571. if err != nil {
  100572. return nil, err
  100573. }
  100574. req.Header = reqHeaders
  100575. googleapi.Expand(req.URL, map[string]string{
  100576. "project": c.project,
  100577. "sslCertificate": c.sslCertificate,
  100578. })
  100579. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100580. }
  100581. // Do executes the "compute.sslCertificates.get" call.
  100582. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  100583. // status code is an error. Response headers are in either
  100584. // *SslCertificate.ServerResponse.Header or (if a response was returned
  100585. // at all) in error.(*googleapi.Error).Header. Use
  100586. // googleapi.IsNotModified to check whether the returned error was
  100587. // because http.StatusNotModified was returned.
  100588. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  100589. gensupport.SetOptions(c.urlParams_, opts...)
  100590. res, err := c.doRequest("json")
  100591. if res != nil && res.StatusCode == http.StatusNotModified {
  100592. if res.Body != nil {
  100593. res.Body.Close()
  100594. }
  100595. return nil, &googleapi.Error{
  100596. Code: res.StatusCode,
  100597. Header: res.Header,
  100598. }
  100599. }
  100600. if err != nil {
  100601. return nil, err
  100602. }
  100603. defer googleapi.CloseBody(res)
  100604. if err := googleapi.CheckResponse(res); err != nil {
  100605. return nil, err
  100606. }
  100607. ret := &SslCertificate{
  100608. ServerResponse: googleapi.ServerResponse{
  100609. Header: res.Header,
  100610. HTTPStatusCode: res.StatusCode,
  100611. },
  100612. }
  100613. target := &ret
  100614. if err := gensupport.DecodeResponse(target, res); err != nil {
  100615. return nil, err
  100616. }
  100617. return ret, nil
  100618. // {
  100619. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  100620. // "httpMethod": "GET",
  100621. // "id": "compute.sslCertificates.get",
  100622. // "parameterOrder": [
  100623. // "project",
  100624. // "sslCertificate"
  100625. // ],
  100626. // "parameters": {
  100627. // "project": {
  100628. // "description": "Project ID for this request.",
  100629. // "location": "path",
  100630. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100631. // "required": true,
  100632. // "type": "string"
  100633. // },
  100634. // "sslCertificate": {
  100635. // "description": "Name of the SslCertificate resource to return.",
  100636. // "location": "path",
  100637. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100638. // "required": true,
  100639. // "type": "string"
  100640. // }
  100641. // },
  100642. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  100643. // "response": {
  100644. // "$ref": "SslCertificate"
  100645. // },
  100646. // "scopes": [
  100647. // "https://www.googleapis.com/auth/cloud-platform",
  100648. // "https://www.googleapis.com/auth/compute",
  100649. // "https://www.googleapis.com/auth/compute.readonly"
  100650. // ]
  100651. // }
  100652. }
  100653. // method id "compute.sslCertificates.insert":
  100654. type SslCertificatesInsertCall struct {
  100655. s *Service
  100656. project string
  100657. sslcertificate *SslCertificate
  100658. urlParams_ gensupport.URLParams
  100659. ctx_ context.Context
  100660. header_ http.Header
  100661. }
  100662. // Insert: Creates a SslCertificate resource in the specified project
  100663. // using the data included in the request.
  100664. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  100665. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100666. c.project = project
  100667. c.sslcertificate = sslcertificate
  100668. return c
  100669. }
  100670. // RequestId sets the optional parameter "requestId": An optional
  100671. // request ID to identify requests. Specify a unique request ID so that
  100672. // if you must retry your request, the server will know to ignore the
  100673. // request if it has already been completed.
  100674. //
  100675. // For example, consider a situation where you make an initial request
  100676. // and the request times out. If you make the request again with the
  100677. // same request ID, the server can check if original operation with the
  100678. // same request ID was received, and if so, will ignore the second
  100679. // request. This prevents clients from accidentally creating duplicate
  100680. // commitments.
  100681. //
  100682. // The request ID must be a valid UUID with the exception that zero UUID
  100683. // is not supported (00000000-0000-0000-0000-000000000000).
  100684. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  100685. c.urlParams_.Set("requestId", requestId)
  100686. return c
  100687. }
  100688. // Fields allows partial responses to be retrieved. See
  100689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100690. // for more information.
  100691. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  100692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100693. return c
  100694. }
  100695. // Context sets the context to be used in this call's Do method. Any
  100696. // pending HTTP request will be aborted if the provided context is
  100697. // canceled.
  100698. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  100699. c.ctx_ = ctx
  100700. return c
  100701. }
  100702. // Header returns an http.Header that can be modified by the caller to
  100703. // add HTTP headers to the request.
  100704. func (c *SslCertificatesInsertCall) Header() http.Header {
  100705. if c.header_ == nil {
  100706. c.header_ = make(http.Header)
  100707. }
  100708. return c.header_
  100709. }
  100710. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  100711. reqHeaders := make(http.Header)
  100712. for k, v := range c.header_ {
  100713. reqHeaders[k] = v
  100714. }
  100715. reqHeaders.Set("User-Agent", c.s.userAgent())
  100716. var body io.Reader = nil
  100717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  100718. if err != nil {
  100719. return nil, err
  100720. }
  100721. reqHeaders.Set("Content-Type", "application/json")
  100722. c.urlParams_.Set("alt", alt)
  100723. c.urlParams_.Set("prettyPrint", "false")
  100724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  100725. urls += "?" + c.urlParams_.Encode()
  100726. req, err := http.NewRequest("POST", urls, body)
  100727. if err != nil {
  100728. return nil, err
  100729. }
  100730. req.Header = reqHeaders
  100731. googleapi.Expand(req.URL, map[string]string{
  100732. "project": c.project,
  100733. })
  100734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100735. }
  100736. // Do executes the "compute.sslCertificates.insert" call.
  100737. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100738. // status code is an error. Response headers are in either
  100739. // *Operation.ServerResponse.Header or (if a response was returned at
  100740. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100741. // to check whether the returned error was because
  100742. // http.StatusNotModified was returned.
  100743. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100744. gensupport.SetOptions(c.urlParams_, opts...)
  100745. res, err := c.doRequest("json")
  100746. if res != nil && res.StatusCode == http.StatusNotModified {
  100747. if res.Body != nil {
  100748. res.Body.Close()
  100749. }
  100750. return nil, &googleapi.Error{
  100751. Code: res.StatusCode,
  100752. Header: res.Header,
  100753. }
  100754. }
  100755. if err != nil {
  100756. return nil, err
  100757. }
  100758. defer googleapi.CloseBody(res)
  100759. if err := googleapi.CheckResponse(res); err != nil {
  100760. return nil, err
  100761. }
  100762. ret := &Operation{
  100763. ServerResponse: googleapi.ServerResponse{
  100764. Header: res.Header,
  100765. HTTPStatusCode: res.StatusCode,
  100766. },
  100767. }
  100768. target := &ret
  100769. if err := gensupport.DecodeResponse(target, res); err != nil {
  100770. return nil, err
  100771. }
  100772. return ret, nil
  100773. // {
  100774. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  100775. // "httpMethod": "POST",
  100776. // "id": "compute.sslCertificates.insert",
  100777. // "parameterOrder": [
  100778. // "project"
  100779. // ],
  100780. // "parameters": {
  100781. // "project": {
  100782. // "description": "Project ID for this request.",
  100783. // "location": "path",
  100784. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100785. // "required": true,
  100786. // "type": "string"
  100787. // },
  100788. // "requestId": {
  100789. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100790. // "location": "query",
  100791. // "type": "string"
  100792. // }
  100793. // },
  100794. // "path": "{project}/global/sslCertificates",
  100795. // "request": {
  100796. // "$ref": "SslCertificate"
  100797. // },
  100798. // "response": {
  100799. // "$ref": "Operation"
  100800. // },
  100801. // "scopes": [
  100802. // "https://www.googleapis.com/auth/cloud-platform",
  100803. // "https://www.googleapis.com/auth/compute"
  100804. // ]
  100805. // }
  100806. }
  100807. // method id "compute.sslCertificates.list":
  100808. type SslCertificatesListCall struct {
  100809. s *Service
  100810. project string
  100811. urlParams_ gensupport.URLParams
  100812. ifNoneMatch_ string
  100813. ctx_ context.Context
  100814. header_ http.Header
  100815. }
  100816. // List: Retrieves the list of SslCertificate resources available to the
  100817. // specified project.
  100818. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  100819. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100820. c.project = project
  100821. return c
  100822. }
  100823. // Filter sets the optional parameter "filter": A filter expression that
  100824. // filters resources listed in the response. The expression must specify
  100825. // the field name, a comparison operator, and the value that you want to
  100826. // use for filtering. The value must be a string, a number, or a
  100827. // boolean. The comparison operator must be either =, !=, >, or <.
  100828. //
  100829. // For example, if you are filtering Compute Engine instances, you can
  100830. // exclude instances named example-instance by specifying name !=
  100831. // example-instance.
  100832. //
  100833. // You can also filter nested fields. For example, you could specify
  100834. // scheduling.automaticRestart = false to include instances only if they
  100835. // are not scheduled for automatic restarts. You can use filtering on
  100836. // nested fields to filter based on resource labels.
  100837. //
  100838. // To filter on multiple expressions, provide each separate expression
  100839. // within parentheses. For example, (scheduling.automaticRestart = true)
  100840. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100841. // AND expression. However, you can include AND and OR expressions
  100842. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100843. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100844. // true).
  100845. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  100846. c.urlParams_.Set("filter", filter)
  100847. return c
  100848. }
  100849. // MaxResults sets the optional parameter "maxResults": The maximum
  100850. // number of results per page that should be returned. If the number of
  100851. // available results is larger than maxResults, Compute Engine returns a
  100852. // nextPageToken that can be used to get the next page of results in
  100853. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100854. // (Default: 500)
  100855. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  100856. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100857. return c
  100858. }
  100859. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  100860. // a certain order. By default, results are returned in alphanumerical
  100861. // order based on the resource name.
  100862. //
  100863. // You can also sort results in descending order based on the creation
  100864. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100865. // based on the creationTimestamp field in reverse chronological order
  100866. // (newest result first). Use this to sort resources like operations so
  100867. // that the newest operation is returned first.
  100868. //
  100869. // Currently, only sorting by name or creationTimestamp desc is
  100870. // supported.
  100871. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  100872. c.urlParams_.Set("orderBy", orderBy)
  100873. return c
  100874. }
  100875. // PageToken sets the optional parameter "pageToken": Specifies a page
  100876. // token to use. Set pageToken to the nextPageToken returned by a
  100877. // previous list request to get the next page of results.
  100878. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  100879. c.urlParams_.Set("pageToken", pageToken)
  100880. return c
  100881. }
  100882. // Fields allows partial responses to be retrieved. See
  100883. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100884. // for more information.
  100885. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  100886. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100887. return c
  100888. }
  100889. // IfNoneMatch sets the optional parameter which makes the operation
  100890. // fail if the object's ETag matches the given value. This is useful for
  100891. // getting updates only after the object has changed since the last
  100892. // request. Use googleapi.IsNotModified to check whether the response
  100893. // error from Do is the result of In-None-Match.
  100894. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  100895. c.ifNoneMatch_ = entityTag
  100896. return c
  100897. }
  100898. // Context sets the context to be used in this call's Do method. Any
  100899. // pending HTTP request will be aborted if the provided context is
  100900. // canceled.
  100901. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  100902. c.ctx_ = ctx
  100903. return c
  100904. }
  100905. // Header returns an http.Header that can be modified by the caller to
  100906. // add HTTP headers to the request.
  100907. func (c *SslCertificatesListCall) Header() http.Header {
  100908. if c.header_ == nil {
  100909. c.header_ = make(http.Header)
  100910. }
  100911. return c.header_
  100912. }
  100913. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  100914. reqHeaders := make(http.Header)
  100915. for k, v := range c.header_ {
  100916. reqHeaders[k] = v
  100917. }
  100918. reqHeaders.Set("User-Agent", c.s.userAgent())
  100919. if c.ifNoneMatch_ != "" {
  100920. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100921. }
  100922. var body io.Reader = nil
  100923. c.urlParams_.Set("alt", alt)
  100924. c.urlParams_.Set("prettyPrint", "false")
  100925. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  100926. urls += "?" + c.urlParams_.Encode()
  100927. req, err := http.NewRequest("GET", urls, body)
  100928. if err != nil {
  100929. return nil, err
  100930. }
  100931. req.Header = reqHeaders
  100932. googleapi.Expand(req.URL, map[string]string{
  100933. "project": c.project,
  100934. })
  100935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100936. }
  100937. // Do executes the "compute.sslCertificates.list" call.
  100938. // Exactly one of *SslCertificateList or error will be non-nil. Any
  100939. // non-2xx status code is an error. Response headers are in either
  100940. // *SslCertificateList.ServerResponse.Header or (if a response was
  100941. // returned at all) in error.(*googleapi.Error).Header. Use
  100942. // googleapi.IsNotModified to check whether the returned error was
  100943. // because http.StatusNotModified was returned.
  100944. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  100945. gensupport.SetOptions(c.urlParams_, opts...)
  100946. res, err := c.doRequest("json")
  100947. if res != nil && res.StatusCode == http.StatusNotModified {
  100948. if res.Body != nil {
  100949. res.Body.Close()
  100950. }
  100951. return nil, &googleapi.Error{
  100952. Code: res.StatusCode,
  100953. Header: res.Header,
  100954. }
  100955. }
  100956. if err != nil {
  100957. return nil, err
  100958. }
  100959. defer googleapi.CloseBody(res)
  100960. if err := googleapi.CheckResponse(res); err != nil {
  100961. return nil, err
  100962. }
  100963. ret := &SslCertificateList{
  100964. ServerResponse: googleapi.ServerResponse{
  100965. Header: res.Header,
  100966. HTTPStatusCode: res.StatusCode,
  100967. },
  100968. }
  100969. target := &ret
  100970. if err := gensupport.DecodeResponse(target, res); err != nil {
  100971. return nil, err
  100972. }
  100973. return ret, nil
  100974. // {
  100975. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  100976. // "httpMethod": "GET",
  100977. // "id": "compute.sslCertificates.list",
  100978. // "parameterOrder": [
  100979. // "project"
  100980. // ],
  100981. // "parameters": {
  100982. // "filter": {
  100983. // "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).",
  100984. // "location": "query",
  100985. // "type": "string"
  100986. // },
  100987. // "maxResults": {
  100988. // "default": "500",
  100989. // "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)",
  100990. // "format": "uint32",
  100991. // "location": "query",
  100992. // "minimum": "0",
  100993. // "type": "integer"
  100994. // },
  100995. // "orderBy": {
  100996. // "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.",
  100997. // "location": "query",
  100998. // "type": "string"
  100999. // },
  101000. // "pageToken": {
  101001. // "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.",
  101002. // "location": "query",
  101003. // "type": "string"
  101004. // },
  101005. // "project": {
  101006. // "description": "Project ID for this request.",
  101007. // "location": "path",
  101008. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101009. // "required": true,
  101010. // "type": "string"
  101011. // }
  101012. // },
  101013. // "path": "{project}/global/sslCertificates",
  101014. // "response": {
  101015. // "$ref": "SslCertificateList"
  101016. // },
  101017. // "scopes": [
  101018. // "https://www.googleapis.com/auth/cloud-platform",
  101019. // "https://www.googleapis.com/auth/compute",
  101020. // "https://www.googleapis.com/auth/compute.readonly"
  101021. // ]
  101022. // }
  101023. }
  101024. // Pages invokes f for each page of results.
  101025. // A non-nil error returned from f will halt the iteration.
  101026. // The provided context supersedes any context provided to the Context method.
  101027. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  101028. c.ctx_ = ctx
  101029. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  101030. for {
  101031. x, err := c.Do()
  101032. if err != nil {
  101033. return err
  101034. }
  101035. if err := f(x); err != nil {
  101036. return err
  101037. }
  101038. if x.NextPageToken == "" {
  101039. return nil
  101040. }
  101041. c.PageToken(x.NextPageToken)
  101042. }
  101043. }
  101044. // method id "compute.sslCertificates.testIamPermissions":
  101045. type SslCertificatesTestIamPermissionsCall struct {
  101046. s *Service
  101047. project string
  101048. resource string
  101049. testpermissionsrequest *TestPermissionsRequest
  101050. urlParams_ gensupport.URLParams
  101051. ctx_ context.Context
  101052. header_ http.Header
  101053. }
  101054. // TestIamPermissions: Returns permissions that a caller has on the
  101055. // specified resource.
  101056. func (r *SslCertificatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslCertificatesTestIamPermissionsCall {
  101057. c := &SslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101058. c.project = project
  101059. c.resource = resource
  101060. c.testpermissionsrequest = testpermissionsrequest
  101061. return c
  101062. }
  101063. // Fields allows partial responses to be retrieved. See
  101064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101065. // for more information.
  101066. func (c *SslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslCertificatesTestIamPermissionsCall {
  101067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101068. return c
  101069. }
  101070. // Context sets the context to be used in this call's Do method. Any
  101071. // pending HTTP request will be aborted if the provided context is
  101072. // canceled.
  101073. func (c *SslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *SslCertificatesTestIamPermissionsCall {
  101074. c.ctx_ = ctx
  101075. return c
  101076. }
  101077. // Header returns an http.Header that can be modified by the caller to
  101078. // add HTTP headers to the request.
  101079. func (c *SslCertificatesTestIamPermissionsCall) Header() http.Header {
  101080. if c.header_ == nil {
  101081. c.header_ = make(http.Header)
  101082. }
  101083. return c.header_
  101084. }
  101085. func (c *SslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  101086. reqHeaders := make(http.Header)
  101087. for k, v := range c.header_ {
  101088. reqHeaders[k] = v
  101089. }
  101090. reqHeaders.Set("User-Agent", c.s.userAgent())
  101091. var body io.Reader = nil
  101092. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  101093. if err != nil {
  101094. return nil, err
  101095. }
  101096. reqHeaders.Set("Content-Type", "application/json")
  101097. c.urlParams_.Set("alt", alt)
  101098. c.urlParams_.Set("prettyPrint", "false")
  101099. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{resource}/testIamPermissions")
  101100. urls += "?" + c.urlParams_.Encode()
  101101. req, err := http.NewRequest("POST", urls, body)
  101102. if err != nil {
  101103. return nil, err
  101104. }
  101105. req.Header = reqHeaders
  101106. googleapi.Expand(req.URL, map[string]string{
  101107. "project": c.project,
  101108. "resource": c.resource,
  101109. })
  101110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101111. }
  101112. // Do executes the "compute.sslCertificates.testIamPermissions" call.
  101113. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  101114. // non-2xx status code is an error. Response headers are in either
  101115. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  101116. // returned at all) in error.(*googleapi.Error).Header. Use
  101117. // googleapi.IsNotModified to check whether the returned error was
  101118. // because http.StatusNotModified was returned.
  101119. func (c *SslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  101120. gensupport.SetOptions(c.urlParams_, opts...)
  101121. res, err := c.doRequest("json")
  101122. if res != nil && res.StatusCode == http.StatusNotModified {
  101123. if res.Body != nil {
  101124. res.Body.Close()
  101125. }
  101126. return nil, &googleapi.Error{
  101127. Code: res.StatusCode,
  101128. Header: res.Header,
  101129. }
  101130. }
  101131. if err != nil {
  101132. return nil, err
  101133. }
  101134. defer googleapi.CloseBody(res)
  101135. if err := googleapi.CheckResponse(res); err != nil {
  101136. return nil, err
  101137. }
  101138. ret := &TestPermissionsResponse{
  101139. ServerResponse: googleapi.ServerResponse{
  101140. Header: res.Header,
  101141. HTTPStatusCode: res.StatusCode,
  101142. },
  101143. }
  101144. target := &ret
  101145. if err := gensupport.DecodeResponse(target, res); err != nil {
  101146. return nil, err
  101147. }
  101148. return ret, nil
  101149. // {
  101150. // "description": "Returns permissions that a caller has on the specified resource.",
  101151. // "httpMethod": "POST",
  101152. // "id": "compute.sslCertificates.testIamPermissions",
  101153. // "parameterOrder": [
  101154. // "project",
  101155. // "resource"
  101156. // ],
  101157. // "parameters": {
  101158. // "project": {
  101159. // "description": "Project ID for this request.",
  101160. // "location": "path",
  101161. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101162. // "required": true,
  101163. // "type": "string"
  101164. // },
  101165. // "resource": {
  101166. // "description": "Name or id of the resource for this request.",
  101167. // "location": "path",
  101168. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101169. // "required": true,
  101170. // "type": "string"
  101171. // }
  101172. // },
  101173. // "path": "{project}/global/sslCertificates/{resource}/testIamPermissions",
  101174. // "request": {
  101175. // "$ref": "TestPermissionsRequest"
  101176. // },
  101177. // "response": {
  101178. // "$ref": "TestPermissionsResponse"
  101179. // },
  101180. // "scopes": [
  101181. // "https://www.googleapis.com/auth/cloud-platform",
  101182. // "https://www.googleapis.com/auth/compute",
  101183. // "https://www.googleapis.com/auth/compute.readonly"
  101184. // ]
  101185. // }
  101186. }
  101187. // method id "compute.sslPolicies.delete":
  101188. type SslPoliciesDeleteCall struct {
  101189. s *Service
  101190. project string
  101191. sslPolicy string
  101192. urlParams_ gensupport.URLParams
  101193. ctx_ context.Context
  101194. header_ http.Header
  101195. }
  101196. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  101197. // be deleted only if it is not in use by any TargetHttpsProxy or
  101198. // TargetSslProxy resources.
  101199. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  101200. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101201. c.project = project
  101202. c.sslPolicy = sslPolicy
  101203. return c
  101204. }
  101205. // RequestId sets the optional parameter "requestId": An optional
  101206. // request ID to identify requests. Specify a unique request ID so that
  101207. // if you must retry your request, the server will know to ignore the
  101208. // request if it has already been completed.
  101209. //
  101210. // For example, consider a situation where you make an initial request
  101211. // and the request times out. If you make the request again with the
  101212. // same request ID, the server can check if original operation with the
  101213. // same request ID was received, and if so, will ignore the second
  101214. // request. This prevents clients from accidentally creating duplicate
  101215. // commitments.
  101216. //
  101217. // The request ID must be a valid UUID with the exception that zero UUID
  101218. // is not supported (00000000-0000-0000-0000-000000000000).
  101219. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  101220. c.urlParams_.Set("requestId", requestId)
  101221. return c
  101222. }
  101223. // Fields allows partial responses to be retrieved. See
  101224. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101225. // for more information.
  101226. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  101227. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101228. return c
  101229. }
  101230. // Context sets the context to be used in this call's Do method. Any
  101231. // pending HTTP request will be aborted if the provided context is
  101232. // canceled.
  101233. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  101234. c.ctx_ = ctx
  101235. return c
  101236. }
  101237. // Header returns an http.Header that can be modified by the caller to
  101238. // add HTTP headers to the request.
  101239. func (c *SslPoliciesDeleteCall) Header() http.Header {
  101240. if c.header_ == nil {
  101241. c.header_ = make(http.Header)
  101242. }
  101243. return c.header_
  101244. }
  101245. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  101246. reqHeaders := make(http.Header)
  101247. for k, v := range c.header_ {
  101248. reqHeaders[k] = v
  101249. }
  101250. reqHeaders.Set("User-Agent", c.s.userAgent())
  101251. var body io.Reader = nil
  101252. c.urlParams_.Set("alt", alt)
  101253. c.urlParams_.Set("prettyPrint", "false")
  101254. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  101255. urls += "?" + c.urlParams_.Encode()
  101256. req, err := http.NewRequest("DELETE", urls, body)
  101257. if err != nil {
  101258. return nil, err
  101259. }
  101260. req.Header = reqHeaders
  101261. googleapi.Expand(req.URL, map[string]string{
  101262. "project": c.project,
  101263. "sslPolicy": c.sslPolicy,
  101264. })
  101265. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101266. }
  101267. // Do executes the "compute.sslPolicies.delete" call.
  101268. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101269. // status code is an error. Response headers are in either
  101270. // *Operation.ServerResponse.Header or (if a response was returned at
  101271. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101272. // to check whether the returned error was because
  101273. // http.StatusNotModified was returned.
  101274. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101275. gensupport.SetOptions(c.urlParams_, opts...)
  101276. res, err := c.doRequest("json")
  101277. if res != nil && res.StatusCode == http.StatusNotModified {
  101278. if res.Body != nil {
  101279. res.Body.Close()
  101280. }
  101281. return nil, &googleapi.Error{
  101282. Code: res.StatusCode,
  101283. Header: res.Header,
  101284. }
  101285. }
  101286. if err != nil {
  101287. return nil, err
  101288. }
  101289. defer googleapi.CloseBody(res)
  101290. if err := googleapi.CheckResponse(res); err != nil {
  101291. return nil, err
  101292. }
  101293. ret := &Operation{
  101294. ServerResponse: googleapi.ServerResponse{
  101295. Header: res.Header,
  101296. HTTPStatusCode: res.StatusCode,
  101297. },
  101298. }
  101299. target := &ret
  101300. if err := gensupport.DecodeResponse(target, res); err != nil {
  101301. return nil, err
  101302. }
  101303. return ret, nil
  101304. // {
  101305. // "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.",
  101306. // "httpMethod": "DELETE",
  101307. // "id": "compute.sslPolicies.delete",
  101308. // "parameterOrder": [
  101309. // "project",
  101310. // "sslPolicy"
  101311. // ],
  101312. // "parameters": {
  101313. // "project": {
  101314. // "description": "Project ID for this request.",
  101315. // "location": "path",
  101316. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101317. // "required": true,
  101318. // "type": "string"
  101319. // },
  101320. // "requestId": {
  101321. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101322. // "location": "query",
  101323. // "type": "string"
  101324. // },
  101325. // "sslPolicy": {
  101326. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  101327. // "location": "path",
  101328. // "required": true,
  101329. // "type": "string"
  101330. // }
  101331. // },
  101332. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  101333. // "response": {
  101334. // "$ref": "Operation"
  101335. // },
  101336. // "scopes": [
  101337. // "https://www.googleapis.com/auth/cloud-platform",
  101338. // "https://www.googleapis.com/auth/compute"
  101339. // ]
  101340. // }
  101341. }
  101342. // method id "compute.sslPolicies.get":
  101343. type SslPoliciesGetCall struct {
  101344. s *Service
  101345. project string
  101346. sslPolicy string
  101347. urlParams_ gensupport.URLParams
  101348. ifNoneMatch_ string
  101349. ctx_ context.Context
  101350. header_ http.Header
  101351. }
  101352. // Get: Lists all of the ordered rules present in a single specified
  101353. // policy.
  101354. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  101355. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101356. c.project = project
  101357. c.sslPolicy = sslPolicy
  101358. return c
  101359. }
  101360. // Fields allows partial responses to be retrieved. See
  101361. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101362. // for more information.
  101363. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  101364. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101365. return c
  101366. }
  101367. // IfNoneMatch sets the optional parameter which makes the operation
  101368. // fail if the object's ETag matches the given value. This is useful for
  101369. // getting updates only after the object has changed since the last
  101370. // request. Use googleapi.IsNotModified to check whether the response
  101371. // error from Do is the result of In-None-Match.
  101372. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  101373. c.ifNoneMatch_ = entityTag
  101374. return c
  101375. }
  101376. // Context sets the context to be used in this call's Do method. Any
  101377. // pending HTTP request will be aborted if the provided context is
  101378. // canceled.
  101379. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  101380. c.ctx_ = ctx
  101381. return c
  101382. }
  101383. // Header returns an http.Header that can be modified by the caller to
  101384. // add HTTP headers to the request.
  101385. func (c *SslPoliciesGetCall) Header() http.Header {
  101386. if c.header_ == nil {
  101387. c.header_ = make(http.Header)
  101388. }
  101389. return c.header_
  101390. }
  101391. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  101392. reqHeaders := make(http.Header)
  101393. for k, v := range c.header_ {
  101394. reqHeaders[k] = v
  101395. }
  101396. reqHeaders.Set("User-Agent", c.s.userAgent())
  101397. if c.ifNoneMatch_ != "" {
  101398. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101399. }
  101400. var body io.Reader = nil
  101401. c.urlParams_.Set("alt", alt)
  101402. c.urlParams_.Set("prettyPrint", "false")
  101403. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  101404. urls += "?" + c.urlParams_.Encode()
  101405. req, err := http.NewRequest("GET", urls, body)
  101406. if err != nil {
  101407. return nil, err
  101408. }
  101409. req.Header = reqHeaders
  101410. googleapi.Expand(req.URL, map[string]string{
  101411. "project": c.project,
  101412. "sslPolicy": c.sslPolicy,
  101413. })
  101414. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101415. }
  101416. // Do executes the "compute.sslPolicies.get" call.
  101417. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  101418. // status code is an error. Response headers are in either
  101419. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  101420. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101421. // to check whether the returned error was because
  101422. // http.StatusNotModified was returned.
  101423. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  101424. gensupport.SetOptions(c.urlParams_, opts...)
  101425. res, err := c.doRequest("json")
  101426. if res != nil && res.StatusCode == http.StatusNotModified {
  101427. if res.Body != nil {
  101428. res.Body.Close()
  101429. }
  101430. return nil, &googleapi.Error{
  101431. Code: res.StatusCode,
  101432. Header: res.Header,
  101433. }
  101434. }
  101435. if err != nil {
  101436. return nil, err
  101437. }
  101438. defer googleapi.CloseBody(res)
  101439. if err := googleapi.CheckResponse(res); err != nil {
  101440. return nil, err
  101441. }
  101442. ret := &SslPolicy{
  101443. ServerResponse: googleapi.ServerResponse{
  101444. Header: res.Header,
  101445. HTTPStatusCode: res.StatusCode,
  101446. },
  101447. }
  101448. target := &ret
  101449. if err := gensupport.DecodeResponse(target, res); err != nil {
  101450. return nil, err
  101451. }
  101452. return ret, nil
  101453. // {
  101454. // "description": "Lists all of the ordered rules present in a single specified policy.",
  101455. // "httpMethod": "GET",
  101456. // "id": "compute.sslPolicies.get",
  101457. // "parameterOrder": [
  101458. // "project",
  101459. // "sslPolicy"
  101460. // ],
  101461. // "parameters": {
  101462. // "project": {
  101463. // "description": "Project ID for this request.",
  101464. // "location": "path",
  101465. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101466. // "required": true,
  101467. // "type": "string"
  101468. // },
  101469. // "sslPolicy": {
  101470. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  101471. // "location": "path",
  101472. // "required": true,
  101473. // "type": "string"
  101474. // }
  101475. // },
  101476. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  101477. // "response": {
  101478. // "$ref": "SslPolicy"
  101479. // },
  101480. // "scopes": [
  101481. // "https://www.googleapis.com/auth/cloud-platform",
  101482. // "https://www.googleapis.com/auth/compute",
  101483. // "https://www.googleapis.com/auth/compute.readonly"
  101484. // ]
  101485. // }
  101486. }
  101487. // method id "compute.sslPolicies.insert":
  101488. type SslPoliciesInsertCall struct {
  101489. s *Service
  101490. project string
  101491. sslpolicy *SslPolicy
  101492. urlParams_ gensupport.URLParams
  101493. ctx_ context.Context
  101494. header_ http.Header
  101495. }
  101496. // Insert: Returns the specified SSL policy resource. Gets a list of
  101497. // available SSL policies by making a list() request.
  101498. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  101499. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101500. c.project = project
  101501. c.sslpolicy = sslpolicy
  101502. return c
  101503. }
  101504. // RequestId sets the optional parameter "requestId": An optional
  101505. // request ID to identify requests. Specify a unique request ID so that
  101506. // if you must retry your request, the server will know to ignore the
  101507. // request if it has already been completed.
  101508. //
  101509. // For example, consider a situation where you make an initial request
  101510. // and the request times out. If you make the request again with the
  101511. // same request ID, the server can check if original operation with the
  101512. // same request ID was received, and if so, will ignore the second
  101513. // request. This prevents clients from accidentally creating duplicate
  101514. // commitments.
  101515. //
  101516. // The request ID must be a valid UUID with the exception that zero UUID
  101517. // is not supported (00000000-0000-0000-0000-000000000000).
  101518. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  101519. c.urlParams_.Set("requestId", requestId)
  101520. return c
  101521. }
  101522. // Fields allows partial responses to be retrieved. See
  101523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101524. // for more information.
  101525. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  101526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101527. return c
  101528. }
  101529. // Context sets the context to be used in this call's Do method. Any
  101530. // pending HTTP request will be aborted if the provided context is
  101531. // canceled.
  101532. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  101533. c.ctx_ = ctx
  101534. return c
  101535. }
  101536. // Header returns an http.Header that can be modified by the caller to
  101537. // add HTTP headers to the request.
  101538. func (c *SslPoliciesInsertCall) Header() http.Header {
  101539. if c.header_ == nil {
  101540. c.header_ = make(http.Header)
  101541. }
  101542. return c.header_
  101543. }
  101544. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  101545. reqHeaders := make(http.Header)
  101546. for k, v := range c.header_ {
  101547. reqHeaders[k] = v
  101548. }
  101549. reqHeaders.Set("User-Agent", c.s.userAgent())
  101550. var body io.Reader = nil
  101551. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  101552. if err != nil {
  101553. return nil, err
  101554. }
  101555. reqHeaders.Set("Content-Type", "application/json")
  101556. c.urlParams_.Set("alt", alt)
  101557. c.urlParams_.Set("prettyPrint", "false")
  101558. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  101559. urls += "?" + c.urlParams_.Encode()
  101560. req, err := http.NewRequest("POST", urls, body)
  101561. if err != nil {
  101562. return nil, err
  101563. }
  101564. req.Header = reqHeaders
  101565. googleapi.Expand(req.URL, map[string]string{
  101566. "project": c.project,
  101567. })
  101568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101569. }
  101570. // Do executes the "compute.sslPolicies.insert" call.
  101571. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101572. // status code is an error. Response headers are in either
  101573. // *Operation.ServerResponse.Header or (if a response was returned at
  101574. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101575. // to check whether the returned error was because
  101576. // http.StatusNotModified was returned.
  101577. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101578. gensupport.SetOptions(c.urlParams_, opts...)
  101579. res, err := c.doRequest("json")
  101580. if res != nil && res.StatusCode == http.StatusNotModified {
  101581. if res.Body != nil {
  101582. res.Body.Close()
  101583. }
  101584. return nil, &googleapi.Error{
  101585. Code: res.StatusCode,
  101586. Header: res.Header,
  101587. }
  101588. }
  101589. if err != nil {
  101590. return nil, err
  101591. }
  101592. defer googleapi.CloseBody(res)
  101593. if err := googleapi.CheckResponse(res); err != nil {
  101594. return nil, err
  101595. }
  101596. ret := &Operation{
  101597. ServerResponse: googleapi.ServerResponse{
  101598. Header: res.Header,
  101599. HTTPStatusCode: res.StatusCode,
  101600. },
  101601. }
  101602. target := &ret
  101603. if err := gensupport.DecodeResponse(target, res); err != nil {
  101604. return nil, err
  101605. }
  101606. return ret, nil
  101607. // {
  101608. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  101609. // "httpMethod": "POST",
  101610. // "id": "compute.sslPolicies.insert",
  101611. // "parameterOrder": [
  101612. // "project"
  101613. // ],
  101614. // "parameters": {
  101615. // "project": {
  101616. // "description": "Project ID for this request.",
  101617. // "location": "path",
  101618. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101619. // "required": true,
  101620. // "type": "string"
  101621. // },
  101622. // "requestId": {
  101623. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101624. // "location": "query",
  101625. // "type": "string"
  101626. // }
  101627. // },
  101628. // "path": "{project}/global/sslPolicies",
  101629. // "request": {
  101630. // "$ref": "SslPolicy"
  101631. // },
  101632. // "response": {
  101633. // "$ref": "Operation"
  101634. // },
  101635. // "scopes": [
  101636. // "https://www.googleapis.com/auth/cloud-platform",
  101637. // "https://www.googleapis.com/auth/compute"
  101638. // ]
  101639. // }
  101640. }
  101641. // method id "compute.sslPolicies.list":
  101642. type SslPoliciesListCall struct {
  101643. s *Service
  101644. project string
  101645. urlParams_ gensupport.URLParams
  101646. ifNoneMatch_ string
  101647. ctx_ context.Context
  101648. header_ http.Header
  101649. }
  101650. // List: Lists all the SSL policies that have been configured for the
  101651. // specified project.
  101652. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  101653. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101654. c.project = project
  101655. return c
  101656. }
  101657. // Filter sets the optional parameter "filter": A filter expression that
  101658. // filters resources listed in the response. The expression must specify
  101659. // the field name, a comparison operator, and the value that you want to
  101660. // use for filtering. The value must be a string, a number, or a
  101661. // boolean. The comparison operator must be either =, !=, >, or <.
  101662. //
  101663. // For example, if you are filtering Compute Engine instances, you can
  101664. // exclude instances named example-instance by specifying name !=
  101665. // example-instance.
  101666. //
  101667. // You can also filter nested fields. For example, you could specify
  101668. // scheduling.automaticRestart = false to include instances only if they
  101669. // are not scheduled for automatic restarts. You can use filtering on
  101670. // nested fields to filter based on resource labels.
  101671. //
  101672. // To filter on multiple expressions, provide each separate expression
  101673. // within parentheses. For example, (scheduling.automaticRestart = true)
  101674. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  101675. // AND expression. However, you can include AND and OR expressions
  101676. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  101677. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  101678. // true).
  101679. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  101680. c.urlParams_.Set("filter", filter)
  101681. return c
  101682. }
  101683. // MaxResults sets the optional parameter "maxResults": The maximum
  101684. // number of results per page that should be returned. If the number of
  101685. // available results is larger than maxResults, Compute Engine returns a
  101686. // nextPageToken that can be used to get the next page of results in
  101687. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  101688. // (Default: 500)
  101689. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  101690. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  101691. return c
  101692. }
  101693. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  101694. // a certain order. By default, results are returned in alphanumerical
  101695. // order based on the resource name.
  101696. //
  101697. // You can also sort results in descending order based on the creation
  101698. // timestamp using orderBy="creationTimestamp desc". This sorts results
  101699. // based on the creationTimestamp field in reverse chronological order
  101700. // (newest result first). Use this to sort resources like operations so
  101701. // that the newest operation is returned first.
  101702. //
  101703. // Currently, only sorting by name or creationTimestamp desc is
  101704. // supported.
  101705. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  101706. c.urlParams_.Set("orderBy", orderBy)
  101707. return c
  101708. }
  101709. // PageToken sets the optional parameter "pageToken": Specifies a page
  101710. // token to use. Set pageToken to the nextPageToken returned by a
  101711. // previous list request to get the next page of results.
  101712. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  101713. c.urlParams_.Set("pageToken", pageToken)
  101714. return c
  101715. }
  101716. // Fields allows partial responses to be retrieved. See
  101717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101718. // for more information.
  101719. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  101720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101721. return c
  101722. }
  101723. // IfNoneMatch sets the optional parameter which makes the operation
  101724. // fail if the object's ETag matches the given value. This is useful for
  101725. // getting updates only after the object has changed since the last
  101726. // request. Use googleapi.IsNotModified to check whether the response
  101727. // error from Do is the result of In-None-Match.
  101728. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  101729. c.ifNoneMatch_ = entityTag
  101730. return c
  101731. }
  101732. // Context sets the context to be used in this call's Do method. Any
  101733. // pending HTTP request will be aborted if the provided context is
  101734. // canceled.
  101735. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  101736. c.ctx_ = ctx
  101737. return c
  101738. }
  101739. // Header returns an http.Header that can be modified by the caller to
  101740. // add HTTP headers to the request.
  101741. func (c *SslPoliciesListCall) Header() http.Header {
  101742. if c.header_ == nil {
  101743. c.header_ = make(http.Header)
  101744. }
  101745. return c.header_
  101746. }
  101747. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  101748. reqHeaders := make(http.Header)
  101749. for k, v := range c.header_ {
  101750. reqHeaders[k] = v
  101751. }
  101752. reqHeaders.Set("User-Agent", c.s.userAgent())
  101753. if c.ifNoneMatch_ != "" {
  101754. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101755. }
  101756. var body io.Reader = nil
  101757. c.urlParams_.Set("alt", alt)
  101758. c.urlParams_.Set("prettyPrint", "false")
  101759. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  101760. urls += "?" + c.urlParams_.Encode()
  101761. req, err := http.NewRequest("GET", urls, body)
  101762. if err != nil {
  101763. return nil, err
  101764. }
  101765. req.Header = reqHeaders
  101766. googleapi.Expand(req.URL, map[string]string{
  101767. "project": c.project,
  101768. })
  101769. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101770. }
  101771. // Do executes the "compute.sslPolicies.list" call.
  101772. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  101773. // status code is an error. Response headers are in either
  101774. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  101775. // at all) in error.(*googleapi.Error).Header. Use
  101776. // googleapi.IsNotModified to check whether the returned error was
  101777. // because http.StatusNotModified was returned.
  101778. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  101779. gensupport.SetOptions(c.urlParams_, opts...)
  101780. res, err := c.doRequest("json")
  101781. if res != nil && res.StatusCode == http.StatusNotModified {
  101782. if res.Body != nil {
  101783. res.Body.Close()
  101784. }
  101785. return nil, &googleapi.Error{
  101786. Code: res.StatusCode,
  101787. Header: res.Header,
  101788. }
  101789. }
  101790. if err != nil {
  101791. return nil, err
  101792. }
  101793. defer googleapi.CloseBody(res)
  101794. if err := googleapi.CheckResponse(res); err != nil {
  101795. return nil, err
  101796. }
  101797. ret := &SslPoliciesList{
  101798. ServerResponse: googleapi.ServerResponse{
  101799. Header: res.Header,
  101800. HTTPStatusCode: res.StatusCode,
  101801. },
  101802. }
  101803. target := &ret
  101804. if err := gensupport.DecodeResponse(target, res); err != nil {
  101805. return nil, err
  101806. }
  101807. return ret, nil
  101808. // {
  101809. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  101810. // "httpMethod": "GET",
  101811. // "id": "compute.sslPolicies.list",
  101812. // "parameterOrder": [
  101813. // "project"
  101814. // ],
  101815. // "parameters": {
  101816. // "filter": {
  101817. // "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).",
  101818. // "location": "query",
  101819. // "type": "string"
  101820. // },
  101821. // "maxResults": {
  101822. // "default": "500",
  101823. // "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)",
  101824. // "format": "uint32",
  101825. // "location": "query",
  101826. // "minimum": "0",
  101827. // "type": "integer"
  101828. // },
  101829. // "orderBy": {
  101830. // "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.",
  101831. // "location": "query",
  101832. // "type": "string"
  101833. // },
  101834. // "pageToken": {
  101835. // "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.",
  101836. // "location": "query",
  101837. // "type": "string"
  101838. // },
  101839. // "project": {
  101840. // "description": "Project ID for this request.",
  101841. // "location": "path",
  101842. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101843. // "required": true,
  101844. // "type": "string"
  101845. // }
  101846. // },
  101847. // "path": "{project}/global/sslPolicies",
  101848. // "response": {
  101849. // "$ref": "SslPoliciesList"
  101850. // },
  101851. // "scopes": [
  101852. // "https://www.googleapis.com/auth/cloud-platform",
  101853. // "https://www.googleapis.com/auth/compute",
  101854. // "https://www.googleapis.com/auth/compute.readonly"
  101855. // ]
  101856. // }
  101857. }
  101858. // Pages invokes f for each page of results.
  101859. // A non-nil error returned from f will halt the iteration.
  101860. // The provided context supersedes any context provided to the Context method.
  101861. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  101862. c.ctx_ = ctx
  101863. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  101864. for {
  101865. x, err := c.Do()
  101866. if err != nil {
  101867. return err
  101868. }
  101869. if err := f(x); err != nil {
  101870. return err
  101871. }
  101872. if x.NextPageToken == "" {
  101873. return nil
  101874. }
  101875. c.PageToken(x.NextPageToken)
  101876. }
  101877. }
  101878. // method id "compute.sslPolicies.listAvailableFeatures":
  101879. type SslPoliciesListAvailableFeaturesCall struct {
  101880. s *Service
  101881. project string
  101882. urlParams_ gensupport.URLParams
  101883. ifNoneMatch_ string
  101884. ctx_ context.Context
  101885. header_ http.Header
  101886. }
  101887. // ListAvailableFeatures: Lists all features that can be specified in
  101888. // the SSL policy when using custom profile.
  101889. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  101890. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101891. c.project = project
  101892. return c
  101893. }
  101894. // Filter sets the optional parameter "filter": A filter expression that
  101895. // filters resources listed in the response. The expression must specify
  101896. // the field name, a comparison operator, and the value that you want to
  101897. // use for filtering. The value must be a string, a number, or a
  101898. // boolean. The comparison operator must be either =, !=, >, or <.
  101899. //
  101900. // For example, if you are filtering Compute Engine instances, you can
  101901. // exclude instances named example-instance by specifying name !=
  101902. // example-instance.
  101903. //
  101904. // You can also filter nested fields. For example, you could specify
  101905. // scheduling.automaticRestart = false to include instances only if they
  101906. // are not scheduled for automatic restarts. You can use filtering on
  101907. // nested fields to filter based on resource labels.
  101908. //
  101909. // To filter on multiple expressions, provide each separate expression
  101910. // within parentheses. For example, (scheduling.automaticRestart = true)
  101911. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  101912. // AND expression. However, you can include AND and OR expressions
  101913. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  101914. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  101915. // true).
  101916. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  101917. c.urlParams_.Set("filter", filter)
  101918. return c
  101919. }
  101920. // MaxResults sets the optional parameter "maxResults": The maximum
  101921. // number of results per page that should be returned. If the number of
  101922. // available results is larger than maxResults, Compute Engine returns a
  101923. // nextPageToken that can be used to get the next page of results in
  101924. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  101925. // (Default: 500)
  101926. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  101927. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  101928. return c
  101929. }
  101930. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  101931. // a certain order. By default, results are returned in alphanumerical
  101932. // order based on the resource name.
  101933. //
  101934. // You can also sort results in descending order based on the creation
  101935. // timestamp using orderBy="creationTimestamp desc". This sorts results
  101936. // based on the creationTimestamp field in reverse chronological order
  101937. // (newest result first). Use this to sort resources like operations so
  101938. // that the newest operation is returned first.
  101939. //
  101940. // Currently, only sorting by name or creationTimestamp desc is
  101941. // supported.
  101942. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  101943. c.urlParams_.Set("orderBy", orderBy)
  101944. return c
  101945. }
  101946. // PageToken sets the optional parameter "pageToken": Specifies a page
  101947. // token to use. Set pageToken to the nextPageToken returned by a
  101948. // previous list request to get the next page of results.
  101949. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  101950. c.urlParams_.Set("pageToken", pageToken)
  101951. return c
  101952. }
  101953. // Fields allows partial responses to be retrieved. See
  101954. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101955. // for more information.
  101956. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  101957. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101958. return c
  101959. }
  101960. // IfNoneMatch sets the optional parameter which makes the operation
  101961. // fail if the object's ETag matches the given value. This is useful for
  101962. // getting updates only after the object has changed since the last
  101963. // request. Use googleapi.IsNotModified to check whether the response
  101964. // error from Do is the result of In-None-Match.
  101965. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  101966. c.ifNoneMatch_ = entityTag
  101967. return c
  101968. }
  101969. // Context sets the context to be used in this call's Do method. Any
  101970. // pending HTTP request will be aborted if the provided context is
  101971. // canceled.
  101972. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  101973. c.ctx_ = ctx
  101974. return c
  101975. }
  101976. // Header returns an http.Header that can be modified by the caller to
  101977. // add HTTP headers to the request.
  101978. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  101979. if c.header_ == nil {
  101980. c.header_ = make(http.Header)
  101981. }
  101982. return c.header_
  101983. }
  101984. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  101985. reqHeaders := make(http.Header)
  101986. for k, v := range c.header_ {
  101987. reqHeaders[k] = v
  101988. }
  101989. reqHeaders.Set("User-Agent", c.s.userAgent())
  101990. if c.ifNoneMatch_ != "" {
  101991. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101992. }
  101993. var body io.Reader = nil
  101994. c.urlParams_.Set("alt", alt)
  101995. c.urlParams_.Set("prettyPrint", "false")
  101996. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  101997. urls += "?" + c.urlParams_.Encode()
  101998. req, err := http.NewRequest("GET", urls, body)
  101999. if err != nil {
  102000. return nil, err
  102001. }
  102002. req.Header = reqHeaders
  102003. googleapi.Expand(req.URL, map[string]string{
  102004. "project": c.project,
  102005. })
  102006. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102007. }
  102008. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  102009. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  102010. // will be non-nil. Any non-2xx status code is an error. Response
  102011. // headers are in either
  102012. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  102013. // (if a response was returned at all) in
  102014. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  102015. // whether the returned error was because http.StatusNotModified was
  102016. // returned.
  102017. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  102018. gensupport.SetOptions(c.urlParams_, opts...)
  102019. res, err := c.doRequest("json")
  102020. if res != nil && res.StatusCode == http.StatusNotModified {
  102021. if res.Body != nil {
  102022. res.Body.Close()
  102023. }
  102024. return nil, &googleapi.Error{
  102025. Code: res.StatusCode,
  102026. Header: res.Header,
  102027. }
  102028. }
  102029. if err != nil {
  102030. return nil, err
  102031. }
  102032. defer googleapi.CloseBody(res)
  102033. if err := googleapi.CheckResponse(res); err != nil {
  102034. return nil, err
  102035. }
  102036. ret := &SslPoliciesListAvailableFeaturesResponse{
  102037. ServerResponse: googleapi.ServerResponse{
  102038. Header: res.Header,
  102039. HTTPStatusCode: res.StatusCode,
  102040. },
  102041. }
  102042. target := &ret
  102043. if err := gensupport.DecodeResponse(target, res); err != nil {
  102044. return nil, err
  102045. }
  102046. return ret, nil
  102047. // {
  102048. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  102049. // "httpMethod": "GET",
  102050. // "id": "compute.sslPolicies.listAvailableFeatures",
  102051. // "parameterOrder": [
  102052. // "project"
  102053. // ],
  102054. // "parameters": {
  102055. // "filter": {
  102056. // "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).",
  102057. // "location": "query",
  102058. // "type": "string"
  102059. // },
  102060. // "maxResults": {
  102061. // "default": "500",
  102062. // "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)",
  102063. // "format": "uint32",
  102064. // "location": "query",
  102065. // "minimum": "0",
  102066. // "type": "integer"
  102067. // },
  102068. // "orderBy": {
  102069. // "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.",
  102070. // "location": "query",
  102071. // "type": "string"
  102072. // },
  102073. // "pageToken": {
  102074. // "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.",
  102075. // "location": "query",
  102076. // "type": "string"
  102077. // },
  102078. // "project": {
  102079. // "description": "Project ID for this request.",
  102080. // "location": "path",
  102081. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102082. // "required": true,
  102083. // "type": "string"
  102084. // }
  102085. // },
  102086. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  102087. // "response": {
  102088. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  102089. // },
  102090. // "scopes": [
  102091. // "https://www.googleapis.com/auth/cloud-platform",
  102092. // "https://www.googleapis.com/auth/compute",
  102093. // "https://www.googleapis.com/auth/compute.readonly"
  102094. // ]
  102095. // }
  102096. }
  102097. // method id "compute.sslPolicies.patch":
  102098. type SslPoliciesPatchCall struct {
  102099. s *Service
  102100. project string
  102101. sslPolicy string
  102102. sslpolicy *SslPolicy
  102103. urlParams_ gensupport.URLParams
  102104. ctx_ context.Context
  102105. header_ http.Header
  102106. }
  102107. // Patch: Patches the specified SSL policy with the data included in the
  102108. // request.
  102109. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  102110. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102111. c.project = project
  102112. c.sslPolicy = sslPolicy
  102113. c.sslpolicy = sslpolicy
  102114. return c
  102115. }
  102116. // RequestId sets the optional parameter "requestId": An optional
  102117. // request ID to identify requests. Specify a unique request ID so that
  102118. // if you must retry your request, the server will know to ignore the
  102119. // request if it has already been completed.
  102120. //
  102121. // For example, consider a situation where you make an initial request
  102122. // and the request times out. If you make the request again with the
  102123. // same request ID, the server can check if original operation with the
  102124. // same request ID was received, and if so, will ignore the second
  102125. // request. This prevents clients from accidentally creating duplicate
  102126. // commitments.
  102127. //
  102128. // The request ID must be a valid UUID with the exception that zero UUID
  102129. // is not supported (00000000-0000-0000-0000-000000000000).
  102130. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  102131. c.urlParams_.Set("requestId", requestId)
  102132. return c
  102133. }
  102134. // Fields allows partial responses to be retrieved. See
  102135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102136. // for more information.
  102137. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  102138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102139. return c
  102140. }
  102141. // Context sets the context to be used in this call's Do method. Any
  102142. // pending HTTP request will be aborted if the provided context is
  102143. // canceled.
  102144. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  102145. c.ctx_ = ctx
  102146. return c
  102147. }
  102148. // Header returns an http.Header that can be modified by the caller to
  102149. // add HTTP headers to the request.
  102150. func (c *SslPoliciesPatchCall) Header() http.Header {
  102151. if c.header_ == nil {
  102152. c.header_ = make(http.Header)
  102153. }
  102154. return c.header_
  102155. }
  102156. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  102157. reqHeaders := make(http.Header)
  102158. for k, v := range c.header_ {
  102159. reqHeaders[k] = v
  102160. }
  102161. reqHeaders.Set("User-Agent", c.s.userAgent())
  102162. var body io.Reader = nil
  102163. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  102164. if err != nil {
  102165. return nil, err
  102166. }
  102167. reqHeaders.Set("Content-Type", "application/json")
  102168. c.urlParams_.Set("alt", alt)
  102169. c.urlParams_.Set("prettyPrint", "false")
  102170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  102171. urls += "?" + c.urlParams_.Encode()
  102172. req, err := http.NewRequest("PATCH", urls, body)
  102173. if err != nil {
  102174. return nil, err
  102175. }
  102176. req.Header = reqHeaders
  102177. googleapi.Expand(req.URL, map[string]string{
  102178. "project": c.project,
  102179. "sslPolicy": c.sslPolicy,
  102180. })
  102181. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102182. }
  102183. // Do executes the "compute.sslPolicies.patch" call.
  102184. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102185. // status code is an error. Response headers are in either
  102186. // *Operation.ServerResponse.Header or (if a response was returned at
  102187. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102188. // to check whether the returned error was because
  102189. // http.StatusNotModified was returned.
  102190. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102191. gensupport.SetOptions(c.urlParams_, opts...)
  102192. res, err := c.doRequest("json")
  102193. if res != nil && res.StatusCode == http.StatusNotModified {
  102194. if res.Body != nil {
  102195. res.Body.Close()
  102196. }
  102197. return nil, &googleapi.Error{
  102198. Code: res.StatusCode,
  102199. Header: res.Header,
  102200. }
  102201. }
  102202. if err != nil {
  102203. return nil, err
  102204. }
  102205. defer googleapi.CloseBody(res)
  102206. if err := googleapi.CheckResponse(res); err != nil {
  102207. return nil, err
  102208. }
  102209. ret := &Operation{
  102210. ServerResponse: googleapi.ServerResponse{
  102211. Header: res.Header,
  102212. HTTPStatusCode: res.StatusCode,
  102213. },
  102214. }
  102215. target := &ret
  102216. if err := gensupport.DecodeResponse(target, res); err != nil {
  102217. return nil, err
  102218. }
  102219. return ret, nil
  102220. // {
  102221. // "description": "Patches the specified SSL policy with the data included in the request.",
  102222. // "httpMethod": "PATCH",
  102223. // "id": "compute.sslPolicies.patch",
  102224. // "parameterOrder": [
  102225. // "project",
  102226. // "sslPolicy"
  102227. // ],
  102228. // "parameters": {
  102229. // "project": {
  102230. // "description": "Project ID for this request.",
  102231. // "location": "path",
  102232. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102233. // "required": true,
  102234. // "type": "string"
  102235. // },
  102236. // "requestId": {
  102237. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102238. // "location": "query",
  102239. // "type": "string"
  102240. // },
  102241. // "sslPolicy": {
  102242. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  102243. // "location": "path",
  102244. // "required": true,
  102245. // "type": "string"
  102246. // }
  102247. // },
  102248. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  102249. // "request": {
  102250. // "$ref": "SslPolicy"
  102251. // },
  102252. // "response": {
  102253. // "$ref": "Operation"
  102254. // },
  102255. // "scopes": [
  102256. // "https://www.googleapis.com/auth/cloud-platform",
  102257. // "https://www.googleapis.com/auth/compute"
  102258. // ]
  102259. // }
  102260. }
  102261. // method id "compute.sslPolicies.testIamPermissions":
  102262. type SslPoliciesTestIamPermissionsCall struct {
  102263. s *Service
  102264. project string
  102265. resource string
  102266. testpermissionsrequest *TestPermissionsRequest
  102267. urlParams_ gensupport.URLParams
  102268. ctx_ context.Context
  102269. header_ http.Header
  102270. }
  102271. // TestIamPermissions: Returns permissions that a caller has on the
  102272. // specified resource.
  102273. func (r *SslPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslPoliciesTestIamPermissionsCall {
  102274. c := &SslPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102275. c.project = project
  102276. c.resource = resource
  102277. c.testpermissionsrequest = testpermissionsrequest
  102278. return c
  102279. }
  102280. // Fields allows partial responses to be retrieved. See
  102281. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102282. // for more information.
  102283. func (c *SslPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslPoliciesTestIamPermissionsCall {
  102284. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102285. return c
  102286. }
  102287. // Context sets the context to be used in this call's Do method. Any
  102288. // pending HTTP request will be aborted if the provided context is
  102289. // canceled.
  102290. func (c *SslPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SslPoliciesTestIamPermissionsCall {
  102291. c.ctx_ = ctx
  102292. return c
  102293. }
  102294. // Header returns an http.Header that can be modified by the caller to
  102295. // add HTTP headers to the request.
  102296. func (c *SslPoliciesTestIamPermissionsCall) Header() http.Header {
  102297. if c.header_ == nil {
  102298. c.header_ = make(http.Header)
  102299. }
  102300. return c.header_
  102301. }
  102302. func (c *SslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  102303. reqHeaders := make(http.Header)
  102304. for k, v := range c.header_ {
  102305. reqHeaders[k] = v
  102306. }
  102307. reqHeaders.Set("User-Agent", c.s.userAgent())
  102308. var body io.Reader = nil
  102309. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  102310. if err != nil {
  102311. return nil, err
  102312. }
  102313. reqHeaders.Set("Content-Type", "application/json")
  102314. c.urlParams_.Set("alt", alt)
  102315. c.urlParams_.Set("prettyPrint", "false")
  102316. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{resource}/testIamPermissions")
  102317. urls += "?" + c.urlParams_.Encode()
  102318. req, err := http.NewRequest("POST", urls, body)
  102319. if err != nil {
  102320. return nil, err
  102321. }
  102322. req.Header = reqHeaders
  102323. googleapi.Expand(req.URL, map[string]string{
  102324. "project": c.project,
  102325. "resource": c.resource,
  102326. })
  102327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102328. }
  102329. // Do executes the "compute.sslPolicies.testIamPermissions" call.
  102330. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  102331. // non-2xx status code is an error. Response headers are in either
  102332. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  102333. // returned at all) in error.(*googleapi.Error).Header. Use
  102334. // googleapi.IsNotModified to check whether the returned error was
  102335. // because http.StatusNotModified was returned.
  102336. func (c *SslPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  102337. gensupport.SetOptions(c.urlParams_, opts...)
  102338. res, err := c.doRequest("json")
  102339. if res != nil && res.StatusCode == http.StatusNotModified {
  102340. if res.Body != nil {
  102341. res.Body.Close()
  102342. }
  102343. return nil, &googleapi.Error{
  102344. Code: res.StatusCode,
  102345. Header: res.Header,
  102346. }
  102347. }
  102348. if err != nil {
  102349. return nil, err
  102350. }
  102351. defer googleapi.CloseBody(res)
  102352. if err := googleapi.CheckResponse(res); err != nil {
  102353. return nil, err
  102354. }
  102355. ret := &TestPermissionsResponse{
  102356. ServerResponse: googleapi.ServerResponse{
  102357. Header: res.Header,
  102358. HTTPStatusCode: res.StatusCode,
  102359. },
  102360. }
  102361. target := &ret
  102362. if err := gensupport.DecodeResponse(target, res); err != nil {
  102363. return nil, err
  102364. }
  102365. return ret, nil
  102366. // {
  102367. // "description": "Returns permissions that a caller has on the specified resource.",
  102368. // "httpMethod": "POST",
  102369. // "id": "compute.sslPolicies.testIamPermissions",
  102370. // "parameterOrder": [
  102371. // "project",
  102372. // "resource"
  102373. // ],
  102374. // "parameters": {
  102375. // "project": {
  102376. // "description": "Project ID for this request.",
  102377. // "location": "path",
  102378. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102379. // "required": true,
  102380. // "type": "string"
  102381. // },
  102382. // "resource": {
  102383. // "description": "Name or id of the resource for this request.",
  102384. // "location": "path",
  102385. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102386. // "required": true,
  102387. // "type": "string"
  102388. // }
  102389. // },
  102390. // "path": "{project}/global/sslPolicies/{resource}/testIamPermissions",
  102391. // "request": {
  102392. // "$ref": "TestPermissionsRequest"
  102393. // },
  102394. // "response": {
  102395. // "$ref": "TestPermissionsResponse"
  102396. // },
  102397. // "scopes": [
  102398. // "https://www.googleapis.com/auth/cloud-platform",
  102399. // "https://www.googleapis.com/auth/compute",
  102400. // "https://www.googleapis.com/auth/compute.readonly"
  102401. // ]
  102402. // }
  102403. }
  102404. // method id "compute.subnetworks.aggregatedList":
  102405. type SubnetworksAggregatedListCall struct {
  102406. s *Service
  102407. project string
  102408. urlParams_ gensupport.URLParams
  102409. ifNoneMatch_ string
  102410. ctx_ context.Context
  102411. header_ http.Header
  102412. }
  102413. // AggregatedList: Retrieves an aggregated list of subnetworks.
  102414. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  102415. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102416. c.project = project
  102417. return c
  102418. }
  102419. // Filter sets the optional parameter "filter": A filter expression that
  102420. // filters resources listed in the response. The expression must specify
  102421. // the field name, a comparison operator, and the value that you want to
  102422. // use for filtering. The value must be a string, a number, or a
  102423. // boolean. The comparison operator must be either =, !=, >, or <.
  102424. //
  102425. // For example, if you are filtering Compute Engine instances, you can
  102426. // exclude instances named example-instance by specifying name !=
  102427. // example-instance.
  102428. //
  102429. // You can also filter nested fields. For example, you could specify
  102430. // scheduling.automaticRestart = false to include instances only if they
  102431. // are not scheduled for automatic restarts. You can use filtering on
  102432. // nested fields to filter based on resource labels.
  102433. //
  102434. // To filter on multiple expressions, provide each separate expression
  102435. // within parentheses. For example, (scheduling.automaticRestart = true)
  102436. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  102437. // AND expression. However, you can include AND and OR expressions
  102438. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  102439. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  102440. // true).
  102441. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  102442. c.urlParams_.Set("filter", filter)
  102443. return c
  102444. }
  102445. // MaxResults sets the optional parameter "maxResults": The maximum
  102446. // number of results per page that should be returned. If the number of
  102447. // available results is larger than maxResults, Compute Engine returns a
  102448. // nextPageToken that can be used to get the next page of results in
  102449. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  102450. // (Default: 500)
  102451. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  102452. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  102453. return c
  102454. }
  102455. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  102456. // a certain order. By default, results are returned in alphanumerical
  102457. // order based on the resource name.
  102458. //
  102459. // You can also sort results in descending order based on the creation
  102460. // timestamp using orderBy="creationTimestamp desc". This sorts results
  102461. // based on the creationTimestamp field in reverse chronological order
  102462. // (newest result first). Use this to sort resources like operations so
  102463. // that the newest operation is returned first.
  102464. //
  102465. // Currently, only sorting by name or creationTimestamp desc is
  102466. // supported.
  102467. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  102468. c.urlParams_.Set("orderBy", orderBy)
  102469. return c
  102470. }
  102471. // PageToken sets the optional parameter "pageToken": Specifies a page
  102472. // token to use. Set pageToken to the nextPageToken returned by a
  102473. // previous list request to get the next page of results.
  102474. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  102475. c.urlParams_.Set("pageToken", pageToken)
  102476. return c
  102477. }
  102478. // Fields allows partial responses to be retrieved. See
  102479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102480. // for more information.
  102481. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  102482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102483. return c
  102484. }
  102485. // IfNoneMatch sets the optional parameter which makes the operation
  102486. // fail if the object's ETag matches the given value. This is useful for
  102487. // getting updates only after the object has changed since the last
  102488. // request. Use googleapi.IsNotModified to check whether the response
  102489. // error from Do is the result of In-None-Match.
  102490. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  102491. c.ifNoneMatch_ = entityTag
  102492. return c
  102493. }
  102494. // Context sets the context to be used in this call's Do method. Any
  102495. // pending HTTP request will be aborted if the provided context is
  102496. // canceled.
  102497. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  102498. c.ctx_ = ctx
  102499. return c
  102500. }
  102501. // Header returns an http.Header that can be modified by the caller to
  102502. // add HTTP headers to the request.
  102503. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  102504. if c.header_ == nil {
  102505. c.header_ = make(http.Header)
  102506. }
  102507. return c.header_
  102508. }
  102509. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  102510. reqHeaders := make(http.Header)
  102511. for k, v := range c.header_ {
  102512. reqHeaders[k] = v
  102513. }
  102514. reqHeaders.Set("User-Agent", c.s.userAgent())
  102515. if c.ifNoneMatch_ != "" {
  102516. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102517. }
  102518. var body io.Reader = nil
  102519. c.urlParams_.Set("alt", alt)
  102520. c.urlParams_.Set("prettyPrint", "false")
  102521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  102522. urls += "?" + c.urlParams_.Encode()
  102523. req, err := http.NewRequest("GET", urls, body)
  102524. if err != nil {
  102525. return nil, err
  102526. }
  102527. req.Header = reqHeaders
  102528. googleapi.Expand(req.URL, map[string]string{
  102529. "project": c.project,
  102530. })
  102531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102532. }
  102533. // Do executes the "compute.subnetworks.aggregatedList" call.
  102534. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  102535. // Any non-2xx status code is an error. Response headers are in either
  102536. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  102537. // returned at all) in error.(*googleapi.Error).Header. Use
  102538. // googleapi.IsNotModified to check whether the returned error was
  102539. // because http.StatusNotModified was returned.
  102540. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  102541. gensupport.SetOptions(c.urlParams_, opts...)
  102542. res, err := c.doRequest("json")
  102543. if res != nil && res.StatusCode == http.StatusNotModified {
  102544. if res.Body != nil {
  102545. res.Body.Close()
  102546. }
  102547. return nil, &googleapi.Error{
  102548. Code: res.StatusCode,
  102549. Header: res.Header,
  102550. }
  102551. }
  102552. if err != nil {
  102553. return nil, err
  102554. }
  102555. defer googleapi.CloseBody(res)
  102556. if err := googleapi.CheckResponse(res); err != nil {
  102557. return nil, err
  102558. }
  102559. ret := &SubnetworkAggregatedList{
  102560. ServerResponse: googleapi.ServerResponse{
  102561. Header: res.Header,
  102562. HTTPStatusCode: res.StatusCode,
  102563. },
  102564. }
  102565. target := &ret
  102566. if err := gensupport.DecodeResponse(target, res); err != nil {
  102567. return nil, err
  102568. }
  102569. return ret, nil
  102570. // {
  102571. // "description": "Retrieves an aggregated list of subnetworks.",
  102572. // "httpMethod": "GET",
  102573. // "id": "compute.subnetworks.aggregatedList",
  102574. // "parameterOrder": [
  102575. // "project"
  102576. // ],
  102577. // "parameters": {
  102578. // "filter": {
  102579. // "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).",
  102580. // "location": "query",
  102581. // "type": "string"
  102582. // },
  102583. // "maxResults": {
  102584. // "default": "500",
  102585. // "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)",
  102586. // "format": "uint32",
  102587. // "location": "query",
  102588. // "minimum": "0",
  102589. // "type": "integer"
  102590. // },
  102591. // "orderBy": {
  102592. // "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.",
  102593. // "location": "query",
  102594. // "type": "string"
  102595. // },
  102596. // "pageToken": {
  102597. // "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.",
  102598. // "location": "query",
  102599. // "type": "string"
  102600. // },
  102601. // "project": {
  102602. // "description": "Project ID for this request.",
  102603. // "location": "path",
  102604. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102605. // "required": true,
  102606. // "type": "string"
  102607. // }
  102608. // },
  102609. // "path": "{project}/aggregated/subnetworks",
  102610. // "response": {
  102611. // "$ref": "SubnetworkAggregatedList"
  102612. // },
  102613. // "scopes": [
  102614. // "https://www.googleapis.com/auth/cloud-platform",
  102615. // "https://www.googleapis.com/auth/compute",
  102616. // "https://www.googleapis.com/auth/compute.readonly"
  102617. // ]
  102618. // }
  102619. }
  102620. // Pages invokes f for each page of results.
  102621. // A non-nil error returned from f will halt the iteration.
  102622. // The provided context supersedes any context provided to the Context method.
  102623. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  102624. c.ctx_ = ctx
  102625. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  102626. for {
  102627. x, err := c.Do()
  102628. if err != nil {
  102629. return err
  102630. }
  102631. if err := f(x); err != nil {
  102632. return err
  102633. }
  102634. if x.NextPageToken == "" {
  102635. return nil
  102636. }
  102637. c.PageToken(x.NextPageToken)
  102638. }
  102639. }
  102640. // method id "compute.subnetworks.delete":
  102641. type SubnetworksDeleteCall struct {
  102642. s *Service
  102643. project string
  102644. region string
  102645. subnetwork string
  102646. urlParams_ gensupport.URLParams
  102647. ctx_ context.Context
  102648. header_ http.Header
  102649. }
  102650. // Delete: Deletes the specified subnetwork.
  102651. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  102652. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102653. c.project = project
  102654. c.region = region
  102655. c.subnetwork = subnetwork
  102656. return c
  102657. }
  102658. // RequestId sets the optional parameter "requestId": An optional
  102659. // request ID to identify requests. Specify a unique request ID so that
  102660. // if you must retry your request, the server will know to ignore the
  102661. // request if it has already been completed.
  102662. //
  102663. // For example, consider a situation where you make an initial request
  102664. // and the request times out. If you make the request again with the
  102665. // same request ID, the server can check if original operation with the
  102666. // same request ID was received, and if so, will ignore the second
  102667. // request. This prevents clients from accidentally creating duplicate
  102668. // commitments.
  102669. //
  102670. // The request ID must be a valid UUID with the exception that zero UUID
  102671. // is not supported (00000000-0000-0000-0000-000000000000).
  102672. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  102673. c.urlParams_.Set("requestId", requestId)
  102674. return c
  102675. }
  102676. // Fields allows partial responses to be retrieved. See
  102677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102678. // for more information.
  102679. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  102680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102681. return c
  102682. }
  102683. // Context sets the context to be used in this call's Do method. Any
  102684. // pending HTTP request will be aborted if the provided context is
  102685. // canceled.
  102686. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  102687. c.ctx_ = ctx
  102688. return c
  102689. }
  102690. // Header returns an http.Header that can be modified by the caller to
  102691. // add HTTP headers to the request.
  102692. func (c *SubnetworksDeleteCall) Header() http.Header {
  102693. if c.header_ == nil {
  102694. c.header_ = make(http.Header)
  102695. }
  102696. return c.header_
  102697. }
  102698. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  102699. reqHeaders := make(http.Header)
  102700. for k, v := range c.header_ {
  102701. reqHeaders[k] = v
  102702. }
  102703. reqHeaders.Set("User-Agent", c.s.userAgent())
  102704. var body io.Reader = nil
  102705. c.urlParams_.Set("alt", alt)
  102706. c.urlParams_.Set("prettyPrint", "false")
  102707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  102708. urls += "?" + c.urlParams_.Encode()
  102709. req, err := http.NewRequest("DELETE", urls, body)
  102710. if err != nil {
  102711. return nil, err
  102712. }
  102713. req.Header = reqHeaders
  102714. googleapi.Expand(req.URL, map[string]string{
  102715. "project": c.project,
  102716. "region": c.region,
  102717. "subnetwork": c.subnetwork,
  102718. })
  102719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102720. }
  102721. // Do executes the "compute.subnetworks.delete" call.
  102722. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102723. // status code is an error. Response headers are in either
  102724. // *Operation.ServerResponse.Header or (if a response was returned at
  102725. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102726. // to check whether the returned error was because
  102727. // http.StatusNotModified was returned.
  102728. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102729. gensupport.SetOptions(c.urlParams_, opts...)
  102730. res, err := c.doRequest("json")
  102731. if res != nil && res.StatusCode == http.StatusNotModified {
  102732. if res.Body != nil {
  102733. res.Body.Close()
  102734. }
  102735. return nil, &googleapi.Error{
  102736. Code: res.StatusCode,
  102737. Header: res.Header,
  102738. }
  102739. }
  102740. if err != nil {
  102741. return nil, err
  102742. }
  102743. defer googleapi.CloseBody(res)
  102744. if err := googleapi.CheckResponse(res); err != nil {
  102745. return nil, err
  102746. }
  102747. ret := &Operation{
  102748. ServerResponse: googleapi.ServerResponse{
  102749. Header: res.Header,
  102750. HTTPStatusCode: res.StatusCode,
  102751. },
  102752. }
  102753. target := &ret
  102754. if err := gensupport.DecodeResponse(target, res); err != nil {
  102755. return nil, err
  102756. }
  102757. return ret, nil
  102758. // {
  102759. // "description": "Deletes the specified subnetwork.",
  102760. // "httpMethod": "DELETE",
  102761. // "id": "compute.subnetworks.delete",
  102762. // "parameterOrder": [
  102763. // "project",
  102764. // "region",
  102765. // "subnetwork"
  102766. // ],
  102767. // "parameters": {
  102768. // "project": {
  102769. // "description": "Project ID for this request.",
  102770. // "location": "path",
  102771. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102772. // "required": true,
  102773. // "type": "string"
  102774. // },
  102775. // "region": {
  102776. // "description": "Name of the region scoping this request.",
  102777. // "location": "path",
  102778. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102779. // "required": true,
  102780. // "type": "string"
  102781. // },
  102782. // "requestId": {
  102783. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102784. // "location": "query",
  102785. // "type": "string"
  102786. // },
  102787. // "subnetwork": {
  102788. // "description": "Name of the Subnetwork resource to delete.",
  102789. // "location": "path",
  102790. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102791. // "required": true,
  102792. // "type": "string"
  102793. // }
  102794. // },
  102795. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  102796. // "response": {
  102797. // "$ref": "Operation"
  102798. // },
  102799. // "scopes": [
  102800. // "https://www.googleapis.com/auth/cloud-platform",
  102801. // "https://www.googleapis.com/auth/compute"
  102802. // ]
  102803. // }
  102804. }
  102805. // method id "compute.subnetworks.expandIpCidrRange":
  102806. type SubnetworksExpandIpCidrRangeCall struct {
  102807. s *Service
  102808. project string
  102809. region string
  102810. subnetwork string
  102811. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  102812. urlParams_ gensupport.URLParams
  102813. ctx_ context.Context
  102814. header_ http.Header
  102815. }
  102816. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  102817. // specified value.
  102818. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  102819. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102820. c.project = project
  102821. c.region = region
  102822. c.subnetwork = subnetwork
  102823. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  102824. return c
  102825. }
  102826. // RequestId sets the optional parameter "requestId": An optional
  102827. // request ID to identify requests. Specify a unique request ID so that
  102828. // if you must retry your request, the server will know to ignore the
  102829. // request if it has already been completed.
  102830. //
  102831. // For example, consider a situation where you make an initial request
  102832. // and the request times out. If you make the request again with the
  102833. // same request ID, the server can check if original operation with the
  102834. // same request ID was received, and if so, will ignore the second
  102835. // request. This prevents clients from accidentally creating duplicate
  102836. // commitments.
  102837. //
  102838. // The request ID must be a valid UUID with the exception that zero UUID
  102839. // is not supported (00000000-0000-0000-0000-000000000000).
  102840. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  102841. c.urlParams_.Set("requestId", requestId)
  102842. return c
  102843. }
  102844. // Fields allows partial responses to be retrieved. See
  102845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102846. // for more information.
  102847. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  102848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102849. return c
  102850. }
  102851. // Context sets the context to be used in this call's Do method. Any
  102852. // pending HTTP request will be aborted if the provided context is
  102853. // canceled.
  102854. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  102855. c.ctx_ = ctx
  102856. return c
  102857. }
  102858. // Header returns an http.Header that can be modified by the caller to
  102859. // add HTTP headers to the request.
  102860. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  102861. if c.header_ == nil {
  102862. c.header_ = make(http.Header)
  102863. }
  102864. return c.header_
  102865. }
  102866. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  102867. reqHeaders := make(http.Header)
  102868. for k, v := range c.header_ {
  102869. reqHeaders[k] = v
  102870. }
  102871. reqHeaders.Set("User-Agent", c.s.userAgent())
  102872. var body io.Reader = nil
  102873. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  102874. if err != nil {
  102875. return nil, err
  102876. }
  102877. reqHeaders.Set("Content-Type", "application/json")
  102878. c.urlParams_.Set("alt", alt)
  102879. c.urlParams_.Set("prettyPrint", "false")
  102880. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  102881. urls += "?" + c.urlParams_.Encode()
  102882. req, err := http.NewRequest("POST", urls, body)
  102883. if err != nil {
  102884. return nil, err
  102885. }
  102886. req.Header = reqHeaders
  102887. googleapi.Expand(req.URL, map[string]string{
  102888. "project": c.project,
  102889. "region": c.region,
  102890. "subnetwork": c.subnetwork,
  102891. })
  102892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102893. }
  102894. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  102895. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102896. // status code is an error. Response headers are in either
  102897. // *Operation.ServerResponse.Header or (if a response was returned at
  102898. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102899. // to check whether the returned error was because
  102900. // http.StatusNotModified was returned.
  102901. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102902. gensupport.SetOptions(c.urlParams_, opts...)
  102903. res, err := c.doRequest("json")
  102904. if res != nil && res.StatusCode == http.StatusNotModified {
  102905. if res.Body != nil {
  102906. res.Body.Close()
  102907. }
  102908. return nil, &googleapi.Error{
  102909. Code: res.StatusCode,
  102910. Header: res.Header,
  102911. }
  102912. }
  102913. if err != nil {
  102914. return nil, err
  102915. }
  102916. defer googleapi.CloseBody(res)
  102917. if err := googleapi.CheckResponse(res); err != nil {
  102918. return nil, err
  102919. }
  102920. ret := &Operation{
  102921. ServerResponse: googleapi.ServerResponse{
  102922. Header: res.Header,
  102923. HTTPStatusCode: res.StatusCode,
  102924. },
  102925. }
  102926. target := &ret
  102927. if err := gensupport.DecodeResponse(target, res); err != nil {
  102928. return nil, err
  102929. }
  102930. return ret, nil
  102931. // {
  102932. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  102933. // "httpMethod": "POST",
  102934. // "id": "compute.subnetworks.expandIpCidrRange",
  102935. // "parameterOrder": [
  102936. // "project",
  102937. // "region",
  102938. // "subnetwork"
  102939. // ],
  102940. // "parameters": {
  102941. // "project": {
  102942. // "description": "Project ID for this request.",
  102943. // "location": "path",
  102944. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102945. // "required": true,
  102946. // "type": "string"
  102947. // },
  102948. // "region": {
  102949. // "description": "Name of the region scoping this request.",
  102950. // "location": "path",
  102951. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102952. // "required": true,
  102953. // "type": "string"
  102954. // },
  102955. // "requestId": {
  102956. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102957. // "location": "query",
  102958. // "type": "string"
  102959. // },
  102960. // "subnetwork": {
  102961. // "description": "Name of the Subnetwork resource to update.",
  102962. // "location": "path",
  102963. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102964. // "required": true,
  102965. // "type": "string"
  102966. // }
  102967. // },
  102968. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  102969. // "request": {
  102970. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  102971. // },
  102972. // "response": {
  102973. // "$ref": "Operation"
  102974. // },
  102975. // "scopes": [
  102976. // "https://www.googleapis.com/auth/cloud-platform",
  102977. // "https://www.googleapis.com/auth/compute"
  102978. // ]
  102979. // }
  102980. }
  102981. // method id "compute.subnetworks.get":
  102982. type SubnetworksGetCall struct {
  102983. s *Service
  102984. project string
  102985. region string
  102986. subnetwork string
  102987. urlParams_ gensupport.URLParams
  102988. ifNoneMatch_ string
  102989. ctx_ context.Context
  102990. header_ http.Header
  102991. }
  102992. // Get: Returns the specified subnetwork. Gets a list of available
  102993. // subnetworks list() request.
  102994. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  102995. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102996. c.project = project
  102997. c.region = region
  102998. c.subnetwork = subnetwork
  102999. return c
  103000. }
  103001. // Fields allows partial responses to be retrieved. See
  103002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103003. // for more information.
  103004. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  103005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103006. return c
  103007. }
  103008. // IfNoneMatch sets the optional parameter which makes the operation
  103009. // fail if the object's ETag matches the given value. This is useful for
  103010. // getting updates only after the object has changed since the last
  103011. // request. Use googleapi.IsNotModified to check whether the response
  103012. // error from Do is the result of In-None-Match.
  103013. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  103014. c.ifNoneMatch_ = entityTag
  103015. return c
  103016. }
  103017. // Context sets the context to be used in this call's Do method. Any
  103018. // pending HTTP request will be aborted if the provided context is
  103019. // canceled.
  103020. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  103021. c.ctx_ = ctx
  103022. return c
  103023. }
  103024. // Header returns an http.Header that can be modified by the caller to
  103025. // add HTTP headers to the request.
  103026. func (c *SubnetworksGetCall) Header() http.Header {
  103027. if c.header_ == nil {
  103028. c.header_ = make(http.Header)
  103029. }
  103030. return c.header_
  103031. }
  103032. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  103033. reqHeaders := make(http.Header)
  103034. for k, v := range c.header_ {
  103035. reqHeaders[k] = v
  103036. }
  103037. reqHeaders.Set("User-Agent", c.s.userAgent())
  103038. if c.ifNoneMatch_ != "" {
  103039. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103040. }
  103041. var body io.Reader = nil
  103042. c.urlParams_.Set("alt", alt)
  103043. c.urlParams_.Set("prettyPrint", "false")
  103044. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  103045. urls += "?" + c.urlParams_.Encode()
  103046. req, err := http.NewRequest("GET", urls, body)
  103047. if err != nil {
  103048. return nil, err
  103049. }
  103050. req.Header = reqHeaders
  103051. googleapi.Expand(req.URL, map[string]string{
  103052. "project": c.project,
  103053. "region": c.region,
  103054. "subnetwork": c.subnetwork,
  103055. })
  103056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103057. }
  103058. // Do executes the "compute.subnetworks.get" call.
  103059. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  103060. // status code is an error. Response headers are in either
  103061. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  103062. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103063. // to check whether the returned error was because
  103064. // http.StatusNotModified was returned.
  103065. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  103066. gensupport.SetOptions(c.urlParams_, opts...)
  103067. res, err := c.doRequest("json")
  103068. if res != nil && res.StatusCode == http.StatusNotModified {
  103069. if res.Body != nil {
  103070. res.Body.Close()
  103071. }
  103072. return nil, &googleapi.Error{
  103073. Code: res.StatusCode,
  103074. Header: res.Header,
  103075. }
  103076. }
  103077. if err != nil {
  103078. return nil, err
  103079. }
  103080. defer googleapi.CloseBody(res)
  103081. if err := googleapi.CheckResponse(res); err != nil {
  103082. return nil, err
  103083. }
  103084. ret := &Subnetwork{
  103085. ServerResponse: googleapi.ServerResponse{
  103086. Header: res.Header,
  103087. HTTPStatusCode: res.StatusCode,
  103088. },
  103089. }
  103090. target := &ret
  103091. if err := gensupport.DecodeResponse(target, res); err != nil {
  103092. return nil, err
  103093. }
  103094. return ret, nil
  103095. // {
  103096. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  103097. // "httpMethod": "GET",
  103098. // "id": "compute.subnetworks.get",
  103099. // "parameterOrder": [
  103100. // "project",
  103101. // "region",
  103102. // "subnetwork"
  103103. // ],
  103104. // "parameters": {
  103105. // "project": {
  103106. // "description": "Project ID for this request.",
  103107. // "location": "path",
  103108. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103109. // "required": true,
  103110. // "type": "string"
  103111. // },
  103112. // "region": {
  103113. // "description": "Name of the region scoping this request.",
  103114. // "location": "path",
  103115. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103116. // "required": true,
  103117. // "type": "string"
  103118. // },
  103119. // "subnetwork": {
  103120. // "description": "Name of the Subnetwork resource to return.",
  103121. // "location": "path",
  103122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103123. // "required": true,
  103124. // "type": "string"
  103125. // }
  103126. // },
  103127. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  103128. // "response": {
  103129. // "$ref": "Subnetwork"
  103130. // },
  103131. // "scopes": [
  103132. // "https://www.googleapis.com/auth/cloud-platform",
  103133. // "https://www.googleapis.com/auth/compute",
  103134. // "https://www.googleapis.com/auth/compute.readonly"
  103135. // ]
  103136. // }
  103137. }
  103138. // method id "compute.subnetworks.getIamPolicy":
  103139. type SubnetworksGetIamPolicyCall struct {
  103140. s *Service
  103141. project string
  103142. region string
  103143. resource string
  103144. urlParams_ gensupport.URLParams
  103145. ifNoneMatch_ string
  103146. ctx_ context.Context
  103147. header_ http.Header
  103148. }
  103149. // GetIamPolicy: Gets the access control policy for a resource. May be
  103150. // empty if no such policy or resource exists.
  103151. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  103152. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103153. c.project = project
  103154. c.region = region
  103155. c.resource = resource
  103156. return c
  103157. }
  103158. // Fields allows partial responses to be retrieved. See
  103159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103160. // for more information.
  103161. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  103162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103163. return c
  103164. }
  103165. // IfNoneMatch sets the optional parameter which makes the operation
  103166. // fail if the object's ETag matches the given value. This is useful for
  103167. // getting updates only after the object has changed since the last
  103168. // request. Use googleapi.IsNotModified to check whether the response
  103169. // error from Do is the result of In-None-Match.
  103170. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  103171. c.ifNoneMatch_ = entityTag
  103172. return c
  103173. }
  103174. // Context sets the context to be used in this call's Do method. Any
  103175. // pending HTTP request will be aborted if the provided context is
  103176. // canceled.
  103177. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  103178. c.ctx_ = ctx
  103179. return c
  103180. }
  103181. // Header returns an http.Header that can be modified by the caller to
  103182. // add HTTP headers to the request.
  103183. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  103184. if c.header_ == nil {
  103185. c.header_ = make(http.Header)
  103186. }
  103187. return c.header_
  103188. }
  103189. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  103190. reqHeaders := make(http.Header)
  103191. for k, v := range c.header_ {
  103192. reqHeaders[k] = v
  103193. }
  103194. reqHeaders.Set("User-Agent", c.s.userAgent())
  103195. if c.ifNoneMatch_ != "" {
  103196. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103197. }
  103198. var body io.Reader = nil
  103199. c.urlParams_.Set("alt", alt)
  103200. c.urlParams_.Set("prettyPrint", "false")
  103201. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  103202. urls += "?" + c.urlParams_.Encode()
  103203. req, err := http.NewRequest("GET", urls, body)
  103204. if err != nil {
  103205. return nil, err
  103206. }
  103207. req.Header = reqHeaders
  103208. googleapi.Expand(req.URL, map[string]string{
  103209. "project": c.project,
  103210. "region": c.region,
  103211. "resource": c.resource,
  103212. })
  103213. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103214. }
  103215. // Do executes the "compute.subnetworks.getIamPolicy" call.
  103216. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  103217. // code is an error. Response headers are in either
  103218. // *Policy.ServerResponse.Header or (if a response was returned at all)
  103219. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  103220. // check whether the returned error was because http.StatusNotModified
  103221. // was returned.
  103222. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  103223. gensupport.SetOptions(c.urlParams_, opts...)
  103224. res, err := c.doRequest("json")
  103225. if res != nil && res.StatusCode == http.StatusNotModified {
  103226. if res.Body != nil {
  103227. res.Body.Close()
  103228. }
  103229. return nil, &googleapi.Error{
  103230. Code: res.StatusCode,
  103231. Header: res.Header,
  103232. }
  103233. }
  103234. if err != nil {
  103235. return nil, err
  103236. }
  103237. defer googleapi.CloseBody(res)
  103238. if err := googleapi.CheckResponse(res); err != nil {
  103239. return nil, err
  103240. }
  103241. ret := &Policy{
  103242. ServerResponse: googleapi.ServerResponse{
  103243. Header: res.Header,
  103244. HTTPStatusCode: res.StatusCode,
  103245. },
  103246. }
  103247. target := &ret
  103248. if err := gensupport.DecodeResponse(target, res); err != nil {
  103249. return nil, err
  103250. }
  103251. return ret, nil
  103252. // {
  103253. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  103254. // "httpMethod": "GET",
  103255. // "id": "compute.subnetworks.getIamPolicy",
  103256. // "parameterOrder": [
  103257. // "project",
  103258. // "region",
  103259. // "resource"
  103260. // ],
  103261. // "parameters": {
  103262. // "project": {
  103263. // "description": "Project ID for this request.",
  103264. // "location": "path",
  103265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103266. // "required": true,
  103267. // "type": "string"
  103268. // },
  103269. // "region": {
  103270. // "description": "The name of the region for this request.",
  103271. // "location": "path",
  103272. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103273. // "required": true,
  103274. // "type": "string"
  103275. // },
  103276. // "resource": {
  103277. // "description": "Name or id of the resource for this request.",
  103278. // "location": "path",
  103279. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103280. // "required": true,
  103281. // "type": "string"
  103282. // }
  103283. // },
  103284. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  103285. // "response": {
  103286. // "$ref": "Policy"
  103287. // },
  103288. // "scopes": [
  103289. // "https://www.googleapis.com/auth/cloud-platform",
  103290. // "https://www.googleapis.com/auth/compute",
  103291. // "https://www.googleapis.com/auth/compute.readonly"
  103292. // ]
  103293. // }
  103294. }
  103295. // method id "compute.subnetworks.insert":
  103296. type SubnetworksInsertCall struct {
  103297. s *Service
  103298. project string
  103299. region string
  103300. subnetwork *Subnetwork
  103301. urlParams_ gensupport.URLParams
  103302. ctx_ context.Context
  103303. header_ http.Header
  103304. }
  103305. // Insert: Creates a subnetwork in the specified project using the data
  103306. // included in the request.
  103307. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  103308. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103309. c.project = project
  103310. c.region = region
  103311. c.subnetwork = subnetwork
  103312. return c
  103313. }
  103314. // RequestId sets the optional parameter "requestId": An optional
  103315. // request ID to identify requests. Specify a unique request ID so that
  103316. // if you must retry your request, the server will know to ignore the
  103317. // request if it has already been completed.
  103318. //
  103319. // For example, consider a situation where you make an initial request
  103320. // and the request times out. If you make the request again with the
  103321. // same request ID, the server can check if original operation with the
  103322. // same request ID was received, and if so, will ignore the second
  103323. // request. This prevents clients from accidentally creating duplicate
  103324. // commitments.
  103325. //
  103326. // The request ID must be a valid UUID with the exception that zero UUID
  103327. // is not supported (00000000-0000-0000-0000-000000000000).
  103328. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  103329. c.urlParams_.Set("requestId", requestId)
  103330. return c
  103331. }
  103332. // Fields allows partial responses to be retrieved. See
  103333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103334. // for more information.
  103335. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  103336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103337. return c
  103338. }
  103339. // Context sets the context to be used in this call's Do method. Any
  103340. // pending HTTP request will be aborted if the provided context is
  103341. // canceled.
  103342. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  103343. c.ctx_ = ctx
  103344. return c
  103345. }
  103346. // Header returns an http.Header that can be modified by the caller to
  103347. // add HTTP headers to the request.
  103348. func (c *SubnetworksInsertCall) Header() http.Header {
  103349. if c.header_ == nil {
  103350. c.header_ = make(http.Header)
  103351. }
  103352. return c.header_
  103353. }
  103354. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  103355. reqHeaders := make(http.Header)
  103356. for k, v := range c.header_ {
  103357. reqHeaders[k] = v
  103358. }
  103359. reqHeaders.Set("User-Agent", c.s.userAgent())
  103360. var body io.Reader = nil
  103361. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  103362. if err != nil {
  103363. return nil, err
  103364. }
  103365. reqHeaders.Set("Content-Type", "application/json")
  103366. c.urlParams_.Set("alt", alt)
  103367. c.urlParams_.Set("prettyPrint", "false")
  103368. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  103369. urls += "?" + c.urlParams_.Encode()
  103370. req, err := http.NewRequest("POST", urls, body)
  103371. if err != nil {
  103372. return nil, err
  103373. }
  103374. req.Header = reqHeaders
  103375. googleapi.Expand(req.URL, map[string]string{
  103376. "project": c.project,
  103377. "region": c.region,
  103378. })
  103379. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103380. }
  103381. // Do executes the "compute.subnetworks.insert" call.
  103382. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103383. // status code is an error. Response headers are in either
  103384. // *Operation.ServerResponse.Header or (if a response was returned at
  103385. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103386. // to check whether the returned error was because
  103387. // http.StatusNotModified was returned.
  103388. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103389. gensupport.SetOptions(c.urlParams_, opts...)
  103390. res, err := c.doRequest("json")
  103391. if res != nil && res.StatusCode == http.StatusNotModified {
  103392. if res.Body != nil {
  103393. res.Body.Close()
  103394. }
  103395. return nil, &googleapi.Error{
  103396. Code: res.StatusCode,
  103397. Header: res.Header,
  103398. }
  103399. }
  103400. if err != nil {
  103401. return nil, err
  103402. }
  103403. defer googleapi.CloseBody(res)
  103404. if err := googleapi.CheckResponse(res); err != nil {
  103405. return nil, err
  103406. }
  103407. ret := &Operation{
  103408. ServerResponse: googleapi.ServerResponse{
  103409. Header: res.Header,
  103410. HTTPStatusCode: res.StatusCode,
  103411. },
  103412. }
  103413. target := &ret
  103414. if err := gensupport.DecodeResponse(target, res); err != nil {
  103415. return nil, err
  103416. }
  103417. return ret, nil
  103418. // {
  103419. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  103420. // "httpMethod": "POST",
  103421. // "id": "compute.subnetworks.insert",
  103422. // "parameterOrder": [
  103423. // "project",
  103424. // "region"
  103425. // ],
  103426. // "parameters": {
  103427. // "project": {
  103428. // "description": "Project ID for this request.",
  103429. // "location": "path",
  103430. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103431. // "required": true,
  103432. // "type": "string"
  103433. // },
  103434. // "region": {
  103435. // "description": "Name of the region scoping this request.",
  103436. // "location": "path",
  103437. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103438. // "required": true,
  103439. // "type": "string"
  103440. // },
  103441. // "requestId": {
  103442. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103443. // "location": "query",
  103444. // "type": "string"
  103445. // }
  103446. // },
  103447. // "path": "{project}/regions/{region}/subnetworks",
  103448. // "request": {
  103449. // "$ref": "Subnetwork"
  103450. // },
  103451. // "response": {
  103452. // "$ref": "Operation"
  103453. // },
  103454. // "scopes": [
  103455. // "https://www.googleapis.com/auth/cloud-platform",
  103456. // "https://www.googleapis.com/auth/compute"
  103457. // ]
  103458. // }
  103459. }
  103460. // method id "compute.subnetworks.list":
  103461. type SubnetworksListCall struct {
  103462. s *Service
  103463. project string
  103464. region string
  103465. urlParams_ gensupport.URLParams
  103466. ifNoneMatch_ string
  103467. ctx_ context.Context
  103468. header_ http.Header
  103469. }
  103470. // List: Retrieves a list of subnetworks available to the specified
  103471. // project.
  103472. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  103473. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103474. c.project = project
  103475. c.region = region
  103476. return c
  103477. }
  103478. // Filter sets the optional parameter "filter": A filter expression that
  103479. // filters resources listed in the response. The expression must specify
  103480. // the field name, a comparison operator, and the value that you want to
  103481. // use for filtering. The value must be a string, a number, or a
  103482. // boolean. The comparison operator must be either =, !=, >, or <.
  103483. //
  103484. // For example, if you are filtering Compute Engine instances, you can
  103485. // exclude instances named example-instance by specifying name !=
  103486. // example-instance.
  103487. //
  103488. // You can also filter nested fields. For example, you could specify
  103489. // scheduling.automaticRestart = false to include instances only if they
  103490. // are not scheduled for automatic restarts. You can use filtering on
  103491. // nested fields to filter based on resource labels.
  103492. //
  103493. // To filter on multiple expressions, provide each separate expression
  103494. // within parentheses. For example, (scheduling.automaticRestart = true)
  103495. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  103496. // AND expression. However, you can include AND and OR expressions
  103497. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  103498. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  103499. // true).
  103500. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  103501. c.urlParams_.Set("filter", filter)
  103502. return c
  103503. }
  103504. // MaxResults sets the optional parameter "maxResults": The maximum
  103505. // number of results per page that should be returned. If the number of
  103506. // available results is larger than maxResults, Compute Engine returns a
  103507. // nextPageToken that can be used to get the next page of results in
  103508. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  103509. // (Default: 500)
  103510. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  103511. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  103512. return c
  103513. }
  103514. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  103515. // a certain order. By default, results are returned in alphanumerical
  103516. // order based on the resource name.
  103517. //
  103518. // You can also sort results in descending order based on the creation
  103519. // timestamp using orderBy="creationTimestamp desc". This sorts results
  103520. // based on the creationTimestamp field in reverse chronological order
  103521. // (newest result first). Use this to sort resources like operations so
  103522. // that the newest operation is returned first.
  103523. //
  103524. // Currently, only sorting by name or creationTimestamp desc is
  103525. // supported.
  103526. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  103527. c.urlParams_.Set("orderBy", orderBy)
  103528. return c
  103529. }
  103530. // PageToken sets the optional parameter "pageToken": Specifies a page
  103531. // token to use. Set pageToken to the nextPageToken returned by a
  103532. // previous list request to get the next page of results.
  103533. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  103534. c.urlParams_.Set("pageToken", pageToken)
  103535. return c
  103536. }
  103537. // Fields allows partial responses to be retrieved. See
  103538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103539. // for more information.
  103540. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  103541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103542. return c
  103543. }
  103544. // IfNoneMatch sets the optional parameter which makes the operation
  103545. // fail if the object's ETag matches the given value. This is useful for
  103546. // getting updates only after the object has changed since the last
  103547. // request. Use googleapi.IsNotModified to check whether the response
  103548. // error from Do is the result of In-None-Match.
  103549. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  103550. c.ifNoneMatch_ = entityTag
  103551. return c
  103552. }
  103553. // Context sets the context to be used in this call's Do method. Any
  103554. // pending HTTP request will be aborted if the provided context is
  103555. // canceled.
  103556. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  103557. c.ctx_ = ctx
  103558. return c
  103559. }
  103560. // Header returns an http.Header that can be modified by the caller to
  103561. // add HTTP headers to the request.
  103562. func (c *SubnetworksListCall) Header() http.Header {
  103563. if c.header_ == nil {
  103564. c.header_ = make(http.Header)
  103565. }
  103566. return c.header_
  103567. }
  103568. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  103569. reqHeaders := make(http.Header)
  103570. for k, v := range c.header_ {
  103571. reqHeaders[k] = v
  103572. }
  103573. reqHeaders.Set("User-Agent", c.s.userAgent())
  103574. if c.ifNoneMatch_ != "" {
  103575. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103576. }
  103577. var body io.Reader = nil
  103578. c.urlParams_.Set("alt", alt)
  103579. c.urlParams_.Set("prettyPrint", "false")
  103580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  103581. urls += "?" + c.urlParams_.Encode()
  103582. req, err := http.NewRequest("GET", urls, body)
  103583. if err != nil {
  103584. return nil, err
  103585. }
  103586. req.Header = reqHeaders
  103587. googleapi.Expand(req.URL, map[string]string{
  103588. "project": c.project,
  103589. "region": c.region,
  103590. })
  103591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103592. }
  103593. // Do executes the "compute.subnetworks.list" call.
  103594. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  103595. // status code is an error. Response headers are in either
  103596. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  103597. // at all) in error.(*googleapi.Error).Header. Use
  103598. // googleapi.IsNotModified to check whether the returned error was
  103599. // because http.StatusNotModified was returned.
  103600. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  103601. gensupport.SetOptions(c.urlParams_, opts...)
  103602. res, err := c.doRequest("json")
  103603. if res != nil && res.StatusCode == http.StatusNotModified {
  103604. if res.Body != nil {
  103605. res.Body.Close()
  103606. }
  103607. return nil, &googleapi.Error{
  103608. Code: res.StatusCode,
  103609. Header: res.Header,
  103610. }
  103611. }
  103612. if err != nil {
  103613. return nil, err
  103614. }
  103615. defer googleapi.CloseBody(res)
  103616. if err := googleapi.CheckResponse(res); err != nil {
  103617. return nil, err
  103618. }
  103619. ret := &SubnetworkList{
  103620. ServerResponse: googleapi.ServerResponse{
  103621. Header: res.Header,
  103622. HTTPStatusCode: res.StatusCode,
  103623. },
  103624. }
  103625. target := &ret
  103626. if err := gensupport.DecodeResponse(target, res); err != nil {
  103627. return nil, err
  103628. }
  103629. return ret, nil
  103630. // {
  103631. // "description": "Retrieves a list of subnetworks available to the specified project.",
  103632. // "httpMethod": "GET",
  103633. // "id": "compute.subnetworks.list",
  103634. // "parameterOrder": [
  103635. // "project",
  103636. // "region"
  103637. // ],
  103638. // "parameters": {
  103639. // "filter": {
  103640. // "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).",
  103641. // "location": "query",
  103642. // "type": "string"
  103643. // },
  103644. // "maxResults": {
  103645. // "default": "500",
  103646. // "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)",
  103647. // "format": "uint32",
  103648. // "location": "query",
  103649. // "minimum": "0",
  103650. // "type": "integer"
  103651. // },
  103652. // "orderBy": {
  103653. // "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.",
  103654. // "location": "query",
  103655. // "type": "string"
  103656. // },
  103657. // "pageToken": {
  103658. // "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.",
  103659. // "location": "query",
  103660. // "type": "string"
  103661. // },
  103662. // "project": {
  103663. // "description": "Project ID for this request.",
  103664. // "location": "path",
  103665. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103666. // "required": true,
  103667. // "type": "string"
  103668. // },
  103669. // "region": {
  103670. // "description": "Name of the region scoping this request.",
  103671. // "location": "path",
  103672. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103673. // "required": true,
  103674. // "type": "string"
  103675. // }
  103676. // },
  103677. // "path": "{project}/regions/{region}/subnetworks",
  103678. // "response": {
  103679. // "$ref": "SubnetworkList"
  103680. // },
  103681. // "scopes": [
  103682. // "https://www.googleapis.com/auth/cloud-platform",
  103683. // "https://www.googleapis.com/auth/compute",
  103684. // "https://www.googleapis.com/auth/compute.readonly"
  103685. // ]
  103686. // }
  103687. }
  103688. // Pages invokes f for each page of results.
  103689. // A non-nil error returned from f will halt the iteration.
  103690. // The provided context supersedes any context provided to the Context method.
  103691. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  103692. c.ctx_ = ctx
  103693. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  103694. for {
  103695. x, err := c.Do()
  103696. if err != nil {
  103697. return err
  103698. }
  103699. if err := f(x); err != nil {
  103700. return err
  103701. }
  103702. if x.NextPageToken == "" {
  103703. return nil
  103704. }
  103705. c.PageToken(x.NextPageToken)
  103706. }
  103707. }
  103708. // method id "compute.subnetworks.listUsable":
  103709. type SubnetworksListUsableCall struct {
  103710. s *Service
  103711. project string
  103712. urlParams_ gensupport.URLParams
  103713. ifNoneMatch_ string
  103714. ctx_ context.Context
  103715. header_ http.Header
  103716. }
  103717. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  103718. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  103719. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103720. c.project = project
  103721. return c
  103722. }
  103723. // Filter sets the optional parameter "filter": A filter expression that
  103724. // filters resources listed in the response. The expression must specify
  103725. // the field name, a comparison operator, and the value that you want to
  103726. // use for filtering. The value must be a string, a number, or a
  103727. // boolean. The comparison operator must be either =, !=, >, or <.
  103728. //
  103729. // For example, if you are filtering Compute Engine instances, you can
  103730. // exclude instances named example-instance by specifying name !=
  103731. // example-instance.
  103732. //
  103733. // You can also filter nested fields. For example, you could specify
  103734. // scheduling.automaticRestart = false to include instances only if they
  103735. // are not scheduled for automatic restarts. You can use filtering on
  103736. // nested fields to filter based on resource labels.
  103737. //
  103738. // To filter on multiple expressions, provide each separate expression
  103739. // within parentheses. For example, (scheduling.automaticRestart = true)
  103740. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  103741. // AND expression. However, you can include AND and OR expressions
  103742. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  103743. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  103744. // true).
  103745. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  103746. c.urlParams_.Set("filter", filter)
  103747. return c
  103748. }
  103749. // MaxResults sets the optional parameter "maxResults": The maximum
  103750. // number of results per page that should be returned. If the number of
  103751. // available results is larger than maxResults, Compute Engine returns a
  103752. // nextPageToken that can be used to get the next page of results in
  103753. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  103754. // (Default: 500)
  103755. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  103756. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  103757. return c
  103758. }
  103759. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  103760. // a certain order. By default, results are returned in alphanumerical
  103761. // order based on the resource name.
  103762. //
  103763. // You can also sort results in descending order based on the creation
  103764. // timestamp using orderBy="creationTimestamp desc". This sorts results
  103765. // based on the creationTimestamp field in reverse chronological order
  103766. // (newest result first). Use this to sort resources like operations so
  103767. // that the newest operation is returned first.
  103768. //
  103769. // Currently, only sorting by name or creationTimestamp desc is
  103770. // supported.
  103771. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  103772. c.urlParams_.Set("orderBy", orderBy)
  103773. return c
  103774. }
  103775. // PageToken sets the optional parameter "pageToken": Specifies a page
  103776. // token to use. Set pageToken to the nextPageToken returned by a
  103777. // previous list request to get the next page of results.
  103778. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  103779. c.urlParams_.Set("pageToken", pageToken)
  103780. return c
  103781. }
  103782. // Fields allows partial responses to be retrieved. See
  103783. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103784. // for more information.
  103785. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  103786. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103787. return c
  103788. }
  103789. // IfNoneMatch sets the optional parameter which makes the operation
  103790. // fail if the object's ETag matches the given value. This is useful for
  103791. // getting updates only after the object has changed since the last
  103792. // request. Use googleapi.IsNotModified to check whether the response
  103793. // error from Do is the result of In-None-Match.
  103794. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  103795. c.ifNoneMatch_ = entityTag
  103796. return c
  103797. }
  103798. // Context sets the context to be used in this call's Do method. Any
  103799. // pending HTTP request will be aborted if the provided context is
  103800. // canceled.
  103801. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  103802. c.ctx_ = ctx
  103803. return c
  103804. }
  103805. // Header returns an http.Header that can be modified by the caller to
  103806. // add HTTP headers to the request.
  103807. func (c *SubnetworksListUsableCall) Header() http.Header {
  103808. if c.header_ == nil {
  103809. c.header_ = make(http.Header)
  103810. }
  103811. return c.header_
  103812. }
  103813. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  103814. reqHeaders := make(http.Header)
  103815. for k, v := range c.header_ {
  103816. reqHeaders[k] = v
  103817. }
  103818. reqHeaders.Set("User-Agent", c.s.userAgent())
  103819. if c.ifNoneMatch_ != "" {
  103820. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103821. }
  103822. var body io.Reader = nil
  103823. c.urlParams_.Set("alt", alt)
  103824. c.urlParams_.Set("prettyPrint", "false")
  103825. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  103826. urls += "?" + c.urlParams_.Encode()
  103827. req, err := http.NewRequest("GET", urls, body)
  103828. if err != nil {
  103829. return nil, err
  103830. }
  103831. req.Header = reqHeaders
  103832. googleapi.Expand(req.URL, map[string]string{
  103833. "project": c.project,
  103834. })
  103835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103836. }
  103837. // Do executes the "compute.subnetworks.listUsable" call.
  103838. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  103839. // non-nil. Any non-2xx status code is an error. Response headers are in
  103840. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  103841. // a response was returned at all) in error.(*googleapi.Error).Header.
  103842. // Use googleapi.IsNotModified to check whether the returned error was
  103843. // because http.StatusNotModified was returned.
  103844. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  103845. gensupport.SetOptions(c.urlParams_, opts...)
  103846. res, err := c.doRequest("json")
  103847. if res != nil && res.StatusCode == http.StatusNotModified {
  103848. if res.Body != nil {
  103849. res.Body.Close()
  103850. }
  103851. return nil, &googleapi.Error{
  103852. Code: res.StatusCode,
  103853. Header: res.Header,
  103854. }
  103855. }
  103856. if err != nil {
  103857. return nil, err
  103858. }
  103859. defer googleapi.CloseBody(res)
  103860. if err := googleapi.CheckResponse(res); err != nil {
  103861. return nil, err
  103862. }
  103863. ret := &UsableSubnetworksAggregatedList{
  103864. ServerResponse: googleapi.ServerResponse{
  103865. Header: res.Header,
  103866. HTTPStatusCode: res.StatusCode,
  103867. },
  103868. }
  103869. target := &ret
  103870. if err := gensupport.DecodeResponse(target, res); err != nil {
  103871. return nil, err
  103872. }
  103873. return ret, nil
  103874. // {
  103875. // "description": "Retrieves an aggregated list of usable subnetworks.",
  103876. // "httpMethod": "GET",
  103877. // "id": "compute.subnetworks.listUsable",
  103878. // "parameterOrder": [
  103879. // "project"
  103880. // ],
  103881. // "parameters": {
  103882. // "filter": {
  103883. // "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).",
  103884. // "location": "query",
  103885. // "type": "string"
  103886. // },
  103887. // "maxResults": {
  103888. // "default": "500",
  103889. // "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)",
  103890. // "format": "uint32",
  103891. // "location": "query",
  103892. // "minimum": "0",
  103893. // "type": "integer"
  103894. // },
  103895. // "orderBy": {
  103896. // "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.",
  103897. // "location": "query",
  103898. // "type": "string"
  103899. // },
  103900. // "pageToken": {
  103901. // "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.",
  103902. // "location": "query",
  103903. // "type": "string"
  103904. // },
  103905. // "project": {
  103906. // "description": "Project ID for this request.",
  103907. // "location": "path",
  103908. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103909. // "required": true,
  103910. // "type": "string"
  103911. // }
  103912. // },
  103913. // "path": "{project}/aggregated/subnetworks/listUsable",
  103914. // "response": {
  103915. // "$ref": "UsableSubnetworksAggregatedList"
  103916. // },
  103917. // "scopes": [
  103918. // "https://www.googleapis.com/auth/cloud-platform",
  103919. // "https://www.googleapis.com/auth/compute",
  103920. // "https://www.googleapis.com/auth/compute.readonly"
  103921. // ]
  103922. // }
  103923. }
  103924. // Pages invokes f for each page of results.
  103925. // A non-nil error returned from f will halt the iteration.
  103926. // The provided context supersedes any context provided to the Context method.
  103927. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  103928. c.ctx_ = ctx
  103929. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  103930. for {
  103931. x, err := c.Do()
  103932. if err != nil {
  103933. return err
  103934. }
  103935. if err := f(x); err != nil {
  103936. return err
  103937. }
  103938. if x.NextPageToken == "" {
  103939. return nil
  103940. }
  103941. c.PageToken(x.NextPageToken)
  103942. }
  103943. }
  103944. // method id "compute.subnetworks.patch":
  103945. type SubnetworksPatchCall struct {
  103946. s *Service
  103947. project string
  103948. region string
  103949. subnetwork string
  103950. subnetwork2 *Subnetwork
  103951. urlParams_ gensupport.URLParams
  103952. ctx_ context.Context
  103953. header_ http.Header
  103954. }
  103955. // Patch: Patches the specified subnetwork with the data included in the
  103956. // request. Only certain fields can up updated with a patch request as
  103957. // indicated in the field descriptions. You must specify the current
  103958. // fingeprint of the subnetwork resource being patched.
  103959. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  103960. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103961. c.project = project
  103962. c.region = region
  103963. c.subnetwork = subnetwork
  103964. c.subnetwork2 = subnetwork2
  103965. return c
  103966. }
  103967. // RequestId sets the optional parameter "requestId": An optional
  103968. // request ID to identify requests. Specify a unique request ID so that
  103969. // if you must retry your request, the server will know to ignore the
  103970. // request if it has already been completed.
  103971. //
  103972. // For example, consider a situation where you make an initial request
  103973. // and the request times out. If you make the request again with the
  103974. // same request ID, the server can check if original operation with the
  103975. // same request ID was received, and if so, will ignore the second
  103976. // request. This prevents clients from accidentally creating duplicate
  103977. // commitments.
  103978. //
  103979. // The request ID must be a valid UUID with the exception that zero UUID
  103980. // is not supported (00000000-0000-0000-0000-000000000000).
  103981. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  103982. c.urlParams_.Set("requestId", requestId)
  103983. return c
  103984. }
  103985. // Fields allows partial responses to be retrieved. See
  103986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103987. // for more information.
  103988. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  103989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103990. return c
  103991. }
  103992. // Context sets the context to be used in this call's Do method. Any
  103993. // pending HTTP request will be aborted if the provided context is
  103994. // canceled.
  103995. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  103996. c.ctx_ = ctx
  103997. return c
  103998. }
  103999. // Header returns an http.Header that can be modified by the caller to
  104000. // add HTTP headers to the request.
  104001. func (c *SubnetworksPatchCall) Header() http.Header {
  104002. if c.header_ == nil {
  104003. c.header_ = make(http.Header)
  104004. }
  104005. return c.header_
  104006. }
  104007. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  104008. reqHeaders := make(http.Header)
  104009. for k, v := range c.header_ {
  104010. reqHeaders[k] = v
  104011. }
  104012. reqHeaders.Set("User-Agent", c.s.userAgent())
  104013. var body io.Reader = nil
  104014. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  104015. if err != nil {
  104016. return nil, err
  104017. }
  104018. reqHeaders.Set("Content-Type", "application/json")
  104019. c.urlParams_.Set("alt", alt)
  104020. c.urlParams_.Set("prettyPrint", "false")
  104021. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  104022. urls += "?" + c.urlParams_.Encode()
  104023. req, err := http.NewRequest("PATCH", urls, body)
  104024. if err != nil {
  104025. return nil, err
  104026. }
  104027. req.Header = reqHeaders
  104028. googleapi.Expand(req.URL, map[string]string{
  104029. "project": c.project,
  104030. "region": c.region,
  104031. "subnetwork": c.subnetwork,
  104032. })
  104033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104034. }
  104035. // Do executes the "compute.subnetworks.patch" call.
  104036. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104037. // status code is an error. Response headers are in either
  104038. // *Operation.ServerResponse.Header or (if a response was returned at
  104039. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104040. // to check whether the returned error was because
  104041. // http.StatusNotModified was returned.
  104042. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104043. gensupport.SetOptions(c.urlParams_, opts...)
  104044. res, err := c.doRequest("json")
  104045. if res != nil && res.StatusCode == http.StatusNotModified {
  104046. if res.Body != nil {
  104047. res.Body.Close()
  104048. }
  104049. return nil, &googleapi.Error{
  104050. Code: res.StatusCode,
  104051. Header: res.Header,
  104052. }
  104053. }
  104054. if err != nil {
  104055. return nil, err
  104056. }
  104057. defer googleapi.CloseBody(res)
  104058. if err := googleapi.CheckResponse(res); err != nil {
  104059. return nil, err
  104060. }
  104061. ret := &Operation{
  104062. ServerResponse: googleapi.ServerResponse{
  104063. Header: res.Header,
  104064. HTTPStatusCode: res.StatusCode,
  104065. },
  104066. }
  104067. target := &ret
  104068. if err := gensupport.DecodeResponse(target, res); err != nil {
  104069. return nil, err
  104070. }
  104071. return ret, nil
  104072. // {
  104073. // "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.",
  104074. // "httpMethod": "PATCH",
  104075. // "id": "compute.subnetworks.patch",
  104076. // "parameterOrder": [
  104077. // "project",
  104078. // "region",
  104079. // "subnetwork"
  104080. // ],
  104081. // "parameters": {
  104082. // "project": {
  104083. // "description": "Project ID for this request.",
  104084. // "location": "path",
  104085. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104086. // "required": true,
  104087. // "type": "string"
  104088. // },
  104089. // "region": {
  104090. // "description": "Name of the region scoping this request.",
  104091. // "location": "path",
  104092. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104093. // "required": true,
  104094. // "type": "string"
  104095. // },
  104096. // "requestId": {
  104097. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104098. // "location": "query",
  104099. // "type": "string"
  104100. // },
  104101. // "subnetwork": {
  104102. // "description": "Name of the Subnetwork resource to patch.",
  104103. // "location": "path",
  104104. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104105. // "required": true,
  104106. // "type": "string"
  104107. // }
  104108. // },
  104109. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  104110. // "request": {
  104111. // "$ref": "Subnetwork"
  104112. // },
  104113. // "response": {
  104114. // "$ref": "Operation"
  104115. // },
  104116. // "scopes": [
  104117. // "https://www.googleapis.com/auth/cloud-platform",
  104118. // "https://www.googleapis.com/auth/compute"
  104119. // ]
  104120. // }
  104121. }
  104122. // method id "compute.subnetworks.setIamPolicy":
  104123. type SubnetworksSetIamPolicyCall struct {
  104124. s *Service
  104125. project string
  104126. region string
  104127. resource string
  104128. regionsetpolicyrequest *RegionSetPolicyRequest
  104129. urlParams_ gensupport.URLParams
  104130. ctx_ context.Context
  104131. header_ http.Header
  104132. }
  104133. // SetIamPolicy: Sets the access control policy on the specified
  104134. // resource. Replaces any existing policy.
  104135. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  104136. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104137. c.project = project
  104138. c.region = region
  104139. c.resource = resource
  104140. c.regionsetpolicyrequest = regionsetpolicyrequest
  104141. return c
  104142. }
  104143. // Fields allows partial responses to be retrieved. See
  104144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104145. // for more information.
  104146. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  104147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104148. return c
  104149. }
  104150. // Context sets the context to be used in this call's Do method. Any
  104151. // pending HTTP request will be aborted if the provided context is
  104152. // canceled.
  104153. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  104154. c.ctx_ = ctx
  104155. return c
  104156. }
  104157. // Header returns an http.Header that can be modified by the caller to
  104158. // add HTTP headers to the request.
  104159. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  104160. if c.header_ == nil {
  104161. c.header_ = make(http.Header)
  104162. }
  104163. return c.header_
  104164. }
  104165. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  104166. reqHeaders := make(http.Header)
  104167. for k, v := range c.header_ {
  104168. reqHeaders[k] = v
  104169. }
  104170. reqHeaders.Set("User-Agent", c.s.userAgent())
  104171. var body io.Reader = nil
  104172. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  104173. if err != nil {
  104174. return nil, err
  104175. }
  104176. reqHeaders.Set("Content-Type", "application/json")
  104177. c.urlParams_.Set("alt", alt)
  104178. c.urlParams_.Set("prettyPrint", "false")
  104179. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  104180. urls += "?" + c.urlParams_.Encode()
  104181. req, err := http.NewRequest("POST", urls, body)
  104182. if err != nil {
  104183. return nil, err
  104184. }
  104185. req.Header = reqHeaders
  104186. googleapi.Expand(req.URL, map[string]string{
  104187. "project": c.project,
  104188. "region": c.region,
  104189. "resource": c.resource,
  104190. })
  104191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104192. }
  104193. // Do executes the "compute.subnetworks.setIamPolicy" call.
  104194. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  104195. // code is an error. Response headers are in either
  104196. // *Policy.ServerResponse.Header or (if a response was returned at all)
  104197. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  104198. // check whether the returned error was because http.StatusNotModified
  104199. // was returned.
  104200. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  104201. gensupport.SetOptions(c.urlParams_, opts...)
  104202. res, err := c.doRequest("json")
  104203. if res != nil && res.StatusCode == http.StatusNotModified {
  104204. if res.Body != nil {
  104205. res.Body.Close()
  104206. }
  104207. return nil, &googleapi.Error{
  104208. Code: res.StatusCode,
  104209. Header: res.Header,
  104210. }
  104211. }
  104212. if err != nil {
  104213. return nil, err
  104214. }
  104215. defer googleapi.CloseBody(res)
  104216. if err := googleapi.CheckResponse(res); err != nil {
  104217. return nil, err
  104218. }
  104219. ret := &Policy{
  104220. ServerResponse: googleapi.ServerResponse{
  104221. Header: res.Header,
  104222. HTTPStatusCode: res.StatusCode,
  104223. },
  104224. }
  104225. target := &ret
  104226. if err := gensupport.DecodeResponse(target, res); err != nil {
  104227. return nil, err
  104228. }
  104229. return ret, nil
  104230. // {
  104231. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  104232. // "httpMethod": "POST",
  104233. // "id": "compute.subnetworks.setIamPolicy",
  104234. // "parameterOrder": [
  104235. // "project",
  104236. // "region",
  104237. // "resource"
  104238. // ],
  104239. // "parameters": {
  104240. // "project": {
  104241. // "description": "Project ID for this request.",
  104242. // "location": "path",
  104243. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104244. // "required": true,
  104245. // "type": "string"
  104246. // },
  104247. // "region": {
  104248. // "description": "The name of the region for this request.",
  104249. // "location": "path",
  104250. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104251. // "required": true,
  104252. // "type": "string"
  104253. // },
  104254. // "resource": {
  104255. // "description": "Name or id of the resource for this request.",
  104256. // "location": "path",
  104257. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104258. // "required": true,
  104259. // "type": "string"
  104260. // }
  104261. // },
  104262. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  104263. // "request": {
  104264. // "$ref": "RegionSetPolicyRequest"
  104265. // },
  104266. // "response": {
  104267. // "$ref": "Policy"
  104268. // },
  104269. // "scopes": [
  104270. // "https://www.googleapis.com/auth/cloud-platform",
  104271. // "https://www.googleapis.com/auth/compute"
  104272. // ]
  104273. // }
  104274. }
  104275. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  104276. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  104277. s *Service
  104278. project string
  104279. region string
  104280. subnetwork string
  104281. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  104282. urlParams_ gensupport.URLParams
  104283. ctx_ context.Context
  104284. header_ http.Header
  104285. }
  104286. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  104287. // Google services without assigning external IP addresses through
  104288. // Private Google Access.
  104289. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  104290. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104291. c.project = project
  104292. c.region = region
  104293. c.subnetwork = subnetwork
  104294. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  104295. return c
  104296. }
  104297. // RequestId sets the optional parameter "requestId": An optional
  104298. // request ID to identify requests. Specify a unique request ID so that
  104299. // if you must retry your request, the server will know to ignore the
  104300. // request if it has already been completed.
  104301. //
  104302. // For example, consider a situation where you make an initial request
  104303. // and the request times out. If you make the request again with the
  104304. // same request ID, the server can check if original operation with the
  104305. // same request ID was received, and if so, will ignore the second
  104306. // request. This prevents clients from accidentally creating duplicate
  104307. // commitments.
  104308. //
  104309. // The request ID must be a valid UUID with the exception that zero UUID
  104310. // is not supported (00000000-0000-0000-0000-000000000000).
  104311. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  104312. c.urlParams_.Set("requestId", requestId)
  104313. return c
  104314. }
  104315. // Fields allows partial responses to be retrieved. See
  104316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104317. // for more information.
  104318. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  104319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104320. return c
  104321. }
  104322. // Context sets the context to be used in this call's Do method. Any
  104323. // pending HTTP request will be aborted if the provided context is
  104324. // canceled.
  104325. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  104326. c.ctx_ = ctx
  104327. return c
  104328. }
  104329. // Header returns an http.Header that can be modified by the caller to
  104330. // add HTTP headers to the request.
  104331. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  104332. if c.header_ == nil {
  104333. c.header_ = make(http.Header)
  104334. }
  104335. return c.header_
  104336. }
  104337. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  104338. reqHeaders := make(http.Header)
  104339. for k, v := range c.header_ {
  104340. reqHeaders[k] = v
  104341. }
  104342. reqHeaders.Set("User-Agent", c.s.userAgent())
  104343. var body io.Reader = nil
  104344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  104345. if err != nil {
  104346. return nil, err
  104347. }
  104348. reqHeaders.Set("Content-Type", "application/json")
  104349. c.urlParams_.Set("alt", alt)
  104350. c.urlParams_.Set("prettyPrint", "false")
  104351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  104352. urls += "?" + c.urlParams_.Encode()
  104353. req, err := http.NewRequest("POST", urls, body)
  104354. if err != nil {
  104355. return nil, err
  104356. }
  104357. req.Header = reqHeaders
  104358. googleapi.Expand(req.URL, map[string]string{
  104359. "project": c.project,
  104360. "region": c.region,
  104361. "subnetwork": c.subnetwork,
  104362. })
  104363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104364. }
  104365. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  104366. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104367. // status code is an error. Response headers are in either
  104368. // *Operation.ServerResponse.Header or (if a response was returned at
  104369. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104370. // to check whether the returned error was because
  104371. // http.StatusNotModified was returned.
  104372. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104373. gensupport.SetOptions(c.urlParams_, opts...)
  104374. res, err := c.doRequest("json")
  104375. if res != nil && res.StatusCode == http.StatusNotModified {
  104376. if res.Body != nil {
  104377. res.Body.Close()
  104378. }
  104379. return nil, &googleapi.Error{
  104380. Code: res.StatusCode,
  104381. Header: res.Header,
  104382. }
  104383. }
  104384. if err != nil {
  104385. return nil, err
  104386. }
  104387. defer googleapi.CloseBody(res)
  104388. if err := googleapi.CheckResponse(res); err != nil {
  104389. return nil, err
  104390. }
  104391. ret := &Operation{
  104392. ServerResponse: googleapi.ServerResponse{
  104393. Header: res.Header,
  104394. HTTPStatusCode: res.StatusCode,
  104395. },
  104396. }
  104397. target := &ret
  104398. if err := gensupport.DecodeResponse(target, res); err != nil {
  104399. return nil, err
  104400. }
  104401. return ret, nil
  104402. // {
  104403. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  104404. // "httpMethod": "POST",
  104405. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  104406. // "parameterOrder": [
  104407. // "project",
  104408. // "region",
  104409. // "subnetwork"
  104410. // ],
  104411. // "parameters": {
  104412. // "project": {
  104413. // "description": "Project ID for this request.",
  104414. // "location": "path",
  104415. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104416. // "required": true,
  104417. // "type": "string"
  104418. // },
  104419. // "region": {
  104420. // "description": "Name of the region scoping this request.",
  104421. // "location": "path",
  104422. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104423. // "required": true,
  104424. // "type": "string"
  104425. // },
  104426. // "requestId": {
  104427. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104428. // "location": "query",
  104429. // "type": "string"
  104430. // },
  104431. // "subnetwork": {
  104432. // "description": "Name of the Subnetwork resource.",
  104433. // "location": "path",
  104434. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104435. // "required": true,
  104436. // "type": "string"
  104437. // }
  104438. // },
  104439. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  104440. // "request": {
  104441. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  104442. // },
  104443. // "response": {
  104444. // "$ref": "Operation"
  104445. // },
  104446. // "scopes": [
  104447. // "https://www.googleapis.com/auth/cloud-platform",
  104448. // "https://www.googleapis.com/auth/compute"
  104449. // ]
  104450. // }
  104451. }
  104452. // method id "compute.subnetworks.testIamPermissions":
  104453. type SubnetworksTestIamPermissionsCall struct {
  104454. s *Service
  104455. project string
  104456. region string
  104457. resource string
  104458. testpermissionsrequest *TestPermissionsRequest
  104459. urlParams_ gensupport.URLParams
  104460. ctx_ context.Context
  104461. header_ http.Header
  104462. }
  104463. // TestIamPermissions: Returns permissions that a caller has on the
  104464. // specified resource.
  104465. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  104466. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104467. c.project = project
  104468. c.region = region
  104469. c.resource = resource
  104470. c.testpermissionsrequest = testpermissionsrequest
  104471. return c
  104472. }
  104473. // Fields allows partial responses to be retrieved. See
  104474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104475. // for more information.
  104476. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  104477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  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 *SubnetworksTestIamPermissionsCall) Header() http.Header {
  104490. if c.header_ == nil {
  104491. c.header_ = make(http.Header)
  104492. }
  104493. return c.header_
  104494. }
  104495. func (c *SubnetworksTestIamPermissionsCall) 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. var body io.Reader = nil
  104502. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  104503. if err != nil {
  104504. return nil, err
  104505. }
  104506. reqHeaders.Set("Content-Type", "application/json")
  104507. c.urlParams_.Set("alt", alt)
  104508. c.urlParams_.Set("prettyPrint", "false")
  104509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  104510. urls += "?" + c.urlParams_.Encode()
  104511. req, err := http.NewRequest("POST", urls, body)
  104512. if err != nil {
  104513. return nil, err
  104514. }
  104515. req.Header = reqHeaders
  104516. googleapi.Expand(req.URL, map[string]string{
  104517. "project": c.project,
  104518. "region": c.region,
  104519. "resource": c.resource,
  104520. })
  104521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104522. }
  104523. // Do executes the "compute.subnetworks.testIamPermissions" call.
  104524. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  104525. // non-2xx status code is an error. Response headers are in either
  104526. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  104527. // returned at all) in error.(*googleapi.Error).Header. Use
  104528. // googleapi.IsNotModified to check whether the returned error was
  104529. // because http.StatusNotModified was returned.
  104530. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  104531. gensupport.SetOptions(c.urlParams_, opts...)
  104532. res, err := c.doRequest("json")
  104533. if res != nil && res.StatusCode == http.StatusNotModified {
  104534. if res.Body != nil {
  104535. res.Body.Close()
  104536. }
  104537. return nil, &googleapi.Error{
  104538. Code: res.StatusCode,
  104539. Header: res.Header,
  104540. }
  104541. }
  104542. if err != nil {
  104543. return nil, err
  104544. }
  104545. defer googleapi.CloseBody(res)
  104546. if err := googleapi.CheckResponse(res); err != nil {
  104547. return nil, err
  104548. }
  104549. ret := &TestPermissionsResponse{
  104550. ServerResponse: googleapi.ServerResponse{
  104551. Header: res.Header,
  104552. HTTPStatusCode: res.StatusCode,
  104553. },
  104554. }
  104555. target := &ret
  104556. if err := gensupport.DecodeResponse(target, res); err != nil {
  104557. return nil, err
  104558. }
  104559. return ret, nil
  104560. // {
  104561. // "description": "Returns permissions that a caller has on the specified resource.",
  104562. // "httpMethod": "POST",
  104563. // "id": "compute.subnetworks.testIamPermissions",
  104564. // "parameterOrder": [
  104565. // "project",
  104566. // "region",
  104567. // "resource"
  104568. // ],
  104569. // "parameters": {
  104570. // "project": {
  104571. // "description": "Project ID for this request.",
  104572. // "location": "path",
  104573. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104574. // "required": true,
  104575. // "type": "string"
  104576. // },
  104577. // "region": {
  104578. // "description": "The name of the region for this request.",
  104579. // "location": "path",
  104580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104581. // "required": true,
  104582. // "type": "string"
  104583. // },
  104584. // "resource": {
  104585. // "description": "Name or id of the resource for this request.",
  104586. // "location": "path",
  104587. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104588. // "required": true,
  104589. // "type": "string"
  104590. // }
  104591. // },
  104592. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  104593. // "request": {
  104594. // "$ref": "TestPermissionsRequest"
  104595. // },
  104596. // "response": {
  104597. // "$ref": "TestPermissionsResponse"
  104598. // },
  104599. // "scopes": [
  104600. // "https://www.googleapis.com/auth/cloud-platform",
  104601. // "https://www.googleapis.com/auth/compute",
  104602. // "https://www.googleapis.com/auth/compute.readonly"
  104603. // ]
  104604. // }
  104605. }
  104606. // method id "compute.targetHttpProxies.delete":
  104607. type TargetHttpProxiesDeleteCall struct {
  104608. s *Service
  104609. project string
  104610. targetHttpProxy string
  104611. urlParams_ gensupport.URLParams
  104612. ctx_ context.Context
  104613. header_ http.Header
  104614. }
  104615. // Delete: Deletes the specified TargetHttpProxy resource.
  104616. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  104617. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  104618. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104619. c.project = project
  104620. c.targetHttpProxy = targetHttpProxy
  104621. return c
  104622. }
  104623. // RequestId sets the optional parameter "requestId": An optional
  104624. // request ID to identify requests. Specify a unique request ID so that
  104625. // if you must retry your request, the server will know to ignore the
  104626. // request if it has already been completed.
  104627. //
  104628. // For example, consider a situation where you make an initial request
  104629. // and the request times out. If you make the request again with the
  104630. // same request ID, the server can check if original operation with the
  104631. // same request ID was received, and if so, will ignore the second
  104632. // request. This prevents clients from accidentally creating duplicate
  104633. // commitments.
  104634. //
  104635. // The request ID must be a valid UUID with the exception that zero UUID
  104636. // is not supported (00000000-0000-0000-0000-000000000000).
  104637. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  104638. c.urlParams_.Set("requestId", requestId)
  104639. return c
  104640. }
  104641. // Fields allows partial responses to be retrieved. See
  104642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104643. // for more information.
  104644. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  104645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104646. return c
  104647. }
  104648. // Context sets the context to be used in this call's Do method. Any
  104649. // pending HTTP request will be aborted if the provided context is
  104650. // canceled.
  104651. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  104652. c.ctx_ = ctx
  104653. return c
  104654. }
  104655. // Header returns an http.Header that can be modified by the caller to
  104656. // add HTTP headers to the request.
  104657. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  104658. if c.header_ == nil {
  104659. c.header_ = make(http.Header)
  104660. }
  104661. return c.header_
  104662. }
  104663. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  104664. reqHeaders := make(http.Header)
  104665. for k, v := range c.header_ {
  104666. reqHeaders[k] = v
  104667. }
  104668. reqHeaders.Set("User-Agent", c.s.userAgent())
  104669. var body io.Reader = nil
  104670. c.urlParams_.Set("alt", alt)
  104671. c.urlParams_.Set("prettyPrint", "false")
  104672. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  104673. urls += "?" + c.urlParams_.Encode()
  104674. req, err := http.NewRequest("DELETE", urls, body)
  104675. if err != nil {
  104676. return nil, err
  104677. }
  104678. req.Header = reqHeaders
  104679. googleapi.Expand(req.URL, map[string]string{
  104680. "project": c.project,
  104681. "targetHttpProxy": c.targetHttpProxy,
  104682. })
  104683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104684. }
  104685. // Do executes the "compute.targetHttpProxies.delete" call.
  104686. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104687. // status code is an error. Response headers are in either
  104688. // *Operation.ServerResponse.Header or (if a response was returned at
  104689. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104690. // to check whether the returned error was because
  104691. // http.StatusNotModified was returned.
  104692. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104693. gensupport.SetOptions(c.urlParams_, opts...)
  104694. res, err := c.doRequest("json")
  104695. if res != nil && res.StatusCode == http.StatusNotModified {
  104696. if res.Body != nil {
  104697. res.Body.Close()
  104698. }
  104699. return nil, &googleapi.Error{
  104700. Code: res.StatusCode,
  104701. Header: res.Header,
  104702. }
  104703. }
  104704. if err != nil {
  104705. return nil, err
  104706. }
  104707. defer googleapi.CloseBody(res)
  104708. if err := googleapi.CheckResponse(res); err != nil {
  104709. return nil, err
  104710. }
  104711. ret := &Operation{
  104712. ServerResponse: googleapi.ServerResponse{
  104713. Header: res.Header,
  104714. HTTPStatusCode: res.StatusCode,
  104715. },
  104716. }
  104717. target := &ret
  104718. if err := gensupport.DecodeResponse(target, res); err != nil {
  104719. return nil, err
  104720. }
  104721. return ret, nil
  104722. // {
  104723. // "description": "Deletes the specified TargetHttpProxy resource.",
  104724. // "httpMethod": "DELETE",
  104725. // "id": "compute.targetHttpProxies.delete",
  104726. // "parameterOrder": [
  104727. // "project",
  104728. // "targetHttpProxy"
  104729. // ],
  104730. // "parameters": {
  104731. // "project": {
  104732. // "description": "Project ID for this request.",
  104733. // "location": "path",
  104734. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104735. // "required": true,
  104736. // "type": "string"
  104737. // },
  104738. // "requestId": {
  104739. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104740. // "location": "query",
  104741. // "type": "string"
  104742. // },
  104743. // "targetHttpProxy": {
  104744. // "description": "Name of the TargetHttpProxy resource to delete.",
  104745. // "location": "path",
  104746. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104747. // "required": true,
  104748. // "type": "string"
  104749. // }
  104750. // },
  104751. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  104752. // "response": {
  104753. // "$ref": "Operation"
  104754. // },
  104755. // "scopes": [
  104756. // "https://www.googleapis.com/auth/cloud-platform",
  104757. // "https://www.googleapis.com/auth/compute"
  104758. // ]
  104759. // }
  104760. }
  104761. // method id "compute.targetHttpProxies.get":
  104762. type TargetHttpProxiesGetCall struct {
  104763. s *Service
  104764. project string
  104765. targetHttpProxy string
  104766. urlParams_ gensupport.URLParams
  104767. ifNoneMatch_ string
  104768. ctx_ context.Context
  104769. header_ http.Header
  104770. }
  104771. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  104772. // available target HTTP proxies by making a list() request.
  104773. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  104774. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  104775. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104776. c.project = project
  104777. c.targetHttpProxy = targetHttpProxy
  104778. return c
  104779. }
  104780. // Fields allows partial responses to be retrieved. See
  104781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104782. // for more information.
  104783. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  104784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104785. return c
  104786. }
  104787. // IfNoneMatch sets the optional parameter which makes the operation
  104788. // fail if the object's ETag matches the given value. This is useful for
  104789. // getting updates only after the object has changed since the last
  104790. // request. Use googleapi.IsNotModified to check whether the response
  104791. // error from Do is the result of In-None-Match.
  104792. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  104793. c.ifNoneMatch_ = entityTag
  104794. return c
  104795. }
  104796. // Context sets the context to be used in this call's Do method. Any
  104797. // pending HTTP request will be aborted if the provided context is
  104798. // canceled.
  104799. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  104800. c.ctx_ = ctx
  104801. return c
  104802. }
  104803. // Header returns an http.Header that can be modified by the caller to
  104804. // add HTTP headers to the request.
  104805. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  104806. if c.header_ == nil {
  104807. c.header_ = make(http.Header)
  104808. }
  104809. return c.header_
  104810. }
  104811. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  104812. reqHeaders := make(http.Header)
  104813. for k, v := range c.header_ {
  104814. reqHeaders[k] = v
  104815. }
  104816. reqHeaders.Set("User-Agent", c.s.userAgent())
  104817. if c.ifNoneMatch_ != "" {
  104818. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104819. }
  104820. var body io.Reader = nil
  104821. c.urlParams_.Set("alt", alt)
  104822. c.urlParams_.Set("prettyPrint", "false")
  104823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  104824. urls += "?" + c.urlParams_.Encode()
  104825. req, err := http.NewRequest("GET", urls, body)
  104826. if err != nil {
  104827. return nil, err
  104828. }
  104829. req.Header = reqHeaders
  104830. googleapi.Expand(req.URL, map[string]string{
  104831. "project": c.project,
  104832. "targetHttpProxy": c.targetHttpProxy,
  104833. })
  104834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104835. }
  104836. // Do executes the "compute.targetHttpProxies.get" call.
  104837. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  104838. // status code is an error. Response headers are in either
  104839. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  104840. // at all) in error.(*googleapi.Error).Header. Use
  104841. // googleapi.IsNotModified to check whether the returned error was
  104842. // because http.StatusNotModified was returned.
  104843. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  104844. gensupport.SetOptions(c.urlParams_, opts...)
  104845. res, err := c.doRequest("json")
  104846. if res != nil && res.StatusCode == http.StatusNotModified {
  104847. if res.Body != nil {
  104848. res.Body.Close()
  104849. }
  104850. return nil, &googleapi.Error{
  104851. Code: res.StatusCode,
  104852. Header: res.Header,
  104853. }
  104854. }
  104855. if err != nil {
  104856. return nil, err
  104857. }
  104858. defer googleapi.CloseBody(res)
  104859. if err := googleapi.CheckResponse(res); err != nil {
  104860. return nil, err
  104861. }
  104862. ret := &TargetHttpProxy{
  104863. ServerResponse: googleapi.ServerResponse{
  104864. Header: res.Header,
  104865. HTTPStatusCode: res.StatusCode,
  104866. },
  104867. }
  104868. target := &ret
  104869. if err := gensupport.DecodeResponse(target, res); err != nil {
  104870. return nil, err
  104871. }
  104872. return ret, nil
  104873. // {
  104874. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  104875. // "httpMethod": "GET",
  104876. // "id": "compute.targetHttpProxies.get",
  104877. // "parameterOrder": [
  104878. // "project",
  104879. // "targetHttpProxy"
  104880. // ],
  104881. // "parameters": {
  104882. // "project": {
  104883. // "description": "Project ID for this request.",
  104884. // "location": "path",
  104885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104886. // "required": true,
  104887. // "type": "string"
  104888. // },
  104889. // "targetHttpProxy": {
  104890. // "description": "Name of the TargetHttpProxy resource to return.",
  104891. // "location": "path",
  104892. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104893. // "required": true,
  104894. // "type": "string"
  104895. // }
  104896. // },
  104897. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  104898. // "response": {
  104899. // "$ref": "TargetHttpProxy"
  104900. // },
  104901. // "scopes": [
  104902. // "https://www.googleapis.com/auth/cloud-platform",
  104903. // "https://www.googleapis.com/auth/compute",
  104904. // "https://www.googleapis.com/auth/compute.readonly"
  104905. // ]
  104906. // }
  104907. }
  104908. // method id "compute.targetHttpProxies.insert":
  104909. type TargetHttpProxiesInsertCall struct {
  104910. s *Service
  104911. project string
  104912. targethttpproxy *TargetHttpProxy
  104913. urlParams_ gensupport.URLParams
  104914. ctx_ context.Context
  104915. header_ http.Header
  104916. }
  104917. // Insert: Creates a TargetHttpProxy resource in the specified project
  104918. // using the data included in the request.
  104919. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  104920. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  104921. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104922. c.project = project
  104923. c.targethttpproxy = targethttpproxy
  104924. return c
  104925. }
  104926. // RequestId sets the optional parameter "requestId": An optional
  104927. // request ID to identify requests. Specify a unique request ID so that
  104928. // if you must retry your request, the server will know to ignore the
  104929. // request if it has already been completed.
  104930. //
  104931. // For example, consider a situation where you make an initial request
  104932. // and the request times out. If you make the request again with the
  104933. // same request ID, the server can check if original operation with the
  104934. // same request ID was received, and if so, will ignore the second
  104935. // request. This prevents clients from accidentally creating duplicate
  104936. // commitments.
  104937. //
  104938. // The request ID must be a valid UUID with the exception that zero UUID
  104939. // is not supported (00000000-0000-0000-0000-000000000000).
  104940. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  104941. c.urlParams_.Set("requestId", requestId)
  104942. return c
  104943. }
  104944. // Fields allows partial responses to be retrieved. See
  104945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104946. // for more information.
  104947. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  104948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104949. return c
  104950. }
  104951. // Context sets the context to be used in this call's Do method. Any
  104952. // pending HTTP request will be aborted if the provided context is
  104953. // canceled.
  104954. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  104955. c.ctx_ = ctx
  104956. return c
  104957. }
  104958. // Header returns an http.Header that can be modified by the caller to
  104959. // add HTTP headers to the request.
  104960. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  104961. if c.header_ == nil {
  104962. c.header_ = make(http.Header)
  104963. }
  104964. return c.header_
  104965. }
  104966. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  104967. reqHeaders := make(http.Header)
  104968. for k, v := range c.header_ {
  104969. reqHeaders[k] = v
  104970. }
  104971. reqHeaders.Set("User-Agent", c.s.userAgent())
  104972. var body io.Reader = nil
  104973. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  104974. if err != nil {
  104975. return nil, err
  104976. }
  104977. reqHeaders.Set("Content-Type", "application/json")
  104978. c.urlParams_.Set("alt", alt)
  104979. c.urlParams_.Set("prettyPrint", "false")
  104980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  104981. urls += "?" + c.urlParams_.Encode()
  104982. req, err := http.NewRequest("POST", urls, body)
  104983. if err != nil {
  104984. return nil, err
  104985. }
  104986. req.Header = reqHeaders
  104987. googleapi.Expand(req.URL, map[string]string{
  104988. "project": c.project,
  104989. })
  104990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104991. }
  104992. // Do executes the "compute.targetHttpProxies.insert" call.
  104993. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104994. // status code is an error. Response headers are in either
  104995. // *Operation.ServerResponse.Header or (if a response was returned at
  104996. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104997. // to check whether the returned error was because
  104998. // http.StatusNotModified was returned.
  104999. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105000. gensupport.SetOptions(c.urlParams_, opts...)
  105001. res, err := c.doRequest("json")
  105002. if res != nil && res.StatusCode == http.StatusNotModified {
  105003. if res.Body != nil {
  105004. res.Body.Close()
  105005. }
  105006. return nil, &googleapi.Error{
  105007. Code: res.StatusCode,
  105008. Header: res.Header,
  105009. }
  105010. }
  105011. if err != nil {
  105012. return nil, err
  105013. }
  105014. defer googleapi.CloseBody(res)
  105015. if err := googleapi.CheckResponse(res); err != nil {
  105016. return nil, err
  105017. }
  105018. ret := &Operation{
  105019. ServerResponse: googleapi.ServerResponse{
  105020. Header: res.Header,
  105021. HTTPStatusCode: res.StatusCode,
  105022. },
  105023. }
  105024. target := &ret
  105025. if err := gensupport.DecodeResponse(target, res); err != nil {
  105026. return nil, err
  105027. }
  105028. return ret, nil
  105029. // {
  105030. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  105031. // "httpMethod": "POST",
  105032. // "id": "compute.targetHttpProxies.insert",
  105033. // "parameterOrder": [
  105034. // "project"
  105035. // ],
  105036. // "parameters": {
  105037. // "project": {
  105038. // "description": "Project ID for this request.",
  105039. // "location": "path",
  105040. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105041. // "required": true,
  105042. // "type": "string"
  105043. // },
  105044. // "requestId": {
  105045. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105046. // "location": "query",
  105047. // "type": "string"
  105048. // }
  105049. // },
  105050. // "path": "{project}/global/targetHttpProxies",
  105051. // "request": {
  105052. // "$ref": "TargetHttpProxy"
  105053. // },
  105054. // "response": {
  105055. // "$ref": "Operation"
  105056. // },
  105057. // "scopes": [
  105058. // "https://www.googleapis.com/auth/cloud-platform",
  105059. // "https://www.googleapis.com/auth/compute"
  105060. // ]
  105061. // }
  105062. }
  105063. // method id "compute.targetHttpProxies.list":
  105064. type TargetHttpProxiesListCall struct {
  105065. s *Service
  105066. project string
  105067. urlParams_ gensupport.URLParams
  105068. ifNoneMatch_ string
  105069. ctx_ context.Context
  105070. header_ http.Header
  105071. }
  105072. // List: Retrieves the list of TargetHttpProxy resources available to
  105073. // the specified project.
  105074. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  105075. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  105076. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105077. c.project = project
  105078. return c
  105079. }
  105080. // Filter sets the optional parameter "filter": A filter expression that
  105081. // filters resources listed in the response. The expression must specify
  105082. // the field name, a comparison operator, and the value that you want to
  105083. // use for filtering. The value must be a string, a number, or a
  105084. // boolean. The comparison operator must be either =, !=, >, or <.
  105085. //
  105086. // For example, if you are filtering Compute Engine instances, you can
  105087. // exclude instances named example-instance by specifying name !=
  105088. // example-instance.
  105089. //
  105090. // You can also filter nested fields. For example, you could specify
  105091. // scheduling.automaticRestart = false to include instances only if they
  105092. // are not scheduled for automatic restarts. You can use filtering on
  105093. // nested fields to filter based on resource labels.
  105094. //
  105095. // To filter on multiple expressions, provide each separate expression
  105096. // within parentheses. For example, (scheduling.automaticRestart = true)
  105097. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  105098. // AND expression. However, you can include AND and OR expressions
  105099. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  105100. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  105101. // true).
  105102. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  105103. c.urlParams_.Set("filter", filter)
  105104. return c
  105105. }
  105106. // MaxResults sets the optional parameter "maxResults": The maximum
  105107. // number of results per page that should be returned. If the number of
  105108. // available results is larger than maxResults, Compute Engine returns a
  105109. // nextPageToken that can be used to get the next page of results in
  105110. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  105111. // (Default: 500)
  105112. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  105113. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  105114. return c
  105115. }
  105116. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  105117. // a certain order. By default, results are returned in alphanumerical
  105118. // order based on the resource name.
  105119. //
  105120. // You can also sort results in descending order based on the creation
  105121. // timestamp using orderBy="creationTimestamp desc". This sorts results
  105122. // based on the creationTimestamp field in reverse chronological order
  105123. // (newest result first). Use this to sort resources like operations so
  105124. // that the newest operation is returned first.
  105125. //
  105126. // Currently, only sorting by name or creationTimestamp desc is
  105127. // supported.
  105128. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  105129. c.urlParams_.Set("orderBy", orderBy)
  105130. return c
  105131. }
  105132. // PageToken sets the optional parameter "pageToken": Specifies a page
  105133. // token to use. Set pageToken to the nextPageToken returned by a
  105134. // previous list request to get the next page of results.
  105135. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  105136. c.urlParams_.Set("pageToken", pageToken)
  105137. return c
  105138. }
  105139. // Fields allows partial responses to be retrieved. See
  105140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105141. // for more information.
  105142. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  105143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105144. return c
  105145. }
  105146. // IfNoneMatch sets the optional parameter which makes the operation
  105147. // fail if the object's ETag matches the given value. This is useful for
  105148. // getting updates only after the object has changed since the last
  105149. // request. Use googleapi.IsNotModified to check whether the response
  105150. // error from Do is the result of In-None-Match.
  105151. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  105152. c.ifNoneMatch_ = entityTag
  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 *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  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 *TargetHttpProxiesListCall) Header() http.Header {
  105165. if c.header_ == nil {
  105166. c.header_ = make(http.Header)
  105167. }
  105168. return c.header_
  105169. }
  105170. func (c *TargetHttpProxiesListCall) 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. if c.ifNoneMatch_ != "" {
  105177. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105178. }
  105179. var body io.Reader = nil
  105180. c.urlParams_.Set("alt", alt)
  105181. c.urlParams_.Set("prettyPrint", "false")
  105182. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  105183. urls += "?" + c.urlParams_.Encode()
  105184. req, err := http.NewRequest("GET", urls, body)
  105185. if err != nil {
  105186. return nil, err
  105187. }
  105188. req.Header = reqHeaders
  105189. googleapi.Expand(req.URL, map[string]string{
  105190. "project": c.project,
  105191. })
  105192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105193. }
  105194. // Do executes the "compute.targetHttpProxies.list" call.
  105195. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  105196. // non-2xx status code is an error. Response headers are in either
  105197. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  105198. // returned at all) in error.(*googleapi.Error).Header. Use
  105199. // googleapi.IsNotModified to check whether the returned error was
  105200. // because http.StatusNotModified was returned.
  105201. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  105202. gensupport.SetOptions(c.urlParams_, opts...)
  105203. res, err := c.doRequest("json")
  105204. if res != nil && res.StatusCode == http.StatusNotModified {
  105205. if res.Body != nil {
  105206. res.Body.Close()
  105207. }
  105208. return nil, &googleapi.Error{
  105209. Code: res.StatusCode,
  105210. Header: res.Header,
  105211. }
  105212. }
  105213. if err != nil {
  105214. return nil, err
  105215. }
  105216. defer googleapi.CloseBody(res)
  105217. if err := googleapi.CheckResponse(res); err != nil {
  105218. return nil, err
  105219. }
  105220. ret := &TargetHttpProxyList{
  105221. ServerResponse: googleapi.ServerResponse{
  105222. Header: res.Header,
  105223. HTTPStatusCode: res.StatusCode,
  105224. },
  105225. }
  105226. target := &ret
  105227. if err := gensupport.DecodeResponse(target, res); err != nil {
  105228. return nil, err
  105229. }
  105230. return ret, nil
  105231. // {
  105232. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  105233. // "httpMethod": "GET",
  105234. // "id": "compute.targetHttpProxies.list",
  105235. // "parameterOrder": [
  105236. // "project"
  105237. // ],
  105238. // "parameters": {
  105239. // "filter": {
  105240. // "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).",
  105241. // "location": "query",
  105242. // "type": "string"
  105243. // },
  105244. // "maxResults": {
  105245. // "default": "500",
  105246. // "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)",
  105247. // "format": "uint32",
  105248. // "location": "query",
  105249. // "minimum": "0",
  105250. // "type": "integer"
  105251. // },
  105252. // "orderBy": {
  105253. // "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.",
  105254. // "location": "query",
  105255. // "type": "string"
  105256. // },
  105257. // "pageToken": {
  105258. // "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.",
  105259. // "location": "query",
  105260. // "type": "string"
  105261. // },
  105262. // "project": {
  105263. // "description": "Project ID for this request.",
  105264. // "location": "path",
  105265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105266. // "required": true,
  105267. // "type": "string"
  105268. // }
  105269. // },
  105270. // "path": "{project}/global/targetHttpProxies",
  105271. // "response": {
  105272. // "$ref": "TargetHttpProxyList"
  105273. // },
  105274. // "scopes": [
  105275. // "https://www.googleapis.com/auth/cloud-platform",
  105276. // "https://www.googleapis.com/auth/compute",
  105277. // "https://www.googleapis.com/auth/compute.readonly"
  105278. // ]
  105279. // }
  105280. }
  105281. // Pages invokes f for each page of results.
  105282. // A non-nil error returned from f will halt the iteration.
  105283. // The provided context supersedes any context provided to the Context method.
  105284. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  105285. c.ctx_ = ctx
  105286. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  105287. for {
  105288. x, err := c.Do()
  105289. if err != nil {
  105290. return err
  105291. }
  105292. if err := f(x); err != nil {
  105293. return err
  105294. }
  105295. if x.NextPageToken == "" {
  105296. return nil
  105297. }
  105298. c.PageToken(x.NextPageToken)
  105299. }
  105300. }
  105301. // method id "compute.targetHttpProxies.setUrlMap":
  105302. type TargetHttpProxiesSetUrlMapCall struct {
  105303. s *Service
  105304. project string
  105305. targetHttpProxy string
  105306. urlmapreference *UrlMapReference
  105307. urlParams_ gensupport.URLParams
  105308. ctx_ context.Context
  105309. header_ http.Header
  105310. }
  105311. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  105312. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  105313. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  105314. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105315. c.project = project
  105316. c.targetHttpProxy = targetHttpProxy
  105317. c.urlmapreference = urlmapreference
  105318. return c
  105319. }
  105320. // RequestId sets the optional parameter "requestId": An optional
  105321. // request ID to identify requests. Specify a unique request ID so that
  105322. // if you must retry your request, the server will know to ignore the
  105323. // request if it has already been completed.
  105324. //
  105325. // For example, consider a situation where you make an initial request
  105326. // and the request times out. If you make the request again with the
  105327. // same request ID, the server can check if original operation with the
  105328. // same request ID was received, and if so, will ignore the second
  105329. // request. This prevents clients from accidentally creating duplicate
  105330. // commitments.
  105331. //
  105332. // The request ID must be a valid UUID with the exception that zero UUID
  105333. // is not supported (00000000-0000-0000-0000-000000000000).
  105334. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  105335. c.urlParams_.Set("requestId", requestId)
  105336. return c
  105337. }
  105338. // Fields allows partial responses to be retrieved. See
  105339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105340. // for more information.
  105341. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  105342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105343. return c
  105344. }
  105345. // Context sets the context to be used in this call's Do method. Any
  105346. // pending HTTP request will be aborted if the provided context is
  105347. // canceled.
  105348. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  105349. c.ctx_ = ctx
  105350. return c
  105351. }
  105352. // Header returns an http.Header that can be modified by the caller to
  105353. // add HTTP headers to the request.
  105354. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  105355. if c.header_ == nil {
  105356. c.header_ = make(http.Header)
  105357. }
  105358. return c.header_
  105359. }
  105360. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  105361. reqHeaders := make(http.Header)
  105362. for k, v := range c.header_ {
  105363. reqHeaders[k] = v
  105364. }
  105365. reqHeaders.Set("User-Agent", c.s.userAgent())
  105366. var body io.Reader = nil
  105367. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  105368. if err != nil {
  105369. return nil, err
  105370. }
  105371. reqHeaders.Set("Content-Type", "application/json")
  105372. c.urlParams_.Set("alt", alt)
  105373. c.urlParams_.Set("prettyPrint", "false")
  105374. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  105375. urls += "?" + c.urlParams_.Encode()
  105376. req, err := http.NewRequest("POST", urls, body)
  105377. if err != nil {
  105378. return nil, err
  105379. }
  105380. req.Header = reqHeaders
  105381. googleapi.Expand(req.URL, map[string]string{
  105382. "project": c.project,
  105383. "targetHttpProxy": c.targetHttpProxy,
  105384. })
  105385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105386. }
  105387. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  105388. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105389. // status code is an error. Response headers are in either
  105390. // *Operation.ServerResponse.Header or (if a response was returned at
  105391. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105392. // to check whether the returned error was because
  105393. // http.StatusNotModified was returned.
  105394. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105395. gensupport.SetOptions(c.urlParams_, opts...)
  105396. res, err := c.doRequest("json")
  105397. if res != nil && res.StatusCode == http.StatusNotModified {
  105398. if res.Body != nil {
  105399. res.Body.Close()
  105400. }
  105401. return nil, &googleapi.Error{
  105402. Code: res.StatusCode,
  105403. Header: res.Header,
  105404. }
  105405. }
  105406. if err != nil {
  105407. return nil, err
  105408. }
  105409. defer googleapi.CloseBody(res)
  105410. if err := googleapi.CheckResponse(res); err != nil {
  105411. return nil, err
  105412. }
  105413. ret := &Operation{
  105414. ServerResponse: googleapi.ServerResponse{
  105415. Header: res.Header,
  105416. HTTPStatusCode: res.StatusCode,
  105417. },
  105418. }
  105419. target := &ret
  105420. if err := gensupport.DecodeResponse(target, res); err != nil {
  105421. return nil, err
  105422. }
  105423. return ret, nil
  105424. // {
  105425. // "description": "Changes the URL map for TargetHttpProxy.",
  105426. // "httpMethod": "POST",
  105427. // "id": "compute.targetHttpProxies.setUrlMap",
  105428. // "parameterOrder": [
  105429. // "project",
  105430. // "targetHttpProxy"
  105431. // ],
  105432. // "parameters": {
  105433. // "project": {
  105434. // "description": "Project ID for this request.",
  105435. // "location": "path",
  105436. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105437. // "required": true,
  105438. // "type": "string"
  105439. // },
  105440. // "requestId": {
  105441. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105442. // "location": "query",
  105443. // "type": "string"
  105444. // },
  105445. // "targetHttpProxy": {
  105446. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  105447. // "location": "path",
  105448. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105449. // "required": true,
  105450. // "type": "string"
  105451. // }
  105452. // },
  105453. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  105454. // "request": {
  105455. // "$ref": "UrlMapReference"
  105456. // },
  105457. // "response": {
  105458. // "$ref": "Operation"
  105459. // },
  105460. // "scopes": [
  105461. // "https://www.googleapis.com/auth/cloud-platform",
  105462. // "https://www.googleapis.com/auth/compute"
  105463. // ]
  105464. // }
  105465. }
  105466. // method id "compute.targetHttpProxies.testIamPermissions":
  105467. type TargetHttpProxiesTestIamPermissionsCall struct {
  105468. s *Service
  105469. project string
  105470. resource string
  105471. testpermissionsrequest *TestPermissionsRequest
  105472. urlParams_ gensupport.URLParams
  105473. ctx_ context.Context
  105474. header_ http.Header
  105475. }
  105476. // TestIamPermissions: Returns permissions that a caller has on the
  105477. // specified resource.
  105478. func (r *TargetHttpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpProxiesTestIamPermissionsCall {
  105479. c := &TargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105480. c.project = project
  105481. c.resource = resource
  105482. c.testpermissionsrequest = testpermissionsrequest
  105483. return c
  105484. }
  105485. // Fields allows partial responses to be retrieved. See
  105486. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105487. // for more information.
  105488. func (c *TargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpProxiesTestIamPermissionsCall {
  105489. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105490. return c
  105491. }
  105492. // Context sets the context to be used in this call's Do method. Any
  105493. // pending HTTP request will be aborted if the provided context is
  105494. // canceled.
  105495. func (c *TargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpProxiesTestIamPermissionsCall {
  105496. c.ctx_ = ctx
  105497. return c
  105498. }
  105499. // Header returns an http.Header that can be modified by the caller to
  105500. // add HTTP headers to the request.
  105501. func (c *TargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  105502. if c.header_ == nil {
  105503. c.header_ = make(http.Header)
  105504. }
  105505. return c.header_
  105506. }
  105507. func (c *TargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  105508. reqHeaders := make(http.Header)
  105509. for k, v := range c.header_ {
  105510. reqHeaders[k] = v
  105511. }
  105512. reqHeaders.Set("User-Agent", c.s.userAgent())
  105513. var body io.Reader = nil
  105514. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  105515. if err != nil {
  105516. return nil, err
  105517. }
  105518. reqHeaders.Set("Content-Type", "application/json")
  105519. c.urlParams_.Set("alt", alt)
  105520. c.urlParams_.Set("prettyPrint", "false")
  105521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{resource}/testIamPermissions")
  105522. urls += "?" + c.urlParams_.Encode()
  105523. req, err := http.NewRequest("POST", urls, body)
  105524. if err != nil {
  105525. return nil, err
  105526. }
  105527. req.Header = reqHeaders
  105528. googleapi.Expand(req.URL, map[string]string{
  105529. "project": c.project,
  105530. "resource": c.resource,
  105531. })
  105532. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105533. }
  105534. // Do executes the "compute.targetHttpProxies.testIamPermissions" call.
  105535. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  105536. // non-2xx status code is an error. Response headers are in either
  105537. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  105538. // returned at all) in error.(*googleapi.Error).Header. Use
  105539. // googleapi.IsNotModified to check whether the returned error was
  105540. // because http.StatusNotModified was returned.
  105541. func (c *TargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  105542. gensupport.SetOptions(c.urlParams_, opts...)
  105543. res, err := c.doRequest("json")
  105544. if res != nil && res.StatusCode == http.StatusNotModified {
  105545. if res.Body != nil {
  105546. res.Body.Close()
  105547. }
  105548. return nil, &googleapi.Error{
  105549. Code: res.StatusCode,
  105550. Header: res.Header,
  105551. }
  105552. }
  105553. if err != nil {
  105554. return nil, err
  105555. }
  105556. defer googleapi.CloseBody(res)
  105557. if err := googleapi.CheckResponse(res); err != nil {
  105558. return nil, err
  105559. }
  105560. ret := &TestPermissionsResponse{
  105561. ServerResponse: googleapi.ServerResponse{
  105562. Header: res.Header,
  105563. HTTPStatusCode: res.StatusCode,
  105564. },
  105565. }
  105566. target := &ret
  105567. if err := gensupport.DecodeResponse(target, res); err != nil {
  105568. return nil, err
  105569. }
  105570. return ret, nil
  105571. // {
  105572. // "description": "Returns permissions that a caller has on the specified resource.",
  105573. // "httpMethod": "POST",
  105574. // "id": "compute.targetHttpProxies.testIamPermissions",
  105575. // "parameterOrder": [
  105576. // "project",
  105577. // "resource"
  105578. // ],
  105579. // "parameters": {
  105580. // "project": {
  105581. // "description": "Project ID for this request.",
  105582. // "location": "path",
  105583. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105584. // "required": true,
  105585. // "type": "string"
  105586. // },
  105587. // "resource": {
  105588. // "description": "Name or id of the resource for this request.",
  105589. // "location": "path",
  105590. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105591. // "required": true,
  105592. // "type": "string"
  105593. // }
  105594. // },
  105595. // "path": "{project}/global/targetHttpProxies/{resource}/testIamPermissions",
  105596. // "request": {
  105597. // "$ref": "TestPermissionsRequest"
  105598. // },
  105599. // "response": {
  105600. // "$ref": "TestPermissionsResponse"
  105601. // },
  105602. // "scopes": [
  105603. // "https://www.googleapis.com/auth/cloud-platform",
  105604. // "https://www.googleapis.com/auth/compute",
  105605. // "https://www.googleapis.com/auth/compute.readonly"
  105606. // ]
  105607. // }
  105608. }
  105609. // method id "compute.targetHttpsProxies.delete":
  105610. type TargetHttpsProxiesDeleteCall struct {
  105611. s *Service
  105612. project string
  105613. targetHttpsProxy string
  105614. urlParams_ gensupport.URLParams
  105615. ctx_ context.Context
  105616. header_ http.Header
  105617. }
  105618. // Delete: Deletes the specified TargetHttpsProxy resource.
  105619. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  105620. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105621. c.project = project
  105622. c.targetHttpsProxy = targetHttpsProxy
  105623. return c
  105624. }
  105625. // RequestId sets the optional parameter "requestId": An optional
  105626. // request ID to identify requests. Specify a unique request ID so that
  105627. // if you must retry your request, the server will know to ignore the
  105628. // request if it has already been completed.
  105629. //
  105630. // For example, consider a situation where you make an initial request
  105631. // and the request times out. If you make the request again with the
  105632. // same request ID, the server can check if original operation with the
  105633. // same request ID was received, and if so, will ignore the second
  105634. // request. This prevents clients from accidentally creating duplicate
  105635. // commitments.
  105636. //
  105637. // The request ID must be a valid UUID with the exception that zero UUID
  105638. // is not supported (00000000-0000-0000-0000-000000000000).
  105639. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  105640. c.urlParams_.Set("requestId", requestId)
  105641. return c
  105642. }
  105643. // Fields allows partial responses to be retrieved. See
  105644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105645. // for more information.
  105646. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  105647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105648. return c
  105649. }
  105650. // Context sets the context to be used in this call's Do method. Any
  105651. // pending HTTP request will be aborted if the provided context is
  105652. // canceled.
  105653. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  105654. c.ctx_ = ctx
  105655. return c
  105656. }
  105657. // Header returns an http.Header that can be modified by the caller to
  105658. // add HTTP headers to the request.
  105659. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  105660. if c.header_ == nil {
  105661. c.header_ = make(http.Header)
  105662. }
  105663. return c.header_
  105664. }
  105665. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  105666. reqHeaders := make(http.Header)
  105667. for k, v := range c.header_ {
  105668. reqHeaders[k] = v
  105669. }
  105670. reqHeaders.Set("User-Agent", c.s.userAgent())
  105671. var body io.Reader = nil
  105672. c.urlParams_.Set("alt", alt)
  105673. c.urlParams_.Set("prettyPrint", "false")
  105674. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  105675. urls += "?" + c.urlParams_.Encode()
  105676. req, err := http.NewRequest("DELETE", urls, body)
  105677. if err != nil {
  105678. return nil, err
  105679. }
  105680. req.Header = reqHeaders
  105681. googleapi.Expand(req.URL, map[string]string{
  105682. "project": c.project,
  105683. "targetHttpsProxy": c.targetHttpsProxy,
  105684. })
  105685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105686. }
  105687. // Do executes the "compute.targetHttpsProxies.delete" call.
  105688. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105689. // status code is an error. Response headers are in either
  105690. // *Operation.ServerResponse.Header or (if a response was returned at
  105691. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105692. // to check whether the returned error was because
  105693. // http.StatusNotModified was returned.
  105694. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105695. gensupport.SetOptions(c.urlParams_, opts...)
  105696. res, err := c.doRequest("json")
  105697. if res != nil && res.StatusCode == http.StatusNotModified {
  105698. if res.Body != nil {
  105699. res.Body.Close()
  105700. }
  105701. return nil, &googleapi.Error{
  105702. Code: res.StatusCode,
  105703. Header: res.Header,
  105704. }
  105705. }
  105706. if err != nil {
  105707. return nil, err
  105708. }
  105709. defer googleapi.CloseBody(res)
  105710. if err := googleapi.CheckResponse(res); err != nil {
  105711. return nil, err
  105712. }
  105713. ret := &Operation{
  105714. ServerResponse: googleapi.ServerResponse{
  105715. Header: res.Header,
  105716. HTTPStatusCode: res.StatusCode,
  105717. },
  105718. }
  105719. target := &ret
  105720. if err := gensupport.DecodeResponse(target, res); err != nil {
  105721. return nil, err
  105722. }
  105723. return ret, nil
  105724. // {
  105725. // "description": "Deletes the specified TargetHttpsProxy resource.",
  105726. // "httpMethod": "DELETE",
  105727. // "id": "compute.targetHttpsProxies.delete",
  105728. // "parameterOrder": [
  105729. // "project",
  105730. // "targetHttpsProxy"
  105731. // ],
  105732. // "parameters": {
  105733. // "project": {
  105734. // "description": "Project ID for this request.",
  105735. // "location": "path",
  105736. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105737. // "required": true,
  105738. // "type": "string"
  105739. // },
  105740. // "requestId": {
  105741. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105742. // "location": "query",
  105743. // "type": "string"
  105744. // },
  105745. // "targetHttpsProxy": {
  105746. // "description": "Name of the TargetHttpsProxy resource to delete.",
  105747. // "location": "path",
  105748. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105749. // "required": true,
  105750. // "type": "string"
  105751. // }
  105752. // },
  105753. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  105754. // "response": {
  105755. // "$ref": "Operation"
  105756. // },
  105757. // "scopes": [
  105758. // "https://www.googleapis.com/auth/cloud-platform",
  105759. // "https://www.googleapis.com/auth/compute"
  105760. // ]
  105761. // }
  105762. }
  105763. // method id "compute.targetHttpsProxies.get":
  105764. type TargetHttpsProxiesGetCall struct {
  105765. s *Service
  105766. project string
  105767. targetHttpsProxy string
  105768. urlParams_ gensupport.URLParams
  105769. ifNoneMatch_ string
  105770. ctx_ context.Context
  105771. header_ http.Header
  105772. }
  105773. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  105774. // available target HTTPS proxies by making a list() request.
  105775. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  105776. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105777. c.project = project
  105778. c.targetHttpsProxy = targetHttpsProxy
  105779. return c
  105780. }
  105781. // Fields allows partial responses to be retrieved. See
  105782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105783. // for more information.
  105784. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  105785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105786. return c
  105787. }
  105788. // IfNoneMatch sets the optional parameter which makes the operation
  105789. // fail if the object's ETag matches the given value. This is useful for
  105790. // getting updates only after the object has changed since the last
  105791. // request. Use googleapi.IsNotModified to check whether the response
  105792. // error from Do is the result of In-None-Match.
  105793. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  105794. c.ifNoneMatch_ = entityTag
  105795. return c
  105796. }
  105797. // Context sets the context to be used in this call's Do method. Any
  105798. // pending HTTP request will be aborted if the provided context is
  105799. // canceled.
  105800. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  105801. c.ctx_ = ctx
  105802. return c
  105803. }
  105804. // Header returns an http.Header that can be modified by the caller to
  105805. // add HTTP headers to the request.
  105806. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  105807. if c.header_ == nil {
  105808. c.header_ = make(http.Header)
  105809. }
  105810. return c.header_
  105811. }
  105812. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  105813. reqHeaders := make(http.Header)
  105814. for k, v := range c.header_ {
  105815. reqHeaders[k] = v
  105816. }
  105817. reqHeaders.Set("User-Agent", c.s.userAgent())
  105818. if c.ifNoneMatch_ != "" {
  105819. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105820. }
  105821. var body io.Reader = nil
  105822. c.urlParams_.Set("alt", alt)
  105823. c.urlParams_.Set("prettyPrint", "false")
  105824. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  105825. urls += "?" + c.urlParams_.Encode()
  105826. req, err := http.NewRequest("GET", urls, body)
  105827. if err != nil {
  105828. return nil, err
  105829. }
  105830. req.Header = reqHeaders
  105831. googleapi.Expand(req.URL, map[string]string{
  105832. "project": c.project,
  105833. "targetHttpsProxy": c.targetHttpsProxy,
  105834. })
  105835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105836. }
  105837. // Do executes the "compute.targetHttpsProxies.get" call.
  105838. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  105839. // non-2xx status code is an error. Response headers are in either
  105840. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  105841. // returned at all) in error.(*googleapi.Error).Header. Use
  105842. // googleapi.IsNotModified to check whether the returned error was
  105843. // because http.StatusNotModified was returned.
  105844. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  105845. gensupport.SetOptions(c.urlParams_, opts...)
  105846. res, err := c.doRequest("json")
  105847. if res != nil && res.StatusCode == http.StatusNotModified {
  105848. if res.Body != nil {
  105849. res.Body.Close()
  105850. }
  105851. return nil, &googleapi.Error{
  105852. Code: res.StatusCode,
  105853. Header: res.Header,
  105854. }
  105855. }
  105856. if err != nil {
  105857. return nil, err
  105858. }
  105859. defer googleapi.CloseBody(res)
  105860. if err := googleapi.CheckResponse(res); err != nil {
  105861. return nil, err
  105862. }
  105863. ret := &TargetHttpsProxy{
  105864. ServerResponse: googleapi.ServerResponse{
  105865. Header: res.Header,
  105866. HTTPStatusCode: res.StatusCode,
  105867. },
  105868. }
  105869. target := &ret
  105870. if err := gensupport.DecodeResponse(target, res); err != nil {
  105871. return nil, err
  105872. }
  105873. return ret, nil
  105874. // {
  105875. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  105876. // "httpMethod": "GET",
  105877. // "id": "compute.targetHttpsProxies.get",
  105878. // "parameterOrder": [
  105879. // "project",
  105880. // "targetHttpsProxy"
  105881. // ],
  105882. // "parameters": {
  105883. // "project": {
  105884. // "description": "Project ID for this request.",
  105885. // "location": "path",
  105886. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105887. // "required": true,
  105888. // "type": "string"
  105889. // },
  105890. // "targetHttpsProxy": {
  105891. // "description": "Name of the TargetHttpsProxy resource to return.",
  105892. // "location": "path",
  105893. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105894. // "required": true,
  105895. // "type": "string"
  105896. // }
  105897. // },
  105898. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  105899. // "response": {
  105900. // "$ref": "TargetHttpsProxy"
  105901. // },
  105902. // "scopes": [
  105903. // "https://www.googleapis.com/auth/cloud-platform",
  105904. // "https://www.googleapis.com/auth/compute",
  105905. // "https://www.googleapis.com/auth/compute.readonly"
  105906. // ]
  105907. // }
  105908. }
  105909. // method id "compute.targetHttpsProxies.insert":
  105910. type TargetHttpsProxiesInsertCall struct {
  105911. s *Service
  105912. project string
  105913. targethttpsproxy *TargetHttpsProxy
  105914. urlParams_ gensupport.URLParams
  105915. ctx_ context.Context
  105916. header_ http.Header
  105917. }
  105918. // Insert: Creates a TargetHttpsProxy resource in the specified project
  105919. // using the data included in the request.
  105920. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  105921. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105922. c.project = project
  105923. c.targethttpsproxy = targethttpsproxy
  105924. return c
  105925. }
  105926. // RequestId sets the optional parameter "requestId": An optional
  105927. // request ID to identify requests. Specify a unique request ID so that
  105928. // if you must retry your request, the server will know to ignore the
  105929. // request if it has already been completed.
  105930. //
  105931. // For example, consider a situation where you make an initial request
  105932. // and the request times out. If you make the request again with the
  105933. // same request ID, the server can check if original operation with the
  105934. // same request ID was received, and if so, will ignore the second
  105935. // request. This prevents clients from accidentally creating duplicate
  105936. // commitments.
  105937. //
  105938. // The request ID must be a valid UUID with the exception that zero UUID
  105939. // is not supported (00000000-0000-0000-0000-000000000000).
  105940. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  105941. c.urlParams_.Set("requestId", requestId)
  105942. return c
  105943. }
  105944. // Fields allows partial responses to be retrieved. See
  105945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105946. // for more information.
  105947. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  105948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105949. return c
  105950. }
  105951. // Context sets the context to be used in this call's Do method. Any
  105952. // pending HTTP request will be aborted if the provided context is
  105953. // canceled.
  105954. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  105955. c.ctx_ = ctx
  105956. return c
  105957. }
  105958. // Header returns an http.Header that can be modified by the caller to
  105959. // add HTTP headers to the request.
  105960. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  105961. if c.header_ == nil {
  105962. c.header_ = make(http.Header)
  105963. }
  105964. return c.header_
  105965. }
  105966. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  105967. reqHeaders := make(http.Header)
  105968. for k, v := range c.header_ {
  105969. reqHeaders[k] = v
  105970. }
  105971. reqHeaders.Set("User-Agent", c.s.userAgent())
  105972. var body io.Reader = nil
  105973. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  105974. if err != nil {
  105975. return nil, err
  105976. }
  105977. reqHeaders.Set("Content-Type", "application/json")
  105978. c.urlParams_.Set("alt", alt)
  105979. c.urlParams_.Set("prettyPrint", "false")
  105980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  105981. urls += "?" + c.urlParams_.Encode()
  105982. req, err := http.NewRequest("POST", urls, body)
  105983. if err != nil {
  105984. return nil, err
  105985. }
  105986. req.Header = reqHeaders
  105987. googleapi.Expand(req.URL, map[string]string{
  105988. "project": c.project,
  105989. })
  105990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105991. }
  105992. // Do executes the "compute.targetHttpsProxies.insert" call.
  105993. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105994. // status code is an error. Response headers are in either
  105995. // *Operation.ServerResponse.Header or (if a response was returned at
  105996. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105997. // to check whether the returned error was because
  105998. // http.StatusNotModified was returned.
  105999. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106000. gensupport.SetOptions(c.urlParams_, opts...)
  106001. res, err := c.doRequest("json")
  106002. if res != nil && res.StatusCode == http.StatusNotModified {
  106003. if res.Body != nil {
  106004. res.Body.Close()
  106005. }
  106006. return nil, &googleapi.Error{
  106007. Code: res.StatusCode,
  106008. Header: res.Header,
  106009. }
  106010. }
  106011. if err != nil {
  106012. return nil, err
  106013. }
  106014. defer googleapi.CloseBody(res)
  106015. if err := googleapi.CheckResponse(res); err != nil {
  106016. return nil, err
  106017. }
  106018. ret := &Operation{
  106019. ServerResponse: googleapi.ServerResponse{
  106020. Header: res.Header,
  106021. HTTPStatusCode: res.StatusCode,
  106022. },
  106023. }
  106024. target := &ret
  106025. if err := gensupport.DecodeResponse(target, res); err != nil {
  106026. return nil, err
  106027. }
  106028. return ret, nil
  106029. // {
  106030. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  106031. // "httpMethod": "POST",
  106032. // "id": "compute.targetHttpsProxies.insert",
  106033. // "parameterOrder": [
  106034. // "project"
  106035. // ],
  106036. // "parameters": {
  106037. // "project": {
  106038. // "description": "Project ID for this request.",
  106039. // "location": "path",
  106040. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106041. // "required": true,
  106042. // "type": "string"
  106043. // },
  106044. // "requestId": {
  106045. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106046. // "location": "query",
  106047. // "type": "string"
  106048. // }
  106049. // },
  106050. // "path": "{project}/global/targetHttpsProxies",
  106051. // "request": {
  106052. // "$ref": "TargetHttpsProxy"
  106053. // },
  106054. // "response": {
  106055. // "$ref": "Operation"
  106056. // },
  106057. // "scopes": [
  106058. // "https://www.googleapis.com/auth/cloud-platform",
  106059. // "https://www.googleapis.com/auth/compute"
  106060. // ]
  106061. // }
  106062. }
  106063. // method id "compute.targetHttpsProxies.list":
  106064. type TargetHttpsProxiesListCall struct {
  106065. s *Service
  106066. project string
  106067. urlParams_ gensupport.URLParams
  106068. ifNoneMatch_ string
  106069. ctx_ context.Context
  106070. header_ http.Header
  106071. }
  106072. // List: Retrieves the list of TargetHttpsProxy resources available to
  106073. // the specified project.
  106074. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  106075. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106076. c.project = project
  106077. return c
  106078. }
  106079. // Filter sets the optional parameter "filter": A filter expression that
  106080. // filters resources listed in the response. The expression must specify
  106081. // the field name, a comparison operator, and the value that you want to
  106082. // use for filtering. The value must be a string, a number, or a
  106083. // boolean. The comparison operator must be either =, !=, >, or <.
  106084. //
  106085. // For example, if you are filtering Compute Engine instances, you can
  106086. // exclude instances named example-instance by specifying name !=
  106087. // example-instance.
  106088. //
  106089. // You can also filter nested fields. For example, you could specify
  106090. // scheduling.automaticRestart = false to include instances only if they
  106091. // are not scheduled for automatic restarts. You can use filtering on
  106092. // nested fields to filter based on resource labels.
  106093. //
  106094. // To filter on multiple expressions, provide each separate expression
  106095. // within parentheses. For example, (scheduling.automaticRestart = true)
  106096. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  106097. // AND expression. However, you can include AND and OR expressions
  106098. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  106099. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  106100. // true).
  106101. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  106102. c.urlParams_.Set("filter", filter)
  106103. return c
  106104. }
  106105. // MaxResults sets the optional parameter "maxResults": The maximum
  106106. // number of results per page that should be returned. If the number of
  106107. // available results is larger than maxResults, Compute Engine returns a
  106108. // nextPageToken that can be used to get the next page of results in
  106109. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  106110. // (Default: 500)
  106111. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  106112. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  106113. return c
  106114. }
  106115. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  106116. // a certain order. By default, results are returned in alphanumerical
  106117. // order based on the resource name.
  106118. //
  106119. // You can also sort results in descending order based on the creation
  106120. // timestamp using orderBy="creationTimestamp desc". This sorts results
  106121. // based on the creationTimestamp field in reverse chronological order
  106122. // (newest result first). Use this to sort resources like operations so
  106123. // that the newest operation is returned first.
  106124. //
  106125. // Currently, only sorting by name or creationTimestamp desc is
  106126. // supported.
  106127. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  106128. c.urlParams_.Set("orderBy", orderBy)
  106129. return c
  106130. }
  106131. // PageToken sets the optional parameter "pageToken": Specifies a page
  106132. // token to use. Set pageToken to the nextPageToken returned by a
  106133. // previous list request to get the next page of results.
  106134. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  106135. c.urlParams_.Set("pageToken", pageToken)
  106136. return c
  106137. }
  106138. // Fields allows partial responses to be retrieved. See
  106139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106140. // for more information.
  106141. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  106142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106143. return c
  106144. }
  106145. // IfNoneMatch sets the optional parameter which makes the operation
  106146. // fail if the object's ETag matches the given value. This is useful for
  106147. // getting updates only after the object has changed since the last
  106148. // request. Use googleapi.IsNotModified to check whether the response
  106149. // error from Do is the result of In-None-Match.
  106150. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  106151. c.ifNoneMatch_ = entityTag
  106152. return c
  106153. }
  106154. // Context sets the context to be used in this call's Do method. Any
  106155. // pending HTTP request will be aborted if the provided context is
  106156. // canceled.
  106157. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  106158. c.ctx_ = ctx
  106159. return c
  106160. }
  106161. // Header returns an http.Header that can be modified by the caller to
  106162. // add HTTP headers to the request.
  106163. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  106164. if c.header_ == nil {
  106165. c.header_ = make(http.Header)
  106166. }
  106167. return c.header_
  106168. }
  106169. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  106170. reqHeaders := make(http.Header)
  106171. for k, v := range c.header_ {
  106172. reqHeaders[k] = v
  106173. }
  106174. reqHeaders.Set("User-Agent", c.s.userAgent())
  106175. if c.ifNoneMatch_ != "" {
  106176. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  106177. }
  106178. var body io.Reader = nil
  106179. c.urlParams_.Set("alt", alt)
  106180. c.urlParams_.Set("prettyPrint", "false")
  106181. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  106182. urls += "?" + c.urlParams_.Encode()
  106183. req, err := http.NewRequest("GET", urls, body)
  106184. if err != nil {
  106185. return nil, err
  106186. }
  106187. req.Header = reqHeaders
  106188. googleapi.Expand(req.URL, map[string]string{
  106189. "project": c.project,
  106190. })
  106191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106192. }
  106193. // Do executes the "compute.targetHttpsProxies.list" call.
  106194. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  106195. // non-2xx status code is an error. Response headers are in either
  106196. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  106197. // returned at all) in error.(*googleapi.Error).Header. Use
  106198. // googleapi.IsNotModified to check whether the returned error was
  106199. // because http.StatusNotModified was returned.
  106200. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  106201. gensupport.SetOptions(c.urlParams_, opts...)
  106202. res, err := c.doRequest("json")
  106203. if res != nil && res.StatusCode == http.StatusNotModified {
  106204. if res.Body != nil {
  106205. res.Body.Close()
  106206. }
  106207. return nil, &googleapi.Error{
  106208. Code: res.StatusCode,
  106209. Header: res.Header,
  106210. }
  106211. }
  106212. if err != nil {
  106213. return nil, err
  106214. }
  106215. defer googleapi.CloseBody(res)
  106216. if err := googleapi.CheckResponse(res); err != nil {
  106217. return nil, err
  106218. }
  106219. ret := &TargetHttpsProxyList{
  106220. ServerResponse: googleapi.ServerResponse{
  106221. Header: res.Header,
  106222. HTTPStatusCode: res.StatusCode,
  106223. },
  106224. }
  106225. target := &ret
  106226. if err := gensupport.DecodeResponse(target, res); err != nil {
  106227. return nil, err
  106228. }
  106229. return ret, nil
  106230. // {
  106231. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  106232. // "httpMethod": "GET",
  106233. // "id": "compute.targetHttpsProxies.list",
  106234. // "parameterOrder": [
  106235. // "project"
  106236. // ],
  106237. // "parameters": {
  106238. // "filter": {
  106239. // "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).",
  106240. // "location": "query",
  106241. // "type": "string"
  106242. // },
  106243. // "maxResults": {
  106244. // "default": "500",
  106245. // "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)",
  106246. // "format": "uint32",
  106247. // "location": "query",
  106248. // "minimum": "0",
  106249. // "type": "integer"
  106250. // },
  106251. // "orderBy": {
  106252. // "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.",
  106253. // "location": "query",
  106254. // "type": "string"
  106255. // },
  106256. // "pageToken": {
  106257. // "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.",
  106258. // "location": "query",
  106259. // "type": "string"
  106260. // },
  106261. // "project": {
  106262. // "description": "Project ID for this request.",
  106263. // "location": "path",
  106264. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106265. // "required": true,
  106266. // "type": "string"
  106267. // }
  106268. // },
  106269. // "path": "{project}/global/targetHttpsProxies",
  106270. // "response": {
  106271. // "$ref": "TargetHttpsProxyList"
  106272. // },
  106273. // "scopes": [
  106274. // "https://www.googleapis.com/auth/cloud-platform",
  106275. // "https://www.googleapis.com/auth/compute",
  106276. // "https://www.googleapis.com/auth/compute.readonly"
  106277. // ]
  106278. // }
  106279. }
  106280. // Pages invokes f for each page of results.
  106281. // A non-nil error returned from f will halt the iteration.
  106282. // The provided context supersedes any context provided to the Context method.
  106283. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  106284. c.ctx_ = ctx
  106285. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  106286. for {
  106287. x, err := c.Do()
  106288. if err != nil {
  106289. return err
  106290. }
  106291. if err := f(x); err != nil {
  106292. return err
  106293. }
  106294. if x.NextPageToken == "" {
  106295. return nil
  106296. }
  106297. c.PageToken(x.NextPageToken)
  106298. }
  106299. }
  106300. // method id "compute.targetHttpsProxies.setQuicOverride":
  106301. type TargetHttpsProxiesSetQuicOverrideCall struct {
  106302. s *Service
  106303. project string
  106304. targetHttpsProxy string
  106305. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  106306. urlParams_ gensupport.URLParams
  106307. ctx_ context.Context
  106308. header_ http.Header
  106309. }
  106310. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  106311. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  106312. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106313. c.project = project
  106314. c.targetHttpsProxy = targetHttpsProxy
  106315. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  106316. return c
  106317. }
  106318. // RequestId sets the optional parameter "requestId": An optional
  106319. // request ID to identify requests. Specify a unique request ID so that
  106320. // if you must retry your request, the server will know to ignore the
  106321. // request if it has already been completed.
  106322. //
  106323. // For example, consider a situation where you make an initial request
  106324. // and the request times out. If you make the request again with the
  106325. // same request ID, the server can check if original operation with the
  106326. // same request ID was received, and if so, will ignore the second
  106327. // request. This prevents clients from accidentally creating duplicate
  106328. // commitments.
  106329. //
  106330. // The request ID must be a valid UUID with the exception that zero UUID
  106331. // is not supported (00000000-0000-0000-0000-000000000000).
  106332. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  106333. c.urlParams_.Set("requestId", requestId)
  106334. return c
  106335. }
  106336. // Fields allows partial responses to be retrieved. See
  106337. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106338. // for more information.
  106339. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  106340. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106341. return c
  106342. }
  106343. // Context sets the context to be used in this call's Do method. Any
  106344. // pending HTTP request will be aborted if the provided context is
  106345. // canceled.
  106346. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  106347. c.ctx_ = ctx
  106348. return c
  106349. }
  106350. // Header returns an http.Header that can be modified by the caller to
  106351. // add HTTP headers to the request.
  106352. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  106353. if c.header_ == nil {
  106354. c.header_ = make(http.Header)
  106355. }
  106356. return c.header_
  106357. }
  106358. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  106359. reqHeaders := make(http.Header)
  106360. for k, v := range c.header_ {
  106361. reqHeaders[k] = v
  106362. }
  106363. reqHeaders.Set("User-Agent", c.s.userAgent())
  106364. var body io.Reader = nil
  106365. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  106366. if err != nil {
  106367. return nil, err
  106368. }
  106369. reqHeaders.Set("Content-Type", "application/json")
  106370. c.urlParams_.Set("alt", alt)
  106371. c.urlParams_.Set("prettyPrint", "false")
  106372. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  106373. urls += "?" + c.urlParams_.Encode()
  106374. req, err := http.NewRequest("POST", urls, body)
  106375. if err != nil {
  106376. return nil, err
  106377. }
  106378. req.Header = reqHeaders
  106379. googleapi.Expand(req.URL, map[string]string{
  106380. "project": c.project,
  106381. "targetHttpsProxy": c.targetHttpsProxy,
  106382. })
  106383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106384. }
  106385. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  106386. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106387. // status code is an error. Response headers are in either
  106388. // *Operation.ServerResponse.Header or (if a response was returned at
  106389. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106390. // to check whether the returned error was because
  106391. // http.StatusNotModified was returned.
  106392. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106393. gensupport.SetOptions(c.urlParams_, opts...)
  106394. res, err := c.doRequest("json")
  106395. if res != nil && res.StatusCode == http.StatusNotModified {
  106396. if res.Body != nil {
  106397. res.Body.Close()
  106398. }
  106399. return nil, &googleapi.Error{
  106400. Code: res.StatusCode,
  106401. Header: res.Header,
  106402. }
  106403. }
  106404. if err != nil {
  106405. return nil, err
  106406. }
  106407. defer googleapi.CloseBody(res)
  106408. if err := googleapi.CheckResponse(res); err != nil {
  106409. return nil, err
  106410. }
  106411. ret := &Operation{
  106412. ServerResponse: googleapi.ServerResponse{
  106413. Header: res.Header,
  106414. HTTPStatusCode: res.StatusCode,
  106415. },
  106416. }
  106417. target := &ret
  106418. if err := gensupport.DecodeResponse(target, res); err != nil {
  106419. return nil, err
  106420. }
  106421. return ret, nil
  106422. // {
  106423. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  106424. // "httpMethod": "POST",
  106425. // "id": "compute.targetHttpsProxies.setQuicOverride",
  106426. // "parameterOrder": [
  106427. // "project",
  106428. // "targetHttpsProxy"
  106429. // ],
  106430. // "parameters": {
  106431. // "project": {
  106432. // "description": "Project ID for this request.",
  106433. // "location": "path",
  106434. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106435. // "required": true,
  106436. // "type": "string"
  106437. // },
  106438. // "requestId": {
  106439. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106440. // "location": "query",
  106441. // "type": "string"
  106442. // },
  106443. // "targetHttpsProxy": {
  106444. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  106445. // "location": "path",
  106446. // "required": true,
  106447. // "type": "string"
  106448. // }
  106449. // },
  106450. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  106451. // "request": {
  106452. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  106453. // },
  106454. // "response": {
  106455. // "$ref": "Operation"
  106456. // },
  106457. // "scopes": [
  106458. // "https://www.googleapis.com/auth/cloud-platform",
  106459. // "https://www.googleapis.com/auth/compute"
  106460. // ]
  106461. // }
  106462. }
  106463. // method id "compute.targetHttpsProxies.setSslCertificates":
  106464. type TargetHttpsProxiesSetSslCertificatesCall struct {
  106465. s *Service
  106466. project string
  106467. targetHttpsProxy string
  106468. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  106469. urlParams_ gensupport.URLParams
  106470. ctx_ context.Context
  106471. header_ http.Header
  106472. }
  106473. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  106474. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  106475. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106476. c.project = project
  106477. c.targetHttpsProxy = targetHttpsProxy
  106478. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  106479. return c
  106480. }
  106481. // RequestId sets the optional parameter "requestId": An optional
  106482. // request ID to identify requests. Specify a unique request ID so that
  106483. // if you must retry your request, the server will know to ignore the
  106484. // request if it has already been completed.
  106485. //
  106486. // For example, consider a situation where you make an initial request
  106487. // and the request times out. If you make the request again with the
  106488. // same request ID, the server can check if original operation with the
  106489. // same request ID was received, and if so, will ignore the second
  106490. // request. This prevents clients from accidentally creating duplicate
  106491. // commitments.
  106492. //
  106493. // The request ID must be a valid UUID with the exception that zero UUID
  106494. // is not supported (00000000-0000-0000-0000-000000000000).
  106495. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  106496. c.urlParams_.Set("requestId", requestId)
  106497. return c
  106498. }
  106499. // Fields allows partial responses to be retrieved. See
  106500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106501. // for more information.
  106502. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  106503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106504. return c
  106505. }
  106506. // Context sets the context to be used in this call's Do method. Any
  106507. // pending HTTP request will be aborted if the provided context is
  106508. // canceled.
  106509. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  106510. c.ctx_ = ctx
  106511. return c
  106512. }
  106513. // Header returns an http.Header that can be modified by the caller to
  106514. // add HTTP headers to the request.
  106515. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  106516. if c.header_ == nil {
  106517. c.header_ = make(http.Header)
  106518. }
  106519. return c.header_
  106520. }
  106521. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  106522. reqHeaders := make(http.Header)
  106523. for k, v := range c.header_ {
  106524. reqHeaders[k] = v
  106525. }
  106526. reqHeaders.Set("User-Agent", c.s.userAgent())
  106527. var body io.Reader = nil
  106528. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  106529. if err != nil {
  106530. return nil, err
  106531. }
  106532. reqHeaders.Set("Content-Type", "application/json")
  106533. c.urlParams_.Set("alt", alt)
  106534. c.urlParams_.Set("prettyPrint", "false")
  106535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  106536. urls += "?" + c.urlParams_.Encode()
  106537. req, err := http.NewRequest("POST", urls, body)
  106538. if err != nil {
  106539. return nil, err
  106540. }
  106541. req.Header = reqHeaders
  106542. googleapi.Expand(req.URL, map[string]string{
  106543. "project": c.project,
  106544. "targetHttpsProxy": c.targetHttpsProxy,
  106545. })
  106546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106547. }
  106548. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  106549. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106550. // status code is an error. Response headers are in either
  106551. // *Operation.ServerResponse.Header or (if a response was returned at
  106552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106553. // to check whether the returned error was because
  106554. // http.StatusNotModified was returned.
  106555. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106556. gensupport.SetOptions(c.urlParams_, opts...)
  106557. res, err := c.doRequest("json")
  106558. if res != nil && res.StatusCode == http.StatusNotModified {
  106559. if res.Body != nil {
  106560. res.Body.Close()
  106561. }
  106562. return nil, &googleapi.Error{
  106563. Code: res.StatusCode,
  106564. Header: res.Header,
  106565. }
  106566. }
  106567. if err != nil {
  106568. return nil, err
  106569. }
  106570. defer googleapi.CloseBody(res)
  106571. if err := googleapi.CheckResponse(res); err != nil {
  106572. return nil, err
  106573. }
  106574. ret := &Operation{
  106575. ServerResponse: googleapi.ServerResponse{
  106576. Header: res.Header,
  106577. HTTPStatusCode: res.StatusCode,
  106578. },
  106579. }
  106580. target := &ret
  106581. if err := gensupport.DecodeResponse(target, res); err != nil {
  106582. return nil, err
  106583. }
  106584. return ret, nil
  106585. // {
  106586. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  106587. // "httpMethod": "POST",
  106588. // "id": "compute.targetHttpsProxies.setSslCertificates",
  106589. // "parameterOrder": [
  106590. // "project",
  106591. // "targetHttpsProxy"
  106592. // ],
  106593. // "parameters": {
  106594. // "project": {
  106595. // "description": "Project ID for this request.",
  106596. // "location": "path",
  106597. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106598. // "required": true,
  106599. // "type": "string"
  106600. // },
  106601. // "requestId": {
  106602. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106603. // "location": "query",
  106604. // "type": "string"
  106605. // },
  106606. // "targetHttpsProxy": {
  106607. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  106608. // "location": "path",
  106609. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  106610. // "required": true,
  106611. // "type": "string"
  106612. // }
  106613. // },
  106614. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  106615. // "request": {
  106616. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  106617. // },
  106618. // "response": {
  106619. // "$ref": "Operation"
  106620. // },
  106621. // "scopes": [
  106622. // "https://www.googleapis.com/auth/cloud-platform",
  106623. // "https://www.googleapis.com/auth/compute"
  106624. // ]
  106625. // }
  106626. }
  106627. // method id "compute.targetHttpsProxies.setSslPolicy":
  106628. type TargetHttpsProxiesSetSslPolicyCall struct {
  106629. s *Service
  106630. project string
  106631. targetHttpsProxy string
  106632. sslpolicyreference *SslPolicyReference
  106633. urlParams_ gensupport.URLParams
  106634. ctx_ context.Context
  106635. header_ http.Header
  106636. }
  106637. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  106638. // policy specifies the server-side support for SSL features. This
  106639. // affects connections between clients and the HTTPS proxy load
  106640. // balancer. They do not affect the connection between the load balancer
  106641. // and the backends.
  106642. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  106643. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106644. c.project = project
  106645. c.targetHttpsProxy = targetHttpsProxy
  106646. c.sslpolicyreference = sslpolicyreference
  106647. return c
  106648. }
  106649. // RequestId sets the optional parameter "requestId": An optional
  106650. // request ID to identify requests. Specify a unique request ID so that
  106651. // if you must retry your request, the server will know to ignore the
  106652. // request if it has already been completed.
  106653. //
  106654. // For example, consider a situation where you make an initial request
  106655. // and the request times out. If you make the request again with the
  106656. // same request ID, the server can check if original operation with the
  106657. // same request ID was received, and if so, will ignore the second
  106658. // request. This prevents clients from accidentally creating duplicate
  106659. // commitments.
  106660. //
  106661. // The request ID must be a valid UUID with the exception that zero UUID
  106662. // is not supported (00000000-0000-0000-0000-000000000000).
  106663. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  106664. c.urlParams_.Set("requestId", requestId)
  106665. return c
  106666. }
  106667. // Fields allows partial responses to be retrieved. See
  106668. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106669. // for more information.
  106670. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  106671. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106672. return c
  106673. }
  106674. // Context sets the context to be used in this call's Do method. Any
  106675. // pending HTTP request will be aborted if the provided context is
  106676. // canceled.
  106677. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  106678. c.ctx_ = ctx
  106679. return c
  106680. }
  106681. // Header returns an http.Header that can be modified by the caller to
  106682. // add HTTP headers to the request.
  106683. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  106684. if c.header_ == nil {
  106685. c.header_ = make(http.Header)
  106686. }
  106687. return c.header_
  106688. }
  106689. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  106690. reqHeaders := make(http.Header)
  106691. for k, v := range c.header_ {
  106692. reqHeaders[k] = v
  106693. }
  106694. reqHeaders.Set("User-Agent", c.s.userAgent())
  106695. var body io.Reader = nil
  106696. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  106697. if err != nil {
  106698. return nil, err
  106699. }
  106700. reqHeaders.Set("Content-Type", "application/json")
  106701. c.urlParams_.Set("alt", alt)
  106702. c.urlParams_.Set("prettyPrint", "false")
  106703. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  106704. urls += "?" + c.urlParams_.Encode()
  106705. req, err := http.NewRequest("POST", urls, body)
  106706. if err != nil {
  106707. return nil, err
  106708. }
  106709. req.Header = reqHeaders
  106710. googleapi.Expand(req.URL, map[string]string{
  106711. "project": c.project,
  106712. "targetHttpsProxy": c.targetHttpsProxy,
  106713. })
  106714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106715. }
  106716. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  106717. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106718. // status code is an error. Response headers are in either
  106719. // *Operation.ServerResponse.Header or (if a response was returned at
  106720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106721. // to check whether the returned error was because
  106722. // http.StatusNotModified was returned.
  106723. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106724. gensupport.SetOptions(c.urlParams_, opts...)
  106725. res, err := c.doRequest("json")
  106726. if res != nil && res.StatusCode == http.StatusNotModified {
  106727. if res.Body != nil {
  106728. res.Body.Close()
  106729. }
  106730. return nil, &googleapi.Error{
  106731. Code: res.StatusCode,
  106732. Header: res.Header,
  106733. }
  106734. }
  106735. if err != nil {
  106736. return nil, err
  106737. }
  106738. defer googleapi.CloseBody(res)
  106739. if err := googleapi.CheckResponse(res); err != nil {
  106740. return nil, err
  106741. }
  106742. ret := &Operation{
  106743. ServerResponse: googleapi.ServerResponse{
  106744. Header: res.Header,
  106745. HTTPStatusCode: res.StatusCode,
  106746. },
  106747. }
  106748. target := &ret
  106749. if err := gensupport.DecodeResponse(target, res); err != nil {
  106750. return nil, err
  106751. }
  106752. return ret, nil
  106753. // {
  106754. // "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.",
  106755. // "httpMethod": "POST",
  106756. // "id": "compute.targetHttpsProxies.setSslPolicy",
  106757. // "parameterOrder": [
  106758. // "project",
  106759. // "targetHttpsProxy"
  106760. // ],
  106761. // "parameters": {
  106762. // "project": {
  106763. // "description": "Project ID for this request.",
  106764. // "location": "path",
  106765. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106766. // "required": true,
  106767. // "type": "string"
  106768. // },
  106769. // "requestId": {
  106770. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106771. // "location": "query",
  106772. // "type": "string"
  106773. // },
  106774. // "targetHttpsProxy": {
  106775. // "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.",
  106776. // "location": "path",
  106777. // "required": true,
  106778. // "type": "string"
  106779. // }
  106780. // },
  106781. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  106782. // "request": {
  106783. // "$ref": "SslPolicyReference"
  106784. // },
  106785. // "response": {
  106786. // "$ref": "Operation"
  106787. // },
  106788. // "scopes": [
  106789. // "https://www.googleapis.com/auth/cloud-platform",
  106790. // "https://www.googleapis.com/auth/compute"
  106791. // ]
  106792. // }
  106793. }
  106794. // method id "compute.targetHttpsProxies.setUrlMap":
  106795. type TargetHttpsProxiesSetUrlMapCall struct {
  106796. s *Service
  106797. project string
  106798. targetHttpsProxy string
  106799. urlmapreference *UrlMapReference
  106800. urlParams_ gensupport.URLParams
  106801. ctx_ context.Context
  106802. header_ http.Header
  106803. }
  106804. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  106805. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  106806. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106807. c.project = project
  106808. c.targetHttpsProxy = targetHttpsProxy
  106809. c.urlmapreference = urlmapreference
  106810. return c
  106811. }
  106812. // RequestId sets the optional parameter "requestId": An optional
  106813. // request ID to identify requests. Specify a unique request ID so that
  106814. // if you must retry your request, the server will know to ignore the
  106815. // request if it has already been completed.
  106816. //
  106817. // For example, consider a situation where you make an initial request
  106818. // and the request times out. If you make the request again with the
  106819. // same request ID, the server can check if original operation with the
  106820. // same request ID was received, and if so, will ignore the second
  106821. // request. This prevents clients from accidentally creating duplicate
  106822. // commitments.
  106823. //
  106824. // The request ID must be a valid UUID with the exception that zero UUID
  106825. // is not supported (00000000-0000-0000-0000-000000000000).
  106826. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  106827. c.urlParams_.Set("requestId", requestId)
  106828. return c
  106829. }
  106830. // Fields allows partial responses to be retrieved. See
  106831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106832. // for more information.
  106833. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  106834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106835. return c
  106836. }
  106837. // Context sets the context to be used in this call's Do method. Any
  106838. // pending HTTP request will be aborted if the provided context is
  106839. // canceled.
  106840. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  106841. c.ctx_ = ctx
  106842. return c
  106843. }
  106844. // Header returns an http.Header that can be modified by the caller to
  106845. // add HTTP headers to the request.
  106846. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  106847. if c.header_ == nil {
  106848. c.header_ = make(http.Header)
  106849. }
  106850. return c.header_
  106851. }
  106852. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  106853. reqHeaders := make(http.Header)
  106854. for k, v := range c.header_ {
  106855. reqHeaders[k] = v
  106856. }
  106857. reqHeaders.Set("User-Agent", c.s.userAgent())
  106858. var body io.Reader = nil
  106859. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  106860. if err != nil {
  106861. return nil, err
  106862. }
  106863. reqHeaders.Set("Content-Type", "application/json")
  106864. c.urlParams_.Set("alt", alt)
  106865. c.urlParams_.Set("prettyPrint", "false")
  106866. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  106867. urls += "?" + c.urlParams_.Encode()
  106868. req, err := http.NewRequest("POST", urls, body)
  106869. if err != nil {
  106870. return nil, err
  106871. }
  106872. req.Header = reqHeaders
  106873. googleapi.Expand(req.URL, map[string]string{
  106874. "project": c.project,
  106875. "targetHttpsProxy": c.targetHttpsProxy,
  106876. })
  106877. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106878. }
  106879. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  106880. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106881. // status code is an error. Response headers are in either
  106882. // *Operation.ServerResponse.Header or (if a response was returned at
  106883. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106884. // to check whether the returned error was because
  106885. // http.StatusNotModified was returned.
  106886. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106887. gensupport.SetOptions(c.urlParams_, opts...)
  106888. res, err := c.doRequest("json")
  106889. if res != nil && res.StatusCode == http.StatusNotModified {
  106890. if res.Body != nil {
  106891. res.Body.Close()
  106892. }
  106893. return nil, &googleapi.Error{
  106894. Code: res.StatusCode,
  106895. Header: res.Header,
  106896. }
  106897. }
  106898. if err != nil {
  106899. return nil, err
  106900. }
  106901. defer googleapi.CloseBody(res)
  106902. if err := googleapi.CheckResponse(res); err != nil {
  106903. return nil, err
  106904. }
  106905. ret := &Operation{
  106906. ServerResponse: googleapi.ServerResponse{
  106907. Header: res.Header,
  106908. HTTPStatusCode: res.StatusCode,
  106909. },
  106910. }
  106911. target := &ret
  106912. if err := gensupport.DecodeResponse(target, res); err != nil {
  106913. return nil, err
  106914. }
  106915. return ret, nil
  106916. // {
  106917. // "description": "Changes the URL map for TargetHttpsProxy.",
  106918. // "httpMethod": "POST",
  106919. // "id": "compute.targetHttpsProxies.setUrlMap",
  106920. // "parameterOrder": [
  106921. // "project",
  106922. // "targetHttpsProxy"
  106923. // ],
  106924. // "parameters": {
  106925. // "project": {
  106926. // "description": "Project ID for this request.",
  106927. // "location": "path",
  106928. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106929. // "required": true,
  106930. // "type": "string"
  106931. // },
  106932. // "requestId": {
  106933. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106934. // "location": "query",
  106935. // "type": "string"
  106936. // },
  106937. // "targetHttpsProxy": {
  106938. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  106939. // "location": "path",
  106940. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  106941. // "required": true,
  106942. // "type": "string"
  106943. // }
  106944. // },
  106945. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  106946. // "request": {
  106947. // "$ref": "UrlMapReference"
  106948. // },
  106949. // "response": {
  106950. // "$ref": "Operation"
  106951. // },
  106952. // "scopes": [
  106953. // "https://www.googleapis.com/auth/cloud-platform",
  106954. // "https://www.googleapis.com/auth/compute"
  106955. // ]
  106956. // }
  106957. }
  106958. // method id "compute.targetHttpsProxies.testIamPermissions":
  106959. type TargetHttpsProxiesTestIamPermissionsCall struct {
  106960. s *Service
  106961. project string
  106962. resource string
  106963. testpermissionsrequest *TestPermissionsRequest
  106964. urlParams_ gensupport.URLParams
  106965. ctx_ context.Context
  106966. header_ http.Header
  106967. }
  106968. // TestIamPermissions: Returns permissions that a caller has on the
  106969. // specified resource.
  106970. func (r *TargetHttpsProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpsProxiesTestIamPermissionsCall {
  106971. c := &TargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106972. c.project = project
  106973. c.resource = resource
  106974. c.testpermissionsrequest = testpermissionsrequest
  106975. return c
  106976. }
  106977. // Fields allows partial responses to be retrieved. See
  106978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106979. // for more information.
  106980. func (c *TargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesTestIamPermissionsCall {
  106981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106982. return c
  106983. }
  106984. // Context sets the context to be used in this call's Do method. Any
  106985. // pending HTTP request will be aborted if the provided context is
  106986. // canceled.
  106987. func (c *TargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpsProxiesTestIamPermissionsCall {
  106988. c.ctx_ = ctx
  106989. return c
  106990. }
  106991. // Header returns an http.Header that can be modified by the caller to
  106992. // add HTTP headers to the request.
  106993. func (c *TargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  106994. if c.header_ == nil {
  106995. c.header_ = make(http.Header)
  106996. }
  106997. return c.header_
  106998. }
  106999. func (c *TargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  107000. reqHeaders := make(http.Header)
  107001. for k, v := range c.header_ {
  107002. reqHeaders[k] = v
  107003. }
  107004. reqHeaders.Set("User-Agent", c.s.userAgent())
  107005. var body io.Reader = nil
  107006. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  107007. if err != nil {
  107008. return nil, err
  107009. }
  107010. reqHeaders.Set("Content-Type", "application/json")
  107011. c.urlParams_.Set("alt", alt)
  107012. c.urlParams_.Set("prettyPrint", "false")
  107013. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{resource}/testIamPermissions")
  107014. urls += "?" + c.urlParams_.Encode()
  107015. req, err := http.NewRequest("POST", urls, body)
  107016. if err != nil {
  107017. return nil, err
  107018. }
  107019. req.Header = reqHeaders
  107020. googleapi.Expand(req.URL, map[string]string{
  107021. "project": c.project,
  107022. "resource": c.resource,
  107023. })
  107024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107025. }
  107026. // Do executes the "compute.targetHttpsProxies.testIamPermissions" call.
  107027. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  107028. // non-2xx status code is an error. Response headers are in either
  107029. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  107030. // returned at all) in error.(*googleapi.Error).Header. Use
  107031. // googleapi.IsNotModified to check whether the returned error was
  107032. // because http.StatusNotModified was returned.
  107033. func (c *TargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  107034. gensupport.SetOptions(c.urlParams_, opts...)
  107035. res, err := c.doRequest("json")
  107036. if res != nil && res.StatusCode == http.StatusNotModified {
  107037. if res.Body != nil {
  107038. res.Body.Close()
  107039. }
  107040. return nil, &googleapi.Error{
  107041. Code: res.StatusCode,
  107042. Header: res.Header,
  107043. }
  107044. }
  107045. if err != nil {
  107046. return nil, err
  107047. }
  107048. defer googleapi.CloseBody(res)
  107049. if err := googleapi.CheckResponse(res); err != nil {
  107050. return nil, err
  107051. }
  107052. ret := &TestPermissionsResponse{
  107053. ServerResponse: googleapi.ServerResponse{
  107054. Header: res.Header,
  107055. HTTPStatusCode: res.StatusCode,
  107056. },
  107057. }
  107058. target := &ret
  107059. if err := gensupport.DecodeResponse(target, res); err != nil {
  107060. return nil, err
  107061. }
  107062. return ret, nil
  107063. // {
  107064. // "description": "Returns permissions that a caller has on the specified resource.",
  107065. // "httpMethod": "POST",
  107066. // "id": "compute.targetHttpsProxies.testIamPermissions",
  107067. // "parameterOrder": [
  107068. // "project",
  107069. // "resource"
  107070. // ],
  107071. // "parameters": {
  107072. // "project": {
  107073. // "description": "Project ID for this request.",
  107074. // "location": "path",
  107075. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107076. // "required": true,
  107077. // "type": "string"
  107078. // },
  107079. // "resource": {
  107080. // "description": "Name or id of the resource for this request.",
  107081. // "location": "path",
  107082. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  107083. // "required": true,
  107084. // "type": "string"
  107085. // }
  107086. // },
  107087. // "path": "{project}/global/targetHttpsProxies/{resource}/testIamPermissions",
  107088. // "request": {
  107089. // "$ref": "TestPermissionsRequest"
  107090. // },
  107091. // "response": {
  107092. // "$ref": "TestPermissionsResponse"
  107093. // },
  107094. // "scopes": [
  107095. // "https://www.googleapis.com/auth/cloud-platform",
  107096. // "https://www.googleapis.com/auth/compute",
  107097. // "https://www.googleapis.com/auth/compute.readonly"
  107098. // ]
  107099. // }
  107100. }
  107101. // method id "compute.targetInstances.aggregatedList":
  107102. type TargetInstancesAggregatedListCall struct {
  107103. s *Service
  107104. project string
  107105. urlParams_ gensupport.URLParams
  107106. ifNoneMatch_ string
  107107. ctx_ context.Context
  107108. header_ http.Header
  107109. }
  107110. // AggregatedList: Retrieves an aggregated list of target instances.
  107111. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  107112. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  107113. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107114. c.project = project
  107115. return c
  107116. }
  107117. // Filter sets the optional parameter "filter": A filter expression that
  107118. // filters resources listed in the response. The expression must specify
  107119. // the field name, a comparison operator, and the value that you want to
  107120. // use for filtering. The value must be a string, a number, or a
  107121. // boolean. The comparison operator must be either =, !=, >, or <.
  107122. //
  107123. // For example, if you are filtering Compute Engine instances, you can
  107124. // exclude instances named example-instance by specifying name !=
  107125. // example-instance.
  107126. //
  107127. // You can also filter nested fields. For example, you could specify
  107128. // scheduling.automaticRestart = false to include instances only if they
  107129. // are not scheduled for automatic restarts. You can use filtering on
  107130. // nested fields to filter based on resource labels.
  107131. //
  107132. // To filter on multiple expressions, provide each separate expression
  107133. // within parentheses. For example, (scheduling.automaticRestart = true)
  107134. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  107135. // AND expression. However, you can include AND and OR expressions
  107136. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  107137. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  107138. // true).
  107139. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  107140. c.urlParams_.Set("filter", filter)
  107141. return c
  107142. }
  107143. // MaxResults sets the optional parameter "maxResults": The maximum
  107144. // number of results per page that should be returned. If the number of
  107145. // available results is larger than maxResults, Compute Engine returns a
  107146. // nextPageToken that can be used to get the next page of results in
  107147. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  107148. // (Default: 500)
  107149. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  107150. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  107151. return c
  107152. }
  107153. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  107154. // a certain order. By default, results are returned in alphanumerical
  107155. // order based on the resource name.
  107156. //
  107157. // You can also sort results in descending order based on the creation
  107158. // timestamp using orderBy="creationTimestamp desc". This sorts results
  107159. // based on the creationTimestamp field in reverse chronological order
  107160. // (newest result first). Use this to sort resources like operations so
  107161. // that the newest operation is returned first.
  107162. //
  107163. // Currently, only sorting by name or creationTimestamp desc is
  107164. // supported.
  107165. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  107166. c.urlParams_.Set("orderBy", orderBy)
  107167. return c
  107168. }
  107169. // PageToken sets the optional parameter "pageToken": Specifies a page
  107170. // token to use. Set pageToken to the nextPageToken returned by a
  107171. // previous list request to get the next page of results.
  107172. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  107173. c.urlParams_.Set("pageToken", pageToken)
  107174. return c
  107175. }
  107176. // Fields allows partial responses to be retrieved. See
  107177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107178. // for more information.
  107179. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  107180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107181. return c
  107182. }
  107183. // IfNoneMatch sets the optional parameter which makes the operation
  107184. // fail if the object's ETag matches the given value. This is useful for
  107185. // getting updates only after the object has changed since the last
  107186. // request. Use googleapi.IsNotModified to check whether the response
  107187. // error from Do is the result of In-None-Match.
  107188. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  107189. c.ifNoneMatch_ = entityTag
  107190. return c
  107191. }
  107192. // Context sets the context to be used in this call's Do method. Any
  107193. // pending HTTP request will be aborted if the provided context is
  107194. // canceled.
  107195. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  107196. c.ctx_ = ctx
  107197. return c
  107198. }
  107199. // Header returns an http.Header that can be modified by the caller to
  107200. // add HTTP headers to the request.
  107201. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  107202. if c.header_ == nil {
  107203. c.header_ = make(http.Header)
  107204. }
  107205. return c.header_
  107206. }
  107207. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  107208. reqHeaders := make(http.Header)
  107209. for k, v := range c.header_ {
  107210. reqHeaders[k] = v
  107211. }
  107212. reqHeaders.Set("User-Agent", c.s.userAgent())
  107213. if c.ifNoneMatch_ != "" {
  107214. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  107215. }
  107216. var body io.Reader = nil
  107217. c.urlParams_.Set("alt", alt)
  107218. c.urlParams_.Set("prettyPrint", "false")
  107219. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  107220. urls += "?" + c.urlParams_.Encode()
  107221. req, err := http.NewRequest("GET", urls, body)
  107222. if err != nil {
  107223. return nil, err
  107224. }
  107225. req.Header = reqHeaders
  107226. googleapi.Expand(req.URL, map[string]string{
  107227. "project": c.project,
  107228. })
  107229. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107230. }
  107231. // Do executes the "compute.targetInstances.aggregatedList" call.
  107232. // Exactly one of *TargetInstanceAggregatedList or error will be
  107233. // non-nil. Any non-2xx status code is an error. Response headers are in
  107234. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  107235. // response was returned at all) in error.(*googleapi.Error).Header. Use
  107236. // googleapi.IsNotModified to check whether the returned error was
  107237. // because http.StatusNotModified was returned.
  107238. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  107239. gensupport.SetOptions(c.urlParams_, opts...)
  107240. res, err := c.doRequest("json")
  107241. if res != nil && res.StatusCode == http.StatusNotModified {
  107242. if res.Body != nil {
  107243. res.Body.Close()
  107244. }
  107245. return nil, &googleapi.Error{
  107246. Code: res.StatusCode,
  107247. Header: res.Header,
  107248. }
  107249. }
  107250. if err != nil {
  107251. return nil, err
  107252. }
  107253. defer googleapi.CloseBody(res)
  107254. if err := googleapi.CheckResponse(res); err != nil {
  107255. return nil, err
  107256. }
  107257. ret := &TargetInstanceAggregatedList{
  107258. ServerResponse: googleapi.ServerResponse{
  107259. Header: res.Header,
  107260. HTTPStatusCode: res.StatusCode,
  107261. },
  107262. }
  107263. target := &ret
  107264. if err := gensupport.DecodeResponse(target, res); err != nil {
  107265. return nil, err
  107266. }
  107267. return ret, nil
  107268. // {
  107269. // "description": "Retrieves an aggregated list of target instances.",
  107270. // "httpMethod": "GET",
  107271. // "id": "compute.targetInstances.aggregatedList",
  107272. // "parameterOrder": [
  107273. // "project"
  107274. // ],
  107275. // "parameters": {
  107276. // "filter": {
  107277. // "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).",
  107278. // "location": "query",
  107279. // "type": "string"
  107280. // },
  107281. // "maxResults": {
  107282. // "default": "500",
  107283. // "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)",
  107284. // "format": "uint32",
  107285. // "location": "query",
  107286. // "minimum": "0",
  107287. // "type": "integer"
  107288. // },
  107289. // "orderBy": {
  107290. // "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.",
  107291. // "location": "query",
  107292. // "type": "string"
  107293. // },
  107294. // "pageToken": {
  107295. // "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.",
  107296. // "location": "query",
  107297. // "type": "string"
  107298. // },
  107299. // "project": {
  107300. // "description": "Project ID for this request.",
  107301. // "location": "path",
  107302. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107303. // "required": true,
  107304. // "type": "string"
  107305. // }
  107306. // },
  107307. // "path": "{project}/aggregated/targetInstances",
  107308. // "response": {
  107309. // "$ref": "TargetInstanceAggregatedList"
  107310. // },
  107311. // "scopes": [
  107312. // "https://www.googleapis.com/auth/cloud-platform",
  107313. // "https://www.googleapis.com/auth/compute",
  107314. // "https://www.googleapis.com/auth/compute.readonly"
  107315. // ]
  107316. // }
  107317. }
  107318. // Pages invokes f for each page of results.
  107319. // A non-nil error returned from f will halt the iteration.
  107320. // The provided context supersedes any context provided to the Context method.
  107321. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  107322. c.ctx_ = ctx
  107323. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  107324. for {
  107325. x, err := c.Do()
  107326. if err != nil {
  107327. return err
  107328. }
  107329. if err := f(x); err != nil {
  107330. return err
  107331. }
  107332. if x.NextPageToken == "" {
  107333. return nil
  107334. }
  107335. c.PageToken(x.NextPageToken)
  107336. }
  107337. }
  107338. // method id "compute.targetInstances.delete":
  107339. type TargetInstancesDeleteCall struct {
  107340. s *Service
  107341. project string
  107342. zone string
  107343. targetInstance string
  107344. urlParams_ gensupport.URLParams
  107345. ctx_ context.Context
  107346. header_ http.Header
  107347. }
  107348. // Delete: Deletes the specified TargetInstance resource.
  107349. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  107350. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  107351. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107352. c.project = project
  107353. c.zone = zone
  107354. c.targetInstance = targetInstance
  107355. return c
  107356. }
  107357. // RequestId sets the optional parameter "requestId": An optional
  107358. // request ID to identify requests. Specify a unique request ID so that
  107359. // if you must retry your request, the server will know to ignore the
  107360. // request if it has already been completed.
  107361. //
  107362. // For example, consider a situation where you make an initial request
  107363. // and the request times out. If you make the request again with the
  107364. // same request ID, the server can check if original operation with the
  107365. // same request ID was received, and if so, will ignore the second
  107366. // request. This prevents clients from accidentally creating duplicate
  107367. // commitments.
  107368. //
  107369. // The request ID must be a valid UUID with the exception that zero UUID
  107370. // is not supported (00000000-0000-0000-0000-000000000000).
  107371. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  107372. c.urlParams_.Set("requestId", requestId)
  107373. return c
  107374. }
  107375. // Fields allows partial responses to be retrieved. See
  107376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107377. // for more information.
  107378. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  107379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107380. return c
  107381. }
  107382. // Context sets the context to be used in this call's Do method. Any
  107383. // pending HTTP request will be aborted if the provided context is
  107384. // canceled.
  107385. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  107386. c.ctx_ = ctx
  107387. return c
  107388. }
  107389. // Header returns an http.Header that can be modified by the caller to
  107390. // add HTTP headers to the request.
  107391. func (c *TargetInstancesDeleteCall) Header() http.Header {
  107392. if c.header_ == nil {
  107393. c.header_ = make(http.Header)
  107394. }
  107395. return c.header_
  107396. }
  107397. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  107398. reqHeaders := make(http.Header)
  107399. for k, v := range c.header_ {
  107400. reqHeaders[k] = v
  107401. }
  107402. reqHeaders.Set("User-Agent", c.s.userAgent())
  107403. var body io.Reader = nil
  107404. c.urlParams_.Set("alt", alt)
  107405. c.urlParams_.Set("prettyPrint", "false")
  107406. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  107407. urls += "?" + c.urlParams_.Encode()
  107408. req, err := http.NewRequest("DELETE", urls, body)
  107409. if err != nil {
  107410. return nil, err
  107411. }
  107412. req.Header = reqHeaders
  107413. googleapi.Expand(req.URL, map[string]string{
  107414. "project": c.project,
  107415. "zone": c.zone,
  107416. "targetInstance": c.targetInstance,
  107417. })
  107418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107419. }
  107420. // Do executes the "compute.targetInstances.delete" call.
  107421. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107422. // status code is an error. Response headers are in either
  107423. // *Operation.ServerResponse.Header or (if a response was returned at
  107424. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107425. // to check whether the returned error was because
  107426. // http.StatusNotModified was returned.
  107427. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107428. gensupport.SetOptions(c.urlParams_, opts...)
  107429. res, err := c.doRequest("json")
  107430. if res != nil && res.StatusCode == http.StatusNotModified {
  107431. if res.Body != nil {
  107432. res.Body.Close()
  107433. }
  107434. return nil, &googleapi.Error{
  107435. Code: res.StatusCode,
  107436. Header: res.Header,
  107437. }
  107438. }
  107439. if err != nil {
  107440. return nil, err
  107441. }
  107442. defer googleapi.CloseBody(res)
  107443. if err := googleapi.CheckResponse(res); err != nil {
  107444. return nil, err
  107445. }
  107446. ret := &Operation{
  107447. ServerResponse: googleapi.ServerResponse{
  107448. Header: res.Header,
  107449. HTTPStatusCode: res.StatusCode,
  107450. },
  107451. }
  107452. target := &ret
  107453. if err := gensupport.DecodeResponse(target, res); err != nil {
  107454. return nil, err
  107455. }
  107456. return ret, nil
  107457. // {
  107458. // "description": "Deletes the specified TargetInstance resource.",
  107459. // "httpMethod": "DELETE",
  107460. // "id": "compute.targetInstances.delete",
  107461. // "parameterOrder": [
  107462. // "project",
  107463. // "zone",
  107464. // "targetInstance"
  107465. // ],
  107466. // "parameters": {
  107467. // "project": {
  107468. // "description": "Project ID for this request.",
  107469. // "location": "path",
  107470. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107471. // "required": true,
  107472. // "type": "string"
  107473. // },
  107474. // "requestId": {
  107475. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107476. // "location": "query",
  107477. // "type": "string"
  107478. // },
  107479. // "targetInstance": {
  107480. // "description": "Name of the TargetInstance resource to delete.",
  107481. // "location": "path",
  107482. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  107483. // "required": true,
  107484. // "type": "string"
  107485. // },
  107486. // "zone": {
  107487. // "description": "Name of the zone scoping this request.",
  107488. // "location": "path",
  107489. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107490. // "required": true,
  107491. // "type": "string"
  107492. // }
  107493. // },
  107494. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  107495. // "response": {
  107496. // "$ref": "Operation"
  107497. // },
  107498. // "scopes": [
  107499. // "https://www.googleapis.com/auth/cloud-platform",
  107500. // "https://www.googleapis.com/auth/compute"
  107501. // ]
  107502. // }
  107503. }
  107504. // method id "compute.targetInstances.get":
  107505. type TargetInstancesGetCall struct {
  107506. s *Service
  107507. project string
  107508. zone string
  107509. targetInstance string
  107510. urlParams_ gensupport.URLParams
  107511. ifNoneMatch_ string
  107512. ctx_ context.Context
  107513. header_ http.Header
  107514. }
  107515. // Get: Returns the specified TargetInstance resource. Gets a list of
  107516. // available target instances by making a list() request.
  107517. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  107518. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  107519. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107520. c.project = project
  107521. c.zone = zone
  107522. c.targetInstance = targetInstance
  107523. return c
  107524. }
  107525. // Fields allows partial responses to be retrieved. See
  107526. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107527. // for more information.
  107528. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  107529. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107530. return c
  107531. }
  107532. // IfNoneMatch sets the optional parameter which makes the operation
  107533. // fail if the object's ETag matches the given value. This is useful for
  107534. // getting updates only after the object has changed since the last
  107535. // request. Use googleapi.IsNotModified to check whether the response
  107536. // error from Do is the result of In-None-Match.
  107537. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  107538. c.ifNoneMatch_ = entityTag
  107539. return c
  107540. }
  107541. // Context sets the context to be used in this call's Do method. Any
  107542. // pending HTTP request will be aborted if the provided context is
  107543. // canceled.
  107544. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  107545. c.ctx_ = ctx
  107546. return c
  107547. }
  107548. // Header returns an http.Header that can be modified by the caller to
  107549. // add HTTP headers to the request.
  107550. func (c *TargetInstancesGetCall) Header() http.Header {
  107551. if c.header_ == nil {
  107552. c.header_ = make(http.Header)
  107553. }
  107554. return c.header_
  107555. }
  107556. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  107557. reqHeaders := make(http.Header)
  107558. for k, v := range c.header_ {
  107559. reqHeaders[k] = v
  107560. }
  107561. reqHeaders.Set("User-Agent", c.s.userAgent())
  107562. if c.ifNoneMatch_ != "" {
  107563. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  107564. }
  107565. var body io.Reader = nil
  107566. c.urlParams_.Set("alt", alt)
  107567. c.urlParams_.Set("prettyPrint", "false")
  107568. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  107569. urls += "?" + c.urlParams_.Encode()
  107570. req, err := http.NewRequest("GET", urls, body)
  107571. if err != nil {
  107572. return nil, err
  107573. }
  107574. req.Header = reqHeaders
  107575. googleapi.Expand(req.URL, map[string]string{
  107576. "project": c.project,
  107577. "zone": c.zone,
  107578. "targetInstance": c.targetInstance,
  107579. })
  107580. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107581. }
  107582. // Do executes the "compute.targetInstances.get" call.
  107583. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  107584. // status code is an error. Response headers are in either
  107585. // *TargetInstance.ServerResponse.Header or (if a response was returned
  107586. // at all) in error.(*googleapi.Error).Header. Use
  107587. // googleapi.IsNotModified to check whether the returned error was
  107588. // because http.StatusNotModified was returned.
  107589. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  107590. gensupport.SetOptions(c.urlParams_, opts...)
  107591. res, err := c.doRequest("json")
  107592. if res != nil && res.StatusCode == http.StatusNotModified {
  107593. if res.Body != nil {
  107594. res.Body.Close()
  107595. }
  107596. return nil, &googleapi.Error{
  107597. Code: res.StatusCode,
  107598. Header: res.Header,
  107599. }
  107600. }
  107601. if err != nil {
  107602. return nil, err
  107603. }
  107604. defer googleapi.CloseBody(res)
  107605. if err := googleapi.CheckResponse(res); err != nil {
  107606. return nil, err
  107607. }
  107608. ret := &TargetInstance{
  107609. ServerResponse: googleapi.ServerResponse{
  107610. Header: res.Header,
  107611. HTTPStatusCode: res.StatusCode,
  107612. },
  107613. }
  107614. target := &ret
  107615. if err := gensupport.DecodeResponse(target, res); err != nil {
  107616. return nil, err
  107617. }
  107618. return ret, nil
  107619. // {
  107620. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  107621. // "httpMethod": "GET",
  107622. // "id": "compute.targetInstances.get",
  107623. // "parameterOrder": [
  107624. // "project",
  107625. // "zone",
  107626. // "targetInstance"
  107627. // ],
  107628. // "parameters": {
  107629. // "project": {
  107630. // "description": "Project ID for this request.",
  107631. // "location": "path",
  107632. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107633. // "required": true,
  107634. // "type": "string"
  107635. // },
  107636. // "targetInstance": {
  107637. // "description": "Name of the TargetInstance resource to return.",
  107638. // "location": "path",
  107639. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  107640. // "required": true,
  107641. // "type": "string"
  107642. // },
  107643. // "zone": {
  107644. // "description": "Name of the zone scoping this request.",
  107645. // "location": "path",
  107646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107647. // "required": true,
  107648. // "type": "string"
  107649. // }
  107650. // },
  107651. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  107652. // "response": {
  107653. // "$ref": "TargetInstance"
  107654. // },
  107655. // "scopes": [
  107656. // "https://www.googleapis.com/auth/cloud-platform",
  107657. // "https://www.googleapis.com/auth/compute",
  107658. // "https://www.googleapis.com/auth/compute.readonly"
  107659. // ]
  107660. // }
  107661. }
  107662. // method id "compute.targetInstances.insert":
  107663. type TargetInstancesInsertCall struct {
  107664. s *Service
  107665. project string
  107666. zone string
  107667. targetinstance *TargetInstance
  107668. urlParams_ gensupport.URLParams
  107669. ctx_ context.Context
  107670. header_ http.Header
  107671. }
  107672. // Insert: Creates a TargetInstance resource in the specified project
  107673. // and zone using the data included in the request.
  107674. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  107675. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  107676. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107677. c.project = project
  107678. c.zone = zone
  107679. c.targetinstance = targetinstance
  107680. return c
  107681. }
  107682. // RequestId sets the optional parameter "requestId": An optional
  107683. // request ID to identify requests. Specify a unique request ID so that
  107684. // if you must retry your request, the server will know to ignore the
  107685. // request if it has already been completed.
  107686. //
  107687. // For example, consider a situation where you make an initial request
  107688. // and the request times out. If you make the request again with the
  107689. // same request ID, the server can check if original operation with the
  107690. // same request ID was received, and if so, will ignore the second
  107691. // request. This prevents clients from accidentally creating duplicate
  107692. // commitments.
  107693. //
  107694. // The request ID must be a valid UUID with the exception that zero UUID
  107695. // is not supported (00000000-0000-0000-0000-000000000000).
  107696. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  107697. c.urlParams_.Set("requestId", requestId)
  107698. return c
  107699. }
  107700. // Fields allows partial responses to be retrieved. See
  107701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107702. // for more information.
  107703. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  107704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107705. return c
  107706. }
  107707. // Context sets the context to be used in this call's Do method. Any
  107708. // pending HTTP request will be aborted if the provided context is
  107709. // canceled.
  107710. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  107711. c.ctx_ = ctx
  107712. return c
  107713. }
  107714. // Header returns an http.Header that can be modified by the caller to
  107715. // add HTTP headers to the request.
  107716. func (c *TargetInstancesInsertCall) Header() http.Header {
  107717. if c.header_ == nil {
  107718. c.header_ = make(http.Header)
  107719. }
  107720. return c.header_
  107721. }
  107722. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  107723. reqHeaders := make(http.Header)
  107724. for k, v := range c.header_ {
  107725. reqHeaders[k] = v
  107726. }
  107727. reqHeaders.Set("User-Agent", c.s.userAgent())
  107728. var body io.Reader = nil
  107729. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  107730. if err != nil {
  107731. return nil, err
  107732. }
  107733. reqHeaders.Set("Content-Type", "application/json")
  107734. c.urlParams_.Set("alt", alt)
  107735. c.urlParams_.Set("prettyPrint", "false")
  107736. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  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. "zone": c.zone,
  107746. })
  107747. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107748. }
  107749. // Do executes the "compute.targetInstances.insert" call.
  107750. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107751. // status code is an error. Response headers are in either
  107752. // *Operation.ServerResponse.Header or (if a response was returned at
  107753. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107754. // to check whether the returned error was because
  107755. // http.StatusNotModified was returned.
  107756. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107757. gensupport.SetOptions(c.urlParams_, opts...)
  107758. res, err := c.doRequest("json")
  107759. if res != nil && res.StatusCode == http.StatusNotModified {
  107760. if res.Body != nil {
  107761. res.Body.Close()
  107762. }
  107763. return nil, &googleapi.Error{
  107764. Code: res.StatusCode,
  107765. Header: res.Header,
  107766. }
  107767. }
  107768. if err != nil {
  107769. return nil, err
  107770. }
  107771. defer googleapi.CloseBody(res)
  107772. if err := googleapi.CheckResponse(res); err != nil {
  107773. return nil, err
  107774. }
  107775. ret := &Operation{
  107776. ServerResponse: googleapi.ServerResponse{
  107777. Header: res.Header,
  107778. HTTPStatusCode: res.StatusCode,
  107779. },
  107780. }
  107781. target := &ret
  107782. if err := gensupport.DecodeResponse(target, res); err != nil {
  107783. return nil, err
  107784. }
  107785. return ret, nil
  107786. // {
  107787. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  107788. // "httpMethod": "POST",
  107789. // "id": "compute.targetInstances.insert",
  107790. // "parameterOrder": [
  107791. // "project",
  107792. // "zone"
  107793. // ],
  107794. // "parameters": {
  107795. // "project": {
  107796. // "description": "Project ID for this request.",
  107797. // "location": "path",
  107798. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107799. // "required": true,
  107800. // "type": "string"
  107801. // },
  107802. // "requestId": {
  107803. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107804. // "location": "query",
  107805. // "type": "string"
  107806. // },
  107807. // "zone": {
  107808. // "description": "Name of the zone scoping this request.",
  107809. // "location": "path",
  107810. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107811. // "required": true,
  107812. // "type": "string"
  107813. // }
  107814. // },
  107815. // "path": "{project}/zones/{zone}/targetInstances",
  107816. // "request": {
  107817. // "$ref": "TargetInstance"
  107818. // },
  107819. // "response": {
  107820. // "$ref": "Operation"
  107821. // },
  107822. // "scopes": [
  107823. // "https://www.googleapis.com/auth/cloud-platform",
  107824. // "https://www.googleapis.com/auth/compute"
  107825. // ]
  107826. // }
  107827. }
  107828. // method id "compute.targetInstances.list":
  107829. type TargetInstancesListCall struct {
  107830. s *Service
  107831. project string
  107832. zone string
  107833. urlParams_ gensupport.URLParams
  107834. ifNoneMatch_ string
  107835. ctx_ context.Context
  107836. header_ http.Header
  107837. }
  107838. // List: Retrieves a list of TargetInstance resources available to the
  107839. // specified project and zone.
  107840. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  107841. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  107842. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107843. c.project = project
  107844. c.zone = zone
  107845. return c
  107846. }
  107847. // Filter sets the optional parameter "filter": A filter expression that
  107848. // filters resources listed in the response. The expression must specify
  107849. // the field name, a comparison operator, and the value that you want to
  107850. // use for filtering. The value must be a string, a number, or a
  107851. // boolean. The comparison operator must be either =, !=, >, or <.
  107852. //
  107853. // For example, if you are filtering Compute Engine instances, you can
  107854. // exclude instances named example-instance by specifying name !=
  107855. // example-instance.
  107856. //
  107857. // You can also filter nested fields. For example, you could specify
  107858. // scheduling.automaticRestart = false to include instances only if they
  107859. // are not scheduled for automatic restarts. You can use filtering on
  107860. // nested fields to filter based on resource labels.
  107861. //
  107862. // To filter on multiple expressions, provide each separate expression
  107863. // within parentheses. For example, (scheduling.automaticRestart = true)
  107864. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  107865. // AND expression. However, you can include AND and OR expressions
  107866. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  107867. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  107868. // true).
  107869. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  107870. c.urlParams_.Set("filter", filter)
  107871. return c
  107872. }
  107873. // MaxResults sets the optional parameter "maxResults": The maximum
  107874. // number of results per page that should be returned. If the number of
  107875. // available results is larger than maxResults, Compute Engine returns a
  107876. // nextPageToken that can be used to get the next page of results in
  107877. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  107878. // (Default: 500)
  107879. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  107880. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  107881. return c
  107882. }
  107883. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  107884. // a certain order. By default, results are returned in alphanumerical
  107885. // order based on the resource name.
  107886. //
  107887. // You can also sort results in descending order based on the creation
  107888. // timestamp using orderBy="creationTimestamp desc". This sorts results
  107889. // based on the creationTimestamp field in reverse chronological order
  107890. // (newest result first). Use this to sort resources like operations so
  107891. // that the newest operation is returned first.
  107892. //
  107893. // Currently, only sorting by name or creationTimestamp desc is
  107894. // supported.
  107895. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  107896. c.urlParams_.Set("orderBy", orderBy)
  107897. return c
  107898. }
  107899. // PageToken sets the optional parameter "pageToken": Specifies a page
  107900. // token to use. Set pageToken to the nextPageToken returned by a
  107901. // previous list request to get the next page of results.
  107902. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  107903. c.urlParams_.Set("pageToken", pageToken)
  107904. return c
  107905. }
  107906. // Fields allows partial responses to be retrieved. See
  107907. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107908. // for more information.
  107909. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  107910. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107911. return c
  107912. }
  107913. // IfNoneMatch sets the optional parameter which makes the operation
  107914. // fail if the object's ETag matches the given value. This is useful for
  107915. // getting updates only after the object has changed since the last
  107916. // request. Use googleapi.IsNotModified to check whether the response
  107917. // error from Do is the result of In-None-Match.
  107918. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  107919. c.ifNoneMatch_ = entityTag
  107920. return c
  107921. }
  107922. // Context sets the context to be used in this call's Do method. Any
  107923. // pending HTTP request will be aborted if the provided context is
  107924. // canceled.
  107925. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  107926. c.ctx_ = ctx
  107927. return c
  107928. }
  107929. // Header returns an http.Header that can be modified by the caller to
  107930. // add HTTP headers to the request.
  107931. func (c *TargetInstancesListCall) Header() http.Header {
  107932. if c.header_ == nil {
  107933. c.header_ = make(http.Header)
  107934. }
  107935. return c.header_
  107936. }
  107937. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  107938. reqHeaders := make(http.Header)
  107939. for k, v := range c.header_ {
  107940. reqHeaders[k] = v
  107941. }
  107942. reqHeaders.Set("User-Agent", c.s.userAgent())
  107943. if c.ifNoneMatch_ != "" {
  107944. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  107945. }
  107946. var body io.Reader = nil
  107947. c.urlParams_.Set("alt", alt)
  107948. c.urlParams_.Set("prettyPrint", "false")
  107949. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  107950. urls += "?" + c.urlParams_.Encode()
  107951. req, err := http.NewRequest("GET", urls, body)
  107952. if err != nil {
  107953. return nil, err
  107954. }
  107955. req.Header = reqHeaders
  107956. googleapi.Expand(req.URL, map[string]string{
  107957. "project": c.project,
  107958. "zone": c.zone,
  107959. })
  107960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107961. }
  107962. // Do executes the "compute.targetInstances.list" call.
  107963. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  107964. // non-2xx status code is an error. Response headers are in either
  107965. // *TargetInstanceList.ServerResponse.Header or (if a response was
  107966. // returned at all) in error.(*googleapi.Error).Header. Use
  107967. // googleapi.IsNotModified to check whether the returned error was
  107968. // because http.StatusNotModified was returned.
  107969. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  107970. gensupport.SetOptions(c.urlParams_, opts...)
  107971. res, err := c.doRequest("json")
  107972. if res != nil && res.StatusCode == http.StatusNotModified {
  107973. if res.Body != nil {
  107974. res.Body.Close()
  107975. }
  107976. return nil, &googleapi.Error{
  107977. Code: res.StatusCode,
  107978. Header: res.Header,
  107979. }
  107980. }
  107981. if err != nil {
  107982. return nil, err
  107983. }
  107984. defer googleapi.CloseBody(res)
  107985. if err := googleapi.CheckResponse(res); err != nil {
  107986. return nil, err
  107987. }
  107988. ret := &TargetInstanceList{
  107989. ServerResponse: googleapi.ServerResponse{
  107990. Header: res.Header,
  107991. HTTPStatusCode: res.StatusCode,
  107992. },
  107993. }
  107994. target := &ret
  107995. if err := gensupport.DecodeResponse(target, res); err != nil {
  107996. return nil, err
  107997. }
  107998. return ret, nil
  107999. // {
  108000. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  108001. // "httpMethod": "GET",
  108002. // "id": "compute.targetInstances.list",
  108003. // "parameterOrder": [
  108004. // "project",
  108005. // "zone"
  108006. // ],
  108007. // "parameters": {
  108008. // "filter": {
  108009. // "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).",
  108010. // "location": "query",
  108011. // "type": "string"
  108012. // },
  108013. // "maxResults": {
  108014. // "default": "500",
  108015. // "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)",
  108016. // "format": "uint32",
  108017. // "location": "query",
  108018. // "minimum": "0",
  108019. // "type": "integer"
  108020. // },
  108021. // "orderBy": {
  108022. // "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.",
  108023. // "location": "query",
  108024. // "type": "string"
  108025. // },
  108026. // "pageToken": {
  108027. // "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.",
  108028. // "location": "query",
  108029. // "type": "string"
  108030. // },
  108031. // "project": {
  108032. // "description": "Project ID for this request.",
  108033. // "location": "path",
  108034. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108035. // "required": true,
  108036. // "type": "string"
  108037. // },
  108038. // "zone": {
  108039. // "description": "Name of the zone scoping this request.",
  108040. // "location": "path",
  108041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108042. // "required": true,
  108043. // "type": "string"
  108044. // }
  108045. // },
  108046. // "path": "{project}/zones/{zone}/targetInstances",
  108047. // "response": {
  108048. // "$ref": "TargetInstanceList"
  108049. // },
  108050. // "scopes": [
  108051. // "https://www.googleapis.com/auth/cloud-platform",
  108052. // "https://www.googleapis.com/auth/compute",
  108053. // "https://www.googleapis.com/auth/compute.readonly"
  108054. // ]
  108055. // }
  108056. }
  108057. // Pages invokes f for each page of results.
  108058. // A non-nil error returned from f will halt the iteration.
  108059. // The provided context supersedes any context provided to the Context method.
  108060. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  108061. c.ctx_ = ctx
  108062. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  108063. for {
  108064. x, err := c.Do()
  108065. if err != nil {
  108066. return err
  108067. }
  108068. if err := f(x); err != nil {
  108069. return err
  108070. }
  108071. if x.NextPageToken == "" {
  108072. return nil
  108073. }
  108074. c.PageToken(x.NextPageToken)
  108075. }
  108076. }
  108077. // method id "compute.targetInstances.testIamPermissions":
  108078. type TargetInstancesTestIamPermissionsCall struct {
  108079. s *Service
  108080. project string
  108081. zone string
  108082. resource string
  108083. testpermissionsrequest *TestPermissionsRequest
  108084. urlParams_ gensupport.URLParams
  108085. ctx_ context.Context
  108086. header_ http.Header
  108087. }
  108088. // TestIamPermissions: Returns permissions that a caller has on the
  108089. // specified resource.
  108090. func (r *TargetInstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetInstancesTestIamPermissionsCall {
  108091. c := &TargetInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108092. c.project = project
  108093. c.zone = zone
  108094. c.resource = resource
  108095. c.testpermissionsrequest = testpermissionsrequest
  108096. return c
  108097. }
  108098. // Fields allows partial responses to be retrieved. See
  108099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108100. // for more information.
  108101. func (c *TargetInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetInstancesTestIamPermissionsCall {
  108102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108103. return c
  108104. }
  108105. // Context sets the context to be used in this call's Do method. Any
  108106. // pending HTTP request will be aborted if the provided context is
  108107. // canceled.
  108108. func (c *TargetInstancesTestIamPermissionsCall) Context(ctx context.Context) *TargetInstancesTestIamPermissionsCall {
  108109. c.ctx_ = ctx
  108110. return c
  108111. }
  108112. // Header returns an http.Header that can be modified by the caller to
  108113. // add HTTP headers to the request.
  108114. func (c *TargetInstancesTestIamPermissionsCall) Header() http.Header {
  108115. if c.header_ == nil {
  108116. c.header_ = make(http.Header)
  108117. }
  108118. return c.header_
  108119. }
  108120. func (c *TargetInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  108121. reqHeaders := make(http.Header)
  108122. for k, v := range c.header_ {
  108123. reqHeaders[k] = v
  108124. }
  108125. reqHeaders.Set("User-Agent", c.s.userAgent())
  108126. var body io.Reader = nil
  108127. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  108128. if err != nil {
  108129. return nil, err
  108130. }
  108131. reqHeaders.Set("Content-Type", "application/json")
  108132. c.urlParams_.Set("alt", alt)
  108133. c.urlParams_.Set("prettyPrint", "false")
  108134. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions")
  108135. urls += "?" + c.urlParams_.Encode()
  108136. req, err := http.NewRequest("POST", urls, body)
  108137. if err != nil {
  108138. return nil, err
  108139. }
  108140. req.Header = reqHeaders
  108141. googleapi.Expand(req.URL, map[string]string{
  108142. "project": c.project,
  108143. "zone": c.zone,
  108144. "resource": c.resource,
  108145. })
  108146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108147. }
  108148. // Do executes the "compute.targetInstances.testIamPermissions" call.
  108149. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  108150. // non-2xx status code is an error. Response headers are in either
  108151. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  108152. // returned at all) in error.(*googleapi.Error).Header. Use
  108153. // googleapi.IsNotModified to check whether the returned error was
  108154. // because http.StatusNotModified was returned.
  108155. func (c *TargetInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  108156. gensupport.SetOptions(c.urlParams_, opts...)
  108157. res, err := c.doRequest("json")
  108158. if res != nil && res.StatusCode == http.StatusNotModified {
  108159. if res.Body != nil {
  108160. res.Body.Close()
  108161. }
  108162. return nil, &googleapi.Error{
  108163. Code: res.StatusCode,
  108164. Header: res.Header,
  108165. }
  108166. }
  108167. if err != nil {
  108168. return nil, err
  108169. }
  108170. defer googleapi.CloseBody(res)
  108171. if err := googleapi.CheckResponse(res); err != nil {
  108172. return nil, err
  108173. }
  108174. ret := &TestPermissionsResponse{
  108175. ServerResponse: googleapi.ServerResponse{
  108176. Header: res.Header,
  108177. HTTPStatusCode: res.StatusCode,
  108178. },
  108179. }
  108180. target := &ret
  108181. if err := gensupport.DecodeResponse(target, res); err != nil {
  108182. return nil, err
  108183. }
  108184. return ret, nil
  108185. // {
  108186. // "description": "Returns permissions that a caller has on the specified resource.",
  108187. // "httpMethod": "POST",
  108188. // "id": "compute.targetInstances.testIamPermissions",
  108189. // "parameterOrder": [
  108190. // "project",
  108191. // "zone",
  108192. // "resource"
  108193. // ],
  108194. // "parameters": {
  108195. // "project": {
  108196. // "description": "Project ID for this request.",
  108197. // "location": "path",
  108198. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108199. // "required": true,
  108200. // "type": "string"
  108201. // },
  108202. // "resource": {
  108203. // "description": "Name or id of the resource for this request.",
  108204. // "location": "path",
  108205. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  108206. // "required": true,
  108207. // "type": "string"
  108208. // },
  108209. // "zone": {
  108210. // "description": "The name of the zone for this request.",
  108211. // "location": "path",
  108212. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108213. // "required": true,
  108214. // "type": "string"
  108215. // }
  108216. // },
  108217. // "path": "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions",
  108218. // "request": {
  108219. // "$ref": "TestPermissionsRequest"
  108220. // },
  108221. // "response": {
  108222. // "$ref": "TestPermissionsResponse"
  108223. // },
  108224. // "scopes": [
  108225. // "https://www.googleapis.com/auth/cloud-platform",
  108226. // "https://www.googleapis.com/auth/compute",
  108227. // "https://www.googleapis.com/auth/compute.readonly"
  108228. // ]
  108229. // }
  108230. }
  108231. // method id "compute.targetPools.addHealthCheck":
  108232. type TargetPoolsAddHealthCheckCall struct {
  108233. s *Service
  108234. project string
  108235. region string
  108236. targetPool string
  108237. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  108238. urlParams_ gensupport.URLParams
  108239. ctx_ context.Context
  108240. header_ http.Header
  108241. }
  108242. // AddHealthCheck: Adds health check URLs to a target pool.
  108243. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  108244. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  108245. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108246. c.project = project
  108247. c.region = region
  108248. c.targetPool = targetPool
  108249. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  108250. return c
  108251. }
  108252. // RequestId sets the optional parameter "requestId": An optional
  108253. // request ID to identify requests. Specify a unique request ID so that
  108254. // if you must retry your request, the server will know to ignore the
  108255. // request if it has already been completed.
  108256. //
  108257. // For example, consider a situation where you make an initial request
  108258. // and the request times out. If you make the request again with the
  108259. // same request ID, the server can check if original operation with the
  108260. // same request ID was received, and if so, will ignore the second
  108261. // request. This prevents clients from accidentally creating duplicate
  108262. // commitments.
  108263. //
  108264. // The request ID must be a valid UUID with the exception that zero UUID
  108265. // is not supported (00000000-0000-0000-0000-000000000000).
  108266. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  108267. c.urlParams_.Set("requestId", requestId)
  108268. return c
  108269. }
  108270. // Fields allows partial responses to be retrieved. See
  108271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108272. // for more information.
  108273. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  108274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108275. return c
  108276. }
  108277. // Context sets the context to be used in this call's Do method. Any
  108278. // pending HTTP request will be aborted if the provided context is
  108279. // canceled.
  108280. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  108281. c.ctx_ = ctx
  108282. return c
  108283. }
  108284. // Header returns an http.Header that can be modified by the caller to
  108285. // add HTTP headers to the request.
  108286. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  108287. if c.header_ == nil {
  108288. c.header_ = make(http.Header)
  108289. }
  108290. return c.header_
  108291. }
  108292. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  108293. reqHeaders := make(http.Header)
  108294. for k, v := range c.header_ {
  108295. reqHeaders[k] = v
  108296. }
  108297. reqHeaders.Set("User-Agent", c.s.userAgent())
  108298. var body io.Reader = nil
  108299. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  108300. if err != nil {
  108301. return nil, err
  108302. }
  108303. reqHeaders.Set("Content-Type", "application/json")
  108304. c.urlParams_.Set("alt", alt)
  108305. c.urlParams_.Set("prettyPrint", "false")
  108306. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  108307. urls += "?" + c.urlParams_.Encode()
  108308. req, err := http.NewRequest("POST", urls, body)
  108309. if err != nil {
  108310. return nil, err
  108311. }
  108312. req.Header = reqHeaders
  108313. googleapi.Expand(req.URL, map[string]string{
  108314. "project": c.project,
  108315. "region": c.region,
  108316. "targetPool": c.targetPool,
  108317. })
  108318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108319. }
  108320. // Do executes the "compute.targetPools.addHealthCheck" call.
  108321. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108322. // status code is an error. Response headers are in either
  108323. // *Operation.ServerResponse.Header or (if a response was returned at
  108324. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108325. // to check whether the returned error was because
  108326. // http.StatusNotModified was returned.
  108327. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108328. gensupport.SetOptions(c.urlParams_, opts...)
  108329. res, err := c.doRequest("json")
  108330. if res != nil && res.StatusCode == http.StatusNotModified {
  108331. if res.Body != nil {
  108332. res.Body.Close()
  108333. }
  108334. return nil, &googleapi.Error{
  108335. Code: res.StatusCode,
  108336. Header: res.Header,
  108337. }
  108338. }
  108339. if err != nil {
  108340. return nil, err
  108341. }
  108342. defer googleapi.CloseBody(res)
  108343. if err := googleapi.CheckResponse(res); err != nil {
  108344. return nil, err
  108345. }
  108346. ret := &Operation{
  108347. ServerResponse: googleapi.ServerResponse{
  108348. Header: res.Header,
  108349. HTTPStatusCode: res.StatusCode,
  108350. },
  108351. }
  108352. target := &ret
  108353. if err := gensupport.DecodeResponse(target, res); err != nil {
  108354. return nil, err
  108355. }
  108356. return ret, nil
  108357. // {
  108358. // "description": "Adds health check URLs to a target pool.",
  108359. // "httpMethod": "POST",
  108360. // "id": "compute.targetPools.addHealthCheck",
  108361. // "parameterOrder": [
  108362. // "project",
  108363. // "region",
  108364. // "targetPool"
  108365. // ],
  108366. // "parameters": {
  108367. // "project": {
  108368. // "description": "Project ID for this request.",
  108369. // "location": "path",
  108370. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108371. // "required": true,
  108372. // "type": "string"
  108373. // },
  108374. // "region": {
  108375. // "description": "Name of the region scoping this request.",
  108376. // "location": "path",
  108377. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108378. // "required": true,
  108379. // "type": "string"
  108380. // },
  108381. // "requestId": {
  108382. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108383. // "location": "query",
  108384. // "type": "string"
  108385. // },
  108386. // "targetPool": {
  108387. // "description": "Name of the target pool to add a health check to.",
  108388. // "location": "path",
  108389. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  108390. // "required": true,
  108391. // "type": "string"
  108392. // }
  108393. // },
  108394. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  108395. // "request": {
  108396. // "$ref": "TargetPoolsAddHealthCheckRequest"
  108397. // },
  108398. // "response": {
  108399. // "$ref": "Operation"
  108400. // },
  108401. // "scopes": [
  108402. // "https://www.googleapis.com/auth/cloud-platform",
  108403. // "https://www.googleapis.com/auth/compute"
  108404. // ]
  108405. // }
  108406. }
  108407. // method id "compute.targetPools.addInstance":
  108408. type TargetPoolsAddInstanceCall struct {
  108409. s *Service
  108410. project string
  108411. region string
  108412. targetPool string
  108413. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  108414. urlParams_ gensupport.URLParams
  108415. ctx_ context.Context
  108416. header_ http.Header
  108417. }
  108418. // AddInstance: Adds an instance to a target pool.
  108419. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  108420. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  108421. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108422. c.project = project
  108423. c.region = region
  108424. c.targetPool = targetPool
  108425. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  108426. return c
  108427. }
  108428. // RequestId sets the optional parameter "requestId": An optional
  108429. // request ID to identify requests. Specify a unique request ID so that
  108430. // if you must retry your request, the server will know to ignore the
  108431. // request if it has already been completed.
  108432. //
  108433. // For example, consider a situation where you make an initial request
  108434. // and the request times out. If you make the request again with the
  108435. // same request ID, the server can check if original operation with the
  108436. // same request ID was received, and if so, will ignore the second
  108437. // request. This prevents clients from accidentally creating duplicate
  108438. // commitments.
  108439. //
  108440. // The request ID must be a valid UUID with the exception that zero UUID
  108441. // is not supported (00000000-0000-0000-0000-000000000000).
  108442. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  108443. c.urlParams_.Set("requestId", requestId)
  108444. return c
  108445. }
  108446. // Fields allows partial responses to be retrieved. See
  108447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108448. // for more information.
  108449. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  108450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108451. return c
  108452. }
  108453. // Context sets the context to be used in this call's Do method. Any
  108454. // pending HTTP request will be aborted if the provided context is
  108455. // canceled.
  108456. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  108457. c.ctx_ = ctx
  108458. return c
  108459. }
  108460. // Header returns an http.Header that can be modified by the caller to
  108461. // add HTTP headers to the request.
  108462. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  108463. if c.header_ == nil {
  108464. c.header_ = make(http.Header)
  108465. }
  108466. return c.header_
  108467. }
  108468. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  108469. reqHeaders := make(http.Header)
  108470. for k, v := range c.header_ {
  108471. reqHeaders[k] = v
  108472. }
  108473. reqHeaders.Set("User-Agent", c.s.userAgent())
  108474. var body io.Reader = nil
  108475. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  108476. if err != nil {
  108477. return nil, err
  108478. }
  108479. reqHeaders.Set("Content-Type", "application/json")
  108480. c.urlParams_.Set("alt", alt)
  108481. c.urlParams_.Set("prettyPrint", "false")
  108482. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  108483. urls += "?" + c.urlParams_.Encode()
  108484. req, err := http.NewRequest("POST", urls, body)
  108485. if err != nil {
  108486. return nil, err
  108487. }
  108488. req.Header = reqHeaders
  108489. googleapi.Expand(req.URL, map[string]string{
  108490. "project": c.project,
  108491. "region": c.region,
  108492. "targetPool": c.targetPool,
  108493. })
  108494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108495. }
  108496. // Do executes the "compute.targetPools.addInstance" call.
  108497. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108498. // status code is an error. Response headers are in either
  108499. // *Operation.ServerResponse.Header or (if a response was returned at
  108500. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108501. // to check whether the returned error was because
  108502. // http.StatusNotModified was returned.
  108503. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108504. gensupport.SetOptions(c.urlParams_, opts...)
  108505. res, err := c.doRequest("json")
  108506. if res != nil && res.StatusCode == http.StatusNotModified {
  108507. if res.Body != nil {
  108508. res.Body.Close()
  108509. }
  108510. return nil, &googleapi.Error{
  108511. Code: res.StatusCode,
  108512. Header: res.Header,
  108513. }
  108514. }
  108515. if err != nil {
  108516. return nil, err
  108517. }
  108518. defer googleapi.CloseBody(res)
  108519. if err := googleapi.CheckResponse(res); err != nil {
  108520. return nil, err
  108521. }
  108522. ret := &Operation{
  108523. ServerResponse: googleapi.ServerResponse{
  108524. Header: res.Header,
  108525. HTTPStatusCode: res.StatusCode,
  108526. },
  108527. }
  108528. target := &ret
  108529. if err := gensupport.DecodeResponse(target, res); err != nil {
  108530. return nil, err
  108531. }
  108532. return ret, nil
  108533. // {
  108534. // "description": "Adds an instance to a target pool.",
  108535. // "httpMethod": "POST",
  108536. // "id": "compute.targetPools.addInstance",
  108537. // "parameterOrder": [
  108538. // "project",
  108539. // "region",
  108540. // "targetPool"
  108541. // ],
  108542. // "parameters": {
  108543. // "project": {
  108544. // "description": "Project ID for this request.",
  108545. // "location": "path",
  108546. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108547. // "required": true,
  108548. // "type": "string"
  108549. // },
  108550. // "region": {
  108551. // "description": "Name of the region scoping this request.",
  108552. // "location": "path",
  108553. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108554. // "required": true,
  108555. // "type": "string"
  108556. // },
  108557. // "requestId": {
  108558. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108559. // "location": "query",
  108560. // "type": "string"
  108561. // },
  108562. // "targetPool": {
  108563. // "description": "Name of the TargetPool resource to add instances to.",
  108564. // "location": "path",
  108565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  108566. // "required": true,
  108567. // "type": "string"
  108568. // }
  108569. // },
  108570. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  108571. // "request": {
  108572. // "$ref": "TargetPoolsAddInstanceRequest"
  108573. // },
  108574. // "response": {
  108575. // "$ref": "Operation"
  108576. // },
  108577. // "scopes": [
  108578. // "https://www.googleapis.com/auth/cloud-platform",
  108579. // "https://www.googleapis.com/auth/compute"
  108580. // ]
  108581. // }
  108582. }
  108583. // method id "compute.targetPools.aggregatedList":
  108584. type TargetPoolsAggregatedListCall struct {
  108585. s *Service
  108586. project string
  108587. urlParams_ gensupport.URLParams
  108588. ifNoneMatch_ string
  108589. ctx_ context.Context
  108590. header_ http.Header
  108591. }
  108592. // AggregatedList: Retrieves an aggregated list of target pools.
  108593. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  108594. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  108595. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108596. c.project = project
  108597. return c
  108598. }
  108599. // Filter sets the optional parameter "filter": A filter expression that
  108600. // filters resources listed in the response. The expression must specify
  108601. // the field name, a comparison operator, and the value that you want to
  108602. // use for filtering. The value must be a string, a number, or a
  108603. // boolean. The comparison operator must be either =, !=, >, or <.
  108604. //
  108605. // For example, if you are filtering Compute Engine instances, you can
  108606. // exclude instances named example-instance by specifying name !=
  108607. // example-instance.
  108608. //
  108609. // You can also filter nested fields. For example, you could specify
  108610. // scheduling.automaticRestart = false to include instances only if they
  108611. // are not scheduled for automatic restarts. You can use filtering on
  108612. // nested fields to filter based on resource labels.
  108613. //
  108614. // To filter on multiple expressions, provide each separate expression
  108615. // within parentheses. For example, (scheduling.automaticRestart = true)
  108616. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  108617. // AND expression. However, you can include AND and OR expressions
  108618. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  108619. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  108620. // true).
  108621. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  108622. c.urlParams_.Set("filter", filter)
  108623. return c
  108624. }
  108625. // MaxResults sets the optional parameter "maxResults": The maximum
  108626. // number of results per page that should be returned. If the number of
  108627. // available results is larger than maxResults, Compute Engine returns a
  108628. // nextPageToken that can be used to get the next page of results in
  108629. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  108630. // (Default: 500)
  108631. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  108632. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  108633. return c
  108634. }
  108635. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  108636. // a certain order. By default, results are returned in alphanumerical
  108637. // order based on the resource name.
  108638. //
  108639. // You can also sort results in descending order based on the creation
  108640. // timestamp using orderBy="creationTimestamp desc". This sorts results
  108641. // based on the creationTimestamp field in reverse chronological order
  108642. // (newest result first). Use this to sort resources like operations so
  108643. // that the newest operation is returned first.
  108644. //
  108645. // Currently, only sorting by name or creationTimestamp desc is
  108646. // supported.
  108647. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  108648. c.urlParams_.Set("orderBy", orderBy)
  108649. return c
  108650. }
  108651. // PageToken sets the optional parameter "pageToken": Specifies a page
  108652. // token to use. Set pageToken to the nextPageToken returned by a
  108653. // previous list request to get the next page of results.
  108654. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  108655. c.urlParams_.Set("pageToken", pageToken)
  108656. return c
  108657. }
  108658. // Fields allows partial responses to be retrieved. See
  108659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108660. // for more information.
  108661. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  108662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108663. return c
  108664. }
  108665. // IfNoneMatch sets the optional parameter which makes the operation
  108666. // fail if the object's ETag matches the given value. This is useful for
  108667. // getting updates only after the object has changed since the last
  108668. // request. Use googleapi.IsNotModified to check whether the response
  108669. // error from Do is the result of In-None-Match.
  108670. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  108671. c.ifNoneMatch_ = entityTag
  108672. return c
  108673. }
  108674. // Context sets the context to be used in this call's Do method. Any
  108675. // pending HTTP request will be aborted if the provided context is
  108676. // canceled.
  108677. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  108678. c.ctx_ = ctx
  108679. return c
  108680. }
  108681. // Header returns an http.Header that can be modified by the caller to
  108682. // add HTTP headers to the request.
  108683. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  108684. if c.header_ == nil {
  108685. c.header_ = make(http.Header)
  108686. }
  108687. return c.header_
  108688. }
  108689. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  108690. reqHeaders := make(http.Header)
  108691. for k, v := range c.header_ {
  108692. reqHeaders[k] = v
  108693. }
  108694. reqHeaders.Set("User-Agent", c.s.userAgent())
  108695. if c.ifNoneMatch_ != "" {
  108696. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108697. }
  108698. var body io.Reader = nil
  108699. c.urlParams_.Set("alt", alt)
  108700. c.urlParams_.Set("prettyPrint", "false")
  108701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  108702. urls += "?" + c.urlParams_.Encode()
  108703. req, err := http.NewRequest("GET", urls, body)
  108704. if err != nil {
  108705. return nil, err
  108706. }
  108707. req.Header = reqHeaders
  108708. googleapi.Expand(req.URL, map[string]string{
  108709. "project": c.project,
  108710. })
  108711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108712. }
  108713. // Do executes the "compute.targetPools.aggregatedList" call.
  108714. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  108715. // Any non-2xx status code is an error. Response headers are in either
  108716. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  108717. // returned at all) in error.(*googleapi.Error).Header. Use
  108718. // googleapi.IsNotModified to check whether the returned error was
  108719. // because http.StatusNotModified was returned.
  108720. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  108721. gensupport.SetOptions(c.urlParams_, opts...)
  108722. res, err := c.doRequest("json")
  108723. if res != nil && res.StatusCode == http.StatusNotModified {
  108724. if res.Body != nil {
  108725. res.Body.Close()
  108726. }
  108727. return nil, &googleapi.Error{
  108728. Code: res.StatusCode,
  108729. Header: res.Header,
  108730. }
  108731. }
  108732. if err != nil {
  108733. return nil, err
  108734. }
  108735. defer googleapi.CloseBody(res)
  108736. if err := googleapi.CheckResponse(res); err != nil {
  108737. return nil, err
  108738. }
  108739. ret := &TargetPoolAggregatedList{
  108740. ServerResponse: googleapi.ServerResponse{
  108741. Header: res.Header,
  108742. HTTPStatusCode: res.StatusCode,
  108743. },
  108744. }
  108745. target := &ret
  108746. if err := gensupport.DecodeResponse(target, res); err != nil {
  108747. return nil, err
  108748. }
  108749. return ret, nil
  108750. // {
  108751. // "description": "Retrieves an aggregated list of target pools.",
  108752. // "httpMethod": "GET",
  108753. // "id": "compute.targetPools.aggregatedList",
  108754. // "parameterOrder": [
  108755. // "project"
  108756. // ],
  108757. // "parameters": {
  108758. // "filter": {
  108759. // "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).",
  108760. // "location": "query",
  108761. // "type": "string"
  108762. // },
  108763. // "maxResults": {
  108764. // "default": "500",
  108765. // "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)",
  108766. // "format": "uint32",
  108767. // "location": "query",
  108768. // "minimum": "0",
  108769. // "type": "integer"
  108770. // },
  108771. // "orderBy": {
  108772. // "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.",
  108773. // "location": "query",
  108774. // "type": "string"
  108775. // },
  108776. // "pageToken": {
  108777. // "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.",
  108778. // "location": "query",
  108779. // "type": "string"
  108780. // },
  108781. // "project": {
  108782. // "description": "Project ID for this request.",
  108783. // "location": "path",
  108784. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108785. // "required": true,
  108786. // "type": "string"
  108787. // }
  108788. // },
  108789. // "path": "{project}/aggregated/targetPools",
  108790. // "response": {
  108791. // "$ref": "TargetPoolAggregatedList"
  108792. // },
  108793. // "scopes": [
  108794. // "https://www.googleapis.com/auth/cloud-platform",
  108795. // "https://www.googleapis.com/auth/compute",
  108796. // "https://www.googleapis.com/auth/compute.readonly"
  108797. // ]
  108798. // }
  108799. }
  108800. // Pages invokes f for each page of results.
  108801. // A non-nil error returned from f will halt the iteration.
  108802. // The provided context supersedes any context provided to the Context method.
  108803. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  108804. c.ctx_ = ctx
  108805. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  108806. for {
  108807. x, err := c.Do()
  108808. if err != nil {
  108809. return err
  108810. }
  108811. if err := f(x); err != nil {
  108812. return err
  108813. }
  108814. if x.NextPageToken == "" {
  108815. return nil
  108816. }
  108817. c.PageToken(x.NextPageToken)
  108818. }
  108819. }
  108820. // method id "compute.targetPools.delete":
  108821. type TargetPoolsDeleteCall struct {
  108822. s *Service
  108823. project string
  108824. region string
  108825. targetPool string
  108826. urlParams_ gensupport.URLParams
  108827. ctx_ context.Context
  108828. header_ http.Header
  108829. }
  108830. // Delete: Deletes the specified target pool.
  108831. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  108832. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  108833. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108834. c.project = project
  108835. c.region = region
  108836. c.targetPool = targetPool
  108837. return c
  108838. }
  108839. // RequestId sets the optional parameter "requestId": An optional
  108840. // request ID to identify requests. Specify a unique request ID so that
  108841. // if you must retry your request, the server will know to ignore the
  108842. // request if it has already been completed.
  108843. //
  108844. // For example, consider a situation where you make an initial request
  108845. // and the request times out. If you make the request again with the
  108846. // same request ID, the server can check if original operation with the
  108847. // same request ID was received, and if so, will ignore the second
  108848. // request. This prevents clients from accidentally creating duplicate
  108849. // commitments.
  108850. //
  108851. // The request ID must be a valid UUID with the exception that zero UUID
  108852. // is not supported (00000000-0000-0000-0000-000000000000).
  108853. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  108854. c.urlParams_.Set("requestId", requestId)
  108855. return c
  108856. }
  108857. // Fields allows partial responses to be retrieved. See
  108858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108859. // for more information.
  108860. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  108861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108862. return c
  108863. }
  108864. // Context sets the context to be used in this call's Do method. Any
  108865. // pending HTTP request will be aborted if the provided context is
  108866. // canceled.
  108867. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  108868. c.ctx_ = ctx
  108869. return c
  108870. }
  108871. // Header returns an http.Header that can be modified by the caller to
  108872. // add HTTP headers to the request.
  108873. func (c *TargetPoolsDeleteCall) Header() http.Header {
  108874. if c.header_ == nil {
  108875. c.header_ = make(http.Header)
  108876. }
  108877. return c.header_
  108878. }
  108879. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  108880. reqHeaders := make(http.Header)
  108881. for k, v := range c.header_ {
  108882. reqHeaders[k] = v
  108883. }
  108884. reqHeaders.Set("User-Agent", c.s.userAgent())
  108885. var body io.Reader = nil
  108886. c.urlParams_.Set("alt", alt)
  108887. c.urlParams_.Set("prettyPrint", "false")
  108888. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  108889. urls += "?" + c.urlParams_.Encode()
  108890. req, err := http.NewRequest("DELETE", urls, body)
  108891. if err != nil {
  108892. return nil, err
  108893. }
  108894. req.Header = reqHeaders
  108895. googleapi.Expand(req.URL, map[string]string{
  108896. "project": c.project,
  108897. "region": c.region,
  108898. "targetPool": c.targetPool,
  108899. })
  108900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108901. }
  108902. // Do executes the "compute.targetPools.delete" call.
  108903. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108904. // status code is an error. Response headers are in either
  108905. // *Operation.ServerResponse.Header or (if a response was returned at
  108906. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108907. // to check whether the returned error was because
  108908. // http.StatusNotModified was returned.
  108909. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108910. gensupport.SetOptions(c.urlParams_, opts...)
  108911. res, err := c.doRequest("json")
  108912. if res != nil && res.StatusCode == http.StatusNotModified {
  108913. if res.Body != nil {
  108914. res.Body.Close()
  108915. }
  108916. return nil, &googleapi.Error{
  108917. Code: res.StatusCode,
  108918. Header: res.Header,
  108919. }
  108920. }
  108921. if err != nil {
  108922. return nil, err
  108923. }
  108924. defer googleapi.CloseBody(res)
  108925. if err := googleapi.CheckResponse(res); err != nil {
  108926. return nil, err
  108927. }
  108928. ret := &Operation{
  108929. ServerResponse: googleapi.ServerResponse{
  108930. Header: res.Header,
  108931. HTTPStatusCode: res.StatusCode,
  108932. },
  108933. }
  108934. target := &ret
  108935. if err := gensupport.DecodeResponse(target, res); err != nil {
  108936. return nil, err
  108937. }
  108938. return ret, nil
  108939. // {
  108940. // "description": "Deletes the specified target pool.",
  108941. // "httpMethod": "DELETE",
  108942. // "id": "compute.targetPools.delete",
  108943. // "parameterOrder": [
  108944. // "project",
  108945. // "region",
  108946. // "targetPool"
  108947. // ],
  108948. // "parameters": {
  108949. // "project": {
  108950. // "description": "Project ID for this request.",
  108951. // "location": "path",
  108952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108953. // "required": true,
  108954. // "type": "string"
  108955. // },
  108956. // "region": {
  108957. // "description": "Name of the region scoping this request.",
  108958. // "location": "path",
  108959. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108960. // "required": true,
  108961. // "type": "string"
  108962. // },
  108963. // "requestId": {
  108964. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108965. // "location": "query",
  108966. // "type": "string"
  108967. // },
  108968. // "targetPool": {
  108969. // "description": "Name of the TargetPool resource to delete.",
  108970. // "location": "path",
  108971. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  108972. // "required": true,
  108973. // "type": "string"
  108974. // }
  108975. // },
  108976. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  108977. // "response": {
  108978. // "$ref": "Operation"
  108979. // },
  108980. // "scopes": [
  108981. // "https://www.googleapis.com/auth/cloud-platform",
  108982. // "https://www.googleapis.com/auth/compute"
  108983. // ]
  108984. // }
  108985. }
  108986. // method id "compute.targetPools.get":
  108987. type TargetPoolsGetCall struct {
  108988. s *Service
  108989. project string
  108990. region string
  108991. targetPool string
  108992. urlParams_ gensupport.URLParams
  108993. ifNoneMatch_ string
  108994. ctx_ context.Context
  108995. header_ http.Header
  108996. }
  108997. // Get: Returns the specified target pool. Gets a list of available
  108998. // target pools by making a list() request.
  108999. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  109000. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  109001. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109002. c.project = project
  109003. c.region = region
  109004. c.targetPool = targetPool
  109005. return c
  109006. }
  109007. // Fields allows partial responses to be retrieved. See
  109008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109009. // for more information.
  109010. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  109011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109012. return c
  109013. }
  109014. // IfNoneMatch sets the optional parameter which makes the operation
  109015. // fail if the object's ETag matches the given value. This is useful for
  109016. // getting updates only after the object has changed since the last
  109017. // request. Use googleapi.IsNotModified to check whether the response
  109018. // error from Do is the result of In-None-Match.
  109019. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  109020. c.ifNoneMatch_ = entityTag
  109021. return c
  109022. }
  109023. // Context sets the context to be used in this call's Do method. Any
  109024. // pending HTTP request will be aborted if the provided context is
  109025. // canceled.
  109026. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  109027. c.ctx_ = ctx
  109028. return c
  109029. }
  109030. // Header returns an http.Header that can be modified by the caller to
  109031. // add HTTP headers to the request.
  109032. func (c *TargetPoolsGetCall) Header() http.Header {
  109033. if c.header_ == nil {
  109034. c.header_ = make(http.Header)
  109035. }
  109036. return c.header_
  109037. }
  109038. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  109039. reqHeaders := make(http.Header)
  109040. for k, v := range c.header_ {
  109041. reqHeaders[k] = v
  109042. }
  109043. reqHeaders.Set("User-Agent", c.s.userAgent())
  109044. if c.ifNoneMatch_ != "" {
  109045. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109046. }
  109047. var body io.Reader = nil
  109048. c.urlParams_.Set("alt", alt)
  109049. c.urlParams_.Set("prettyPrint", "false")
  109050. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  109051. urls += "?" + c.urlParams_.Encode()
  109052. req, err := http.NewRequest("GET", urls, body)
  109053. if err != nil {
  109054. return nil, err
  109055. }
  109056. req.Header = reqHeaders
  109057. googleapi.Expand(req.URL, map[string]string{
  109058. "project": c.project,
  109059. "region": c.region,
  109060. "targetPool": c.targetPool,
  109061. })
  109062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109063. }
  109064. // Do executes the "compute.targetPools.get" call.
  109065. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  109066. // status code is an error. Response headers are in either
  109067. // *TargetPool.ServerResponse.Header or (if a response was returned at
  109068. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109069. // to check whether the returned error was because
  109070. // http.StatusNotModified was returned.
  109071. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  109072. gensupport.SetOptions(c.urlParams_, opts...)
  109073. res, err := c.doRequest("json")
  109074. if res != nil && res.StatusCode == http.StatusNotModified {
  109075. if res.Body != nil {
  109076. res.Body.Close()
  109077. }
  109078. return nil, &googleapi.Error{
  109079. Code: res.StatusCode,
  109080. Header: res.Header,
  109081. }
  109082. }
  109083. if err != nil {
  109084. return nil, err
  109085. }
  109086. defer googleapi.CloseBody(res)
  109087. if err := googleapi.CheckResponse(res); err != nil {
  109088. return nil, err
  109089. }
  109090. ret := &TargetPool{
  109091. ServerResponse: googleapi.ServerResponse{
  109092. Header: res.Header,
  109093. HTTPStatusCode: res.StatusCode,
  109094. },
  109095. }
  109096. target := &ret
  109097. if err := gensupport.DecodeResponse(target, res); err != nil {
  109098. return nil, err
  109099. }
  109100. return ret, nil
  109101. // {
  109102. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  109103. // "httpMethod": "GET",
  109104. // "id": "compute.targetPools.get",
  109105. // "parameterOrder": [
  109106. // "project",
  109107. // "region",
  109108. // "targetPool"
  109109. // ],
  109110. // "parameters": {
  109111. // "project": {
  109112. // "description": "Project ID for this request.",
  109113. // "location": "path",
  109114. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109115. // "required": true,
  109116. // "type": "string"
  109117. // },
  109118. // "region": {
  109119. // "description": "Name of the region scoping this request.",
  109120. // "location": "path",
  109121. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109122. // "required": true,
  109123. // "type": "string"
  109124. // },
  109125. // "targetPool": {
  109126. // "description": "Name of the TargetPool resource to return.",
  109127. // "location": "path",
  109128. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  109129. // "required": true,
  109130. // "type": "string"
  109131. // }
  109132. // },
  109133. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  109134. // "response": {
  109135. // "$ref": "TargetPool"
  109136. // },
  109137. // "scopes": [
  109138. // "https://www.googleapis.com/auth/cloud-platform",
  109139. // "https://www.googleapis.com/auth/compute",
  109140. // "https://www.googleapis.com/auth/compute.readonly"
  109141. // ]
  109142. // }
  109143. }
  109144. // method id "compute.targetPools.getHealth":
  109145. type TargetPoolsGetHealthCall struct {
  109146. s *Service
  109147. project string
  109148. region string
  109149. targetPool string
  109150. instancereference *InstanceReference
  109151. urlParams_ gensupport.URLParams
  109152. ctx_ context.Context
  109153. header_ http.Header
  109154. }
  109155. // GetHealth: Gets the most recent health check results for each IP for
  109156. // the instance that is referenced by the given target pool.
  109157. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  109158. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  109159. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109160. c.project = project
  109161. c.region = region
  109162. c.targetPool = targetPool
  109163. c.instancereference = instancereference
  109164. return c
  109165. }
  109166. // Fields allows partial responses to be retrieved. See
  109167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109168. // for more information.
  109169. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  109170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109171. return c
  109172. }
  109173. // Context sets the context to be used in this call's Do method. Any
  109174. // pending HTTP request will be aborted if the provided context is
  109175. // canceled.
  109176. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  109177. c.ctx_ = ctx
  109178. return c
  109179. }
  109180. // Header returns an http.Header that can be modified by the caller to
  109181. // add HTTP headers to the request.
  109182. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  109183. if c.header_ == nil {
  109184. c.header_ = make(http.Header)
  109185. }
  109186. return c.header_
  109187. }
  109188. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  109189. reqHeaders := make(http.Header)
  109190. for k, v := range c.header_ {
  109191. reqHeaders[k] = v
  109192. }
  109193. reqHeaders.Set("User-Agent", c.s.userAgent())
  109194. var body io.Reader = nil
  109195. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  109196. if err != nil {
  109197. return nil, err
  109198. }
  109199. reqHeaders.Set("Content-Type", "application/json")
  109200. c.urlParams_.Set("alt", alt)
  109201. c.urlParams_.Set("prettyPrint", "false")
  109202. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  109203. urls += "?" + c.urlParams_.Encode()
  109204. req, err := http.NewRequest("POST", urls, body)
  109205. if err != nil {
  109206. return nil, err
  109207. }
  109208. req.Header = reqHeaders
  109209. googleapi.Expand(req.URL, map[string]string{
  109210. "project": c.project,
  109211. "region": c.region,
  109212. "targetPool": c.targetPool,
  109213. })
  109214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109215. }
  109216. // Do executes the "compute.targetPools.getHealth" call.
  109217. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  109218. // Any non-2xx status code is an error. Response headers are in either
  109219. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  109220. // returned at all) in error.(*googleapi.Error).Header. Use
  109221. // googleapi.IsNotModified to check whether the returned error was
  109222. // because http.StatusNotModified was returned.
  109223. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  109224. gensupport.SetOptions(c.urlParams_, opts...)
  109225. res, err := c.doRequest("json")
  109226. if res != nil && res.StatusCode == http.StatusNotModified {
  109227. if res.Body != nil {
  109228. res.Body.Close()
  109229. }
  109230. return nil, &googleapi.Error{
  109231. Code: res.StatusCode,
  109232. Header: res.Header,
  109233. }
  109234. }
  109235. if err != nil {
  109236. return nil, err
  109237. }
  109238. defer googleapi.CloseBody(res)
  109239. if err := googleapi.CheckResponse(res); err != nil {
  109240. return nil, err
  109241. }
  109242. ret := &TargetPoolInstanceHealth{
  109243. ServerResponse: googleapi.ServerResponse{
  109244. Header: res.Header,
  109245. HTTPStatusCode: res.StatusCode,
  109246. },
  109247. }
  109248. target := &ret
  109249. if err := gensupport.DecodeResponse(target, res); err != nil {
  109250. return nil, err
  109251. }
  109252. return ret, nil
  109253. // {
  109254. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  109255. // "httpMethod": "POST",
  109256. // "id": "compute.targetPools.getHealth",
  109257. // "parameterOrder": [
  109258. // "project",
  109259. // "region",
  109260. // "targetPool"
  109261. // ],
  109262. // "parameters": {
  109263. // "project": {
  109264. // "description": "Project ID for this request.",
  109265. // "location": "path",
  109266. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109267. // "required": true,
  109268. // "type": "string"
  109269. // },
  109270. // "region": {
  109271. // "description": "Name of the region scoping this request.",
  109272. // "location": "path",
  109273. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109274. // "required": true,
  109275. // "type": "string"
  109276. // },
  109277. // "targetPool": {
  109278. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  109279. // "location": "path",
  109280. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  109281. // "required": true,
  109282. // "type": "string"
  109283. // }
  109284. // },
  109285. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  109286. // "request": {
  109287. // "$ref": "InstanceReference"
  109288. // },
  109289. // "response": {
  109290. // "$ref": "TargetPoolInstanceHealth"
  109291. // },
  109292. // "scopes": [
  109293. // "https://www.googleapis.com/auth/cloud-platform",
  109294. // "https://www.googleapis.com/auth/compute",
  109295. // "https://www.googleapis.com/auth/compute.readonly"
  109296. // ]
  109297. // }
  109298. }
  109299. // method id "compute.targetPools.insert":
  109300. type TargetPoolsInsertCall struct {
  109301. s *Service
  109302. project string
  109303. region string
  109304. targetpool *TargetPool
  109305. urlParams_ gensupport.URLParams
  109306. ctx_ context.Context
  109307. header_ http.Header
  109308. }
  109309. // Insert: Creates a target pool in the specified project and region
  109310. // using the data included in the request.
  109311. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  109312. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  109313. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109314. c.project = project
  109315. c.region = region
  109316. c.targetpool = targetpool
  109317. return c
  109318. }
  109319. // RequestId sets the optional parameter "requestId": An optional
  109320. // request ID to identify requests. Specify a unique request ID so that
  109321. // if you must retry your request, the server will know to ignore the
  109322. // request if it has already been completed.
  109323. //
  109324. // For example, consider a situation where you make an initial request
  109325. // and the request times out. If you make the request again with the
  109326. // same request ID, the server can check if original operation with the
  109327. // same request ID was received, and if so, will ignore the second
  109328. // request. This prevents clients from accidentally creating duplicate
  109329. // commitments.
  109330. //
  109331. // The request ID must be a valid UUID with the exception that zero UUID
  109332. // is not supported (00000000-0000-0000-0000-000000000000).
  109333. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  109334. c.urlParams_.Set("requestId", requestId)
  109335. return c
  109336. }
  109337. // Fields allows partial responses to be retrieved. See
  109338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109339. // for more information.
  109340. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  109341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109342. return c
  109343. }
  109344. // Context sets the context to be used in this call's Do method. Any
  109345. // pending HTTP request will be aborted if the provided context is
  109346. // canceled.
  109347. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  109348. c.ctx_ = ctx
  109349. return c
  109350. }
  109351. // Header returns an http.Header that can be modified by the caller to
  109352. // add HTTP headers to the request.
  109353. func (c *TargetPoolsInsertCall) Header() http.Header {
  109354. if c.header_ == nil {
  109355. c.header_ = make(http.Header)
  109356. }
  109357. return c.header_
  109358. }
  109359. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  109360. reqHeaders := make(http.Header)
  109361. for k, v := range c.header_ {
  109362. reqHeaders[k] = v
  109363. }
  109364. reqHeaders.Set("User-Agent", c.s.userAgent())
  109365. var body io.Reader = nil
  109366. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  109367. if err != nil {
  109368. return nil, err
  109369. }
  109370. reqHeaders.Set("Content-Type", "application/json")
  109371. c.urlParams_.Set("alt", alt)
  109372. c.urlParams_.Set("prettyPrint", "false")
  109373. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  109374. urls += "?" + c.urlParams_.Encode()
  109375. req, err := http.NewRequest("POST", urls, body)
  109376. if err != nil {
  109377. return nil, err
  109378. }
  109379. req.Header = reqHeaders
  109380. googleapi.Expand(req.URL, map[string]string{
  109381. "project": c.project,
  109382. "region": c.region,
  109383. })
  109384. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109385. }
  109386. // Do executes the "compute.targetPools.insert" call.
  109387. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109388. // status code is an error. Response headers are in either
  109389. // *Operation.ServerResponse.Header or (if a response was returned at
  109390. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109391. // to check whether the returned error was because
  109392. // http.StatusNotModified was returned.
  109393. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109394. gensupport.SetOptions(c.urlParams_, opts...)
  109395. res, err := c.doRequest("json")
  109396. if res != nil && res.StatusCode == http.StatusNotModified {
  109397. if res.Body != nil {
  109398. res.Body.Close()
  109399. }
  109400. return nil, &googleapi.Error{
  109401. Code: res.StatusCode,
  109402. Header: res.Header,
  109403. }
  109404. }
  109405. if err != nil {
  109406. return nil, err
  109407. }
  109408. defer googleapi.CloseBody(res)
  109409. if err := googleapi.CheckResponse(res); err != nil {
  109410. return nil, err
  109411. }
  109412. ret := &Operation{
  109413. ServerResponse: googleapi.ServerResponse{
  109414. Header: res.Header,
  109415. HTTPStatusCode: res.StatusCode,
  109416. },
  109417. }
  109418. target := &ret
  109419. if err := gensupport.DecodeResponse(target, res); err != nil {
  109420. return nil, err
  109421. }
  109422. return ret, nil
  109423. // {
  109424. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  109425. // "httpMethod": "POST",
  109426. // "id": "compute.targetPools.insert",
  109427. // "parameterOrder": [
  109428. // "project",
  109429. // "region"
  109430. // ],
  109431. // "parameters": {
  109432. // "project": {
  109433. // "description": "Project ID for this request.",
  109434. // "location": "path",
  109435. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109436. // "required": true,
  109437. // "type": "string"
  109438. // },
  109439. // "region": {
  109440. // "description": "Name of the region scoping this request.",
  109441. // "location": "path",
  109442. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109443. // "required": true,
  109444. // "type": "string"
  109445. // },
  109446. // "requestId": {
  109447. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109448. // "location": "query",
  109449. // "type": "string"
  109450. // }
  109451. // },
  109452. // "path": "{project}/regions/{region}/targetPools",
  109453. // "request": {
  109454. // "$ref": "TargetPool"
  109455. // },
  109456. // "response": {
  109457. // "$ref": "Operation"
  109458. // },
  109459. // "scopes": [
  109460. // "https://www.googleapis.com/auth/cloud-platform",
  109461. // "https://www.googleapis.com/auth/compute"
  109462. // ]
  109463. // }
  109464. }
  109465. // method id "compute.targetPools.list":
  109466. type TargetPoolsListCall struct {
  109467. s *Service
  109468. project string
  109469. region string
  109470. urlParams_ gensupport.URLParams
  109471. ifNoneMatch_ string
  109472. ctx_ context.Context
  109473. header_ http.Header
  109474. }
  109475. // List: Retrieves a list of target pools available to the specified
  109476. // project and region.
  109477. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  109478. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  109479. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109480. c.project = project
  109481. c.region = region
  109482. return c
  109483. }
  109484. // Filter sets the optional parameter "filter": A filter expression that
  109485. // filters resources listed in the response. The expression must specify
  109486. // the field name, a comparison operator, and the value that you want to
  109487. // use for filtering. The value must be a string, a number, or a
  109488. // boolean. The comparison operator must be either =, !=, >, or <.
  109489. //
  109490. // For example, if you are filtering Compute Engine instances, you can
  109491. // exclude instances named example-instance by specifying name !=
  109492. // example-instance.
  109493. //
  109494. // You can also filter nested fields. For example, you could specify
  109495. // scheduling.automaticRestart = false to include instances only if they
  109496. // are not scheduled for automatic restarts. You can use filtering on
  109497. // nested fields to filter based on resource labels.
  109498. //
  109499. // To filter on multiple expressions, provide each separate expression
  109500. // within parentheses. For example, (scheduling.automaticRestart = true)
  109501. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  109502. // AND expression. However, you can include AND and OR expressions
  109503. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  109504. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  109505. // true).
  109506. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  109507. c.urlParams_.Set("filter", filter)
  109508. return c
  109509. }
  109510. // MaxResults sets the optional parameter "maxResults": The maximum
  109511. // number of results per page that should be returned. If the number of
  109512. // available results is larger than maxResults, Compute Engine returns a
  109513. // nextPageToken that can be used to get the next page of results in
  109514. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  109515. // (Default: 500)
  109516. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  109517. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  109518. return c
  109519. }
  109520. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  109521. // a certain order. By default, results are returned in alphanumerical
  109522. // order based on the resource name.
  109523. //
  109524. // You can also sort results in descending order based on the creation
  109525. // timestamp using orderBy="creationTimestamp desc". This sorts results
  109526. // based on the creationTimestamp field in reverse chronological order
  109527. // (newest result first). Use this to sort resources like operations so
  109528. // that the newest operation is returned first.
  109529. //
  109530. // Currently, only sorting by name or creationTimestamp desc is
  109531. // supported.
  109532. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  109533. c.urlParams_.Set("orderBy", orderBy)
  109534. return c
  109535. }
  109536. // PageToken sets the optional parameter "pageToken": Specifies a page
  109537. // token to use. Set pageToken to the nextPageToken returned by a
  109538. // previous list request to get the next page of results.
  109539. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  109540. c.urlParams_.Set("pageToken", pageToken)
  109541. return c
  109542. }
  109543. // Fields allows partial responses to be retrieved. See
  109544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109545. // for more information.
  109546. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  109547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109548. return c
  109549. }
  109550. // IfNoneMatch sets the optional parameter which makes the operation
  109551. // fail if the object's ETag matches the given value. This is useful for
  109552. // getting updates only after the object has changed since the last
  109553. // request. Use googleapi.IsNotModified to check whether the response
  109554. // error from Do is the result of In-None-Match.
  109555. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  109556. c.ifNoneMatch_ = entityTag
  109557. return c
  109558. }
  109559. // Context sets the context to be used in this call's Do method. Any
  109560. // pending HTTP request will be aborted if the provided context is
  109561. // canceled.
  109562. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  109563. c.ctx_ = ctx
  109564. return c
  109565. }
  109566. // Header returns an http.Header that can be modified by the caller to
  109567. // add HTTP headers to the request.
  109568. func (c *TargetPoolsListCall) Header() http.Header {
  109569. if c.header_ == nil {
  109570. c.header_ = make(http.Header)
  109571. }
  109572. return c.header_
  109573. }
  109574. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  109575. reqHeaders := make(http.Header)
  109576. for k, v := range c.header_ {
  109577. reqHeaders[k] = v
  109578. }
  109579. reqHeaders.Set("User-Agent", c.s.userAgent())
  109580. if c.ifNoneMatch_ != "" {
  109581. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109582. }
  109583. var body io.Reader = nil
  109584. c.urlParams_.Set("alt", alt)
  109585. c.urlParams_.Set("prettyPrint", "false")
  109586. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  109587. urls += "?" + c.urlParams_.Encode()
  109588. req, err := http.NewRequest("GET", urls, body)
  109589. if err != nil {
  109590. return nil, err
  109591. }
  109592. req.Header = reqHeaders
  109593. googleapi.Expand(req.URL, map[string]string{
  109594. "project": c.project,
  109595. "region": c.region,
  109596. })
  109597. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109598. }
  109599. // Do executes the "compute.targetPools.list" call.
  109600. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  109601. // status code is an error. Response headers are in either
  109602. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  109603. // at all) in error.(*googleapi.Error).Header. Use
  109604. // googleapi.IsNotModified to check whether the returned error was
  109605. // because http.StatusNotModified was returned.
  109606. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  109607. gensupport.SetOptions(c.urlParams_, opts...)
  109608. res, err := c.doRequest("json")
  109609. if res != nil && res.StatusCode == http.StatusNotModified {
  109610. if res.Body != nil {
  109611. res.Body.Close()
  109612. }
  109613. return nil, &googleapi.Error{
  109614. Code: res.StatusCode,
  109615. Header: res.Header,
  109616. }
  109617. }
  109618. if err != nil {
  109619. return nil, err
  109620. }
  109621. defer googleapi.CloseBody(res)
  109622. if err := googleapi.CheckResponse(res); err != nil {
  109623. return nil, err
  109624. }
  109625. ret := &TargetPoolList{
  109626. ServerResponse: googleapi.ServerResponse{
  109627. Header: res.Header,
  109628. HTTPStatusCode: res.StatusCode,
  109629. },
  109630. }
  109631. target := &ret
  109632. if err := gensupport.DecodeResponse(target, res); err != nil {
  109633. return nil, err
  109634. }
  109635. return ret, nil
  109636. // {
  109637. // "description": "Retrieves a list of target pools available to the specified project and region.",
  109638. // "httpMethod": "GET",
  109639. // "id": "compute.targetPools.list",
  109640. // "parameterOrder": [
  109641. // "project",
  109642. // "region"
  109643. // ],
  109644. // "parameters": {
  109645. // "filter": {
  109646. // "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).",
  109647. // "location": "query",
  109648. // "type": "string"
  109649. // },
  109650. // "maxResults": {
  109651. // "default": "500",
  109652. // "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)",
  109653. // "format": "uint32",
  109654. // "location": "query",
  109655. // "minimum": "0",
  109656. // "type": "integer"
  109657. // },
  109658. // "orderBy": {
  109659. // "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.",
  109660. // "location": "query",
  109661. // "type": "string"
  109662. // },
  109663. // "pageToken": {
  109664. // "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.",
  109665. // "location": "query",
  109666. // "type": "string"
  109667. // },
  109668. // "project": {
  109669. // "description": "Project ID for this request.",
  109670. // "location": "path",
  109671. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109672. // "required": true,
  109673. // "type": "string"
  109674. // },
  109675. // "region": {
  109676. // "description": "Name of the region scoping this request.",
  109677. // "location": "path",
  109678. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109679. // "required": true,
  109680. // "type": "string"
  109681. // }
  109682. // },
  109683. // "path": "{project}/regions/{region}/targetPools",
  109684. // "response": {
  109685. // "$ref": "TargetPoolList"
  109686. // },
  109687. // "scopes": [
  109688. // "https://www.googleapis.com/auth/cloud-platform",
  109689. // "https://www.googleapis.com/auth/compute",
  109690. // "https://www.googleapis.com/auth/compute.readonly"
  109691. // ]
  109692. // }
  109693. }
  109694. // Pages invokes f for each page of results.
  109695. // A non-nil error returned from f will halt the iteration.
  109696. // The provided context supersedes any context provided to the Context method.
  109697. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  109698. c.ctx_ = ctx
  109699. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  109700. for {
  109701. x, err := c.Do()
  109702. if err != nil {
  109703. return err
  109704. }
  109705. if err := f(x); err != nil {
  109706. return err
  109707. }
  109708. if x.NextPageToken == "" {
  109709. return nil
  109710. }
  109711. c.PageToken(x.NextPageToken)
  109712. }
  109713. }
  109714. // method id "compute.targetPools.removeHealthCheck":
  109715. type TargetPoolsRemoveHealthCheckCall struct {
  109716. s *Service
  109717. project string
  109718. region string
  109719. targetPool string
  109720. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  109721. urlParams_ gensupport.URLParams
  109722. ctx_ context.Context
  109723. header_ http.Header
  109724. }
  109725. // RemoveHealthCheck: Removes health check URL from a target pool.
  109726. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  109727. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  109728. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109729. c.project = project
  109730. c.region = region
  109731. c.targetPool = targetPool
  109732. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  109733. return c
  109734. }
  109735. // RequestId sets the optional parameter "requestId": An optional
  109736. // request ID to identify requests. Specify a unique request ID so that
  109737. // if you must retry your request, the server will know to ignore the
  109738. // request if it has already been completed.
  109739. //
  109740. // For example, consider a situation where you make an initial request
  109741. // and the request times out. If you make the request again with the
  109742. // same request ID, the server can check if original operation with the
  109743. // same request ID was received, and if so, will ignore the second
  109744. // request. This prevents clients from accidentally creating duplicate
  109745. // commitments.
  109746. //
  109747. // The request ID must be a valid UUID with the exception that zero UUID
  109748. // is not supported (00000000-0000-0000-0000-000000000000).
  109749. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  109750. c.urlParams_.Set("requestId", requestId)
  109751. return c
  109752. }
  109753. // Fields allows partial responses to be retrieved. See
  109754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109755. // for more information.
  109756. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  109757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109758. return c
  109759. }
  109760. // Context sets the context to be used in this call's Do method. Any
  109761. // pending HTTP request will be aborted if the provided context is
  109762. // canceled.
  109763. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  109764. c.ctx_ = ctx
  109765. return c
  109766. }
  109767. // Header returns an http.Header that can be modified by the caller to
  109768. // add HTTP headers to the request.
  109769. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  109770. if c.header_ == nil {
  109771. c.header_ = make(http.Header)
  109772. }
  109773. return c.header_
  109774. }
  109775. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  109776. reqHeaders := make(http.Header)
  109777. for k, v := range c.header_ {
  109778. reqHeaders[k] = v
  109779. }
  109780. reqHeaders.Set("User-Agent", c.s.userAgent())
  109781. var body io.Reader = nil
  109782. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  109783. if err != nil {
  109784. return nil, err
  109785. }
  109786. reqHeaders.Set("Content-Type", "application/json")
  109787. c.urlParams_.Set("alt", alt)
  109788. c.urlParams_.Set("prettyPrint", "false")
  109789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  109790. urls += "?" + c.urlParams_.Encode()
  109791. req, err := http.NewRequest("POST", urls, body)
  109792. if err != nil {
  109793. return nil, err
  109794. }
  109795. req.Header = reqHeaders
  109796. googleapi.Expand(req.URL, map[string]string{
  109797. "project": c.project,
  109798. "region": c.region,
  109799. "targetPool": c.targetPool,
  109800. })
  109801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109802. }
  109803. // Do executes the "compute.targetPools.removeHealthCheck" call.
  109804. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109805. // status code is an error. Response headers are in either
  109806. // *Operation.ServerResponse.Header or (if a response was returned at
  109807. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109808. // to check whether the returned error was because
  109809. // http.StatusNotModified was returned.
  109810. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109811. gensupport.SetOptions(c.urlParams_, opts...)
  109812. res, err := c.doRequest("json")
  109813. if res != nil && res.StatusCode == http.StatusNotModified {
  109814. if res.Body != nil {
  109815. res.Body.Close()
  109816. }
  109817. return nil, &googleapi.Error{
  109818. Code: res.StatusCode,
  109819. Header: res.Header,
  109820. }
  109821. }
  109822. if err != nil {
  109823. return nil, err
  109824. }
  109825. defer googleapi.CloseBody(res)
  109826. if err := googleapi.CheckResponse(res); err != nil {
  109827. return nil, err
  109828. }
  109829. ret := &Operation{
  109830. ServerResponse: googleapi.ServerResponse{
  109831. Header: res.Header,
  109832. HTTPStatusCode: res.StatusCode,
  109833. },
  109834. }
  109835. target := &ret
  109836. if err := gensupport.DecodeResponse(target, res); err != nil {
  109837. return nil, err
  109838. }
  109839. return ret, nil
  109840. // {
  109841. // "description": "Removes health check URL from a target pool.",
  109842. // "httpMethod": "POST",
  109843. // "id": "compute.targetPools.removeHealthCheck",
  109844. // "parameterOrder": [
  109845. // "project",
  109846. // "region",
  109847. // "targetPool"
  109848. // ],
  109849. // "parameters": {
  109850. // "project": {
  109851. // "description": "Project ID for this request.",
  109852. // "location": "path",
  109853. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109854. // "required": true,
  109855. // "type": "string"
  109856. // },
  109857. // "region": {
  109858. // "description": "Name of the region for this request.",
  109859. // "location": "path",
  109860. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109861. // "required": true,
  109862. // "type": "string"
  109863. // },
  109864. // "requestId": {
  109865. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109866. // "location": "query",
  109867. // "type": "string"
  109868. // },
  109869. // "targetPool": {
  109870. // "description": "Name of the target pool to remove health checks from.",
  109871. // "location": "path",
  109872. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  109873. // "required": true,
  109874. // "type": "string"
  109875. // }
  109876. // },
  109877. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  109878. // "request": {
  109879. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  109880. // },
  109881. // "response": {
  109882. // "$ref": "Operation"
  109883. // },
  109884. // "scopes": [
  109885. // "https://www.googleapis.com/auth/cloud-platform",
  109886. // "https://www.googleapis.com/auth/compute"
  109887. // ]
  109888. // }
  109889. }
  109890. // method id "compute.targetPools.removeInstance":
  109891. type TargetPoolsRemoveInstanceCall struct {
  109892. s *Service
  109893. project string
  109894. region string
  109895. targetPool string
  109896. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  109897. urlParams_ gensupport.URLParams
  109898. ctx_ context.Context
  109899. header_ http.Header
  109900. }
  109901. // RemoveInstance: Removes instance URL from a target pool.
  109902. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  109903. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  109904. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109905. c.project = project
  109906. c.region = region
  109907. c.targetPool = targetPool
  109908. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  109909. return c
  109910. }
  109911. // RequestId sets the optional parameter "requestId": An optional
  109912. // request ID to identify requests. Specify a unique request ID so that
  109913. // if you must retry your request, the server will know to ignore the
  109914. // request if it has already been completed.
  109915. //
  109916. // For example, consider a situation where you make an initial request
  109917. // and the request times out. If you make the request again with the
  109918. // same request ID, the server can check if original operation with the
  109919. // same request ID was received, and if so, will ignore the second
  109920. // request. This prevents clients from accidentally creating duplicate
  109921. // commitments.
  109922. //
  109923. // The request ID must be a valid UUID with the exception that zero UUID
  109924. // is not supported (00000000-0000-0000-0000-000000000000).
  109925. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  109926. c.urlParams_.Set("requestId", requestId)
  109927. return c
  109928. }
  109929. // Fields allows partial responses to be retrieved. See
  109930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109931. // for more information.
  109932. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  109933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109934. return c
  109935. }
  109936. // Context sets the context to be used in this call's Do method. Any
  109937. // pending HTTP request will be aborted if the provided context is
  109938. // canceled.
  109939. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  109940. c.ctx_ = ctx
  109941. return c
  109942. }
  109943. // Header returns an http.Header that can be modified by the caller to
  109944. // add HTTP headers to the request.
  109945. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  109946. if c.header_ == nil {
  109947. c.header_ = make(http.Header)
  109948. }
  109949. return c.header_
  109950. }
  109951. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  109952. reqHeaders := make(http.Header)
  109953. for k, v := range c.header_ {
  109954. reqHeaders[k] = v
  109955. }
  109956. reqHeaders.Set("User-Agent", c.s.userAgent())
  109957. var body io.Reader = nil
  109958. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  109959. if err != nil {
  109960. return nil, err
  109961. }
  109962. reqHeaders.Set("Content-Type", "application/json")
  109963. c.urlParams_.Set("alt", alt)
  109964. c.urlParams_.Set("prettyPrint", "false")
  109965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  109966. urls += "?" + c.urlParams_.Encode()
  109967. req, err := http.NewRequest("POST", urls, body)
  109968. if err != nil {
  109969. return nil, err
  109970. }
  109971. req.Header = reqHeaders
  109972. googleapi.Expand(req.URL, map[string]string{
  109973. "project": c.project,
  109974. "region": c.region,
  109975. "targetPool": c.targetPool,
  109976. })
  109977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109978. }
  109979. // Do executes the "compute.targetPools.removeInstance" call.
  109980. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109981. // status code is an error. Response headers are in either
  109982. // *Operation.ServerResponse.Header or (if a response was returned at
  109983. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109984. // to check whether the returned error was because
  109985. // http.StatusNotModified was returned.
  109986. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109987. gensupport.SetOptions(c.urlParams_, opts...)
  109988. res, err := c.doRequest("json")
  109989. if res != nil && res.StatusCode == http.StatusNotModified {
  109990. if res.Body != nil {
  109991. res.Body.Close()
  109992. }
  109993. return nil, &googleapi.Error{
  109994. Code: res.StatusCode,
  109995. Header: res.Header,
  109996. }
  109997. }
  109998. if err != nil {
  109999. return nil, err
  110000. }
  110001. defer googleapi.CloseBody(res)
  110002. if err := googleapi.CheckResponse(res); err != nil {
  110003. return nil, err
  110004. }
  110005. ret := &Operation{
  110006. ServerResponse: googleapi.ServerResponse{
  110007. Header: res.Header,
  110008. HTTPStatusCode: res.StatusCode,
  110009. },
  110010. }
  110011. target := &ret
  110012. if err := gensupport.DecodeResponse(target, res); err != nil {
  110013. return nil, err
  110014. }
  110015. return ret, nil
  110016. // {
  110017. // "description": "Removes instance URL from a target pool.",
  110018. // "httpMethod": "POST",
  110019. // "id": "compute.targetPools.removeInstance",
  110020. // "parameterOrder": [
  110021. // "project",
  110022. // "region",
  110023. // "targetPool"
  110024. // ],
  110025. // "parameters": {
  110026. // "project": {
  110027. // "description": "Project ID for this request.",
  110028. // "location": "path",
  110029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110030. // "required": true,
  110031. // "type": "string"
  110032. // },
  110033. // "region": {
  110034. // "description": "Name of the region scoping this request.",
  110035. // "location": "path",
  110036. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110037. // "required": true,
  110038. // "type": "string"
  110039. // },
  110040. // "requestId": {
  110041. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110042. // "location": "query",
  110043. // "type": "string"
  110044. // },
  110045. // "targetPool": {
  110046. // "description": "Name of the TargetPool resource to remove instances from.",
  110047. // "location": "path",
  110048. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110049. // "required": true,
  110050. // "type": "string"
  110051. // }
  110052. // },
  110053. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  110054. // "request": {
  110055. // "$ref": "TargetPoolsRemoveInstanceRequest"
  110056. // },
  110057. // "response": {
  110058. // "$ref": "Operation"
  110059. // },
  110060. // "scopes": [
  110061. // "https://www.googleapis.com/auth/cloud-platform",
  110062. // "https://www.googleapis.com/auth/compute"
  110063. // ]
  110064. // }
  110065. }
  110066. // method id "compute.targetPools.setBackup":
  110067. type TargetPoolsSetBackupCall struct {
  110068. s *Service
  110069. project string
  110070. region string
  110071. targetPool string
  110072. targetreference *TargetReference
  110073. urlParams_ gensupport.URLParams
  110074. ctx_ context.Context
  110075. header_ http.Header
  110076. }
  110077. // SetBackup: Changes a backup target pool's configurations.
  110078. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  110079. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  110080. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110081. c.project = project
  110082. c.region = region
  110083. c.targetPool = targetPool
  110084. c.targetreference = targetreference
  110085. return c
  110086. }
  110087. // FailoverRatio sets the optional parameter "failoverRatio": New
  110088. // failoverRatio value for the target pool.
  110089. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  110090. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  110091. return c
  110092. }
  110093. // RequestId sets the optional parameter "requestId": An optional
  110094. // request ID to identify requests. Specify a unique request ID so that
  110095. // if you must retry your request, the server will know to ignore the
  110096. // request if it has already been completed.
  110097. //
  110098. // For example, consider a situation where you make an initial request
  110099. // and the request times out. If you make the request again with the
  110100. // same request ID, the server can check if original operation with the
  110101. // same request ID was received, and if so, will ignore the second
  110102. // request. This prevents clients from accidentally creating duplicate
  110103. // commitments.
  110104. //
  110105. // The request ID must be a valid UUID with the exception that zero UUID
  110106. // is not supported (00000000-0000-0000-0000-000000000000).
  110107. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  110108. c.urlParams_.Set("requestId", requestId)
  110109. return c
  110110. }
  110111. // Fields allows partial responses to be retrieved. See
  110112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110113. // for more information.
  110114. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  110115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110116. return c
  110117. }
  110118. // Context sets the context to be used in this call's Do method. Any
  110119. // pending HTTP request will be aborted if the provided context is
  110120. // canceled.
  110121. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  110122. c.ctx_ = ctx
  110123. return c
  110124. }
  110125. // Header returns an http.Header that can be modified by the caller to
  110126. // add HTTP headers to the request.
  110127. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  110128. if c.header_ == nil {
  110129. c.header_ = make(http.Header)
  110130. }
  110131. return c.header_
  110132. }
  110133. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  110134. reqHeaders := make(http.Header)
  110135. for k, v := range c.header_ {
  110136. reqHeaders[k] = v
  110137. }
  110138. reqHeaders.Set("User-Agent", c.s.userAgent())
  110139. var body io.Reader = nil
  110140. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  110141. if err != nil {
  110142. return nil, err
  110143. }
  110144. reqHeaders.Set("Content-Type", "application/json")
  110145. c.urlParams_.Set("alt", alt)
  110146. c.urlParams_.Set("prettyPrint", "false")
  110147. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  110148. urls += "?" + c.urlParams_.Encode()
  110149. req, err := http.NewRequest("POST", urls, body)
  110150. if err != nil {
  110151. return nil, err
  110152. }
  110153. req.Header = reqHeaders
  110154. googleapi.Expand(req.URL, map[string]string{
  110155. "project": c.project,
  110156. "region": c.region,
  110157. "targetPool": c.targetPool,
  110158. })
  110159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110160. }
  110161. // Do executes the "compute.targetPools.setBackup" call.
  110162. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110163. // status code is an error. Response headers are in either
  110164. // *Operation.ServerResponse.Header or (if a response was returned at
  110165. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110166. // to check whether the returned error was because
  110167. // http.StatusNotModified was returned.
  110168. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110169. gensupport.SetOptions(c.urlParams_, opts...)
  110170. res, err := c.doRequest("json")
  110171. if res != nil && res.StatusCode == http.StatusNotModified {
  110172. if res.Body != nil {
  110173. res.Body.Close()
  110174. }
  110175. return nil, &googleapi.Error{
  110176. Code: res.StatusCode,
  110177. Header: res.Header,
  110178. }
  110179. }
  110180. if err != nil {
  110181. return nil, err
  110182. }
  110183. defer googleapi.CloseBody(res)
  110184. if err := googleapi.CheckResponse(res); err != nil {
  110185. return nil, err
  110186. }
  110187. ret := &Operation{
  110188. ServerResponse: googleapi.ServerResponse{
  110189. Header: res.Header,
  110190. HTTPStatusCode: res.StatusCode,
  110191. },
  110192. }
  110193. target := &ret
  110194. if err := gensupport.DecodeResponse(target, res); err != nil {
  110195. return nil, err
  110196. }
  110197. return ret, nil
  110198. // {
  110199. // "description": "Changes a backup target pool's configurations.",
  110200. // "httpMethod": "POST",
  110201. // "id": "compute.targetPools.setBackup",
  110202. // "parameterOrder": [
  110203. // "project",
  110204. // "region",
  110205. // "targetPool"
  110206. // ],
  110207. // "parameters": {
  110208. // "failoverRatio": {
  110209. // "description": "New failoverRatio value for the target pool.",
  110210. // "format": "float",
  110211. // "location": "query",
  110212. // "type": "number"
  110213. // },
  110214. // "project": {
  110215. // "description": "Project ID for this request.",
  110216. // "location": "path",
  110217. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110218. // "required": true,
  110219. // "type": "string"
  110220. // },
  110221. // "region": {
  110222. // "description": "Name of the region scoping this request.",
  110223. // "location": "path",
  110224. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110225. // "required": true,
  110226. // "type": "string"
  110227. // },
  110228. // "requestId": {
  110229. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110230. // "location": "query",
  110231. // "type": "string"
  110232. // },
  110233. // "targetPool": {
  110234. // "description": "Name of the TargetPool resource to set a backup pool for.",
  110235. // "location": "path",
  110236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110237. // "required": true,
  110238. // "type": "string"
  110239. // }
  110240. // },
  110241. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  110242. // "request": {
  110243. // "$ref": "TargetReference"
  110244. // },
  110245. // "response": {
  110246. // "$ref": "Operation"
  110247. // },
  110248. // "scopes": [
  110249. // "https://www.googleapis.com/auth/cloud-platform",
  110250. // "https://www.googleapis.com/auth/compute"
  110251. // ]
  110252. // }
  110253. }
  110254. // method id "compute.targetPools.testIamPermissions":
  110255. type TargetPoolsTestIamPermissionsCall struct {
  110256. s *Service
  110257. project string
  110258. region string
  110259. resource string
  110260. testpermissionsrequest *TestPermissionsRequest
  110261. urlParams_ gensupport.URLParams
  110262. ctx_ context.Context
  110263. header_ http.Header
  110264. }
  110265. // TestIamPermissions: Returns permissions that a caller has on the
  110266. // specified resource.
  110267. func (r *TargetPoolsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetPoolsTestIamPermissionsCall {
  110268. c := &TargetPoolsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110269. c.project = project
  110270. c.region = region
  110271. c.resource = resource
  110272. c.testpermissionsrequest = testpermissionsrequest
  110273. return c
  110274. }
  110275. // Fields allows partial responses to be retrieved. See
  110276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110277. // for more information.
  110278. func (c *TargetPoolsTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetPoolsTestIamPermissionsCall {
  110279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110280. return c
  110281. }
  110282. // Context sets the context to be used in this call's Do method. Any
  110283. // pending HTTP request will be aborted if the provided context is
  110284. // canceled.
  110285. func (c *TargetPoolsTestIamPermissionsCall) Context(ctx context.Context) *TargetPoolsTestIamPermissionsCall {
  110286. c.ctx_ = ctx
  110287. return c
  110288. }
  110289. // Header returns an http.Header that can be modified by the caller to
  110290. // add HTTP headers to the request.
  110291. func (c *TargetPoolsTestIamPermissionsCall) Header() http.Header {
  110292. if c.header_ == nil {
  110293. c.header_ = make(http.Header)
  110294. }
  110295. return c.header_
  110296. }
  110297. func (c *TargetPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  110298. reqHeaders := make(http.Header)
  110299. for k, v := range c.header_ {
  110300. reqHeaders[k] = v
  110301. }
  110302. reqHeaders.Set("User-Agent", c.s.userAgent())
  110303. var body io.Reader = nil
  110304. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  110305. if err != nil {
  110306. return nil, err
  110307. }
  110308. reqHeaders.Set("Content-Type", "application/json")
  110309. c.urlParams_.Set("alt", alt)
  110310. c.urlParams_.Set("prettyPrint", "false")
  110311. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{resource}/testIamPermissions")
  110312. urls += "?" + c.urlParams_.Encode()
  110313. req, err := http.NewRequest("POST", urls, body)
  110314. if err != nil {
  110315. return nil, err
  110316. }
  110317. req.Header = reqHeaders
  110318. googleapi.Expand(req.URL, map[string]string{
  110319. "project": c.project,
  110320. "region": c.region,
  110321. "resource": c.resource,
  110322. })
  110323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110324. }
  110325. // Do executes the "compute.targetPools.testIamPermissions" call.
  110326. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  110327. // non-2xx status code is an error. Response headers are in either
  110328. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  110329. // returned at all) in error.(*googleapi.Error).Header. Use
  110330. // googleapi.IsNotModified to check whether the returned error was
  110331. // because http.StatusNotModified was returned.
  110332. func (c *TargetPoolsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  110333. gensupport.SetOptions(c.urlParams_, opts...)
  110334. res, err := c.doRequest("json")
  110335. if res != nil && res.StatusCode == http.StatusNotModified {
  110336. if res.Body != nil {
  110337. res.Body.Close()
  110338. }
  110339. return nil, &googleapi.Error{
  110340. Code: res.StatusCode,
  110341. Header: res.Header,
  110342. }
  110343. }
  110344. if err != nil {
  110345. return nil, err
  110346. }
  110347. defer googleapi.CloseBody(res)
  110348. if err := googleapi.CheckResponse(res); err != nil {
  110349. return nil, err
  110350. }
  110351. ret := &TestPermissionsResponse{
  110352. ServerResponse: googleapi.ServerResponse{
  110353. Header: res.Header,
  110354. HTTPStatusCode: res.StatusCode,
  110355. },
  110356. }
  110357. target := &ret
  110358. if err := gensupport.DecodeResponse(target, res); err != nil {
  110359. return nil, err
  110360. }
  110361. return ret, nil
  110362. // {
  110363. // "description": "Returns permissions that a caller has on the specified resource.",
  110364. // "httpMethod": "POST",
  110365. // "id": "compute.targetPools.testIamPermissions",
  110366. // "parameterOrder": [
  110367. // "project",
  110368. // "region",
  110369. // "resource"
  110370. // ],
  110371. // "parameters": {
  110372. // "project": {
  110373. // "description": "Project ID for this request.",
  110374. // "location": "path",
  110375. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110376. // "required": true,
  110377. // "type": "string"
  110378. // },
  110379. // "region": {
  110380. // "description": "The name of the region for this request.",
  110381. // "location": "path",
  110382. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110383. // "required": true,
  110384. // "type": "string"
  110385. // },
  110386. // "resource": {
  110387. // "description": "Name or id of the resource for this request.",
  110388. // "location": "path",
  110389. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110390. // "required": true,
  110391. // "type": "string"
  110392. // }
  110393. // },
  110394. // "path": "{project}/regions/{region}/targetPools/{resource}/testIamPermissions",
  110395. // "request": {
  110396. // "$ref": "TestPermissionsRequest"
  110397. // },
  110398. // "response": {
  110399. // "$ref": "TestPermissionsResponse"
  110400. // },
  110401. // "scopes": [
  110402. // "https://www.googleapis.com/auth/cloud-platform",
  110403. // "https://www.googleapis.com/auth/compute",
  110404. // "https://www.googleapis.com/auth/compute.readonly"
  110405. // ]
  110406. // }
  110407. }
  110408. // method id "compute.targetSslProxies.delete":
  110409. type TargetSslProxiesDeleteCall struct {
  110410. s *Service
  110411. project string
  110412. targetSslProxy string
  110413. urlParams_ gensupport.URLParams
  110414. ctx_ context.Context
  110415. header_ http.Header
  110416. }
  110417. // Delete: Deletes the specified TargetSslProxy resource.
  110418. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  110419. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110420. c.project = project
  110421. c.targetSslProxy = targetSslProxy
  110422. return c
  110423. }
  110424. // RequestId sets the optional parameter "requestId": An optional
  110425. // request ID to identify requests. Specify a unique request ID so that
  110426. // if you must retry your request, the server will know to ignore the
  110427. // request if it has already been completed.
  110428. //
  110429. // For example, consider a situation where you make an initial request
  110430. // and the request times out. If you make the request again with the
  110431. // same request ID, the server can check if original operation with the
  110432. // same request ID was received, and if so, will ignore the second
  110433. // request. This prevents clients from accidentally creating duplicate
  110434. // commitments.
  110435. //
  110436. // The request ID must be a valid UUID with the exception that zero UUID
  110437. // is not supported (00000000-0000-0000-0000-000000000000).
  110438. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  110439. c.urlParams_.Set("requestId", requestId)
  110440. return c
  110441. }
  110442. // Fields allows partial responses to be retrieved. See
  110443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110444. // for more information.
  110445. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  110446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110447. return c
  110448. }
  110449. // Context sets the context to be used in this call's Do method. Any
  110450. // pending HTTP request will be aborted if the provided context is
  110451. // canceled.
  110452. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  110453. c.ctx_ = ctx
  110454. return c
  110455. }
  110456. // Header returns an http.Header that can be modified by the caller to
  110457. // add HTTP headers to the request.
  110458. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  110459. if c.header_ == nil {
  110460. c.header_ = make(http.Header)
  110461. }
  110462. return c.header_
  110463. }
  110464. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  110465. reqHeaders := make(http.Header)
  110466. for k, v := range c.header_ {
  110467. reqHeaders[k] = v
  110468. }
  110469. reqHeaders.Set("User-Agent", c.s.userAgent())
  110470. var body io.Reader = nil
  110471. c.urlParams_.Set("alt", alt)
  110472. c.urlParams_.Set("prettyPrint", "false")
  110473. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  110474. urls += "?" + c.urlParams_.Encode()
  110475. req, err := http.NewRequest("DELETE", urls, body)
  110476. if err != nil {
  110477. return nil, err
  110478. }
  110479. req.Header = reqHeaders
  110480. googleapi.Expand(req.URL, map[string]string{
  110481. "project": c.project,
  110482. "targetSslProxy": c.targetSslProxy,
  110483. })
  110484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110485. }
  110486. // Do executes the "compute.targetSslProxies.delete" call.
  110487. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110488. // status code is an error. Response headers are in either
  110489. // *Operation.ServerResponse.Header or (if a response was returned at
  110490. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110491. // to check whether the returned error was because
  110492. // http.StatusNotModified was returned.
  110493. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110494. gensupport.SetOptions(c.urlParams_, opts...)
  110495. res, err := c.doRequest("json")
  110496. if res != nil && res.StatusCode == http.StatusNotModified {
  110497. if res.Body != nil {
  110498. res.Body.Close()
  110499. }
  110500. return nil, &googleapi.Error{
  110501. Code: res.StatusCode,
  110502. Header: res.Header,
  110503. }
  110504. }
  110505. if err != nil {
  110506. return nil, err
  110507. }
  110508. defer googleapi.CloseBody(res)
  110509. if err := googleapi.CheckResponse(res); err != nil {
  110510. return nil, err
  110511. }
  110512. ret := &Operation{
  110513. ServerResponse: googleapi.ServerResponse{
  110514. Header: res.Header,
  110515. HTTPStatusCode: res.StatusCode,
  110516. },
  110517. }
  110518. target := &ret
  110519. if err := gensupport.DecodeResponse(target, res); err != nil {
  110520. return nil, err
  110521. }
  110522. return ret, nil
  110523. // {
  110524. // "description": "Deletes the specified TargetSslProxy resource.",
  110525. // "httpMethod": "DELETE",
  110526. // "id": "compute.targetSslProxies.delete",
  110527. // "parameterOrder": [
  110528. // "project",
  110529. // "targetSslProxy"
  110530. // ],
  110531. // "parameters": {
  110532. // "project": {
  110533. // "description": "Project ID for this request.",
  110534. // "location": "path",
  110535. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110536. // "required": true,
  110537. // "type": "string"
  110538. // },
  110539. // "requestId": {
  110540. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110541. // "location": "query",
  110542. // "type": "string"
  110543. // },
  110544. // "targetSslProxy": {
  110545. // "description": "Name of the TargetSslProxy resource to delete.",
  110546. // "location": "path",
  110547. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110548. // "required": true,
  110549. // "type": "string"
  110550. // }
  110551. // },
  110552. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  110553. // "response": {
  110554. // "$ref": "Operation"
  110555. // },
  110556. // "scopes": [
  110557. // "https://www.googleapis.com/auth/cloud-platform",
  110558. // "https://www.googleapis.com/auth/compute"
  110559. // ]
  110560. // }
  110561. }
  110562. // method id "compute.targetSslProxies.get":
  110563. type TargetSslProxiesGetCall struct {
  110564. s *Service
  110565. project string
  110566. targetSslProxy string
  110567. urlParams_ gensupport.URLParams
  110568. ifNoneMatch_ string
  110569. ctx_ context.Context
  110570. header_ http.Header
  110571. }
  110572. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  110573. // available target SSL proxies by making a list() request.
  110574. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  110575. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110576. c.project = project
  110577. c.targetSslProxy = targetSslProxy
  110578. return c
  110579. }
  110580. // Fields allows partial responses to be retrieved. See
  110581. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110582. // for more information.
  110583. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  110584. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110585. return c
  110586. }
  110587. // IfNoneMatch sets the optional parameter which makes the operation
  110588. // fail if the object's ETag matches the given value. This is useful for
  110589. // getting updates only after the object has changed since the last
  110590. // request. Use googleapi.IsNotModified to check whether the response
  110591. // error from Do is the result of In-None-Match.
  110592. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  110593. c.ifNoneMatch_ = entityTag
  110594. return c
  110595. }
  110596. // Context sets the context to be used in this call's Do method. Any
  110597. // pending HTTP request will be aborted if the provided context is
  110598. // canceled.
  110599. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  110600. c.ctx_ = ctx
  110601. return c
  110602. }
  110603. // Header returns an http.Header that can be modified by the caller to
  110604. // add HTTP headers to the request.
  110605. func (c *TargetSslProxiesGetCall) Header() http.Header {
  110606. if c.header_ == nil {
  110607. c.header_ = make(http.Header)
  110608. }
  110609. return c.header_
  110610. }
  110611. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  110612. reqHeaders := make(http.Header)
  110613. for k, v := range c.header_ {
  110614. reqHeaders[k] = v
  110615. }
  110616. reqHeaders.Set("User-Agent", c.s.userAgent())
  110617. if c.ifNoneMatch_ != "" {
  110618. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  110619. }
  110620. var body io.Reader = nil
  110621. c.urlParams_.Set("alt", alt)
  110622. c.urlParams_.Set("prettyPrint", "false")
  110623. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  110624. urls += "?" + c.urlParams_.Encode()
  110625. req, err := http.NewRequest("GET", urls, body)
  110626. if err != nil {
  110627. return nil, err
  110628. }
  110629. req.Header = reqHeaders
  110630. googleapi.Expand(req.URL, map[string]string{
  110631. "project": c.project,
  110632. "targetSslProxy": c.targetSslProxy,
  110633. })
  110634. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110635. }
  110636. // Do executes the "compute.targetSslProxies.get" call.
  110637. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  110638. // status code is an error. Response headers are in either
  110639. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  110640. // at all) in error.(*googleapi.Error).Header. Use
  110641. // googleapi.IsNotModified to check whether the returned error was
  110642. // because http.StatusNotModified was returned.
  110643. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  110644. gensupport.SetOptions(c.urlParams_, opts...)
  110645. res, err := c.doRequest("json")
  110646. if res != nil && res.StatusCode == http.StatusNotModified {
  110647. if res.Body != nil {
  110648. res.Body.Close()
  110649. }
  110650. return nil, &googleapi.Error{
  110651. Code: res.StatusCode,
  110652. Header: res.Header,
  110653. }
  110654. }
  110655. if err != nil {
  110656. return nil, err
  110657. }
  110658. defer googleapi.CloseBody(res)
  110659. if err := googleapi.CheckResponse(res); err != nil {
  110660. return nil, err
  110661. }
  110662. ret := &TargetSslProxy{
  110663. ServerResponse: googleapi.ServerResponse{
  110664. Header: res.Header,
  110665. HTTPStatusCode: res.StatusCode,
  110666. },
  110667. }
  110668. target := &ret
  110669. if err := gensupport.DecodeResponse(target, res); err != nil {
  110670. return nil, err
  110671. }
  110672. return ret, nil
  110673. // {
  110674. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  110675. // "httpMethod": "GET",
  110676. // "id": "compute.targetSslProxies.get",
  110677. // "parameterOrder": [
  110678. // "project",
  110679. // "targetSslProxy"
  110680. // ],
  110681. // "parameters": {
  110682. // "project": {
  110683. // "description": "Project ID for this request.",
  110684. // "location": "path",
  110685. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110686. // "required": true,
  110687. // "type": "string"
  110688. // },
  110689. // "targetSslProxy": {
  110690. // "description": "Name of the TargetSslProxy resource to return.",
  110691. // "location": "path",
  110692. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110693. // "required": true,
  110694. // "type": "string"
  110695. // }
  110696. // },
  110697. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  110698. // "response": {
  110699. // "$ref": "TargetSslProxy"
  110700. // },
  110701. // "scopes": [
  110702. // "https://www.googleapis.com/auth/cloud-platform",
  110703. // "https://www.googleapis.com/auth/compute",
  110704. // "https://www.googleapis.com/auth/compute.readonly"
  110705. // ]
  110706. // }
  110707. }
  110708. // method id "compute.targetSslProxies.insert":
  110709. type TargetSslProxiesInsertCall struct {
  110710. s *Service
  110711. project string
  110712. targetsslproxy *TargetSslProxy
  110713. urlParams_ gensupport.URLParams
  110714. ctx_ context.Context
  110715. header_ http.Header
  110716. }
  110717. // Insert: Creates a TargetSslProxy resource in the specified project
  110718. // using the data included in the request.
  110719. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  110720. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110721. c.project = project
  110722. c.targetsslproxy = targetsslproxy
  110723. return c
  110724. }
  110725. // RequestId sets the optional parameter "requestId": An optional
  110726. // request ID to identify requests. Specify a unique request ID so that
  110727. // if you must retry your request, the server will know to ignore the
  110728. // request if it has already been completed.
  110729. //
  110730. // For example, consider a situation where you make an initial request
  110731. // and the request times out. If you make the request again with the
  110732. // same request ID, the server can check if original operation with the
  110733. // same request ID was received, and if so, will ignore the second
  110734. // request. This prevents clients from accidentally creating duplicate
  110735. // commitments.
  110736. //
  110737. // The request ID must be a valid UUID with the exception that zero UUID
  110738. // is not supported (00000000-0000-0000-0000-000000000000).
  110739. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  110740. c.urlParams_.Set("requestId", requestId)
  110741. return c
  110742. }
  110743. // Fields allows partial responses to be retrieved. See
  110744. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110745. // for more information.
  110746. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  110747. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110748. return c
  110749. }
  110750. // Context sets the context to be used in this call's Do method. Any
  110751. // pending HTTP request will be aborted if the provided context is
  110752. // canceled.
  110753. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  110754. c.ctx_ = ctx
  110755. return c
  110756. }
  110757. // Header returns an http.Header that can be modified by the caller to
  110758. // add HTTP headers to the request.
  110759. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  110760. if c.header_ == nil {
  110761. c.header_ = make(http.Header)
  110762. }
  110763. return c.header_
  110764. }
  110765. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  110766. reqHeaders := make(http.Header)
  110767. for k, v := range c.header_ {
  110768. reqHeaders[k] = v
  110769. }
  110770. reqHeaders.Set("User-Agent", c.s.userAgent())
  110771. var body io.Reader = nil
  110772. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  110773. if err != nil {
  110774. return nil, err
  110775. }
  110776. reqHeaders.Set("Content-Type", "application/json")
  110777. c.urlParams_.Set("alt", alt)
  110778. c.urlParams_.Set("prettyPrint", "false")
  110779. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  110780. urls += "?" + c.urlParams_.Encode()
  110781. req, err := http.NewRequest("POST", urls, body)
  110782. if err != nil {
  110783. return nil, err
  110784. }
  110785. req.Header = reqHeaders
  110786. googleapi.Expand(req.URL, map[string]string{
  110787. "project": c.project,
  110788. })
  110789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110790. }
  110791. // Do executes the "compute.targetSslProxies.insert" call.
  110792. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110793. // status code is an error. Response headers are in either
  110794. // *Operation.ServerResponse.Header or (if a response was returned at
  110795. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110796. // to check whether the returned error was because
  110797. // http.StatusNotModified was returned.
  110798. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110799. gensupport.SetOptions(c.urlParams_, opts...)
  110800. res, err := c.doRequest("json")
  110801. if res != nil && res.StatusCode == http.StatusNotModified {
  110802. if res.Body != nil {
  110803. res.Body.Close()
  110804. }
  110805. return nil, &googleapi.Error{
  110806. Code: res.StatusCode,
  110807. Header: res.Header,
  110808. }
  110809. }
  110810. if err != nil {
  110811. return nil, err
  110812. }
  110813. defer googleapi.CloseBody(res)
  110814. if err := googleapi.CheckResponse(res); err != nil {
  110815. return nil, err
  110816. }
  110817. ret := &Operation{
  110818. ServerResponse: googleapi.ServerResponse{
  110819. Header: res.Header,
  110820. HTTPStatusCode: res.StatusCode,
  110821. },
  110822. }
  110823. target := &ret
  110824. if err := gensupport.DecodeResponse(target, res); err != nil {
  110825. return nil, err
  110826. }
  110827. return ret, nil
  110828. // {
  110829. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  110830. // "httpMethod": "POST",
  110831. // "id": "compute.targetSslProxies.insert",
  110832. // "parameterOrder": [
  110833. // "project"
  110834. // ],
  110835. // "parameters": {
  110836. // "project": {
  110837. // "description": "Project ID for this request.",
  110838. // "location": "path",
  110839. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110840. // "required": true,
  110841. // "type": "string"
  110842. // },
  110843. // "requestId": {
  110844. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110845. // "location": "query",
  110846. // "type": "string"
  110847. // }
  110848. // },
  110849. // "path": "{project}/global/targetSslProxies",
  110850. // "request": {
  110851. // "$ref": "TargetSslProxy"
  110852. // },
  110853. // "response": {
  110854. // "$ref": "Operation"
  110855. // },
  110856. // "scopes": [
  110857. // "https://www.googleapis.com/auth/cloud-platform",
  110858. // "https://www.googleapis.com/auth/compute"
  110859. // ]
  110860. // }
  110861. }
  110862. // method id "compute.targetSslProxies.list":
  110863. type TargetSslProxiesListCall struct {
  110864. s *Service
  110865. project string
  110866. urlParams_ gensupport.URLParams
  110867. ifNoneMatch_ string
  110868. ctx_ context.Context
  110869. header_ http.Header
  110870. }
  110871. // List: Retrieves the list of TargetSslProxy resources available to the
  110872. // specified project.
  110873. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  110874. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110875. c.project = project
  110876. return c
  110877. }
  110878. // Filter sets the optional parameter "filter": A filter expression that
  110879. // filters resources listed in the response. The expression must specify
  110880. // the field name, a comparison operator, and the value that you want to
  110881. // use for filtering. The value must be a string, a number, or a
  110882. // boolean. The comparison operator must be either =, !=, >, or <.
  110883. //
  110884. // For example, if you are filtering Compute Engine instances, you can
  110885. // exclude instances named example-instance by specifying name !=
  110886. // example-instance.
  110887. //
  110888. // You can also filter nested fields. For example, you could specify
  110889. // scheduling.automaticRestart = false to include instances only if they
  110890. // are not scheduled for automatic restarts. You can use filtering on
  110891. // nested fields to filter based on resource labels.
  110892. //
  110893. // To filter on multiple expressions, provide each separate expression
  110894. // within parentheses. For example, (scheduling.automaticRestart = true)
  110895. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  110896. // AND expression. However, you can include AND and OR expressions
  110897. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  110898. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  110899. // true).
  110900. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  110901. c.urlParams_.Set("filter", filter)
  110902. return c
  110903. }
  110904. // MaxResults sets the optional parameter "maxResults": The maximum
  110905. // number of results per page that should be returned. If the number of
  110906. // available results is larger than maxResults, Compute Engine returns a
  110907. // nextPageToken that can be used to get the next page of results in
  110908. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  110909. // (Default: 500)
  110910. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  110911. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  110912. return c
  110913. }
  110914. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  110915. // a certain order. By default, results are returned in alphanumerical
  110916. // order based on the resource name.
  110917. //
  110918. // You can also sort results in descending order based on the creation
  110919. // timestamp using orderBy="creationTimestamp desc". This sorts results
  110920. // based on the creationTimestamp field in reverse chronological order
  110921. // (newest result first). Use this to sort resources like operations so
  110922. // that the newest operation is returned first.
  110923. //
  110924. // Currently, only sorting by name or creationTimestamp desc is
  110925. // supported.
  110926. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  110927. c.urlParams_.Set("orderBy", orderBy)
  110928. return c
  110929. }
  110930. // PageToken sets the optional parameter "pageToken": Specifies a page
  110931. // token to use. Set pageToken to the nextPageToken returned by a
  110932. // previous list request to get the next page of results.
  110933. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  110934. c.urlParams_.Set("pageToken", pageToken)
  110935. return c
  110936. }
  110937. // Fields allows partial responses to be retrieved. See
  110938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110939. // for more information.
  110940. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  110941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110942. return c
  110943. }
  110944. // IfNoneMatch sets the optional parameter which makes the operation
  110945. // fail if the object's ETag matches the given value. This is useful for
  110946. // getting updates only after the object has changed since the last
  110947. // request. Use googleapi.IsNotModified to check whether the response
  110948. // error from Do is the result of In-None-Match.
  110949. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  110950. c.ifNoneMatch_ = entityTag
  110951. return c
  110952. }
  110953. // Context sets the context to be used in this call's Do method. Any
  110954. // pending HTTP request will be aborted if the provided context is
  110955. // canceled.
  110956. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  110957. c.ctx_ = ctx
  110958. return c
  110959. }
  110960. // Header returns an http.Header that can be modified by the caller to
  110961. // add HTTP headers to the request.
  110962. func (c *TargetSslProxiesListCall) Header() http.Header {
  110963. if c.header_ == nil {
  110964. c.header_ = make(http.Header)
  110965. }
  110966. return c.header_
  110967. }
  110968. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  110969. reqHeaders := make(http.Header)
  110970. for k, v := range c.header_ {
  110971. reqHeaders[k] = v
  110972. }
  110973. reqHeaders.Set("User-Agent", c.s.userAgent())
  110974. if c.ifNoneMatch_ != "" {
  110975. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  110976. }
  110977. var body io.Reader = nil
  110978. c.urlParams_.Set("alt", alt)
  110979. c.urlParams_.Set("prettyPrint", "false")
  110980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  110981. urls += "?" + c.urlParams_.Encode()
  110982. req, err := http.NewRequest("GET", urls, body)
  110983. if err != nil {
  110984. return nil, err
  110985. }
  110986. req.Header = reqHeaders
  110987. googleapi.Expand(req.URL, map[string]string{
  110988. "project": c.project,
  110989. })
  110990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110991. }
  110992. // Do executes the "compute.targetSslProxies.list" call.
  110993. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  110994. // non-2xx status code is an error. Response headers are in either
  110995. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  110996. // returned at all) in error.(*googleapi.Error).Header. Use
  110997. // googleapi.IsNotModified to check whether the returned error was
  110998. // because http.StatusNotModified was returned.
  110999. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  111000. gensupport.SetOptions(c.urlParams_, opts...)
  111001. res, err := c.doRequest("json")
  111002. if res != nil && res.StatusCode == http.StatusNotModified {
  111003. if res.Body != nil {
  111004. res.Body.Close()
  111005. }
  111006. return nil, &googleapi.Error{
  111007. Code: res.StatusCode,
  111008. Header: res.Header,
  111009. }
  111010. }
  111011. if err != nil {
  111012. return nil, err
  111013. }
  111014. defer googleapi.CloseBody(res)
  111015. if err := googleapi.CheckResponse(res); err != nil {
  111016. return nil, err
  111017. }
  111018. ret := &TargetSslProxyList{
  111019. ServerResponse: googleapi.ServerResponse{
  111020. Header: res.Header,
  111021. HTTPStatusCode: res.StatusCode,
  111022. },
  111023. }
  111024. target := &ret
  111025. if err := gensupport.DecodeResponse(target, res); err != nil {
  111026. return nil, err
  111027. }
  111028. return ret, nil
  111029. // {
  111030. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  111031. // "httpMethod": "GET",
  111032. // "id": "compute.targetSslProxies.list",
  111033. // "parameterOrder": [
  111034. // "project"
  111035. // ],
  111036. // "parameters": {
  111037. // "filter": {
  111038. // "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).",
  111039. // "location": "query",
  111040. // "type": "string"
  111041. // },
  111042. // "maxResults": {
  111043. // "default": "500",
  111044. // "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)",
  111045. // "format": "uint32",
  111046. // "location": "query",
  111047. // "minimum": "0",
  111048. // "type": "integer"
  111049. // },
  111050. // "orderBy": {
  111051. // "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.",
  111052. // "location": "query",
  111053. // "type": "string"
  111054. // },
  111055. // "pageToken": {
  111056. // "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.",
  111057. // "location": "query",
  111058. // "type": "string"
  111059. // },
  111060. // "project": {
  111061. // "description": "Project ID for this request.",
  111062. // "location": "path",
  111063. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111064. // "required": true,
  111065. // "type": "string"
  111066. // }
  111067. // },
  111068. // "path": "{project}/global/targetSslProxies",
  111069. // "response": {
  111070. // "$ref": "TargetSslProxyList"
  111071. // },
  111072. // "scopes": [
  111073. // "https://www.googleapis.com/auth/cloud-platform",
  111074. // "https://www.googleapis.com/auth/compute",
  111075. // "https://www.googleapis.com/auth/compute.readonly"
  111076. // ]
  111077. // }
  111078. }
  111079. // Pages invokes f for each page of results.
  111080. // A non-nil error returned from f will halt the iteration.
  111081. // The provided context supersedes any context provided to the Context method.
  111082. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  111083. c.ctx_ = ctx
  111084. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111085. for {
  111086. x, err := c.Do()
  111087. if err != nil {
  111088. return err
  111089. }
  111090. if err := f(x); err != nil {
  111091. return err
  111092. }
  111093. if x.NextPageToken == "" {
  111094. return nil
  111095. }
  111096. c.PageToken(x.NextPageToken)
  111097. }
  111098. }
  111099. // method id "compute.targetSslProxies.setBackendService":
  111100. type TargetSslProxiesSetBackendServiceCall struct {
  111101. s *Service
  111102. project string
  111103. targetSslProxy string
  111104. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  111105. urlParams_ gensupport.URLParams
  111106. ctx_ context.Context
  111107. header_ http.Header
  111108. }
  111109. // SetBackendService: Changes the BackendService for TargetSslProxy.
  111110. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  111111. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111112. c.project = project
  111113. c.targetSslProxy = targetSslProxy
  111114. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  111115. return c
  111116. }
  111117. // RequestId sets the optional parameter "requestId": An optional
  111118. // request ID to identify requests. Specify a unique request ID so that
  111119. // if you must retry your request, the server will know to ignore the
  111120. // request if it has already been completed.
  111121. //
  111122. // For example, consider a situation where you make an initial request
  111123. // and the request times out. If you make the request again with the
  111124. // same request ID, the server can check if original operation with the
  111125. // same request ID was received, and if so, will ignore the second
  111126. // request. This prevents clients from accidentally creating duplicate
  111127. // commitments.
  111128. //
  111129. // The request ID must be a valid UUID with the exception that zero UUID
  111130. // is not supported (00000000-0000-0000-0000-000000000000).
  111131. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  111132. c.urlParams_.Set("requestId", requestId)
  111133. return c
  111134. }
  111135. // Fields allows partial responses to be retrieved. See
  111136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111137. // for more information.
  111138. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  111139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111140. return c
  111141. }
  111142. // Context sets the context to be used in this call's Do method. Any
  111143. // pending HTTP request will be aborted if the provided context is
  111144. // canceled.
  111145. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  111146. c.ctx_ = ctx
  111147. return c
  111148. }
  111149. // Header returns an http.Header that can be modified by the caller to
  111150. // add HTTP headers to the request.
  111151. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  111152. if c.header_ == nil {
  111153. c.header_ = make(http.Header)
  111154. }
  111155. return c.header_
  111156. }
  111157. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  111158. reqHeaders := make(http.Header)
  111159. for k, v := range c.header_ {
  111160. reqHeaders[k] = v
  111161. }
  111162. reqHeaders.Set("User-Agent", c.s.userAgent())
  111163. var body io.Reader = nil
  111164. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  111165. if err != nil {
  111166. return nil, err
  111167. }
  111168. reqHeaders.Set("Content-Type", "application/json")
  111169. c.urlParams_.Set("alt", alt)
  111170. c.urlParams_.Set("prettyPrint", "false")
  111171. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  111172. urls += "?" + c.urlParams_.Encode()
  111173. req, err := http.NewRequest("POST", urls, body)
  111174. if err != nil {
  111175. return nil, err
  111176. }
  111177. req.Header = reqHeaders
  111178. googleapi.Expand(req.URL, map[string]string{
  111179. "project": c.project,
  111180. "targetSslProxy": c.targetSslProxy,
  111181. })
  111182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111183. }
  111184. // Do executes the "compute.targetSslProxies.setBackendService" call.
  111185. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111186. // status code is an error. Response headers are in either
  111187. // *Operation.ServerResponse.Header or (if a response was returned at
  111188. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111189. // to check whether the returned error was because
  111190. // http.StatusNotModified was returned.
  111191. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111192. gensupport.SetOptions(c.urlParams_, opts...)
  111193. res, err := c.doRequest("json")
  111194. if res != nil && res.StatusCode == http.StatusNotModified {
  111195. if res.Body != nil {
  111196. res.Body.Close()
  111197. }
  111198. return nil, &googleapi.Error{
  111199. Code: res.StatusCode,
  111200. Header: res.Header,
  111201. }
  111202. }
  111203. if err != nil {
  111204. return nil, err
  111205. }
  111206. defer googleapi.CloseBody(res)
  111207. if err := googleapi.CheckResponse(res); err != nil {
  111208. return nil, err
  111209. }
  111210. ret := &Operation{
  111211. ServerResponse: googleapi.ServerResponse{
  111212. Header: res.Header,
  111213. HTTPStatusCode: res.StatusCode,
  111214. },
  111215. }
  111216. target := &ret
  111217. if err := gensupport.DecodeResponse(target, res); err != nil {
  111218. return nil, err
  111219. }
  111220. return ret, nil
  111221. // {
  111222. // "description": "Changes the BackendService for TargetSslProxy.",
  111223. // "httpMethod": "POST",
  111224. // "id": "compute.targetSslProxies.setBackendService",
  111225. // "parameterOrder": [
  111226. // "project",
  111227. // "targetSslProxy"
  111228. // ],
  111229. // "parameters": {
  111230. // "project": {
  111231. // "description": "Project ID for this request.",
  111232. // "location": "path",
  111233. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111234. // "required": true,
  111235. // "type": "string"
  111236. // },
  111237. // "requestId": {
  111238. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111239. // "location": "query",
  111240. // "type": "string"
  111241. // },
  111242. // "targetSslProxy": {
  111243. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  111244. // "location": "path",
  111245. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  111246. // "required": true,
  111247. // "type": "string"
  111248. // }
  111249. // },
  111250. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  111251. // "request": {
  111252. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  111253. // },
  111254. // "response": {
  111255. // "$ref": "Operation"
  111256. // },
  111257. // "scopes": [
  111258. // "https://www.googleapis.com/auth/cloud-platform",
  111259. // "https://www.googleapis.com/auth/compute"
  111260. // ]
  111261. // }
  111262. }
  111263. // method id "compute.targetSslProxies.setProxyHeader":
  111264. type TargetSslProxiesSetProxyHeaderCall struct {
  111265. s *Service
  111266. project string
  111267. targetSslProxy string
  111268. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  111269. urlParams_ gensupport.URLParams
  111270. ctx_ context.Context
  111271. header_ http.Header
  111272. }
  111273. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  111274. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  111275. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111276. c.project = project
  111277. c.targetSslProxy = targetSslProxy
  111278. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  111279. return c
  111280. }
  111281. // RequestId sets the optional parameter "requestId": An optional
  111282. // request ID to identify requests. Specify a unique request ID so that
  111283. // if you must retry your request, the server will know to ignore the
  111284. // request if it has already been completed.
  111285. //
  111286. // For example, consider a situation where you make an initial request
  111287. // and the request times out. If you make the request again with the
  111288. // same request ID, the server can check if original operation with the
  111289. // same request ID was received, and if so, will ignore the second
  111290. // request. This prevents clients from accidentally creating duplicate
  111291. // commitments.
  111292. //
  111293. // The request ID must be a valid UUID with the exception that zero UUID
  111294. // is not supported (00000000-0000-0000-0000-000000000000).
  111295. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  111296. c.urlParams_.Set("requestId", requestId)
  111297. return c
  111298. }
  111299. // Fields allows partial responses to be retrieved. See
  111300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111301. // for more information.
  111302. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  111303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111304. return c
  111305. }
  111306. // Context sets the context to be used in this call's Do method. Any
  111307. // pending HTTP request will be aborted if the provided context is
  111308. // canceled.
  111309. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  111310. c.ctx_ = ctx
  111311. return c
  111312. }
  111313. // Header returns an http.Header that can be modified by the caller to
  111314. // add HTTP headers to the request.
  111315. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  111316. if c.header_ == nil {
  111317. c.header_ = make(http.Header)
  111318. }
  111319. return c.header_
  111320. }
  111321. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  111322. reqHeaders := make(http.Header)
  111323. for k, v := range c.header_ {
  111324. reqHeaders[k] = v
  111325. }
  111326. reqHeaders.Set("User-Agent", c.s.userAgent())
  111327. var body io.Reader = nil
  111328. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  111329. if err != nil {
  111330. return nil, err
  111331. }
  111332. reqHeaders.Set("Content-Type", "application/json")
  111333. c.urlParams_.Set("alt", alt)
  111334. c.urlParams_.Set("prettyPrint", "false")
  111335. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  111336. urls += "?" + c.urlParams_.Encode()
  111337. req, err := http.NewRequest("POST", urls, body)
  111338. if err != nil {
  111339. return nil, err
  111340. }
  111341. req.Header = reqHeaders
  111342. googleapi.Expand(req.URL, map[string]string{
  111343. "project": c.project,
  111344. "targetSslProxy": c.targetSslProxy,
  111345. })
  111346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111347. }
  111348. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  111349. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111350. // status code is an error. Response headers are in either
  111351. // *Operation.ServerResponse.Header or (if a response was returned at
  111352. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111353. // to check whether the returned error was because
  111354. // http.StatusNotModified was returned.
  111355. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111356. gensupport.SetOptions(c.urlParams_, opts...)
  111357. res, err := c.doRequest("json")
  111358. if res != nil && res.StatusCode == http.StatusNotModified {
  111359. if res.Body != nil {
  111360. res.Body.Close()
  111361. }
  111362. return nil, &googleapi.Error{
  111363. Code: res.StatusCode,
  111364. Header: res.Header,
  111365. }
  111366. }
  111367. if err != nil {
  111368. return nil, err
  111369. }
  111370. defer googleapi.CloseBody(res)
  111371. if err := googleapi.CheckResponse(res); err != nil {
  111372. return nil, err
  111373. }
  111374. ret := &Operation{
  111375. ServerResponse: googleapi.ServerResponse{
  111376. Header: res.Header,
  111377. HTTPStatusCode: res.StatusCode,
  111378. },
  111379. }
  111380. target := &ret
  111381. if err := gensupport.DecodeResponse(target, res); err != nil {
  111382. return nil, err
  111383. }
  111384. return ret, nil
  111385. // {
  111386. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  111387. // "httpMethod": "POST",
  111388. // "id": "compute.targetSslProxies.setProxyHeader",
  111389. // "parameterOrder": [
  111390. // "project",
  111391. // "targetSslProxy"
  111392. // ],
  111393. // "parameters": {
  111394. // "project": {
  111395. // "description": "Project ID for this request.",
  111396. // "location": "path",
  111397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111398. // "required": true,
  111399. // "type": "string"
  111400. // },
  111401. // "requestId": {
  111402. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111403. // "location": "query",
  111404. // "type": "string"
  111405. // },
  111406. // "targetSslProxy": {
  111407. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  111408. // "location": "path",
  111409. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  111410. // "required": true,
  111411. // "type": "string"
  111412. // }
  111413. // },
  111414. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  111415. // "request": {
  111416. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  111417. // },
  111418. // "response": {
  111419. // "$ref": "Operation"
  111420. // },
  111421. // "scopes": [
  111422. // "https://www.googleapis.com/auth/cloud-platform",
  111423. // "https://www.googleapis.com/auth/compute"
  111424. // ]
  111425. // }
  111426. }
  111427. // method id "compute.targetSslProxies.setSslCertificates":
  111428. type TargetSslProxiesSetSslCertificatesCall struct {
  111429. s *Service
  111430. project string
  111431. targetSslProxy string
  111432. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  111433. urlParams_ gensupport.URLParams
  111434. ctx_ context.Context
  111435. header_ http.Header
  111436. }
  111437. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  111438. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  111439. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111440. c.project = project
  111441. c.targetSslProxy = targetSslProxy
  111442. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  111443. return c
  111444. }
  111445. // RequestId sets the optional parameter "requestId": An optional
  111446. // request ID to identify requests. Specify a unique request ID so that
  111447. // if you must retry your request, the server will know to ignore the
  111448. // request if it has already been completed.
  111449. //
  111450. // For example, consider a situation where you make an initial request
  111451. // and the request times out. If you make the request again with the
  111452. // same request ID, the server can check if original operation with the
  111453. // same request ID was received, and if so, will ignore the second
  111454. // request. This prevents clients from accidentally creating duplicate
  111455. // commitments.
  111456. //
  111457. // The request ID must be a valid UUID with the exception that zero UUID
  111458. // is not supported (00000000-0000-0000-0000-000000000000).
  111459. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  111460. c.urlParams_.Set("requestId", requestId)
  111461. return c
  111462. }
  111463. // Fields allows partial responses to be retrieved. See
  111464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111465. // for more information.
  111466. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  111467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111468. return c
  111469. }
  111470. // Context sets the context to be used in this call's Do method. Any
  111471. // pending HTTP request will be aborted if the provided context is
  111472. // canceled.
  111473. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  111474. c.ctx_ = ctx
  111475. return c
  111476. }
  111477. // Header returns an http.Header that can be modified by the caller to
  111478. // add HTTP headers to the request.
  111479. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  111480. if c.header_ == nil {
  111481. c.header_ = make(http.Header)
  111482. }
  111483. return c.header_
  111484. }
  111485. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  111486. reqHeaders := make(http.Header)
  111487. for k, v := range c.header_ {
  111488. reqHeaders[k] = v
  111489. }
  111490. reqHeaders.Set("User-Agent", c.s.userAgent())
  111491. var body io.Reader = nil
  111492. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  111493. if err != nil {
  111494. return nil, err
  111495. }
  111496. reqHeaders.Set("Content-Type", "application/json")
  111497. c.urlParams_.Set("alt", alt)
  111498. c.urlParams_.Set("prettyPrint", "false")
  111499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  111500. urls += "?" + c.urlParams_.Encode()
  111501. req, err := http.NewRequest("POST", urls, body)
  111502. if err != nil {
  111503. return nil, err
  111504. }
  111505. req.Header = reqHeaders
  111506. googleapi.Expand(req.URL, map[string]string{
  111507. "project": c.project,
  111508. "targetSslProxy": c.targetSslProxy,
  111509. })
  111510. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111511. }
  111512. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  111513. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111514. // status code is an error. Response headers are in either
  111515. // *Operation.ServerResponse.Header or (if a response was returned at
  111516. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111517. // to check whether the returned error was because
  111518. // http.StatusNotModified was returned.
  111519. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111520. gensupport.SetOptions(c.urlParams_, opts...)
  111521. res, err := c.doRequest("json")
  111522. if res != nil && res.StatusCode == http.StatusNotModified {
  111523. if res.Body != nil {
  111524. res.Body.Close()
  111525. }
  111526. return nil, &googleapi.Error{
  111527. Code: res.StatusCode,
  111528. Header: res.Header,
  111529. }
  111530. }
  111531. if err != nil {
  111532. return nil, err
  111533. }
  111534. defer googleapi.CloseBody(res)
  111535. if err := googleapi.CheckResponse(res); err != nil {
  111536. return nil, err
  111537. }
  111538. ret := &Operation{
  111539. ServerResponse: googleapi.ServerResponse{
  111540. Header: res.Header,
  111541. HTTPStatusCode: res.StatusCode,
  111542. },
  111543. }
  111544. target := &ret
  111545. if err := gensupport.DecodeResponse(target, res); err != nil {
  111546. return nil, err
  111547. }
  111548. return ret, nil
  111549. // {
  111550. // "description": "Changes SslCertificates for TargetSslProxy.",
  111551. // "httpMethod": "POST",
  111552. // "id": "compute.targetSslProxies.setSslCertificates",
  111553. // "parameterOrder": [
  111554. // "project",
  111555. // "targetSslProxy"
  111556. // ],
  111557. // "parameters": {
  111558. // "project": {
  111559. // "description": "Project ID for this request.",
  111560. // "location": "path",
  111561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111562. // "required": true,
  111563. // "type": "string"
  111564. // },
  111565. // "requestId": {
  111566. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111567. // "location": "query",
  111568. // "type": "string"
  111569. // },
  111570. // "targetSslProxy": {
  111571. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  111572. // "location": "path",
  111573. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  111574. // "required": true,
  111575. // "type": "string"
  111576. // }
  111577. // },
  111578. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  111579. // "request": {
  111580. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  111581. // },
  111582. // "response": {
  111583. // "$ref": "Operation"
  111584. // },
  111585. // "scopes": [
  111586. // "https://www.googleapis.com/auth/cloud-platform",
  111587. // "https://www.googleapis.com/auth/compute"
  111588. // ]
  111589. // }
  111590. }
  111591. // method id "compute.targetSslProxies.setSslPolicy":
  111592. type TargetSslProxiesSetSslPolicyCall struct {
  111593. s *Service
  111594. project string
  111595. targetSslProxy string
  111596. sslpolicyreference *SslPolicyReference
  111597. urlParams_ gensupport.URLParams
  111598. ctx_ context.Context
  111599. header_ http.Header
  111600. }
  111601. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  111602. // specifies the server-side support for SSL features. This affects
  111603. // connections between clients and the SSL proxy load balancer. They do
  111604. // not affect the connection between the load balancer and the backends.
  111605. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  111606. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111607. c.project = project
  111608. c.targetSslProxy = targetSslProxy
  111609. c.sslpolicyreference = sslpolicyreference
  111610. return c
  111611. }
  111612. // RequestId sets the optional parameter "requestId": An optional
  111613. // request ID to identify requests. Specify a unique request ID so that
  111614. // if you must retry your request, the server will know to ignore the
  111615. // request if it has already been completed.
  111616. //
  111617. // For example, consider a situation where you make an initial request
  111618. // and the request times out. If you make the request again with the
  111619. // same request ID, the server can check if original operation with the
  111620. // same request ID was received, and if so, will ignore the second
  111621. // request. This prevents clients from accidentally creating duplicate
  111622. // commitments.
  111623. //
  111624. // The request ID must be a valid UUID with the exception that zero UUID
  111625. // is not supported (00000000-0000-0000-0000-000000000000).
  111626. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  111627. c.urlParams_.Set("requestId", requestId)
  111628. return c
  111629. }
  111630. // Fields allows partial responses to be retrieved. See
  111631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111632. // for more information.
  111633. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  111634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111635. return c
  111636. }
  111637. // Context sets the context to be used in this call's Do method. Any
  111638. // pending HTTP request will be aborted if the provided context is
  111639. // canceled.
  111640. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  111641. c.ctx_ = ctx
  111642. return c
  111643. }
  111644. // Header returns an http.Header that can be modified by the caller to
  111645. // add HTTP headers to the request.
  111646. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  111647. if c.header_ == nil {
  111648. c.header_ = make(http.Header)
  111649. }
  111650. return c.header_
  111651. }
  111652. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  111653. reqHeaders := make(http.Header)
  111654. for k, v := range c.header_ {
  111655. reqHeaders[k] = v
  111656. }
  111657. reqHeaders.Set("User-Agent", c.s.userAgent())
  111658. var body io.Reader = nil
  111659. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  111660. if err != nil {
  111661. return nil, err
  111662. }
  111663. reqHeaders.Set("Content-Type", "application/json")
  111664. c.urlParams_.Set("alt", alt)
  111665. c.urlParams_.Set("prettyPrint", "false")
  111666. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  111667. urls += "?" + c.urlParams_.Encode()
  111668. req, err := http.NewRequest("POST", urls, body)
  111669. if err != nil {
  111670. return nil, err
  111671. }
  111672. req.Header = reqHeaders
  111673. googleapi.Expand(req.URL, map[string]string{
  111674. "project": c.project,
  111675. "targetSslProxy": c.targetSslProxy,
  111676. })
  111677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111678. }
  111679. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  111680. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111681. // status code is an error. Response headers are in either
  111682. // *Operation.ServerResponse.Header or (if a response was returned at
  111683. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111684. // to check whether the returned error was because
  111685. // http.StatusNotModified was returned.
  111686. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111687. gensupport.SetOptions(c.urlParams_, opts...)
  111688. res, err := c.doRequest("json")
  111689. if res != nil && res.StatusCode == http.StatusNotModified {
  111690. if res.Body != nil {
  111691. res.Body.Close()
  111692. }
  111693. return nil, &googleapi.Error{
  111694. Code: res.StatusCode,
  111695. Header: res.Header,
  111696. }
  111697. }
  111698. if err != nil {
  111699. return nil, err
  111700. }
  111701. defer googleapi.CloseBody(res)
  111702. if err := googleapi.CheckResponse(res); err != nil {
  111703. return nil, err
  111704. }
  111705. ret := &Operation{
  111706. ServerResponse: googleapi.ServerResponse{
  111707. Header: res.Header,
  111708. HTTPStatusCode: res.StatusCode,
  111709. },
  111710. }
  111711. target := &ret
  111712. if err := gensupport.DecodeResponse(target, res); err != nil {
  111713. return nil, err
  111714. }
  111715. return ret, nil
  111716. // {
  111717. // "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.",
  111718. // "httpMethod": "POST",
  111719. // "id": "compute.targetSslProxies.setSslPolicy",
  111720. // "parameterOrder": [
  111721. // "project",
  111722. // "targetSslProxy"
  111723. // ],
  111724. // "parameters": {
  111725. // "project": {
  111726. // "description": "Project ID for this request.",
  111727. // "location": "path",
  111728. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111729. // "required": true,
  111730. // "type": "string"
  111731. // },
  111732. // "requestId": {
  111733. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111734. // "location": "query",
  111735. // "type": "string"
  111736. // },
  111737. // "targetSslProxy": {
  111738. // "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.",
  111739. // "location": "path",
  111740. // "required": true,
  111741. // "type": "string"
  111742. // }
  111743. // },
  111744. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  111745. // "request": {
  111746. // "$ref": "SslPolicyReference"
  111747. // },
  111748. // "response": {
  111749. // "$ref": "Operation"
  111750. // },
  111751. // "scopes": [
  111752. // "https://www.googleapis.com/auth/cloud-platform",
  111753. // "https://www.googleapis.com/auth/compute"
  111754. // ]
  111755. // }
  111756. }
  111757. // method id "compute.targetSslProxies.testIamPermissions":
  111758. type TargetSslProxiesTestIamPermissionsCall struct {
  111759. s *Service
  111760. project string
  111761. resource string
  111762. testpermissionsrequest *TestPermissionsRequest
  111763. urlParams_ gensupport.URLParams
  111764. ctx_ context.Context
  111765. header_ http.Header
  111766. }
  111767. // TestIamPermissions: Returns permissions that a caller has on the
  111768. // specified resource.
  111769. func (r *TargetSslProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetSslProxiesTestIamPermissionsCall {
  111770. c := &TargetSslProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111771. c.project = project
  111772. c.resource = resource
  111773. c.testpermissionsrequest = testpermissionsrequest
  111774. return c
  111775. }
  111776. // Fields allows partial responses to be retrieved. See
  111777. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111778. // for more information.
  111779. func (c *TargetSslProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetSslProxiesTestIamPermissionsCall {
  111780. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111781. return c
  111782. }
  111783. // Context sets the context to be used in this call's Do method. Any
  111784. // pending HTTP request will be aborted if the provided context is
  111785. // canceled.
  111786. func (c *TargetSslProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetSslProxiesTestIamPermissionsCall {
  111787. c.ctx_ = ctx
  111788. return c
  111789. }
  111790. // Header returns an http.Header that can be modified by the caller to
  111791. // add HTTP headers to the request.
  111792. func (c *TargetSslProxiesTestIamPermissionsCall) Header() http.Header {
  111793. if c.header_ == nil {
  111794. c.header_ = make(http.Header)
  111795. }
  111796. return c.header_
  111797. }
  111798. func (c *TargetSslProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  111799. reqHeaders := make(http.Header)
  111800. for k, v := range c.header_ {
  111801. reqHeaders[k] = v
  111802. }
  111803. reqHeaders.Set("User-Agent", c.s.userAgent())
  111804. var body io.Reader = nil
  111805. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  111806. if err != nil {
  111807. return nil, err
  111808. }
  111809. reqHeaders.Set("Content-Type", "application/json")
  111810. c.urlParams_.Set("alt", alt)
  111811. c.urlParams_.Set("prettyPrint", "false")
  111812. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{resource}/testIamPermissions")
  111813. urls += "?" + c.urlParams_.Encode()
  111814. req, err := http.NewRequest("POST", urls, body)
  111815. if err != nil {
  111816. return nil, err
  111817. }
  111818. req.Header = reqHeaders
  111819. googleapi.Expand(req.URL, map[string]string{
  111820. "project": c.project,
  111821. "resource": c.resource,
  111822. })
  111823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111824. }
  111825. // Do executes the "compute.targetSslProxies.testIamPermissions" call.
  111826. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  111827. // non-2xx status code is an error. Response headers are in either
  111828. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  111829. // returned at all) in error.(*googleapi.Error).Header. Use
  111830. // googleapi.IsNotModified to check whether the returned error was
  111831. // because http.StatusNotModified was returned.
  111832. func (c *TargetSslProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  111833. gensupport.SetOptions(c.urlParams_, opts...)
  111834. res, err := c.doRequest("json")
  111835. if res != nil && res.StatusCode == http.StatusNotModified {
  111836. if res.Body != nil {
  111837. res.Body.Close()
  111838. }
  111839. return nil, &googleapi.Error{
  111840. Code: res.StatusCode,
  111841. Header: res.Header,
  111842. }
  111843. }
  111844. if err != nil {
  111845. return nil, err
  111846. }
  111847. defer googleapi.CloseBody(res)
  111848. if err := googleapi.CheckResponse(res); err != nil {
  111849. return nil, err
  111850. }
  111851. ret := &TestPermissionsResponse{
  111852. ServerResponse: googleapi.ServerResponse{
  111853. Header: res.Header,
  111854. HTTPStatusCode: res.StatusCode,
  111855. },
  111856. }
  111857. target := &ret
  111858. if err := gensupport.DecodeResponse(target, res); err != nil {
  111859. return nil, err
  111860. }
  111861. return ret, nil
  111862. // {
  111863. // "description": "Returns permissions that a caller has on the specified resource.",
  111864. // "httpMethod": "POST",
  111865. // "id": "compute.targetSslProxies.testIamPermissions",
  111866. // "parameterOrder": [
  111867. // "project",
  111868. // "resource"
  111869. // ],
  111870. // "parameters": {
  111871. // "project": {
  111872. // "description": "Project ID for this request.",
  111873. // "location": "path",
  111874. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111875. // "required": true,
  111876. // "type": "string"
  111877. // },
  111878. // "resource": {
  111879. // "description": "Name or id of the resource for this request.",
  111880. // "location": "path",
  111881. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  111882. // "required": true,
  111883. // "type": "string"
  111884. // }
  111885. // },
  111886. // "path": "{project}/global/targetSslProxies/{resource}/testIamPermissions",
  111887. // "request": {
  111888. // "$ref": "TestPermissionsRequest"
  111889. // },
  111890. // "response": {
  111891. // "$ref": "TestPermissionsResponse"
  111892. // },
  111893. // "scopes": [
  111894. // "https://www.googleapis.com/auth/cloud-platform",
  111895. // "https://www.googleapis.com/auth/compute",
  111896. // "https://www.googleapis.com/auth/compute.readonly"
  111897. // ]
  111898. // }
  111899. }
  111900. // method id "compute.targetTcpProxies.delete":
  111901. type TargetTcpProxiesDeleteCall struct {
  111902. s *Service
  111903. project string
  111904. targetTcpProxy string
  111905. urlParams_ gensupport.URLParams
  111906. ctx_ context.Context
  111907. header_ http.Header
  111908. }
  111909. // Delete: Deletes the specified TargetTcpProxy resource.
  111910. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  111911. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111912. c.project = project
  111913. c.targetTcpProxy = targetTcpProxy
  111914. return c
  111915. }
  111916. // RequestId sets the optional parameter "requestId": An optional
  111917. // request ID to identify requests. Specify a unique request ID so that
  111918. // if you must retry your request, the server will know to ignore the
  111919. // request if it has already been completed.
  111920. //
  111921. // For example, consider a situation where you make an initial request
  111922. // and the request times out. If you make the request again with the
  111923. // same request ID, the server can check if original operation with the
  111924. // same request ID was received, and if so, will ignore the second
  111925. // request. This prevents clients from accidentally creating duplicate
  111926. // commitments.
  111927. //
  111928. // The request ID must be a valid UUID with the exception that zero UUID
  111929. // is not supported (00000000-0000-0000-0000-000000000000).
  111930. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  111931. c.urlParams_.Set("requestId", requestId)
  111932. return c
  111933. }
  111934. // Fields allows partial responses to be retrieved. See
  111935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111936. // for more information.
  111937. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  111938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111939. return c
  111940. }
  111941. // Context sets the context to be used in this call's Do method. Any
  111942. // pending HTTP request will be aborted if the provided context is
  111943. // canceled.
  111944. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  111945. c.ctx_ = ctx
  111946. return c
  111947. }
  111948. // Header returns an http.Header that can be modified by the caller to
  111949. // add HTTP headers to the request.
  111950. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  111951. if c.header_ == nil {
  111952. c.header_ = make(http.Header)
  111953. }
  111954. return c.header_
  111955. }
  111956. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  111957. reqHeaders := make(http.Header)
  111958. for k, v := range c.header_ {
  111959. reqHeaders[k] = v
  111960. }
  111961. reqHeaders.Set("User-Agent", c.s.userAgent())
  111962. var body io.Reader = nil
  111963. c.urlParams_.Set("alt", alt)
  111964. c.urlParams_.Set("prettyPrint", "false")
  111965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  111966. urls += "?" + c.urlParams_.Encode()
  111967. req, err := http.NewRequest("DELETE", urls, body)
  111968. if err != nil {
  111969. return nil, err
  111970. }
  111971. req.Header = reqHeaders
  111972. googleapi.Expand(req.URL, map[string]string{
  111973. "project": c.project,
  111974. "targetTcpProxy": c.targetTcpProxy,
  111975. })
  111976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111977. }
  111978. // Do executes the "compute.targetTcpProxies.delete" call.
  111979. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111980. // status code is an error. Response headers are in either
  111981. // *Operation.ServerResponse.Header or (if a response was returned at
  111982. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111983. // to check whether the returned error was because
  111984. // http.StatusNotModified was returned.
  111985. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111986. gensupport.SetOptions(c.urlParams_, opts...)
  111987. res, err := c.doRequest("json")
  111988. if res != nil && res.StatusCode == http.StatusNotModified {
  111989. if res.Body != nil {
  111990. res.Body.Close()
  111991. }
  111992. return nil, &googleapi.Error{
  111993. Code: res.StatusCode,
  111994. Header: res.Header,
  111995. }
  111996. }
  111997. if err != nil {
  111998. return nil, err
  111999. }
  112000. defer googleapi.CloseBody(res)
  112001. if err := googleapi.CheckResponse(res); err != nil {
  112002. return nil, err
  112003. }
  112004. ret := &Operation{
  112005. ServerResponse: googleapi.ServerResponse{
  112006. Header: res.Header,
  112007. HTTPStatusCode: res.StatusCode,
  112008. },
  112009. }
  112010. target := &ret
  112011. if err := gensupport.DecodeResponse(target, res); err != nil {
  112012. return nil, err
  112013. }
  112014. return ret, nil
  112015. // {
  112016. // "description": "Deletes the specified TargetTcpProxy resource.",
  112017. // "httpMethod": "DELETE",
  112018. // "id": "compute.targetTcpProxies.delete",
  112019. // "parameterOrder": [
  112020. // "project",
  112021. // "targetTcpProxy"
  112022. // ],
  112023. // "parameters": {
  112024. // "project": {
  112025. // "description": "Project ID for this request.",
  112026. // "location": "path",
  112027. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112028. // "required": true,
  112029. // "type": "string"
  112030. // },
  112031. // "requestId": {
  112032. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112033. // "location": "query",
  112034. // "type": "string"
  112035. // },
  112036. // "targetTcpProxy": {
  112037. // "description": "Name of the TargetTcpProxy resource to delete.",
  112038. // "location": "path",
  112039. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112040. // "required": true,
  112041. // "type": "string"
  112042. // }
  112043. // },
  112044. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  112045. // "response": {
  112046. // "$ref": "Operation"
  112047. // },
  112048. // "scopes": [
  112049. // "https://www.googleapis.com/auth/cloud-platform",
  112050. // "https://www.googleapis.com/auth/compute"
  112051. // ]
  112052. // }
  112053. }
  112054. // method id "compute.targetTcpProxies.get":
  112055. type TargetTcpProxiesGetCall struct {
  112056. s *Service
  112057. project string
  112058. targetTcpProxy string
  112059. urlParams_ gensupport.URLParams
  112060. ifNoneMatch_ string
  112061. ctx_ context.Context
  112062. header_ http.Header
  112063. }
  112064. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  112065. // available target TCP proxies by making a list() request.
  112066. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  112067. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112068. c.project = project
  112069. c.targetTcpProxy = targetTcpProxy
  112070. return c
  112071. }
  112072. // Fields allows partial responses to be retrieved. See
  112073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112074. // for more information.
  112075. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  112076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112077. return c
  112078. }
  112079. // IfNoneMatch sets the optional parameter which makes the operation
  112080. // fail if the object's ETag matches the given value. This is useful for
  112081. // getting updates only after the object has changed since the last
  112082. // request. Use googleapi.IsNotModified to check whether the response
  112083. // error from Do is the result of In-None-Match.
  112084. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  112085. c.ifNoneMatch_ = entityTag
  112086. return c
  112087. }
  112088. // Context sets the context to be used in this call's Do method. Any
  112089. // pending HTTP request will be aborted if the provided context is
  112090. // canceled.
  112091. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  112092. c.ctx_ = ctx
  112093. return c
  112094. }
  112095. // Header returns an http.Header that can be modified by the caller to
  112096. // add HTTP headers to the request.
  112097. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  112098. if c.header_ == nil {
  112099. c.header_ = make(http.Header)
  112100. }
  112101. return c.header_
  112102. }
  112103. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  112104. reqHeaders := make(http.Header)
  112105. for k, v := range c.header_ {
  112106. reqHeaders[k] = v
  112107. }
  112108. reqHeaders.Set("User-Agent", c.s.userAgent())
  112109. if c.ifNoneMatch_ != "" {
  112110. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112111. }
  112112. var body io.Reader = nil
  112113. c.urlParams_.Set("alt", alt)
  112114. c.urlParams_.Set("prettyPrint", "false")
  112115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  112116. urls += "?" + c.urlParams_.Encode()
  112117. req, err := http.NewRequest("GET", urls, body)
  112118. if err != nil {
  112119. return nil, err
  112120. }
  112121. req.Header = reqHeaders
  112122. googleapi.Expand(req.URL, map[string]string{
  112123. "project": c.project,
  112124. "targetTcpProxy": c.targetTcpProxy,
  112125. })
  112126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112127. }
  112128. // Do executes the "compute.targetTcpProxies.get" call.
  112129. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  112130. // status code is an error. Response headers are in either
  112131. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  112132. // at all) in error.(*googleapi.Error).Header. Use
  112133. // googleapi.IsNotModified to check whether the returned error was
  112134. // because http.StatusNotModified was returned.
  112135. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  112136. gensupport.SetOptions(c.urlParams_, opts...)
  112137. res, err := c.doRequest("json")
  112138. if res != nil && res.StatusCode == http.StatusNotModified {
  112139. if res.Body != nil {
  112140. res.Body.Close()
  112141. }
  112142. return nil, &googleapi.Error{
  112143. Code: res.StatusCode,
  112144. Header: res.Header,
  112145. }
  112146. }
  112147. if err != nil {
  112148. return nil, err
  112149. }
  112150. defer googleapi.CloseBody(res)
  112151. if err := googleapi.CheckResponse(res); err != nil {
  112152. return nil, err
  112153. }
  112154. ret := &TargetTcpProxy{
  112155. ServerResponse: googleapi.ServerResponse{
  112156. Header: res.Header,
  112157. HTTPStatusCode: res.StatusCode,
  112158. },
  112159. }
  112160. target := &ret
  112161. if err := gensupport.DecodeResponse(target, res); err != nil {
  112162. return nil, err
  112163. }
  112164. return ret, nil
  112165. // {
  112166. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  112167. // "httpMethod": "GET",
  112168. // "id": "compute.targetTcpProxies.get",
  112169. // "parameterOrder": [
  112170. // "project",
  112171. // "targetTcpProxy"
  112172. // ],
  112173. // "parameters": {
  112174. // "project": {
  112175. // "description": "Project ID for this request.",
  112176. // "location": "path",
  112177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112178. // "required": true,
  112179. // "type": "string"
  112180. // },
  112181. // "targetTcpProxy": {
  112182. // "description": "Name of the TargetTcpProxy resource to return.",
  112183. // "location": "path",
  112184. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112185. // "required": true,
  112186. // "type": "string"
  112187. // }
  112188. // },
  112189. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  112190. // "response": {
  112191. // "$ref": "TargetTcpProxy"
  112192. // },
  112193. // "scopes": [
  112194. // "https://www.googleapis.com/auth/cloud-platform",
  112195. // "https://www.googleapis.com/auth/compute",
  112196. // "https://www.googleapis.com/auth/compute.readonly"
  112197. // ]
  112198. // }
  112199. }
  112200. // method id "compute.targetTcpProxies.insert":
  112201. type TargetTcpProxiesInsertCall struct {
  112202. s *Service
  112203. project string
  112204. targettcpproxy *TargetTcpProxy
  112205. urlParams_ gensupport.URLParams
  112206. ctx_ context.Context
  112207. header_ http.Header
  112208. }
  112209. // Insert: Creates a TargetTcpProxy resource in the specified project
  112210. // using the data included in the request.
  112211. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  112212. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112213. c.project = project
  112214. c.targettcpproxy = targettcpproxy
  112215. return c
  112216. }
  112217. // RequestId sets the optional parameter "requestId": An optional
  112218. // request ID to identify requests. Specify a unique request ID so that
  112219. // if you must retry your request, the server will know to ignore the
  112220. // request if it has already been completed.
  112221. //
  112222. // For example, consider a situation where you make an initial request
  112223. // and the request times out. If you make the request again with the
  112224. // same request ID, the server can check if original operation with the
  112225. // same request ID was received, and if so, will ignore the second
  112226. // request. This prevents clients from accidentally creating duplicate
  112227. // commitments.
  112228. //
  112229. // The request ID must be a valid UUID with the exception that zero UUID
  112230. // is not supported (00000000-0000-0000-0000-000000000000).
  112231. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  112232. c.urlParams_.Set("requestId", requestId)
  112233. return c
  112234. }
  112235. // Fields allows partial responses to be retrieved. See
  112236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112237. // for more information.
  112238. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  112239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112240. return c
  112241. }
  112242. // Context sets the context to be used in this call's Do method. Any
  112243. // pending HTTP request will be aborted if the provided context is
  112244. // canceled.
  112245. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  112246. c.ctx_ = ctx
  112247. return c
  112248. }
  112249. // Header returns an http.Header that can be modified by the caller to
  112250. // add HTTP headers to the request.
  112251. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  112252. if c.header_ == nil {
  112253. c.header_ = make(http.Header)
  112254. }
  112255. return c.header_
  112256. }
  112257. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  112258. reqHeaders := make(http.Header)
  112259. for k, v := range c.header_ {
  112260. reqHeaders[k] = v
  112261. }
  112262. reqHeaders.Set("User-Agent", c.s.userAgent())
  112263. var body io.Reader = nil
  112264. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  112265. if err != nil {
  112266. return nil, err
  112267. }
  112268. reqHeaders.Set("Content-Type", "application/json")
  112269. c.urlParams_.Set("alt", alt)
  112270. c.urlParams_.Set("prettyPrint", "false")
  112271. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  112272. urls += "?" + c.urlParams_.Encode()
  112273. req, err := http.NewRequest("POST", urls, body)
  112274. if err != nil {
  112275. return nil, err
  112276. }
  112277. req.Header = reqHeaders
  112278. googleapi.Expand(req.URL, map[string]string{
  112279. "project": c.project,
  112280. })
  112281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112282. }
  112283. // Do executes the "compute.targetTcpProxies.insert" call.
  112284. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112285. // status code is an error. Response headers are in either
  112286. // *Operation.ServerResponse.Header or (if a response was returned at
  112287. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112288. // to check whether the returned error was because
  112289. // http.StatusNotModified was returned.
  112290. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112291. gensupport.SetOptions(c.urlParams_, opts...)
  112292. res, err := c.doRequest("json")
  112293. if res != nil && res.StatusCode == http.StatusNotModified {
  112294. if res.Body != nil {
  112295. res.Body.Close()
  112296. }
  112297. return nil, &googleapi.Error{
  112298. Code: res.StatusCode,
  112299. Header: res.Header,
  112300. }
  112301. }
  112302. if err != nil {
  112303. return nil, err
  112304. }
  112305. defer googleapi.CloseBody(res)
  112306. if err := googleapi.CheckResponse(res); err != nil {
  112307. return nil, err
  112308. }
  112309. ret := &Operation{
  112310. ServerResponse: googleapi.ServerResponse{
  112311. Header: res.Header,
  112312. HTTPStatusCode: res.StatusCode,
  112313. },
  112314. }
  112315. target := &ret
  112316. if err := gensupport.DecodeResponse(target, res); err != nil {
  112317. return nil, err
  112318. }
  112319. return ret, nil
  112320. // {
  112321. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  112322. // "httpMethod": "POST",
  112323. // "id": "compute.targetTcpProxies.insert",
  112324. // "parameterOrder": [
  112325. // "project"
  112326. // ],
  112327. // "parameters": {
  112328. // "project": {
  112329. // "description": "Project ID for this request.",
  112330. // "location": "path",
  112331. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112332. // "required": true,
  112333. // "type": "string"
  112334. // },
  112335. // "requestId": {
  112336. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112337. // "location": "query",
  112338. // "type": "string"
  112339. // }
  112340. // },
  112341. // "path": "{project}/global/targetTcpProxies",
  112342. // "request": {
  112343. // "$ref": "TargetTcpProxy"
  112344. // },
  112345. // "response": {
  112346. // "$ref": "Operation"
  112347. // },
  112348. // "scopes": [
  112349. // "https://www.googleapis.com/auth/cloud-platform",
  112350. // "https://www.googleapis.com/auth/compute"
  112351. // ]
  112352. // }
  112353. }
  112354. // method id "compute.targetTcpProxies.list":
  112355. type TargetTcpProxiesListCall struct {
  112356. s *Service
  112357. project string
  112358. urlParams_ gensupport.URLParams
  112359. ifNoneMatch_ string
  112360. ctx_ context.Context
  112361. header_ http.Header
  112362. }
  112363. // List: Retrieves the list of TargetTcpProxy resources available to the
  112364. // specified project.
  112365. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  112366. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112367. c.project = project
  112368. return c
  112369. }
  112370. // Filter sets the optional parameter "filter": A filter expression that
  112371. // filters resources listed in the response. The expression must specify
  112372. // the field name, a comparison operator, and the value that you want to
  112373. // use for filtering. The value must be a string, a number, or a
  112374. // boolean. The comparison operator must be either =, !=, >, or <.
  112375. //
  112376. // For example, if you are filtering Compute Engine instances, you can
  112377. // exclude instances named example-instance by specifying name !=
  112378. // example-instance.
  112379. //
  112380. // You can also filter nested fields. For example, you could specify
  112381. // scheduling.automaticRestart = false to include instances only if they
  112382. // are not scheduled for automatic restarts. You can use filtering on
  112383. // nested fields to filter based on resource labels.
  112384. //
  112385. // To filter on multiple expressions, provide each separate expression
  112386. // within parentheses. For example, (scheduling.automaticRestart = true)
  112387. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  112388. // AND expression. However, you can include AND and OR expressions
  112389. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  112390. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  112391. // true).
  112392. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  112393. c.urlParams_.Set("filter", filter)
  112394. return c
  112395. }
  112396. // MaxResults sets the optional parameter "maxResults": The maximum
  112397. // number of results per page that should be returned. If the number of
  112398. // available results is larger than maxResults, Compute Engine returns a
  112399. // nextPageToken that can be used to get the next page of results in
  112400. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  112401. // (Default: 500)
  112402. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  112403. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  112404. return c
  112405. }
  112406. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  112407. // a certain order. By default, results are returned in alphanumerical
  112408. // order based on the resource name.
  112409. //
  112410. // You can also sort results in descending order based on the creation
  112411. // timestamp using orderBy="creationTimestamp desc". This sorts results
  112412. // based on the creationTimestamp field in reverse chronological order
  112413. // (newest result first). Use this to sort resources like operations so
  112414. // that the newest operation is returned first.
  112415. //
  112416. // Currently, only sorting by name or creationTimestamp desc is
  112417. // supported.
  112418. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  112419. c.urlParams_.Set("orderBy", orderBy)
  112420. return c
  112421. }
  112422. // PageToken sets the optional parameter "pageToken": Specifies a page
  112423. // token to use. Set pageToken to the nextPageToken returned by a
  112424. // previous list request to get the next page of results.
  112425. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  112426. c.urlParams_.Set("pageToken", pageToken)
  112427. return c
  112428. }
  112429. // Fields allows partial responses to be retrieved. See
  112430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112431. // for more information.
  112432. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  112433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112434. return c
  112435. }
  112436. // IfNoneMatch sets the optional parameter which makes the operation
  112437. // fail if the object's ETag matches the given value. This is useful for
  112438. // getting updates only after the object has changed since the last
  112439. // request. Use googleapi.IsNotModified to check whether the response
  112440. // error from Do is the result of In-None-Match.
  112441. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  112442. c.ifNoneMatch_ = entityTag
  112443. return c
  112444. }
  112445. // Context sets the context to be used in this call's Do method. Any
  112446. // pending HTTP request will be aborted if the provided context is
  112447. // canceled.
  112448. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  112449. c.ctx_ = ctx
  112450. return c
  112451. }
  112452. // Header returns an http.Header that can be modified by the caller to
  112453. // add HTTP headers to the request.
  112454. func (c *TargetTcpProxiesListCall) Header() http.Header {
  112455. if c.header_ == nil {
  112456. c.header_ = make(http.Header)
  112457. }
  112458. return c.header_
  112459. }
  112460. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  112461. reqHeaders := make(http.Header)
  112462. for k, v := range c.header_ {
  112463. reqHeaders[k] = v
  112464. }
  112465. reqHeaders.Set("User-Agent", c.s.userAgent())
  112466. if c.ifNoneMatch_ != "" {
  112467. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112468. }
  112469. var body io.Reader = nil
  112470. c.urlParams_.Set("alt", alt)
  112471. c.urlParams_.Set("prettyPrint", "false")
  112472. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  112473. urls += "?" + c.urlParams_.Encode()
  112474. req, err := http.NewRequest("GET", urls, body)
  112475. if err != nil {
  112476. return nil, err
  112477. }
  112478. req.Header = reqHeaders
  112479. googleapi.Expand(req.URL, map[string]string{
  112480. "project": c.project,
  112481. })
  112482. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112483. }
  112484. // Do executes the "compute.targetTcpProxies.list" call.
  112485. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  112486. // non-2xx status code is an error. Response headers are in either
  112487. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  112488. // returned at all) in error.(*googleapi.Error).Header. Use
  112489. // googleapi.IsNotModified to check whether the returned error was
  112490. // because http.StatusNotModified was returned.
  112491. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  112492. gensupport.SetOptions(c.urlParams_, opts...)
  112493. res, err := c.doRequest("json")
  112494. if res != nil && res.StatusCode == http.StatusNotModified {
  112495. if res.Body != nil {
  112496. res.Body.Close()
  112497. }
  112498. return nil, &googleapi.Error{
  112499. Code: res.StatusCode,
  112500. Header: res.Header,
  112501. }
  112502. }
  112503. if err != nil {
  112504. return nil, err
  112505. }
  112506. defer googleapi.CloseBody(res)
  112507. if err := googleapi.CheckResponse(res); err != nil {
  112508. return nil, err
  112509. }
  112510. ret := &TargetTcpProxyList{
  112511. ServerResponse: googleapi.ServerResponse{
  112512. Header: res.Header,
  112513. HTTPStatusCode: res.StatusCode,
  112514. },
  112515. }
  112516. target := &ret
  112517. if err := gensupport.DecodeResponse(target, res); err != nil {
  112518. return nil, err
  112519. }
  112520. return ret, nil
  112521. // {
  112522. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  112523. // "httpMethod": "GET",
  112524. // "id": "compute.targetTcpProxies.list",
  112525. // "parameterOrder": [
  112526. // "project"
  112527. // ],
  112528. // "parameters": {
  112529. // "filter": {
  112530. // "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).",
  112531. // "location": "query",
  112532. // "type": "string"
  112533. // },
  112534. // "maxResults": {
  112535. // "default": "500",
  112536. // "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)",
  112537. // "format": "uint32",
  112538. // "location": "query",
  112539. // "minimum": "0",
  112540. // "type": "integer"
  112541. // },
  112542. // "orderBy": {
  112543. // "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.",
  112544. // "location": "query",
  112545. // "type": "string"
  112546. // },
  112547. // "pageToken": {
  112548. // "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.",
  112549. // "location": "query",
  112550. // "type": "string"
  112551. // },
  112552. // "project": {
  112553. // "description": "Project ID for this request.",
  112554. // "location": "path",
  112555. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112556. // "required": true,
  112557. // "type": "string"
  112558. // }
  112559. // },
  112560. // "path": "{project}/global/targetTcpProxies",
  112561. // "response": {
  112562. // "$ref": "TargetTcpProxyList"
  112563. // },
  112564. // "scopes": [
  112565. // "https://www.googleapis.com/auth/cloud-platform",
  112566. // "https://www.googleapis.com/auth/compute",
  112567. // "https://www.googleapis.com/auth/compute.readonly"
  112568. // ]
  112569. // }
  112570. }
  112571. // Pages invokes f for each page of results.
  112572. // A non-nil error returned from f will halt the iteration.
  112573. // The provided context supersedes any context provided to the Context method.
  112574. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  112575. c.ctx_ = ctx
  112576. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  112577. for {
  112578. x, err := c.Do()
  112579. if err != nil {
  112580. return err
  112581. }
  112582. if err := f(x); err != nil {
  112583. return err
  112584. }
  112585. if x.NextPageToken == "" {
  112586. return nil
  112587. }
  112588. c.PageToken(x.NextPageToken)
  112589. }
  112590. }
  112591. // method id "compute.targetTcpProxies.setBackendService":
  112592. type TargetTcpProxiesSetBackendServiceCall struct {
  112593. s *Service
  112594. project string
  112595. targetTcpProxy string
  112596. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  112597. urlParams_ gensupport.URLParams
  112598. ctx_ context.Context
  112599. header_ http.Header
  112600. }
  112601. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  112602. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  112603. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112604. c.project = project
  112605. c.targetTcpProxy = targetTcpProxy
  112606. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  112607. return c
  112608. }
  112609. // RequestId sets the optional parameter "requestId": An optional
  112610. // request ID to identify requests. Specify a unique request ID so that
  112611. // if you must retry your request, the server will know to ignore the
  112612. // request if it has already been completed.
  112613. //
  112614. // For example, consider a situation where you make an initial request
  112615. // and the request times out. If you make the request again with the
  112616. // same request ID, the server can check if original operation with the
  112617. // same request ID was received, and if so, will ignore the second
  112618. // request. This prevents clients from accidentally creating duplicate
  112619. // commitments.
  112620. //
  112621. // The request ID must be a valid UUID with the exception that zero UUID
  112622. // is not supported (00000000-0000-0000-0000-000000000000).
  112623. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  112624. c.urlParams_.Set("requestId", requestId)
  112625. return c
  112626. }
  112627. // Fields allows partial responses to be retrieved. See
  112628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112629. // for more information.
  112630. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  112631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112632. return c
  112633. }
  112634. // Context sets the context to be used in this call's Do method. Any
  112635. // pending HTTP request will be aborted if the provided context is
  112636. // canceled.
  112637. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  112638. c.ctx_ = ctx
  112639. return c
  112640. }
  112641. // Header returns an http.Header that can be modified by the caller to
  112642. // add HTTP headers to the request.
  112643. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  112644. if c.header_ == nil {
  112645. c.header_ = make(http.Header)
  112646. }
  112647. return c.header_
  112648. }
  112649. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  112650. reqHeaders := make(http.Header)
  112651. for k, v := range c.header_ {
  112652. reqHeaders[k] = v
  112653. }
  112654. reqHeaders.Set("User-Agent", c.s.userAgent())
  112655. var body io.Reader = nil
  112656. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  112657. if err != nil {
  112658. return nil, err
  112659. }
  112660. reqHeaders.Set("Content-Type", "application/json")
  112661. c.urlParams_.Set("alt", alt)
  112662. c.urlParams_.Set("prettyPrint", "false")
  112663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  112664. urls += "?" + c.urlParams_.Encode()
  112665. req, err := http.NewRequest("POST", urls, body)
  112666. if err != nil {
  112667. return nil, err
  112668. }
  112669. req.Header = reqHeaders
  112670. googleapi.Expand(req.URL, map[string]string{
  112671. "project": c.project,
  112672. "targetTcpProxy": c.targetTcpProxy,
  112673. })
  112674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112675. }
  112676. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  112677. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112678. // status code is an error. Response headers are in either
  112679. // *Operation.ServerResponse.Header or (if a response was returned at
  112680. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112681. // to check whether the returned error was because
  112682. // http.StatusNotModified was returned.
  112683. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112684. gensupport.SetOptions(c.urlParams_, opts...)
  112685. res, err := c.doRequest("json")
  112686. if res != nil && res.StatusCode == http.StatusNotModified {
  112687. if res.Body != nil {
  112688. res.Body.Close()
  112689. }
  112690. return nil, &googleapi.Error{
  112691. Code: res.StatusCode,
  112692. Header: res.Header,
  112693. }
  112694. }
  112695. if err != nil {
  112696. return nil, err
  112697. }
  112698. defer googleapi.CloseBody(res)
  112699. if err := googleapi.CheckResponse(res); err != nil {
  112700. return nil, err
  112701. }
  112702. ret := &Operation{
  112703. ServerResponse: googleapi.ServerResponse{
  112704. Header: res.Header,
  112705. HTTPStatusCode: res.StatusCode,
  112706. },
  112707. }
  112708. target := &ret
  112709. if err := gensupport.DecodeResponse(target, res); err != nil {
  112710. return nil, err
  112711. }
  112712. return ret, nil
  112713. // {
  112714. // "description": "Changes the BackendService for TargetTcpProxy.",
  112715. // "httpMethod": "POST",
  112716. // "id": "compute.targetTcpProxies.setBackendService",
  112717. // "parameterOrder": [
  112718. // "project",
  112719. // "targetTcpProxy"
  112720. // ],
  112721. // "parameters": {
  112722. // "project": {
  112723. // "description": "Project ID for this request.",
  112724. // "location": "path",
  112725. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112726. // "required": true,
  112727. // "type": "string"
  112728. // },
  112729. // "requestId": {
  112730. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112731. // "location": "query",
  112732. // "type": "string"
  112733. // },
  112734. // "targetTcpProxy": {
  112735. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  112736. // "location": "path",
  112737. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112738. // "required": true,
  112739. // "type": "string"
  112740. // }
  112741. // },
  112742. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  112743. // "request": {
  112744. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  112745. // },
  112746. // "response": {
  112747. // "$ref": "Operation"
  112748. // },
  112749. // "scopes": [
  112750. // "https://www.googleapis.com/auth/cloud-platform",
  112751. // "https://www.googleapis.com/auth/compute"
  112752. // ]
  112753. // }
  112754. }
  112755. // method id "compute.targetTcpProxies.setProxyHeader":
  112756. type TargetTcpProxiesSetProxyHeaderCall struct {
  112757. s *Service
  112758. project string
  112759. targetTcpProxy string
  112760. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  112761. urlParams_ gensupport.URLParams
  112762. ctx_ context.Context
  112763. header_ http.Header
  112764. }
  112765. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  112766. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  112767. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112768. c.project = project
  112769. c.targetTcpProxy = targetTcpProxy
  112770. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  112771. return c
  112772. }
  112773. // RequestId sets the optional parameter "requestId": An optional
  112774. // request ID to identify requests. Specify a unique request ID so that
  112775. // if you must retry your request, the server will know to ignore the
  112776. // request if it has already been completed.
  112777. //
  112778. // For example, consider a situation where you make an initial request
  112779. // and the request times out. If you make the request again with the
  112780. // same request ID, the server can check if original operation with the
  112781. // same request ID was received, and if so, will ignore the second
  112782. // request. This prevents clients from accidentally creating duplicate
  112783. // commitments.
  112784. //
  112785. // The request ID must be a valid UUID with the exception that zero UUID
  112786. // is not supported (00000000-0000-0000-0000-000000000000).
  112787. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  112788. c.urlParams_.Set("requestId", requestId)
  112789. return c
  112790. }
  112791. // Fields allows partial responses to be retrieved. See
  112792. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112793. // for more information.
  112794. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  112795. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112796. return c
  112797. }
  112798. // Context sets the context to be used in this call's Do method. Any
  112799. // pending HTTP request will be aborted if the provided context is
  112800. // canceled.
  112801. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  112802. c.ctx_ = ctx
  112803. return c
  112804. }
  112805. // Header returns an http.Header that can be modified by the caller to
  112806. // add HTTP headers to the request.
  112807. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  112808. if c.header_ == nil {
  112809. c.header_ = make(http.Header)
  112810. }
  112811. return c.header_
  112812. }
  112813. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  112814. reqHeaders := make(http.Header)
  112815. for k, v := range c.header_ {
  112816. reqHeaders[k] = v
  112817. }
  112818. reqHeaders.Set("User-Agent", c.s.userAgent())
  112819. var body io.Reader = nil
  112820. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  112821. if err != nil {
  112822. return nil, err
  112823. }
  112824. reqHeaders.Set("Content-Type", "application/json")
  112825. c.urlParams_.Set("alt", alt)
  112826. c.urlParams_.Set("prettyPrint", "false")
  112827. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  112828. urls += "?" + c.urlParams_.Encode()
  112829. req, err := http.NewRequest("POST", urls, body)
  112830. if err != nil {
  112831. return nil, err
  112832. }
  112833. req.Header = reqHeaders
  112834. googleapi.Expand(req.URL, map[string]string{
  112835. "project": c.project,
  112836. "targetTcpProxy": c.targetTcpProxy,
  112837. })
  112838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112839. }
  112840. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  112841. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112842. // status code is an error. Response headers are in either
  112843. // *Operation.ServerResponse.Header or (if a response was returned at
  112844. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112845. // to check whether the returned error was because
  112846. // http.StatusNotModified was returned.
  112847. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112848. gensupport.SetOptions(c.urlParams_, opts...)
  112849. res, err := c.doRequest("json")
  112850. if res != nil && res.StatusCode == http.StatusNotModified {
  112851. if res.Body != nil {
  112852. res.Body.Close()
  112853. }
  112854. return nil, &googleapi.Error{
  112855. Code: res.StatusCode,
  112856. Header: res.Header,
  112857. }
  112858. }
  112859. if err != nil {
  112860. return nil, err
  112861. }
  112862. defer googleapi.CloseBody(res)
  112863. if err := googleapi.CheckResponse(res); err != nil {
  112864. return nil, err
  112865. }
  112866. ret := &Operation{
  112867. ServerResponse: googleapi.ServerResponse{
  112868. Header: res.Header,
  112869. HTTPStatusCode: res.StatusCode,
  112870. },
  112871. }
  112872. target := &ret
  112873. if err := gensupport.DecodeResponse(target, res); err != nil {
  112874. return nil, err
  112875. }
  112876. return ret, nil
  112877. // {
  112878. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  112879. // "httpMethod": "POST",
  112880. // "id": "compute.targetTcpProxies.setProxyHeader",
  112881. // "parameterOrder": [
  112882. // "project",
  112883. // "targetTcpProxy"
  112884. // ],
  112885. // "parameters": {
  112886. // "project": {
  112887. // "description": "Project ID for this request.",
  112888. // "location": "path",
  112889. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112890. // "required": true,
  112891. // "type": "string"
  112892. // },
  112893. // "requestId": {
  112894. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112895. // "location": "query",
  112896. // "type": "string"
  112897. // },
  112898. // "targetTcpProxy": {
  112899. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  112900. // "location": "path",
  112901. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112902. // "required": true,
  112903. // "type": "string"
  112904. // }
  112905. // },
  112906. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  112907. // "request": {
  112908. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  112909. // },
  112910. // "response": {
  112911. // "$ref": "Operation"
  112912. // },
  112913. // "scopes": [
  112914. // "https://www.googleapis.com/auth/cloud-platform",
  112915. // "https://www.googleapis.com/auth/compute"
  112916. // ]
  112917. // }
  112918. }
  112919. // method id "compute.targetVpnGateways.aggregatedList":
  112920. type TargetVpnGatewaysAggregatedListCall struct {
  112921. s *Service
  112922. project string
  112923. urlParams_ gensupport.URLParams
  112924. ifNoneMatch_ string
  112925. ctx_ context.Context
  112926. header_ http.Header
  112927. }
  112928. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  112929. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  112930. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112931. c.project = project
  112932. return c
  112933. }
  112934. // Filter sets the optional parameter "filter": A filter expression that
  112935. // filters resources listed in the response. The expression must specify
  112936. // the field name, a comparison operator, and the value that you want to
  112937. // use for filtering. The value must be a string, a number, or a
  112938. // boolean. The comparison operator must be either =, !=, >, or <.
  112939. //
  112940. // For example, if you are filtering Compute Engine instances, you can
  112941. // exclude instances named example-instance by specifying name !=
  112942. // example-instance.
  112943. //
  112944. // You can also filter nested fields. For example, you could specify
  112945. // scheduling.automaticRestart = false to include instances only if they
  112946. // are not scheduled for automatic restarts. You can use filtering on
  112947. // nested fields to filter based on resource labels.
  112948. //
  112949. // To filter on multiple expressions, provide each separate expression
  112950. // within parentheses. For example, (scheduling.automaticRestart = true)
  112951. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  112952. // AND expression. However, you can include AND and OR expressions
  112953. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  112954. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  112955. // true).
  112956. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  112957. c.urlParams_.Set("filter", filter)
  112958. return c
  112959. }
  112960. // MaxResults sets the optional parameter "maxResults": The maximum
  112961. // number of results per page that should be returned. If the number of
  112962. // available results is larger than maxResults, Compute Engine returns a
  112963. // nextPageToken that can be used to get the next page of results in
  112964. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  112965. // (Default: 500)
  112966. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  112967. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  112968. return c
  112969. }
  112970. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  112971. // a certain order. By default, results are returned in alphanumerical
  112972. // order based on the resource name.
  112973. //
  112974. // You can also sort results in descending order based on the creation
  112975. // timestamp using orderBy="creationTimestamp desc". This sorts results
  112976. // based on the creationTimestamp field in reverse chronological order
  112977. // (newest result first). Use this to sort resources like operations so
  112978. // that the newest operation is returned first.
  112979. //
  112980. // Currently, only sorting by name or creationTimestamp desc is
  112981. // supported.
  112982. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  112983. c.urlParams_.Set("orderBy", orderBy)
  112984. return c
  112985. }
  112986. // PageToken sets the optional parameter "pageToken": Specifies a page
  112987. // token to use. Set pageToken to the nextPageToken returned by a
  112988. // previous list request to get the next page of results.
  112989. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  112990. c.urlParams_.Set("pageToken", pageToken)
  112991. return c
  112992. }
  112993. // Fields allows partial responses to be retrieved. See
  112994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112995. // for more information.
  112996. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  112997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112998. return c
  112999. }
  113000. // IfNoneMatch sets the optional parameter which makes the operation
  113001. // fail if the object's ETag matches the given value. This is useful for
  113002. // getting updates only after the object has changed since the last
  113003. // request. Use googleapi.IsNotModified to check whether the response
  113004. // error from Do is the result of In-None-Match.
  113005. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  113006. c.ifNoneMatch_ = entityTag
  113007. return c
  113008. }
  113009. // Context sets the context to be used in this call's Do method. Any
  113010. // pending HTTP request will be aborted if the provided context is
  113011. // canceled.
  113012. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  113013. c.ctx_ = ctx
  113014. return c
  113015. }
  113016. // Header returns an http.Header that can be modified by the caller to
  113017. // add HTTP headers to the request.
  113018. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  113019. if c.header_ == nil {
  113020. c.header_ = make(http.Header)
  113021. }
  113022. return c.header_
  113023. }
  113024. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  113025. reqHeaders := make(http.Header)
  113026. for k, v := range c.header_ {
  113027. reqHeaders[k] = v
  113028. }
  113029. reqHeaders.Set("User-Agent", c.s.userAgent())
  113030. if c.ifNoneMatch_ != "" {
  113031. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113032. }
  113033. var body io.Reader = nil
  113034. c.urlParams_.Set("alt", alt)
  113035. c.urlParams_.Set("prettyPrint", "false")
  113036. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  113037. urls += "?" + c.urlParams_.Encode()
  113038. req, err := http.NewRequest("GET", urls, body)
  113039. if err != nil {
  113040. return nil, err
  113041. }
  113042. req.Header = reqHeaders
  113043. googleapi.Expand(req.URL, map[string]string{
  113044. "project": c.project,
  113045. })
  113046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113047. }
  113048. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  113049. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  113050. // non-nil. Any non-2xx status code is an error. Response headers are in
  113051. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  113052. // response was returned at all) in error.(*googleapi.Error).Header. Use
  113053. // googleapi.IsNotModified to check whether the returned error was
  113054. // because http.StatusNotModified was returned.
  113055. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  113056. gensupport.SetOptions(c.urlParams_, opts...)
  113057. res, err := c.doRequest("json")
  113058. if res != nil && res.StatusCode == http.StatusNotModified {
  113059. if res.Body != nil {
  113060. res.Body.Close()
  113061. }
  113062. return nil, &googleapi.Error{
  113063. Code: res.StatusCode,
  113064. Header: res.Header,
  113065. }
  113066. }
  113067. if err != nil {
  113068. return nil, err
  113069. }
  113070. defer googleapi.CloseBody(res)
  113071. if err := googleapi.CheckResponse(res); err != nil {
  113072. return nil, err
  113073. }
  113074. ret := &TargetVpnGatewayAggregatedList{
  113075. ServerResponse: googleapi.ServerResponse{
  113076. Header: res.Header,
  113077. HTTPStatusCode: res.StatusCode,
  113078. },
  113079. }
  113080. target := &ret
  113081. if err := gensupport.DecodeResponse(target, res); err != nil {
  113082. return nil, err
  113083. }
  113084. return ret, nil
  113085. // {
  113086. // "description": "Retrieves an aggregated list of target VPN gateways.",
  113087. // "httpMethod": "GET",
  113088. // "id": "compute.targetVpnGateways.aggregatedList",
  113089. // "parameterOrder": [
  113090. // "project"
  113091. // ],
  113092. // "parameters": {
  113093. // "filter": {
  113094. // "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).",
  113095. // "location": "query",
  113096. // "type": "string"
  113097. // },
  113098. // "maxResults": {
  113099. // "default": "500",
  113100. // "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)",
  113101. // "format": "uint32",
  113102. // "location": "query",
  113103. // "minimum": "0",
  113104. // "type": "integer"
  113105. // },
  113106. // "orderBy": {
  113107. // "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.",
  113108. // "location": "query",
  113109. // "type": "string"
  113110. // },
  113111. // "pageToken": {
  113112. // "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.",
  113113. // "location": "query",
  113114. // "type": "string"
  113115. // },
  113116. // "project": {
  113117. // "description": "Project ID for this request.",
  113118. // "location": "path",
  113119. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113120. // "required": true,
  113121. // "type": "string"
  113122. // }
  113123. // },
  113124. // "path": "{project}/aggregated/targetVpnGateways",
  113125. // "response": {
  113126. // "$ref": "TargetVpnGatewayAggregatedList"
  113127. // },
  113128. // "scopes": [
  113129. // "https://www.googleapis.com/auth/cloud-platform",
  113130. // "https://www.googleapis.com/auth/compute",
  113131. // "https://www.googleapis.com/auth/compute.readonly"
  113132. // ]
  113133. // }
  113134. }
  113135. // Pages invokes f for each page of results.
  113136. // A non-nil error returned from f will halt the iteration.
  113137. // The provided context supersedes any context provided to the Context method.
  113138. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  113139. c.ctx_ = ctx
  113140. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  113141. for {
  113142. x, err := c.Do()
  113143. if err != nil {
  113144. return err
  113145. }
  113146. if err := f(x); err != nil {
  113147. return err
  113148. }
  113149. if x.NextPageToken == "" {
  113150. return nil
  113151. }
  113152. c.PageToken(x.NextPageToken)
  113153. }
  113154. }
  113155. // method id "compute.targetVpnGateways.delete":
  113156. type TargetVpnGatewaysDeleteCall struct {
  113157. s *Service
  113158. project string
  113159. region string
  113160. targetVpnGateway string
  113161. urlParams_ gensupport.URLParams
  113162. ctx_ context.Context
  113163. header_ http.Header
  113164. }
  113165. // Delete: Deletes the specified target VPN gateway.
  113166. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  113167. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113168. c.project = project
  113169. c.region = region
  113170. c.targetVpnGateway = targetVpnGateway
  113171. return c
  113172. }
  113173. // RequestId sets the optional parameter "requestId": An optional
  113174. // request ID to identify requests. Specify a unique request ID so that
  113175. // if you must retry your request, the server will know to ignore the
  113176. // request if it has already been completed.
  113177. //
  113178. // For example, consider a situation where you make an initial request
  113179. // and the request times out. If you make the request again with the
  113180. // same request ID, the server can check if original operation with the
  113181. // same request ID was received, and if so, will ignore the second
  113182. // request. This prevents clients from accidentally creating duplicate
  113183. // commitments.
  113184. //
  113185. // The request ID must be a valid UUID with the exception that zero UUID
  113186. // is not supported (00000000-0000-0000-0000-000000000000).
  113187. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  113188. c.urlParams_.Set("requestId", requestId)
  113189. return c
  113190. }
  113191. // Fields allows partial responses to be retrieved. See
  113192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113193. // for more information.
  113194. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  113195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113196. return c
  113197. }
  113198. // Context sets the context to be used in this call's Do method. Any
  113199. // pending HTTP request will be aborted if the provided context is
  113200. // canceled.
  113201. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  113202. c.ctx_ = ctx
  113203. return c
  113204. }
  113205. // Header returns an http.Header that can be modified by the caller to
  113206. // add HTTP headers to the request.
  113207. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  113208. if c.header_ == nil {
  113209. c.header_ = make(http.Header)
  113210. }
  113211. return c.header_
  113212. }
  113213. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  113214. reqHeaders := make(http.Header)
  113215. for k, v := range c.header_ {
  113216. reqHeaders[k] = v
  113217. }
  113218. reqHeaders.Set("User-Agent", c.s.userAgent())
  113219. var body io.Reader = nil
  113220. c.urlParams_.Set("alt", alt)
  113221. c.urlParams_.Set("prettyPrint", "false")
  113222. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  113223. urls += "?" + c.urlParams_.Encode()
  113224. req, err := http.NewRequest("DELETE", urls, body)
  113225. if err != nil {
  113226. return nil, err
  113227. }
  113228. req.Header = reqHeaders
  113229. googleapi.Expand(req.URL, map[string]string{
  113230. "project": c.project,
  113231. "region": c.region,
  113232. "targetVpnGateway": c.targetVpnGateway,
  113233. })
  113234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113235. }
  113236. // Do executes the "compute.targetVpnGateways.delete" call.
  113237. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113238. // status code is an error. Response headers are in either
  113239. // *Operation.ServerResponse.Header or (if a response was returned at
  113240. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113241. // to check whether the returned error was because
  113242. // http.StatusNotModified was returned.
  113243. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113244. gensupport.SetOptions(c.urlParams_, opts...)
  113245. res, err := c.doRequest("json")
  113246. if res != nil && res.StatusCode == http.StatusNotModified {
  113247. if res.Body != nil {
  113248. res.Body.Close()
  113249. }
  113250. return nil, &googleapi.Error{
  113251. Code: res.StatusCode,
  113252. Header: res.Header,
  113253. }
  113254. }
  113255. if err != nil {
  113256. return nil, err
  113257. }
  113258. defer googleapi.CloseBody(res)
  113259. if err := googleapi.CheckResponse(res); err != nil {
  113260. return nil, err
  113261. }
  113262. ret := &Operation{
  113263. ServerResponse: googleapi.ServerResponse{
  113264. Header: res.Header,
  113265. HTTPStatusCode: res.StatusCode,
  113266. },
  113267. }
  113268. target := &ret
  113269. if err := gensupport.DecodeResponse(target, res); err != nil {
  113270. return nil, err
  113271. }
  113272. return ret, nil
  113273. // {
  113274. // "description": "Deletes the specified target VPN gateway.",
  113275. // "httpMethod": "DELETE",
  113276. // "id": "compute.targetVpnGateways.delete",
  113277. // "parameterOrder": [
  113278. // "project",
  113279. // "region",
  113280. // "targetVpnGateway"
  113281. // ],
  113282. // "parameters": {
  113283. // "project": {
  113284. // "description": "Project ID for this request.",
  113285. // "location": "path",
  113286. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113287. // "required": true,
  113288. // "type": "string"
  113289. // },
  113290. // "region": {
  113291. // "description": "Name of the region for this request.",
  113292. // "location": "path",
  113293. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113294. // "required": true,
  113295. // "type": "string"
  113296. // },
  113297. // "requestId": {
  113298. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113299. // "location": "query",
  113300. // "type": "string"
  113301. // },
  113302. // "targetVpnGateway": {
  113303. // "description": "Name of the target VPN gateway to delete.",
  113304. // "location": "path",
  113305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113306. // "required": true,
  113307. // "type": "string"
  113308. // }
  113309. // },
  113310. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  113311. // "response": {
  113312. // "$ref": "Operation"
  113313. // },
  113314. // "scopes": [
  113315. // "https://www.googleapis.com/auth/cloud-platform",
  113316. // "https://www.googleapis.com/auth/compute"
  113317. // ]
  113318. // }
  113319. }
  113320. // method id "compute.targetVpnGateways.get":
  113321. type TargetVpnGatewaysGetCall struct {
  113322. s *Service
  113323. project string
  113324. region string
  113325. targetVpnGateway string
  113326. urlParams_ gensupport.URLParams
  113327. ifNoneMatch_ string
  113328. ctx_ context.Context
  113329. header_ http.Header
  113330. }
  113331. // Get: Returns the specified target VPN gateway. Gets a list of
  113332. // available target VPN gateways by making a list() request.
  113333. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  113334. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113335. c.project = project
  113336. c.region = region
  113337. c.targetVpnGateway = targetVpnGateway
  113338. return c
  113339. }
  113340. // Fields allows partial responses to be retrieved. See
  113341. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113342. // for more information.
  113343. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  113344. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113345. return c
  113346. }
  113347. // IfNoneMatch sets the optional parameter which makes the operation
  113348. // fail if the object's ETag matches the given value. This is useful for
  113349. // getting updates only after the object has changed since the last
  113350. // request. Use googleapi.IsNotModified to check whether the response
  113351. // error from Do is the result of In-None-Match.
  113352. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  113353. c.ifNoneMatch_ = entityTag
  113354. return c
  113355. }
  113356. // Context sets the context to be used in this call's Do method. Any
  113357. // pending HTTP request will be aborted if the provided context is
  113358. // canceled.
  113359. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  113360. c.ctx_ = ctx
  113361. return c
  113362. }
  113363. // Header returns an http.Header that can be modified by the caller to
  113364. // add HTTP headers to the request.
  113365. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  113366. if c.header_ == nil {
  113367. c.header_ = make(http.Header)
  113368. }
  113369. return c.header_
  113370. }
  113371. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  113372. reqHeaders := make(http.Header)
  113373. for k, v := range c.header_ {
  113374. reqHeaders[k] = v
  113375. }
  113376. reqHeaders.Set("User-Agent", c.s.userAgent())
  113377. if c.ifNoneMatch_ != "" {
  113378. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113379. }
  113380. var body io.Reader = nil
  113381. c.urlParams_.Set("alt", alt)
  113382. c.urlParams_.Set("prettyPrint", "false")
  113383. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  113384. urls += "?" + c.urlParams_.Encode()
  113385. req, err := http.NewRequest("GET", urls, body)
  113386. if err != nil {
  113387. return nil, err
  113388. }
  113389. req.Header = reqHeaders
  113390. googleapi.Expand(req.URL, map[string]string{
  113391. "project": c.project,
  113392. "region": c.region,
  113393. "targetVpnGateway": c.targetVpnGateway,
  113394. })
  113395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113396. }
  113397. // Do executes the "compute.targetVpnGateways.get" call.
  113398. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  113399. // non-2xx status code is an error. Response headers are in either
  113400. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  113401. // returned at all) in error.(*googleapi.Error).Header. Use
  113402. // googleapi.IsNotModified to check whether the returned error was
  113403. // because http.StatusNotModified was returned.
  113404. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  113405. gensupport.SetOptions(c.urlParams_, opts...)
  113406. res, err := c.doRequest("json")
  113407. if res != nil && res.StatusCode == http.StatusNotModified {
  113408. if res.Body != nil {
  113409. res.Body.Close()
  113410. }
  113411. return nil, &googleapi.Error{
  113412. Code: res.StatusCode,
  113413. Header: res.Header,
  113414. }
  113415. }
  113416. if err != nil {
  113417. return nil, err
  113418. }
  113419. defer googleapi.CloseBody(res)
  113420. if err := googleapi.CheckResponse(res); err != nil {
  113421. return nil, err
  113422. }
  113423. ret := &TargetVpnGateway{
  113424. ServerResponse: googleapi.ServerResponse{
  113425. Header: res.Header,
  113426. HTTPStatusCode: res.StatusCode,
  113427. },
  113428. }
  113429. target := &ret
  113430. if err := gensupport.DecodeResponse(target, res); err != nil {
  113431. return nil, err
  113432. }
  113433. return ret, nil
  113434. // {
  113435. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  113436. // "httpMethod": "GET",
  113437. // "id": "compute.targetVpnGateways.get",
  113438. // "parameterOrder": [
  113439. // "project",
  113440. // "region",
  113441. // "targetVpnGateway"
  113442. // ],
  113443. // "parameters": {
  113444. // "project": {
  113445. // "description": "Project ID for this request.",
  113446. // "location": "path",
  113447. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113448. // "required": true,
  113449. // "type": "string"
  113450. // },
  113451. // "region": {
  113452. // "description": "Name of the region for this request.",
  113453. // "location": "path",
  113454. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113455. // "required": true,
  113456. // "type": "string"
  113457. // },
  113458. // "targetVpnGateway": {
  113459. // "description": "Name of the target VPN gateway to return.",
  113460. // "location": "path",
  113461. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113462. // "required": true,
  113463. // "type": "string"
  113464. // }
  113465. // },
  113466. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  113467. // "response": {
  113468. // "$ref": "TargetVpnGateway"
  113469. // },
  113470. // "scopes": [
  113471. // "https://www.googleapis.com/auth/cloud-platform",
  113472. // "https://www.googleapis.com/auth/compute",
  113473. // "https://www.googleapis.com/auth/compute.readonly"
  113474. // ]
  113475. // }
  113476. }
  113477. // method id "compute.targetVpnGateways.insert":
  113478. type TargetVpnGatewaysInsertCall struct {
  113479. s *Service
  113480. project string
  113481. region string
  113482. targetvpngateway *TargetVpnGateway
  113483. urlParams_ gensupport.URLParams
  113484. ctx_ context.Context
  113485. header_ http.Header
  113486. }
  113487. // Insert: Creates a target VPN gateway in the specified project and
  113488. // region using the data included in the request.
  113489. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  113490. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113491. c.project = project
  113492. c.region = region
  113493. c.targetvpngateway = targetvpngateway
  113494. return c
  113495. }
  113496. // RequestId sets the optional parameter "requestId": An optional
  113497. // request ID to identify requests. Specify a unique request ID so that
  113498. // if you must retry your request, the server will know to ignore the
  113499. // request if it has already been completed.
  113500. //
  113501. // For example, consider a situation where you make an initial request
  113502. // and the request times out. If you make the request again with the
  113503. // same request ID, the server can check if original operation with the
  113504. // same request ID was received, and if so, will ignore the second
  113505. // request. This prevents clients from accidentally creating duplicate
  113506. // commitments.
  113507. //
  113508. // The request ID must be a valid UUID with the exception that zero UUID
  113509. // is not supported (00000000-0000-0000-0000-000000000000).
  113510. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  113511. c.urlParams_.Set("requestId", requestId)
  113512. return c
  113513. }
  113514. // Fields allows partial responses to be retrieved. See
  113515. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113516. // for more information.
  113517. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  113518. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113519. return c
  113520. }
  113521. // Context sets the context to be used in this call's Do method. Any
  113522. // pending HTTP request will be aborted if the provided context is
  113523. // canceled.
  113524. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  113525. c.ctx_ = ctx
  113526. return c
  113527. }
  113528. // Header returns an http.Header that can be modified by the caller to
  113529. // add HTTP headers to the request.
  113530. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  113531. if c.header_ == nil {
  113532. c.header_ = make(http.Header)
  113533. }
  113534. return c.header_
  113535. }
  113536. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  113537. reqHeaders := make(http.Header)
  113538. for k, v := range c.header_ {
  113539. reqHeaders[k] = v
  113540. }
  113541. reqHeaders.Set("User-Agent", c.s.userAgent())
  113542. var body io.Reader = nil
  113543. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  113544. if err != nil {
  113545. return nil, err
  113546. }
  113547. reqHeaders.Set("Content-Type", "application/json")
  113548. c.urlParams_.Set("alt", alt)
  113549. c.urlParams_.Set("prettyPrint", "false")
  113550. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  113551. urls += "?" + c.urlParams_.Encode()
  113552. req, err := http.NewRequest("POST", urls, body)
  113553. if err != nil {
  113554. return nil, err
  113555. }
  113556. req.Header = reqHeaders
  113557. googleapi.Expand(req.URL, map[string]string{
  113558. "project": c.project,
  113559. "region": c.region,
  113560. })
  113561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113562. }
  113563. // Do executes the "compute.targetVpnGateways.insert" call.
  113564. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113565. // status code is an error. Response headers are in either
  113566. // *Operation.ServerResponse.Header or (if a response was returned at
  113567. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113568. // to check whether the returned error was because
  113569. // http.StatusNotModified was returned.
  113570. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113571. gensupport.SetOptions(c.urlParams_, opts...)
  113572. res, err := c.doRequest("json")
  113573. if res != nil && res.StatusCode == http.StatusNotModified {
  113574. if res.Body != nil {
  113575. res.Body.Close()
  113576. }
  113577. return nil, &googleapi.Error{
  113578. Code: res.StatusCode,
  113579. Header: res.Header,
  113580. }
  113581. }
  113582. if err != nil {
  113583. return nil, err
  113584. }
  113585. defer googleapi.CloseBody(res)
  113586. if err := googleapi.CheckResponse(res); err != nil {
  113587. return nil, err
  113588. }
  113589. ret := &Operation{
  113590. ServerResponse: googleapi.ServerResponse{
  113591. Header: res.Header,
  113592. HTTPStatusCode: res.StatusCode,
  113593. },
  113594. }
  113595. target := &ret
  113596. if err := gensupport.DecodeResponse(target, res); err != nil {
  113597. return nil, err
  113598. }
  113599. return ret, nil
  113600. // {
  113601. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  113602. // "httpMethod": "POST",
  113603. // "id": "compute.targetVpnGateways.insert",
  113604. // "parameterOrder": [
  113605. // "project",
  113606. // "region"
  113607. // ],
  113608. // "parameters": {
  113609. // "project": {
  113610. // "description": "Project ID for this request.",
  113611. // "location": "path",
  113612. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113613. // "required": true,
  113614. // "type": "string"
  113615. // },
  113616. // "region": {
  113617. // "description": "Name of the region for this request.",
  113618. // "location": "path",
  113619. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113620. // "required": true,
  113621. // "type": "string"
  113622. // },
  113623. // "requestId": {
  113624. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113625. // "location": "query",
  113626. // "type": "string"
  113627. // }
  113628. // },
  113629. // "path": "{project}/regions/{region}/targetVpnGateways",
  113630. // "request": {
  113631. // "$ref": "TargetVpnGateway"
  113632. // },
  113633. // "response": {
  113634. // "$ref": "Operation"
  113635. // },
  113636. // "scopes": [
  113637. // "https://www.googleapis.com/auth/cloud-platform",
  113638. // "https://www.googleapis.com/auth/compute"
  113639. // ]
  113640. // }
  113641. }
  113642. // method id "compute.targetVpnGateways.list":
  113643. type TargetVpnGatewaysListCall struct {
  113644. s *Service
  113645. project string
  113646. region string
  113647. urlParams_ gensupport.URLParams
  113648. ifNoneMatch_ string
  113649. ctx_ context.Context
  113650. header_ http.Header
  113651. }
  113652. // List: Retrieves a list of target VPN gateways available to the
  113653. // specified project and region.
  113654. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  113655. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113656. c.project = project
  113657. c.region = region
  113658. return c
  113659. }
  113660. // Filter sets the optional parameter "filter": A filter expression that
  113661. // filters resources listed in the response. The expression must specify
  113662. // the field name, a comparison operator, and the value that you want to
  113663. // use for filtering. The value must be a string, a number, or a
  113664. // boolean. The comparison operator must be either =, !=, >, or <.
  113665. //
  113666. // For example, if you are filtering Compute Engine instances, you can
  113667. // exclude instances named example-instance by specifying name !=
  113668. // example-instance.
  113669. //
  113670. // You can also filter nested fields. For example, you could specify
  113671. // scheduling.automaticRestart = false to include instances only if they
  113672. // are not scheduled for automatic restarts. You can use filtering on
  113673. // nested fields to filter based on resource labels.
  113674. //
  113675. // To filter on multiple expressions, provide each separate expression
  113676. // within parentheses. For example, (scheduling.automaticRestart = true)
  113677. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  113678. // AND expression. However, you can include AND and OR expressions
  113679. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  113680. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  113681. // true).
  113682. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  113683. c.urlParams_.Set("filter", filter)
  113684. return c
  113685. }
  113686. // MaxResults sets the optional parameter "maxResults": The maximum
  113687. // number of results per page that should be returned. If the number of
  113688. // available results is larger than maxResults, Compute Engine returns a
  113689. // nextPageToken that can be used to get the next page of results in
  113690. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  113691. // (Default: 500)
  113692. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  113693. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  113694. return c
  113695. }
  113696. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  113697. // a certain order. By default, results are returned in alphanumerical
  113698. // order based on the resource name.
  113699. //
  113700. // You can also sort results in descending order based on the creation
  113701. // timestamp using orderBy="creationTimestamp desc". This sorts results
  113702. // based on the creationTimestamp field in reverse chronological order
  113703. // (newest result first). Use this to sort resources like operations so
  113704. // that the newest operation is returned first.
  113705. //
  113706. // Currently, only sorting by name or creationTimestamp desc is
  113707. // supported.
  113708. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  113709. c.urlParams_.Set("orderBy", orderBy)
  113710. return c
  113711. }
  113712. // PageToken sets the optional parameter "pageToken": Specifies a page
  113713. // token to use. Set pageToken to the nextPageToken returned by a
  113714. // previous list request to get the next page of results.
  113715. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  113716. c.urlParams_.Set("pageToken", pageToken)
  113717. return c
  113718. }
  113719. // Fields allows partial responses to be retrieved. See
  113720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113721. // for more information.
  113722. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  113723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113724. return c
  113725. }
  113726. // IfNoneMatch sets the optional parameter which makes the operation
  113727. // fail if the object's ETag matches the given value. This is useful for
  113728. // getting updates only after the object has changed since the last
  113729. // request. Use googleapi.IsNotModified to check whether the response
  113730. // error from Do is the result of In-None-Match.
  113731. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  113732. c.ifNoneMatch_ = entityTag
  113733. return c
  113734. }
  113735. // Context sets the context to be used in this call's Do method. Any
  113736. // pending HTTP request will be aborted if the provided context is
  113737. // canceled.
  113738. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  113739. c.ctx_ = ctx
  113740. return c
  113741. }
  113742. // Header returns an http.Header that can be modified by the caller to
  113743. // add HTTP headers to the request.
  113744. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  113745. if c.header_ == nil {
  113746. c.header_ = make(http.Header)
  113747. }
  113748. return c.header_
  113749. }
  113750. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  113751. reqHeaders := make(http.Header)
  113752. for k, v := range c.header_ {
  113753. reqHeaders[k] = v
  113754. }
  113755. reqHeaders.Set("User-Agent", c.s.userAgent())
  113756. if c.ifNoneMatch_ != "" {
  113757. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113758. }
  113759. var body io.Reader = nil
  113760. c.urlParams_.Set("alt", alt)
  113761. c.urlParams_.Set("prettyPrint", "false")
  113762. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  113763. urls += "?" + c.urlParams_.Encode()
  113764. req, err := http.NewRequest("GET", urls, body)
  113765. if err != nil {
  113766. return nil, err
  113767. }
  113768. req.Header = reqHeaders
  113769. googleapi.Expand(req.URL, map[string]string{
  113770. "project": c.project,
  113771. "region": c.region,
  113772. })
  113773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113774. }
  113775. // Do executes the "compute.targetVpnGateways.list" call.
  113776. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  113777. // non-2xx status code is an error. Response headers are in either
  113778. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  113779. // returned at all) in error.(*googleapi.Error).Header. Use
  113780. // googleapi.IsNotModified to check whether the returned error was
  113781. // because http.StatusNotModified was returned.
  113782. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  113783. gensupport.SetOptions(c.urlParams_, opts...)
  113784. res, err := c.doRequest("json")
  113785. if res != nil && res.StatusCode == http.StatusNotModified {
  113786. if res.Body != nil {
  113787. res.Body.Close()
  113788. }
  113789. return nil, &googleapi.Error{
  113790. Code: res.StatusCode,
  113791. Header: res.Header,
  113792. }
  113793. }
  113794. if err != nil {
  113795. return nil, err
  113796. }
  113797. defer googleapi.CloseBody(res)
  113798. if err := googleapi.CheckResponse(res); err != nil {
  113799. return nil, err
  113800. }
  113801. ret := &TargetVpnGatewayList{
  113802. ServerResponse: googleapi.ServerResponse{
  113803. Header: res.Header,
  113804. HTTPStatusCode: res.StatusCode,
  113805. },
  113806. }
  113807. target := &ret
  113808. if err := gensupport.DecodeResponse(target, res); err != nil {
  113809. return nil, err
  113810. }
  113811. return ret, nil
  113812. // {
  113813. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  113814. // "httpMethod": "GET",
  113815. // "id": "compute.targetVpnGateways.list",
  113816. // "parameterOrder": [
  113817. // "project",
  113818. // "region"
  113819. // ],
  113820. // "parameters": {
  113821. // "filter": {
  113822. // "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).",
  113823. // "location": "query",
  113824. // "type": "string"
  113825. // },
  113826. // "maxResults": {
  113827. // "default": "500",
  113828. // "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)",
  113829. // "format": "uint32",
  113830. // "location": "query",
  113831. // "minimum": "0",
  113832. // "type": "integer"
  113833. // },
  113834. // "orderBy": {
  113835. // "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.",
  113836. // "location": "query",
  113837. // "type": "string"
  113838. // },
  113839. // "pageToken": {
  113840. // "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.",
  113841. // "location": "query",
  113842. // "type": "string"
  113843. // },
  113844. // "project": {
  113845. // "description": "Project ID for this request.",
  113846. // "location": "path",
  113847. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113848. // "required": true,
  113849. // "type": "string"
  113850. // },
  113851. // "region": {
  113852. // "description": "Name of the region for this request.",
  113853. // "location": "path",
  113854. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113855. // "required": true,
  113856. // "type": "string"
  113857. // }
  113858. // },
  113859. // "path": "{project}/regions/{region}/targetVpnGateways",
  113860. // "response": {
  113861. // "$ref": "TargetVpnGatewayList"
  113862. // },
  113863. // "scopes": [
  113864. // "https://www.googleapis.com/auth/cloud-platform",
  113865. // "https://www.googleapis.com/auth/compute",
  113866. // "https://www.googleapis.com/auth/compute.readonly"
  113867. // ]
  113868. // }
  113869. }
  113870. // Pages invokes f for each page of results.
  113871. // A non-nil error returned from f will halt the iteration.
  113872. // The provided context supersedes any context provided to the Context method.
  113873. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  113874. c.ctx_ = ctx
  113875. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  113876. for {
  113877. x, err := c.Do()
  113878. if err != nil {
  113879. return err
  113880. }
  113881. if err := f(x); err != nil {
  113882. return err
  113883. }
  113884. if x.NextPageToken == "" {
  113885. return nil
  113886. }
  113887. c.PageToken(x.NextPageToken)
  113888. }
  113889. }
  113890. // method id "compute.targetVpnGateways.setLabels":
  113891. type TargetVpnGatewaysSetLabelsCall struct {
  113892. s *Service
  113893. project string
  113894. region string
  113895. resource string
  113896. regionsetlabelsrequest *RegionSetLabelsRequest
  113897. urlParams_ gensupport.URLParams
  113898. ctx_ context.Context
  113899. header_ http.Header
  113900. }
  113901. // SetLabels: Sets the labels on a TargetVpnGateway. To learn more about
  113902. // labels, read the Labeling Resources documentation.
  113903. func (r *TargetVpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *TargetVpnGatewaysSetLabelsCall {
  113904. c := &TargetVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113905. c.project = project
  113906. c.region = region
  113907. c.resource = resource
  113908. c.regionsetlabelsrequest = regionsetlabelsrequest
  113909. return c
  113910. }
  113911. // RequestId sets the optional parameter "requestId": An optional
  113912. // request ID to identify requests. Specify a unique request ID so that
  113913. // if you must retry your request, the server will know to ignore the
  113914. // request if it has already been completed.
  113915. //
  113916. // For example, consider a situation where you make an initial request
  113917. // and the request times out. If you make the request again with the
  113918. // same request ID, the server can check if original operation with the
  113919. // same request ID was received, and if so, will ignore the second
  113920. // request. This prevents clients from accidentally creating duplicate
  113921. // commitments.
  113922. //
  113923. // The request ID must be a valid UUID with the exception that zero UUID
  113924. // is not supported (00000000-0000-0000-0000-000000000000).
  113925. func (c *TargetVpnGatewaysSetLabelsCall) RequestId(requestId string) *TargetVpnGatewaysSetLabelsCall {
  113926. c.urlParams_.Set("requestId", requestId)
  113927. return c
  113928. }
  113929. // Fields allows partial responses to be retrieved. See
  113930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113931. // for more information.
  113932. func (c *TargetVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysSetLabelsCall {
  113933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113934. return c
  113935. }
  113936. // Context sets the context to be used in this call's Do method. Any
  113937. // pending HTTP request will be aborted if the provided context is
  113938. // canceled.
  113939. func (c *TargetVpnGatewaysSetLabelsCall) Context(ctx context.Context) *TargetVpnGatewaysSetLabelsCall {
  113940. c.ctx_ = ctx
  113941. return c
  113942. }
  113943. // Header returns an http.Header that can be modified by the caller to
  113944. // add HTTP headers to the request.
  113945. func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header {
  113946. if c.header_ == nil {
  113947. c.header_ = make(http.Header)
  113948. }
  113949. return c.header_
  113950. }
  113951. func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  113952. reqHeaders := make(http.Header)
  113953. for k, v := range c.header_ {
  113954. reqHeaders[k] = v
  113955. }
  113956. reqHeaders.Set("User-Agent", c.s.userAgent())
  113957. var body io.Reader = nil
  113958. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  113959. if err != nil {
  113960. return nil, err
  113961. }
  113962. reqHeaders.Set("Content-Type", "application/json")
  113963. c.urlParams_.Set("alt", alt)
  113964. c.urlParams_.Set("prettyPrint", "false")
  113965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels")
  113966. urls += "?" + c.urlParams_.Encode()
  113967. req, err := http.NewRequest("POST", urls, body)
  113968. if err != nil {
  113969. return nil, err
  113970. }
  113971. req.Header = reqHeaders
  113972. googleapi.Expand(req.URL, map[string]string{
  113973. "project": c.project,
  113974. "region": c.region,
  113975. "resource": c.resource,
  113976. })
  113977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113978. }
  113979. // Do executes the "compute.targetVpnGateways.setLabels" call.
  113980. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113981. // status code is an error. Response headers are in either
  113982. // *Operation.ServerResponse.Header or (if a response was returned at
  113983. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113984. // to check whether the returned error was because
  113985. // http.StatusNotModified was returned.
  113986. func (c *TargetVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113987. gensupport.SetOptions(c.urlParams_, opts...)
  113988. res, err := c.doRequest("json")
  113989. if res != nil && res.StatusCode == http.StatusNotModified {
  113990. if res.Body != nil {
  113991. res.Body.Close()
  113992. }
  113993. return nil, &googleapi.Error{
  113994. Code: res.StatusCode,
  113995. Header: res.Header,
  113996. }
  113997. }
  113998. if err != nil {
  113999. return nil, err
  114000. }
  114001. defer googleapi.CloseBody(res)
  114002. if err := googleapi.CheckResponse(res); err != nil {
  114003. return nil, err
  114004. }
  114005. ret := &Operation{
  114006. ServerResponse: googleapi.ServerResponse{
  114007. Header: res.Header,
  114008. HTTPStatusCode: res.StatusCode,
  114009. },
  114010. }
  114011. target := &ret
  114012. if err := gensupport.DecodeResponse(target, res); err != nil {
  114013. return nil, err
  114014. }
  114015. return ret, nil
  114016. // {
  114017. // "description": "Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  114018. // "httpMethod": "POST",
  114019. // "id": "compute.targetVpnGateways.setLabels",
  114020. // "parameterOrder": [
  114021. // "project",
  114022. // "region",
  114023. // "resource"
  114024. // ],
  114025. // "parameters": {
  114026. // "project": {
  114027. // "description": "Project ID for this request.",
  114028. // "location": "path",
  114029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114030. // "required": true,
  114031. // "type": "string"
  114032. // },
  114033. // "region": {
  114034. // "description": "The region for this request.",
  114035. // "location": "path",
  114036. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114037. // "required": true,
  114038. // "type": "string"
  114039. // },
  114040. // "requestId": {
  114041. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114042. // "location": "query",
  114043. // "type": "string"
  114044. // },
  114045. // "resource": {
  114046. // "description": "Name or id of the resource for this request.",
  114047. // "location": "path",
  114048. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114049. // "required": true,
  114050. // "type": "string"
  114051. // }
  114052. // },
  114053. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels",
  114054. // "request": {
  114055. // "$ref": "RegionSetLabelsRequest"
  114056. // },
  114057. // "response": {
  114058. // "$ref": "Operation"
  114059. // },
  114060. // "scopes": [
  114061. // "https://www.googleapis.com/auth/cloud-platform",
  114062. // "https://www.googleapis.com/auth/compute"
  114063. // ]
  114064. // }
  114065. }
  114066. // method id "compute.targetVpnGateways.testIamPermissions":
  114067. type TargetVpnGatewaysTestIamPermissionsCall struct {
  114068. s *Service
  114069. project string
  114070. region string
  114071. resource string
  114072. testpermissionsrequest *TestPermissionsRequest
  114073. urlParams_ gensupport.URLParams
  114074. ctx_ context.Context
  114075. header_ http.Header
  114076. }
  114077. // TestIamPermissions: Returns permissions that a caller has on the
  114078. // specified resource.
  114079. func (r *TargetVpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetVpnGatewaysTestIamPermissionsCall {
  114080. c := &TargetVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114081. c.project = project
  114082. c.region = region
  114083. c.resource = resource
  114084. c.testpermissionsrequest = testpermissionsrequest
  114085. return c
  114086. }
  114087. // Fields allows partial responses to be retrieved. See
  114088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114089. // for more information.
  114090. func (c *TargetVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysTestIamPermissionsCall {
  114091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114092. return c
  114093. }
  114094. // Context sets the context to be used in this call's Do method. Any
  114095. // pending HTTP request will be aborted if the provided context is
  114096. // canceled.
  114097. func (c *TargetVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *TargetVpnGatewaysTestIamPermissionsCall {
  114098. c.ctx_ = ctx
  114099. return c
  114100. }
  114101. // Header returns an http.Header that can be modified by the caller to
  114102. // add HTTP headers to the request.
  114103. func (c *TargetVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  114104. if c.header_ == nil {
  114105. c.header_ = make(http.Header)
  114106. }
  114107. return c.header_
  114108. }
  114109. func (c *TargetVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  114110. reqHeaders := make(http.Header)
  114111. for k, v := range c.header_ {
  114112. reqHeaders[k] = v
  114113. }
  114114. reqHeaders.Set("User-Agent", c.s.userAgent())
  114115. var body io.Reader = nil
  114116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  114117. if err != nil {
  114118. return nil, err
  114119. }
  114120. reqHeaders.Set("Content-Type", "application/json")
  114121. c.urlParams_.Set("alt", alt)
  114122. c.urlParams_.Set("prettyPrint", "false")
  114123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions")
  114124. urls += "?" + c.urlParams_.Encode()
  114125. req, err := http.NewRequest("POST", urls, body)
  114126. if err != nil {
  114127. return nil, err
  114128. }
  114129. req.Header = reqHeaders
  114130. googleapi.Expand(req.URL, map[string]string{
  114131. "project": c.project,
  114132. "region": c.region,
  114133. "resource": c.resource,
  114134. })
  114135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114136. }
  114137. // Do executes the "compute.targetVpnGateways.testIamPermissions" call.
  114138. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  114139. // non-2xx status code is an error. Response headers are in either
  114140. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  114141. // returned at all) in error.(*googleapi.Error).Header. Use
  114142. // googleapi.IsNotModified to check whether the returned error was
  114143. // because http.StatusNotModified was returned.
  114144. func (c *TargetVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  114145. gensupport.SetOptions(c.urlParams_, opts...)
  114146. res, err := c.doRequest("json")
  114147. if res != nil && res.StatusCode == http.StatusNotModified {
  114148. if res.Body != nil {
  114149. res.Body.Close()
  114150. }
  114151. return nil, &googleapi.Error{
  114152. Code: res.StatusCode,
  114153. Header: res.Header,
  114154. }
  114155. }
  114156. if err != nil {
  114157. return nil, err
  114158. }
  114159. defer googleapi.CloseBody(res)
  114160. if err := googleapi.CheckResponse(res); err != nil {
  114161. return nil, err
  114162. }
  114163. ret := &TestPermissionsResponse{
  114164. ServerResponse: googleapi.ServerResponse{
  114165. Header: res.Header,
  114166. HTTPStatusCode: res.StatusCode,
  114167. },
  114168. }
  114169. target := &ret
  114170. if err := gensupport.DecodeResponse(target, res); err != nil {
  114171. return nil, err
  114172. }
  114173. return ret, nil
  114174. // {
  114175. // "description": "Returns permissions that a caller has on the specified resource.",
  114176. // "httpMethod": "POST",
  114177. // "id": "compute.targetVpnGateways.testIamPermissions",
  114178. // "parameterOrder": [
  114179. // "project",
  114180. // "region",
  114181. // "resource"
  114182. // ],
  114183. // "parameters": {
  114184. // "project": {
  114185. // "description": "Project ID for this request.",
  114186. // "location": "path",
  114187. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114188. // "required": true,
  114189. // "type": "string"
  114190. // },
  114191. // "region": {
  114192. // "description": "The name of the region for this request.",
  114193. // "location": "path",
  114194. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114195. // "required": true,
  114196. // "type": "string"
  114197. // },
  114198. // "resource": {
  114199. // "description": "Name or id of the resource for this request.",
  114200. // "location": "path",
  114201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114202. // "required": true,
  114203. // "type": "string"
  114204. // }
  114205. // },
  114206. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions",
  114207. // "request": {
  114208. // "$ref": "TestPermissionsRequest"
  114209. // },
  114210. // "response": {
  114211. // "$ref": "TestPermissionsResponse"
  114212. // },
  114213. // "scopes": [
  114214. // "https://www.googleapis.com/auth/cloud-platform",
  114215. // "https://www.googleapis.com/auth/compute",
  114216. // "https://www.googleapis.com/auth/compute.readonly"
  114217. // ]
  114218. // }
  114219. }
  114220. // method id "compute.urlMaps.delete":
  114221. type UrlMapsDeleteCall struct {
  114222. s *Service
  114223. project string
  114224. urlMap string
  114225. urlParams_ gensupport.URLParams
  114226. ctx_ context.Context
  114227. header_ http.Header
  114228. }
  114229. // Delete: Deletes the specified UrlMap resource.
  114230. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  114231. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  114232. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114233. c.project = project
  114234. c.urlMap = urlMap
  114235. return c
  114236. }
  114237. // RequestId sets the optional parameter "requestId": An optional
  114238. // request ID to identify requests. Specify a unique request ID so that
  114239. // if you must retry your request, the server will know to ignore the
  114240. // request if it has already been completed.
  114241. //
  114242. // For example, consider a situation where you make an initial request
  114243. // and the request times out. If you make the request again with the
  114244. // same request ID, the server can check if original operation with the
  114245. // same request ID was received, and if so, will ignore the second
  114246. // request. This prevents clients from accidentally creating duplicate
  114247. // commitments.
  114248. //
  114249. // The request ID must be a valid UUID with the exception that zero UUID
  114250. // is not supported (00000000-0000-0000-0000-000000000000).
  114251. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  114252. c.urlParams_.Set("requestId", requestId)
  114253. return c
  114254. }
  114255. // Fields allows partial responses to be retrieved. See
  114256. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114257. // for more information.
  114258. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  114259. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114260. return c
  114261. }
  114262. // Context sets the context to be used in this call's Do method. Any
  114263. // pending HTTP request will be aborted if the provided context is
  114264. // canceled.
  114265. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  114266. c.ctx_ = ctx
  114267. return c
  114268. }
  114269. // Header returns an http.Header that can be modified by the caller to
  114270. // add HTTP headers to the request.
  114271. func (c *UrlMapsDeleteCall) Header() http.Header {
  114272. if c.header_ == nil {
  114273. c.header_ = make(http.Header)
  114274. }
  114275. return c.header_
  114276. }
  114277. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  114278. reqHeaders := make(http.Header)
  114279. for k, v := range c.header_ {
  114280. reqHeaders[k] = v
  114281. }
  114282. reqHeaders.Set("User-Agent", c.s.userAgent())
  114283. var body io.Reader = nil
  114284. c.urlParams_.Set("alt", alt)
  114285. c.urlParams_.Set("prettyPrint", "false")
  114286. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  114287. urls += "?" + c.urlParams_.Encode()
  114288. req, err := http.NewRequest("DELETE", urls, body)
  114289. if err != nil {
  114290. return nil, err
  114291. }
  114292. req.Header = reqHeaders
  114293. googleapi.Expand(req.URL, map[string]string{
  114294. "project": c.project,
  114295. "urlMap": c.urlMap,
  114296. })
  114297. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114298. }
  114299. // Do executes the "compute.urlMaps.delete" call.
  114300. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114301. // status code is an error. Response headers are in either
  114302. // *Operation.ServerResponse.Header or (if a response was returned at
  114303. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114304. // to check whether the returned error was because
  114305. // http.StatusNotModified was returned.
  114306. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114307. gensupport.SetOptions(c.urlParams_, opts...)
  114308. res, err := c.doRequest("json")
  114309. if res != nil && res.StatusCode == http.StatusNotModified {
  114310. if res.Body != nil {
  114311. res.Body.Close()
  114312. }
  114313. return nil, &googleapi.Error{
  114314. Code: res.StatusCode,
  114315. Header: res.Header,
  114316. }
  114317. }
  114318. if err != nil {
  114319. return nil, err
  114320. }
  114321. defer googleapi.CloseBody(res)
  114322. if err := googleapi.CheckResponse(res); err != nil {
  114323. return nil, err
  114324. }
  114325. ret := &Operation{
  114326. ServerResponse: googleapi.ServerResponse{
  114327. Header: res.Header,
  114328. HTTPStatusCode: res.StatusCode,
  114329. },
  114330. }
  114331. target := &ret
  114332. if err := gensupport.DecodeResponse(target, res); err != nil {
  114333. return nil, err
  114334. }
  114335. return ret, nil
  114336. // {
  114337. // "description": "Deletes the specified UrlMap resource.",
  114338. // "httpMethod": "DELETE",
  114339. // "id": "compute.urlMaps.delete",
  114340. // "parameterOrder": [
  114341. // "project",
  114342. // "urlMap"
  114343. // ],
  114344. // "parameters": {
  114345. // "project": {
  114346. // "description": "Project ID for this request.",
  114347. // "location": "path",
  114348. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114349. // "required": true,
  114350. // "type": "string"
  114351. // },
  114352. // "requestId": {
  114353. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114354. // "location": "query",
  114355. // "type": "string"
  114356. // },
  114357. // "urlMap": {
  114358. // "description": "Name of the UrlMap resource to delete.",
  114359. // "location": "path",
  114360. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114361. // "required": true,
  114362. // "type": "string"
  114363. // }
  114364. // },
  114365. // "path": "{project}/global/urlMaps/{urlMap}",
  114366. // "response": {
  114367. // "$ref": "Operation"
  114368. // },
  114369. // "scopes": [
  114370. // "https://www.googleapis.com/auth/cloud-platform",
  114371. // "https://www.googleapis.com/auth/compute"
  114372. // ]
  114373. // }
  114374. }
  114375. // method id "compute.urlMaps.get":
  114376. type UrlMapsGetCall struct {
  114377. s *Service
  114378. project string
  114379. urlMap string
  114380. urlParams_ gensupport.URLParams
  114381. ifNoneMatch_ string
  114382. ctx_ context.Context
  114383. header_ http.Header
  114384. }
  114385. // Get: Returns the specified UrlMap resource. Gets a list of available
  114386. // URL maps by making a list() request.
  114387. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  114388. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  114389. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114390. c.project = project
  114391. c.urlMap = urlMap
  114392. return c
  114393. }
  114394. // Fields allows partial responses to be retrieved. See
  114395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114396. // for more information.
  114397. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  114398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114399. return c
  114400. }
  114401. // IfNoneMatch sets the optional parameter which makes the operation
  114402. // fail if the object's ETag matches the given value. This is useful for
  114403. // getting updates only after the object has changed since the last
  114404. // request. Use googleapi.IsNotModified to check whether the response
  114405. // error from Do is the result of In-None-Match.
  114406. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  114407. c.ifNoneMatch_ = entityTag
  114408. return c
  114409. }
  114410. // Context sets the context to be used in this call's Do method. Any
  114411. // pending HTTP request will be aborted if the provided context is
  114412. // canceled.
  114413. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  114414. c.ctx_ = ctx
  114415. return c
  114416. }
  114417. // Header returns an http.Header that can be modified by the caller to
  114418. // add HTTP headers to the request.
  114419. func (c *UrlMapsGetCall) Header() http.Header {
  114420. if c.header_ == nil {
  114421. c.header_ = make(http.Header)
  114422. }
  114423. return c.header_
  114424. }
  114425. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  114426. reqHeaders := make(http.Header)
  114427. for k, v := range c.header_ {
  114428. reqHeaders[k] = v
  114429. }
  114430. reqHeaders.Set("User-Agent", c.s.userAgent())
  114431. if c.ifNoneMatch_ != "" {
  114432. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114433. }
  114434. var body io.Reader = nil
  114435. c.urlParams_.Set("alt", alt)
  114436. c.urlParams_.Set("prettyPrint", "false")
  114437. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  114438. urls += "?" + c.urlParams_.Encode()
  114439. req, err := http.NewRequest("GET", urls, body)
  114440. if err != nil {
  114441. return nil, err
  114442. }
  114443. req.Header = reqHeaders
  114444. googleapi.Expand(req.URL, map[string]string{
  114445. "project": c.project,
  114446. "urlMap": c.urlMap,
  114447. })
  114448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114449. }
  114450. // Do executes the "compute.urlMaps.get" call.
  114451. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  114452. // code is an error. Response headers are in either
  114453. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  114454. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  114455. // check whether the returned error was because http.StatusNotModified
  114456. // was returned.
  114457. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  114458. gensupport.SetOptions(c.urlParams_, opts...)
  114459. res, err := c.doRequest("json")
  114460. if res != nil && res.StatusCode == http.StatusNotModified {
  114461. if res.Body != nil {
  114462. res.Body.Close()
  114463. }
  114464. return nil, &googleapi.Error{
  114465. Code: res.StatusCode,
  114466. Header: res.Header,
  114467. }
  114468. }
  114469. if err != nil {
  114470. return nil, err
  114471. }
  114472. defer googleapi.CloseBody(res)
  114473. if err := googleapi.CheckResponse(res); err != nil {
  114474. return nil, err
  114475. }
  114476. ret := &UrlMap{
  114477. ServerResponse: googleapi.ServerResponse{
  114478. Header: res.Header,
  114479. HTTPStatusCode: res.StatusCode,
  114480. },
  114481. }
  114482. target := &ret
  114483. if err := gensupport.DecodeResponse(target, res); err != nil {
  114484. return nil, err
  114485. }
  114486. return ret, nil
  114487. // {
  114488. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  114489. // "httpMethod": "GET",
  114490. // "id": "compute.urlMaps.get",
  114491. // "parameterOrder": [
  114492. // "project",
  114493. // "urlMap"
  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. // "urlMap": {
  114504. // "description": "Name of the UrlMap resource to return.",
  114505. // "location": "path",
  114506. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114507. // "required": true,
  114508. // "type": "string"
  114509. // }
  114510. // },
  114511. // "path": "{project}/global/urlMaps/{urlMap}",
  114512. // "response": {
  114513. // "$ref": "UrlMap"
  114514. // },
  114515. // "scopes": [
  114516. // "https://www.googleapis.com/auth/cloud-platform",
  114517. // "https://www.googleapis.com/auth/compute",
  114518. // "https://www.googleapis.com/auth/compute.readonly"
  114519. // ]
  114520. // }
  114521. }
  114522. // method id "compute.urlMaps.insert":
  114523. type UrlMapsInsertCall struct {
  114524. s *Service
  114525. project string
  114526. urlmap *UrlMap
  114527. urlParams_ gensupport.URLParams
  114528. ctx_ context.Context
  114529. header_ http.Header
  114530. }
  114531. // Insert: Creates a UrlMap resource in the specified project using the
  114532. // data included in the request.
  114533. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  114534. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  114535. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114536. c.project = project
  114537. c.urlmap = urlmap
  114538. return c
  114539. }
  114540. // RequestId sets the optional parameter "requestId": An optional
  114541. // request ID to identify requests. Specify a unique request ID so that
  114542. // if you must retry your request, the server will know to ignore the
  114543. // request if it has already been completed.
  114544. //
  114545. // For example, consider a situation where you make an initial request
  114546. // and the request times out. If you make the request again with the
  114547. // same request ID, the server can check if original operation with the
  114548. // same request ID was received, and if so, will ignore the second
  114549. // request. This prevents clients from accidentally creating duplicate
  114550. // commitments.
  114551. //
  114552. // The request ID must be a valid UUID with the exception that zero UUID
  114553. // is not supported (00000000-0000-0000-0000-000000000000).
  114554. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  114555. c.urlParams_.Set("requestId", requestId)
  114556. return c
  114557. }
  114558. // Fields allows partial responses to be retrieved. See
  114559. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114560. // for more information.
  114561. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  114562. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114563. return c
  114564. }
  114565. // Context sets the context to be used in this call's Do method. Any
  114566. // pending HTTP request will be aborted if the provided context is
  114567. // canceled.
  114568. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  114569. c.ctx_ = ctx
  114570. return c
  114571. }
  114572. // Header returns an http.Header that can be modified by the caller to
  114573. // add HTTP headers to the request.
  114574. func (c *UrlMapsInsertCall) Header() http.Header {
  114575. if c.header_ == nil {
  114576. c.header_ = make(http.Header)
  114577. }
  114578. return c.header_
  114579. }
  114580. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  114581. reqHeaders := make(http.Header)
  114582. for k, v := range c.header_ {
  114583. reqHeaders[k] = v
  114584. }
  114585. reqHeaders.Set("User-Agent", c.s.userAgent())
  114586. var body io.Reader = nil
  114587. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  114588. if err != nil {
  114589. return nil, err
  114590. }
  114591. reqHeaders.Set("Content-Type", "application/json")
  114592. c.urlParams_.Set("alt", alt)
  114593. c.urlParams_.Set("prettyPrint", "false")
  114594. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  114595. urls += "?" + c.urlParams_.Encode()
  114596. req, err := http.NewRequest("POST", urls, body)
  114597. if err != nil {
  114598. return nil, err
  114599. }
  114600. req.Header = reqHeaders
  114601. googleapi.Expand(req.URL, map[string]string{
  114602. "project": c.project,
  114603. })
  114604. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114605. }
  114606. // Do executes the "compute.urlMaps.insert" call.
  114607. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114608. // status code is an error. Response headers are in either
  114609. // *Operation.ServerResponse.Header or (if a response was returned at
  114610. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114611. // to check whether the returned error was because
  114612. // http.StatusNotModified was returned.
  114613. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114614. gensupport.SetOptions(c.urlParams_, opts...)
  114615. res, err := c.doRequest("json")
  114616. if res != nil && res.StatusCode == http.StatusNotModified {
  114617. if res.Body != nil {
  114618. res.Body.Close()
  114619. }
  114620. return nil, &googleapi.Error{
  114621. Code: res.StatusCode,
  114622. Header: res.Header,
  114623. }
  114624. }
  114625. if err != nil {
  114626. return nil, err
  114627. }
  114628. defer googleapi.CloseBody(res)
  114629. if err := googleapi.CheckResponse(res); err != nil {
  114630. return nil, err
  114631. }
  114632. ret := &Operation{
  114633. ServerResponse: googleapi.ServerResponse{
  114634. Header: res.Header,
  114635. HTTPStatusCode: res.StatusCode,
  114636. },
  114637. }
  114638. target := &ret
  114639. if err := gensupport.DecodeResponse(target, res); err != nil {
  114640. return nil, err
  114641. }
  114642. return ret, nil
  114643. // {
  114644. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  114645. // "httpMethod": "POST",
  114646. // "id": "compute.urlMaps.insert",
  114647. // "parameterOrder": [
  114648. // "project"
  114649. // ],
  114650. // "parameters": {
  114651. // "project": {
  114652. // "description": "Project ID for this request.",
  114653. // "location": "path",
  114654. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114655. // "required": true,
  114656. // "type": "string"
  114657. // },
  114658. // "requestId": {
  114659. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114660. // "location": "query",
  114661. // "type": "string"
  114662. // }
  114663. // },
  114664. // "path": "{project}/global/urlMaps",
  114665. // "request": {
  114666. // "$ref": "UrlMap"
  114667. // },
  114668. // "response": {
  114669. // "$ref": "Operation"
  114670. // },
  114671. // "scopes": [
  114672. // "https://www.googleapis.com/auth/cloud-platform",
  114673. // "https://www.googleapis.com/auth/compute"
  114674. // ]
  114675. // }
  114676. }
  114677. // method id "compute.urlMaps.invalidateCache":
  114678. type UrlMapsInvalidateCacheCall struct {
  114679. s *Service
  114680. project string
  114681. urlMap string
  114682. cacheinvalidationrule *CacheInvalidationRule
  114683. urlParams_ gensupport.URLParams
  114684. ctx_ context.Context
  114685. header_ http.Header
  114686. }
  114687. // InvalidateCache: Initiates a cache invalidation operation,
  114688. // invalidating the specified path, scoped to the specified UrlMap.
  114689. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  114690. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114691. c.project = project
  114692. c.urlMap = urlMap
  114693. c.cacheinvalidationrule = cacheinvalidationrule
  114694. return c
  114695. }
  114696. // RequestId sets the optional parameter "requestId": An optional
  114697. // request ID to identify requests. Specify a unique request ID so that
  114698. // if you must retry your request, the server will know to ignore the
  114699. // request if it has already been completed.
  114700. //
  114701. // For example, consider a situation where you make an initial request
  114702. // and the request times out. If you make the request again with the
  114703. // same request ID, the server can check if original operation with the
  114704. // same request ID was received, and if so, will ignore the second
  114705. // request. This prevents clients from accidentally creating duplicate
  114706. // commitments.
  114707. //
  114708. // The request ID must be a valid UUID with the exception that zero UUID
  114709. // is not supported (00000000-0000-0000-0000-000000000000).
  114710. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  114711. c.urlParams_.Set("requestId", requestId)
  114712. return c
  114713. }
  114714. // Fields allows partial responses to be retrieved. See
  114715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114716. // for more information.
  114717. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  114718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114719. return c
  114720. }
  114721. // Context sets the context to be used in this call's Do method. Any
  114722. // pending HTTP request will be aborted if the provided context is
  114723. // canceled.
  114724. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  114725. c.ctx_ = ctx
  114726. return c
  114727. }
  114728. // Header returns an http.Header that can be modified by the caller to
  114729. // add HTTP headers to the request.
  114730. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  114731. if c.header_ == nil {
  114732. c.header_ = make(http.Header)
  114733. }
  114734. return c.header_
  114735. }
  114736. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  114737. reqHeaders := make(http.Header)
  114738. for k, v := range c.header_ {
  114739. reqHeaders[k] = v
  114740. }
  114741. reqHeaders.Set("User-Agent", c.s.userAgent())
  114742. var body io.Reader = nil
  114743. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  114744. if err != nil {
  114745. return nil, err
  114746. }
  114747. reqHeaders.Set("Content-Type", "application/json")
  114748. c.urlParams_.Set("alt", alt)
  114749. c.urlParams_.Set("prettyPrint", "false")
  114750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  114751. urls += "?" + c.urlParams_.Encode()
  114752. req, err := http.NewRequest("POST", urls, body)
  114753. if err != nil {
  114754. return nil, err
  114755. }
  114756. req.Header = reqHeaders
  114757. googleapi.Expand(req.URL, map[string]string{
  114758. "project": c.project,
  114759. "urlMap": c.urlMap,
  114760. })
  114761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114762. }
  114763. // Do executes the "compute.urlMaps.invalidateCache" call.
  114764. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114765. // status code is an error. Response headers are in either
  114766. // *Operation.ServerResponse.Header or (if a response was returned at
  114767. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114768. // to check whether the returned error was because
  114769. // http.StatusNotModified was returned.
  114770. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114771. gensupport.SetOptions(c.urlParams_, opts...)
  114772. res, err := c.doRequest("json")
  114773. if res != nil && res.StatusCode == http.StatusNotModified {
  114774. if res.Body != nil {
  114775. res.Body.Close()
  114776. }
  114777. return nil, &googleapi.Error{
  114778. Code: res.StatusCode,
  114779. Header: res.Header,
  114780. }
  114781. }
  114782. if err != nil {
  114783. return nil, err
  114784. }
  114785. defer googleapi.CloseBody(res)
  114786. if err := googleapi.CheckResponse(res); err != nil {
  114787. return nil, err
  114788. }
  114789. ret := &Operation{
  114790. ServerResponse: googleapi.ServerResponse{
  114791. Header: res.Header,
  114792. HTTPStatusCode: res.StatusCode,
  114793. },
  114794. }
  114795. target := &ret
  114796. if err := gensupport.DecodeResponse(target, res); err != nil {
  114797. return nil, err
  114798. }
  114799. return ret, nil
  114800. // {
  114801. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  114802. // "httpMethod": "POST",
  114803. // "id": "compute.urlMaps.invalidateCache",
  114804. // "parameterOrder": [
  114805. // "project",
  114806. // "urlMap"
  114807. // ],
  114808. // "parameters": {
  114809. // "project": {
  114810. // "description": "Project ID for this request.",
  114811. // "location": "path",
  114812. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114813. // "required": true,
  114814. // "type": "string"
  114815. // },
  114816. // "requestId": {
  114817. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114818. // "location": "query",
  114819. // "type": "string"
  114820. // },
  114821. // "urlMap": {
  114822. // "description": "Name of the UrlMap scoping this request.",
  114823. // "location": "path",
  114824. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114825. // "required": true,
  114826. // "type": "string"
  114827. // }
  114828. // },
  114829. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  114830. // "request": {
  114831. // "$ref": "CacheInvalidationRule"
  114832. // },
  114833. // "response": {
  114834. // "$ref": "Operation"
  114835. // },
  114836. // "scopes": [
  114837. // "https://www.googleapis.com/auth/cloud-platform",
  114838. // "https://www.googleapis.com/auth/compute"
  114839. // ]
  114840. // }
  114841. }
  114842. // method id "compute.urlMaps.list":
  114843. type UrlMapsListCall struct {
  114844. s *Service
  114845. project string
  114846. urlParams_ gensupport.URLParams
  114847. ifNoneMatch_ string
  114848. ctx_ context.Context
  114849. header_ http.Header
  114850. }
  114851. // List: Retrieves the list of UrlMap resources available to the
  114852. // specified project.
  114853. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  114854. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  114855. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114856. c.project = project
  114857. return c
  114858. }
  114859. // Filter sets the optional parameter "filter": A filter expression that
  114860. // filters resources listed in the response. The expression must specify
  114861. // the field name, a comparison operator, and the value that you want to
  114862. // use for filtering. The value must be a string, a number, or a
  114863. // boolean. The comparison operator must be either =, !=, >, or <.
  114864. //
  114865. // For example, if you are filtering Compute Engine instances, you can
  114866. // exclude instances named example-instance by specifying name !=
  114867. // example-instance.
  114868. //
  114869. // You can also filter nested fields. For example, you could specify
  114870. // scheduling.automaticRestart = false to include instances only if they
  114871. // are not scheduled for automatic restarts. You can use filtering on
  114872. // nested fields to filter based on resource labels.
  114873. //
  114874. // To filter on multiple expressions, provide each separate expression
  114875. // within parentheses. For example, (scheduling.automaticRestart = true)
  114876. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  114877. // AND expression. However, you can include AND and OR expressions
  114878. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  114879. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  114880. // true).
  114881. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  114882. c.urlParams_.Set("filter", filter)
  114883. return c
  114884. }
  114885. // MaxResults sets the optional parameter "maxResults": The maximum
  114886. // number of results per page that should be returned. If the number of
  114887. // available results is larger than maxResults, Compute Engine returns a
  114888. // nextPageToken that can be used to get the next page of results in
  114889. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  114890. // (Default: 500)
  114891. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  114892. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  114893. return c
  114894. }
  114895. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  114896. // a certain order. By default, results are returned in alphanumerical
  114897. // order based on the resource name.
  114898. //
  114899. // You can also sort results in descending order based on the creation
  114900. // timestamp using orderBy="creationTimestamp desc". This sorts results
  114901. // based on the creationTimestamp field in reverse chronological order
  114902. // (newest result first). Use this to sort resources like operations so
  114903. // that the newest operation is returned first.
  114904. //
  114905. // Currently, only sorting by name or creationTimestamp desc is
  114906. // supported.
  114907. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  114908. c.urlParams_.Set("orderBy", orderBy)
  114909. return c
  114910. }
  114911. // PageToken sets the optional parameter "pageToken": Specifies a page
  114912. // token to use. Set pageToken to the nextPageToken returned by a
  114913. // previous list request to get the next page of results.
  114914. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  114915. c.urlParams_.Set("pageToken", pageToken)
  114916. return c
  114917. }
  114918. // Fields allows partial responses to be retrieved. See
  114919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114920. // for more information.
  114921. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  114922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114923. return c
  114924. }
  114925. // IfNoneMatch sets the optional parameter which makes the operation
  114926. // fail if the object's ETag matches the given value. This is useful for
  114927. // getting updates only after the object has changed since the last
  114928. // request. Use googleapi.IsNotModified to check whether the response
  114929. // error from Do is the result of In-None-Match.
  114930. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  114931. c.ifNoneMatch_ = entityTag
  114932. return c
  114933. }
  114934. // Context sets the context to be used in this call's Do method. Any
  114935. // pending HTTP request will be aborted if the provided context is
  114936. // canceled.
  114937. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  114938. c.ctx_ = ctx
  114939. return c
  114940. }
  114941. // Header returns an http.Header that can be modified by the caller to
  114942. // add HTTP headers to the request.
  114943. func (c *UrlMapsListCall) Header() http.Header {
  114944. if c.header_ == nil {
  114945. c.header_ = make(http.Header)
  114946. }
  114947. return c.header_
  114948. }
  114949. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  114950. reqHeaders := make(http.Header)
  114951. for k, v := range c.header_ {
  114952. reqHeaders[k] = v
  114953. }
  114954. reqHeaders.Set("User-Agent", c.s.userAgent())
  114955. if c.ifNoneMatch_ != "" {
  114956. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114957. }
  114958. var body io.Reader = nil
  114959. c.urlParams_.Set("alt", alt)
  114960. c.urlParams_.Set("prettyPrint", "false")
  114961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  114962. urls += "?" + c.urlParams_.Encode()
  114963. req, err := http.NewRequest("GET", urls, body)
  114964. if err != nil {
  114965. return nil, err
  114966. }
  114967. req.Header = reqHeaders
  114968. googleapi.Expand(req.URL, map[string]string{
  114969. "project": c.project,
  114970. })
  114971. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114972. }
  114973. // Do executes the "compute.urlMaps.list" call.
  114974. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  114975. // status code is an error. Response headers are in either
  114976. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  114977. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114978. // to check whether the returned error was because
  114979. // http.StatusNotModified was returned.
  114980. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  114981. gensupport.SetOptions(c.urlParams_, opts...)
  114982. res, err := c.doRequest("json")
  114983. if res != nil && res.StatusCode == http.StatusNotModified {
  114984. if res.Body != nil {
  114985. res.Body.Close()
  114986. }
  114987. return nil, &googleapi.Error{
  114988. Code: res.StatusCode,
  114989. Header: res.Header,
  114990. }
  114991. }
  114992. if err != nil {
  114993. return nil, err
  114994. }
  114995. defer googleapi.CloseBody(res)
  114996. if err := googleapi.CheckResponse(res); err != nil {
  114997. return nil, err
  114998. }
  114999. ret := &UrlMapList{
  115000. ServerResponse: googleapi.ServerResponse{
  115001. Header: res.Header,
  115002. HTTPStatusCode: res.StatusCode,
  115003. },
  115004. }
  115005. target := &ret
  115006. if err := gensupport.DecodeResponse(target, res); err != nil {
  115007. return nil, err
  115008. }
  115009. return ret, nil
  115010. // {
  115011. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  115012. // "httpMethod": "GET",
  115013. // "id": "compute.urlMaps.list",
  115014. // "parameterOrder": [
  115015. // "project"
  115016. // ],
  115017. // "parameters": {
  115018. // "filter": {
  115019. // "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).",
  115020. // "location": "query",
  115021. // "type": "string"
  115022. // },
  115023. // "maxResults": {
  115024. // "default": "500",
  115025. // "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)",
  115026. // "format": "uint32",
  115027. // "location": "query",
  115028. // "minimum": "0",
  115029. // "type": "integer"
  115030. // },
  115031. // "orderBy": {
  115032. // "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.",
  115033. // "location": "query",
  115034. // "type": "string"
  115035. // },
  115036. // "pageToken": {
  115037. // "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.",
  115038. // "location": "query",
  115039. // "type": "string"
  115040. // },
  115041. // "project": {
  115042. // "description": "Project ID for this request.",
  115043. // "location": "path",
  115044. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115045. // "required": true,
  115046. // "type": "string"
  115047. // }
  115048. // },
  115049. // "path": "{project}/global/urlMaps",
  115050. // "response": {
  115051. // "$ref": "UrlMapList"
  115052. // },
  115053. // "scopes": [
  115054. // "https://www.googleapis.com/auth/cloud-platform",
  115055. // "https://www.googleapis.com/auth/compute",
  115056. // "https://www.googleapis.com/auth/compute.readonly"
  115057. // ]
  115058. // }
  115059. }
  115060. // Pages invokes f for each page of results.
  115061. // A non-nil error returned from f will halt the iteration.
  115062. // The provided context supersedes any context provided to the Context method.
  115063. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  115064. c.ctx_ = ctx
  115065. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  115066. for {
  115067. x, err := c.Do()
  115068. if err != nil {
  115069. return err
  115070. }
  115071. if err := f(x); err != nil {
  115072. return err
  115073. }
  115074. if x.NextPageToken == "" {
  115075. return nil
  115076. }
  115077. c.PageToken(x.NextPageToken)
  115078. }
  115079. }
  115080. // method id "compute.urlMaps.patch":
  115081. type UrlMapsPatchCall struct {
  115082. s *Service
  115083. project string
  115084. urlMap string
  115085. urlmap *UrlMap
  115086. urlParams_ gensupport.URLParams
  115087. ctx_ context.Context
  115088. header_ http.Header
  115089. }
  115090. // Patch: Patches the specified UrlMap resource with the data included
  115091. // in the request. This method supports PATCH semantics and uses the
  115092. // JSON merge patch format and processing rules.
  115093. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  115094. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  115095. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115096. c.project = project
  115097. c.urlMap = urlMap
  115098. c.urlmap = urlmap
  115099. return c
  115100. }
  115101. // RequestId sets the optional parameter "requestId": An optional
  115102. // request ID to identify requests. Specify a unique request ID so that
  115103. // if you must retry your request, the server will know to ignore the
  115104. // request if it has already been completed.
  115105. //
  115106. // For example, consider a situation where you make an initial request
  115107. // and the request times out. If you make the request again with the
  115108. // same request ID, the server can check if original operation with the
  115109. // same request ID was received, and if so, will ignore the second
  115110. // request. This prevents clients from accidentally creating duplicate
  115111. // commitments.
  115112. //
  115113. // The request ID must be a valid UUID with the exception that zero UUID
  115114. // is not supported (00000000-0000-0000-0000-000000000000).
  115115. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  115116. c.urlParams_.Set("requestId", requestId)
  115117. return c
  115118. }
  115119. // Fields allows partial responses to be retrieved. See
  115120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115121. // for more information.
  115122. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  115123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115124. return c
  115125. }
  115126. // Context sets the context to be used in this call's Do method. Any
  115127. // pending HTTP request will be aborted if the provided context is
  115128. // canceled.
  115129. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  115130. c.ctx_ = ctx
  115131. return c
  115132. }
  115133. // Header returns an http.Header that can be modified by the caller to
  115134. // add HTTP headers to the request.
  115135. func (c *UrlMapsPatchCall) Header() http.Header {
  115136. if c.header_ == nil {
  115137. c.header_ = make(http.Header)
  115138. }
  115139. return c.header_
  115140. }
  115141. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  115142. reqHeaders := make(http.Header)
  115143. for k, v := range c.header_ {
  115144. reqHeaders[k] = v
  115145. }
  115146. reqHeaders.Set("User-Agent", c.s.userAgent())
  115147. var body io.Reader = nil
  115148. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  115149. if err != nil {
  115150. return nil, err
  115151. }
  115152. reqHeaders.Set("Content-Type", "application/json")
  115153. c.urlParams_.Set("alt", alt)
  115154. c.urlParams_.Set("prettyPrint", "false")
  115155. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  115156. urls += "?" + c.urlParams_.Encode()
  115157. req, err := http.NewRequest("PATCH", urls, body)
  115158. if err != nil {
  115159. return nil, err
  115160. }
  115161. req.Header = reqHeaders
  115162. googleapi.Expand(req.URL, map[string]string{
  115163. "project": c.project,
  115164. "urlMap": c.urlMap,
  115165. })
  115166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115167. }
  115168. // Do executes the "compute.urlMaps.patch" call.
  115169. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115170. // status code is an error. Response headers are in either
  115171. // *Operation.ServerResponse.Header or (if a response was returned at
  115172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115173. // to check whether the returned error was because
  115174. // http.StatusNotModified was returned.
  115175. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115176. gensupport.SetOptions(c.urlParams_, opts...)
  115177. res, err := c.doRequest("json")
  115178. if res != nil && res.StatusCode == http.StatusNotModified {
  115179. if res.Body != nil {
  115180. res.Body.Close()
  115181. }
  115182. return nil, &googleapi.Error{
  115183. Code: res.StatusCode,
  115184. Header: res.Header,
  115185. }
  115186. }
  115187. if err != nil {
  115188. return nil, err
  115189. }
  115190. defer googleapi.CloseBody(res)
  115191. if err := googleapi.CheckResponse(res); err != nil {
  115192. return nil, err
  115193. }
  115194. ret := &Operation{
  115195. ServerResponse: googleapi.ServerResponse{
  115196. Header: res.Header,
  115197. HTTPStatusCode: res.StatusCode,
  115198. },
  115199. }
  115200. target := &ret
  115201. if err := gensupport.DecodeResponse(target, res); err != nil {
  115202. return nil, err
  115203. }
  115204. return ret, nil
  115205. // {
  115206. // "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.",
  115207. // "httpMethod": "PATCH",
  115208. // "id": "compute.urlMaps.patch",
  115209. // "parameterOrder": [
  115210. // "project",
  115211. // "urlMap"
  115212. // ],
  115213. // "parameters": {
  115214. // "project": {
  115215. // "description": "Project ID for this request.",
  115216. // "location": "path",
  115217. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115218. // "required": true,
  115219. // "type": "string"
  115220. // },
  115221. // "requestId": {
  115222. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115223. // "location": "query",
  115224. // "type": "string"
  115225. // },
  115226. // "urlMap": {
  115227. // "description": "Name of the UrlMap resource to patch.",
  115228. // "location": "path",
  115229. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115230. // "required": true,
  115231. // "type": "string"
  115232. // }
  115233. // },
  115234. // "path": "{project}/global/urlMaps/{urlMap}",
  115235. // "request": {
  115236. // "$ref": "UrlMap"
  115237. // },
  115238. // "response": {
  115239. // "$ref": "Operation"
  115240. // },
  115241. // "scopes": [
  115242. // "https://www.googleapis.com/auth/cloud-platform",
  115243. // "https://www.googleapis.com/auth/compute"
  115244. // ]
  115245. // }
  115246. }
  115247. // method id "compute.urlMaps.testIamPermissions":
  115248. type UrlMapsTestIamPermissionsCall struct {
  115249. s *Service
  115250. project string
  115251. resource string
  115252. testpermissionsrequest *TestPermissionsRequest
  115253. urlParams_ gensupport.URLParams
  115254. ctx_ context.Context
  115255. header_ http.Header
  115256. }
  115257. // TestIamPermissions: Returns permissions that a caller has on the
  115258. // specified resource.
  115259. func (r *UrlMapsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UrlMapsTestIamPermissionsCall {
  115260. c := &UrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115261. c.project = project
  115262. c.resource = resource
  115263. c.testpermissionsrequest = testpermissionsrequest
  115264. return c
  115265. }
  115266. // Fields allows partial responses to be retrieved. See
  115267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115268. // for more information.
  115269. func (c *UrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *UrlMapsTestIamPermissionsCall {
  115270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115271. return c
  115272. }
  115273. // Context sets the context to be used in this call's Do method. Any
  115274. // pending HTTP request will be aborted if the provided context is
  115275. // canceled.
  115276. func (c *UrlMapsTestIamPermissionsCall) Context(ctx context.Context) *UrlMapsTestIamPermissionsCall {
  115277. c.ctx_ = ctx
  115278. return c
  115279. }
  115280. // Header returns an http.Header that can be modified by the caller to
  115281. // add HTTP headers to the request.
  115282. func (c *UrlMapsTestIamPermissionsCall) Header() http.Header {
  115283. if c.header_ == nil {
  115284. c.header_ = make(http.Header)
  115285. }
  115286. return c.header_
  115287. }
  115288. func (c *UrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  115289. reqHeaders := make(http.Header)
  115290. for k, v := range c.header_ {
  115291. reqHeaders[k] = v
  115292. }
  115293. reqHeaders.Set("User-Agent", c.s.userAgent())
  115294. var body io.Reader = nil
  115295. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  115296. if err != nil {
  115297. return nil, err
  115298. }
  115299. reqHeaders.Set("Content-Type", "application/json")
  115300. c.urlParams_.Set("alt", alt)
  115301. c.urlParams_.Set("prettyPrint", "false")
  115302. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{resource}/testIamPermissions")
  115303. urls += "?" + c.urlParams_.Encode()
  115304. req, err := http.NewRequest("POST", urls, body)
  115305. if err != nil {
  115306. return nil, err
  115307. }
  115308. req.Header = reqHeaders
  115309. googleapi.Expand(req.URL, map[string]string{
  115310. "project": c.project,
  115311. "resource": c.resource,
  115312. })
  115313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115314. }
  115315. // Do executes the "compute.urlMaps.testIamPermissions" call.
  115316. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  115317. // non-2xx status code is an error. Response headers are in either
  115318. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  115319. // returned at all) in error.(*googleapi.Error).Header. Use
  115320. // googleapi.IsNotModified to check whether the returned error was
  115321. // because http.StatusNotModified was returned.
  115322. func (c *UrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  115323. gensupport.SetOptions(c.urlParams_, opts...)
  115324. res, err := c.doRequest("json")
  115325. if res != nil && res.StatusCode == http.StatusNotModified {
  115326. if res.Body != nil {
  115327. res.Body.Close()
  115328. }
  115329. return nil, &googleapi.Error{
  115330. Code: res.StatusCode,
  115331. Header: res.Header,
  115332. }
  115333. }
  115334. if err != nil {
  115335. return nil, err
  115336. }
  115337. defer googleapi.CloseBody(res)
  115338. if err := googleapi.CheckResponse(res); err != nil {
  115339. return nil, err
  115340. }
  115341. ret := &TestPermissionsResponse{
  115342. ServerResponse: googleapi.ServerResponse{
  115343. Header: res.Header,
  115344. HTTPStatusCode: res.StatusCode,
  115345. },
  115346. }
  115347. target := &ret
  115348. if err := gensupport.DecodeResponse(target, res); err != nil {
  115349. return nil, err
  115350. }
  115351. return ret, nil
  115352. // {
  115353. // "description": "Returns permissions that a caller has on the specified resource.",
  115354. // "httpMethod": "POST",
  115355. // "id": "compute.urlMaps.testIamPermissions",
  115356. // "parameterOrder": [
  115357. // "project",
  115358. // "resource"
  115359. // ],
  115360. // "parameters": {
  115361. // "project": {
  115362. // "description": "Project ID for this request.",
  115363. // "location": "path",
  115364. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115365. // "required": true,
  115366. // "type": "string"
  115367. // },
  115368. // "resource": {
  115369. // "description": "Name or id of the resource for this request.",
  115370. // "location": "path",
  115371. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115372. // "required": true,
  115373. // "type": "string"
  115374. // }
  115375. // },
  115376. // "path": "{project}/global/urlMaps/{resource}/testIamPermissions",
  115377. // "request": {
  115378. // "$ref": "TestPermissionsRequest"
  115379. // },
  115380. // "response": {
  115381. // "$ref": "TestPermissionsResponse"
  115382. // },
  115383. // "scopes": [
  115384. // "https://www.googleapis.com/auth/cloud-platform",
  115385. // "https://www.googleapis.com/auth/compute",
  115386. // "https://www.googleapis.com/auth/compute.readonly"
  115387. // ]
  115388. // }
  115389. }
  115390. // method id "compute.urlMaps.update":
  115391. type UrlMapsUpdateCall struct {
  115392. s *Service
  115393. project string
  115394. urlMap string
  115395. urlmap *UrlMap
  115396. urlParams_ gensupport.URLParams
  115397. ctx_ context.Context
  115398. header_ http.Header
  115399. }
  115400. // Update: Updates the specified UrlMap resource with the data included
  115401. // in the request.
  115402. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  115403. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  115404. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115405. c.project = project
  115406. c.urlMap = urlMap
  115407. c.urlmap = urlmap
  115408. return c
  115409. }
  115410. // RequestId sets the optional parameter "requestId": An optional
  115411. // request ID to identify requests. Specify a unique request ID so that
  115412. // if you must retry your request, the server will know to ignore the
  115413. // request if it has already been completed.
  115414. //
  115415. // For example, consider a situation where you make an initial request
  115416. // and the request times out. If you make the request again with the
  115417. // same request ID, the server can check if original operation with the
  115418. // same request ID was received, and if so, will ignore the second
  115419. // request. This prevents clients from accidentally creating duplicate
  115420. // commitments.
  115421. //
  115422. // The request ID must be a valid UUID with the exception that zero UUID
  115423. // is not supported (00000000-0000-0000-0000-000000000000).
  115424. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  115425. c.urlParams_.Set("requestId", requestId)
  115426. return c
  115427. }
  115428. // Fields allows partial responses to be retrieved. See
  115429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115430. // for more information.
  115431. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  115432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115433. return c
  115434. }
  115435. // Context sets the context to be used in this call's Do method. Any
  115436. // pending HTTP request will be aborted if the provided context is
  115437. // canceled.
  115438. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  115439. c.ctx_ = ctx
  115440. return c
  115441. }
  115442. // Header returns an http.Header that can be modified by the caller to
  115443. // add HTTP headers to the request.
  115444. func (c *UrlMapsUpdateCall) Header() http.Header {
  115445. if c.header_ == nil {
  115446. c.header_ = make(http.Header)
  115447. }
  115448. return c.header_
  115449. }
  115450. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  115451. reqHeaders := make(http.Header)
  115452. for k, v := range c.header_ {
  115453. reqHeaders[k] = v
  115454. }
  115455. reqHeaders.Set("User-Agent", c.s.userAgent())
  115456. var body io.Reader = nil
  115457. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  115458. if err != nil {
  115459. return nil, err
  115460. }
  115461. reqHeaders.Set("Content-Type", "application/json")
  115462. c.urlParams_.Set("alt", alt)
  115463. c.urlParams_.Set("prettyPrint", "false")
  115464. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  115465. urls += "?" + c.urlParams_.Encode()
  115466. req, err := http.NewRequest("PUT", urls, body)
  115467. if err != nil {
  115468. return nil, err
  115469. }
  115470. req.Header = reqHeaders
  115471. googleapi.Expand(req.URL, map[string]string{
  115472. "project": c.project,
  115473. "urlMap": c.urlMap,
  115474. })
  115475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115476. }
  115477. // Do executes the "compute.urlMaps.update" call.
  115478. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115479. // status code is an error. Response headers are in either
  115480. // *Operation.ServerResponse.Header or (if a response was returned at
  115481. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115482. // to check whether the returned error was because
  115483. // http.StatusNotModified was returned.
  115484. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115485. gensupport.SetOptions(c.urlParams_, opts...)
  115486. res, err := c.doRequest("json")
  115487. if res != nil && res.StatusCode == http.StatusNotModified {
  115488. if res.Body != nil {
  115489. res.Body.Close()
  115490. }
  115491. return nil, &googleapi.Error{
  115492. Code: res.StatusCode,
  115493. Header: res.Header,
  115494. }
  115495. }
  115496. if err != nil {
  115497. return nil, err
  115498. }
  115499. defer googleapi.CloseBody(res)
  115500. if err := googleapi.CheckResponse(res); err != nil {
  115501. return nil, err
  115502. }
  115503. ret := &Operation{
  115504. ServerResponse: googleapi.ServerResponse{
  115505. Header: res.Header,
  115506. HTTPStatusCode: res.StatusCode,
  115507. },
  115508. }
  115509. target := &ret
  115510. if err := gensupport.DecodeResponse(target, res); err != nil {
  115511. return nil, err
  115512. }
  115513. return ret, nil
  115514. // {
  115515. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  115516. // "httpMethod": "PUT",
  115517. // "id": "compute.urlMaps.update",
  115518. // "parameterOrder": [
  115519. // "project",
  115520. // "urlMap"
  115521. // ],
  115522. // "parameters": {
  115523. // "project": {
  115524. // "description": "Project ID for this request.",
  115525. // "location": "path",
  115526. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115527. // "required": true,
  115528. // "type": "string"
  115529. // },
  115530. // "requestId": {
  115531. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115532. // "location": "query",
  115533. // "type": "string"
  115534. // },
  115535. // "urlMap": {
  115536. // "description": "Name of the UrlMap resource to update.",
  115537. // "location": "path",
  115538. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115539. // "required": true,
  115540. // "type": "string"
  115541. // }
  115542. // },
  115543. // "path": "{project}/global/urlMaps/{urlMap}",
  115544. // "request": {
  115545. // "$ref": "UrlMap"
  115546. // },
  115547. // "response": {
  115548. // "$ref": "Operation"
  115549. // },
  115550. // "scopes": [
  115551. // "https://www.googleapis.com/auth/cloud-platform",
  115552. // "https://www.googleapis.com/auth/compute"
  115553. // ]
  115554. // }
  115555. }
  115556. // method id "compute.urlMaps.validate":
  115557. type UrlMapsValidateCall struct {
  115558. s *Service
  115559. project string
  115560. urlMap string
  115561. urlmapsvalidaterequest *UrlMapsValidateRequest
  115562. urlParams_ gensupport.URLParams
  115563. ctx_ context.Context
  115564. header_ http.Header
  115565. }
  115566. // Validate: Runs static validation for the UrlMap. In particular, the
  115567. // tests of the provided UrlMap will be run. Calling this method does
  115568. // NOT create the UrlMap.
  115569. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  115570. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  115571. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115572. c.project = project
  115573. c.urlMap = urlMap
  115574. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  115575. return c
  115576. }
  115577. // Fields allows partial responses to be retrieved. See
  115578. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115579. // for more information.
  115580. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  115581. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115582. return c
  115583. }
  115584. // Context sets the context to be used in this call's Do method. Any
  115585. // pending HTTP request will be aborted if the provided context is
  115586. // canceled.
  115587. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  115588. c.ctx_ = ctx
  115589. return c
  115590. }
  115591. // Header returns an http.Header that can be modified by the caller to
  115592. // add HTTP headers to the request.
  115593. func (c *UrlMapsValidateCall) Header() http.Header {
  115594. if c.header_ == nil {
  115595. c.header_ = make(http.Header)
  115596. }
  115597. return c.header_
  115598. }
  115599. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  115600. reqHeaders := make(http.Header)
  115601. for k, v := range c.header_ {
  115602. reqHeaders[k] = v
  115603. }
  115604. reqHeaders.Set("User-Agent", c.s.userAgent())
  115605. var body io.Reader = nil
  115606. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  115607. if err != nil {
  115608. return nil, err
  115609. }
  115610. reqHeaders.Set("Content-Type", "application/json")
  115611. c.urlParams_.Set("alt", alt)
  115612. c.urlParams_.Set("prettyPrint", "false")
  115613. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  115614. urls += "?" + c.urlParams_.Encode()
  115615. req, err := http.NewRequest("POST", urls, body)
  115616. if err != nil {
  115617. return nil, err
  115618. }
  115619. req.Header = reqHeaders
  115620. googleapi.Expand(req.URL, map[string]string{
  115621. "project": c.project,
  115622. "urlMap": c.urlMap,
  115623. })
  115624. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115625. }
  115626. // Do executes the "compute.urlMaps.validate" call.
  115627. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  115628. // non-2xx status code is an error. Response headers are in either
  115629. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  115630. // returned at all) in error.(*googleapi.Error).Header. Use
  115631. // googleapi.IsNotModified to check whether the returned error was
  115632. // because http.StatusNotModified was returned.
  115633. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  115634. gensupport.SetOptions(c.urlParams_, opts...)
  115635. res, err := c.doRequest("json")
  115636. if res != nil && res.StatusCode == http.StatusNotModified {
  115637. if res.Body != nil {
  115638. res.Body.Close()
  115639. }
  115640. return nil, &googleapi.Error{
  115641. Code: res.StatusCode,
  115642. Header: res.Header,
  115643. }
  115644. }
  115645. if err != nil {
  115646. return nil, err
  115647. }
  115648. defer googleapi.CloseBody(res)
  115649. if err := googleapi.CheckResponse(res); err != nil {
  115650. return nil, err
  115651. }
  115652. ret := &UrlMapsValidateResponse{
  115653. ServerResponse: googleapi.ServerResponse{
  115654. Header: res.Header,
  115655. HTTPStatusCode: res.StatusCode,
  115656. },
  115657. }
  115658. target := &ret
  115659. if err := gensupport.DecodeResponse(target, res); err != nil {
  115660. return nil, err
  115661. }
  115662. return ret, nil
  115663. // {
  115664. // "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.",
  115665. // "httpMethod": "POST",
  115666. // "id": "compute.urlMaps.validate",
  115667. // "parameterOrder": [
  115668. // "project",
  115669. // "urlMap"
  115670. // ],
  115671. // "parameters": {
  115672. // "project": {
  115673. // "description": "Project ID for this request.",
  115674. // "location": "path",
  115675. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115676. // "required": true,
  115677. // "type": "string"
  115678. // },
  115679. // "urlMap": {
  115680. // "description": "Name of the UrlMap resource to be validated as.",
  115681. // "location": "path",
  115682. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115683. // "required": true,
  115684. // "type": "string"
  115685. // }
  115686. // },
  115687. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  115688. // "request": {
  115689. // "$ref": "UrlMapsValidateRequest"
  115690. // },
  115691. // "response": {
  115692. // "$ref": "UrlMapsValidateResponse"
  115693. // },
  115694. // "scopes": [
  115695. // "https://www.googleapis.com/auth/cloud-platform",
  115696. // "https://www.googleapis.com/auth/compute"
  115697. // ]
  115698. // }
  115699. }
  115700. // method id "compute.vpnGateways.aggregatedList":
  115701. type VpnGatewaysAggregatedListCall struct {
  115702. s *Service
  115703. project string
  115704. urlParams_ gensupport.URLParams
  115705. ifNoneMatch_ string
  115706. ctx_ context.Context
  115707. header_ http.Header
  115708. }
  115709. // AggregatedList: Retrieves an aggregated list of VPN gateways.
  115710. func (r *VpnGatewaysService) AggregatedList(project string) *VpnGatewaysAggregatedListCall {
  115711. c := &VpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115712. c.project = project
  115713. return c
  115714. }
  115715. // Filter sets the optional parameter "filter": A filter expression that
  115716. // filters resources listed in the response. The expression must specify
  115717. // the field name, a comparison operator, and the value that you want to
  115718. // use for filtering. The value must be a string, a number, or a
  115719. // boolean. The comparison operator must be either =, !=, >, or <.
  115720. //
  115721. // For example, if you are filtering Compute Engine instances, you can
  115722. // exclude instances named example-instance by specifying name !=
  115723. // example-instance.
  115724. //
  115725. // You can also filter nested fields. For example, you could specify
  115726. // scheduling.automaticRestart = false to include instances only if they
  115727. // are not scheduled for automatic restarts. You can use filtering on
  115728. // nested fields to filter based on resource labels.
  115729. //
  115730. // To filter on multiple expressions, provide each separate expression
  115731. // within parentheses. For example, (scheduling.automaticRestart = true)
  115732. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  115733. // AND expression. However, you can include AND and OR expressions
  115734. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  115735. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  115736. // true).
  115737. func (c *VpnGatewaysAggregatedListCall) Filter(filter string) *VpnGatewaysAggregatedListCall {
  115738. c.urlParams_.Set("filter", filter)
  115739. return c
  115740. }
  115741. // MaxResults sets the optional parameter "maxResults": The maximum
  115742. // number of results per page that should be returned. If the number of
  115743. // available results is larger than maxResults, Compute Engine returns a
  115744. // nextPageToken that can be used to get the next page of results in
  115745. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  115746. // (Default: 500)
  115747. func (c *VpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *VpnGatewaysAggregatedListCall {
  115748. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  115749. return c
  115750. }
  115751. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  115752. // a certain order. By default, results are returned in alphanumerical
  115753. // order based on the resource name.
  115754. //
  115755. // You can also sort results in descending order based on the creation
  115756. // timestamp using orderBy="creationTimestamp desc". This sorts results
  115757. // based on the creationTimestamp field in reverse chronological order
  115758. // (newest result first). Use this to sort resources like operations so
  115759. // that the newest operation is returned first.
  115760. //
  115761. // Currently, only sorting by name or creationTimestamp desc is
  115762. // supported.
  115763. func (c *VpnGatewaysAggregatedListCall) OrderBy(orderBy string) *VpnGatewaysAggregatedListCall {
  115764. c.urlParams_.Set("orderBy", orderBy)
  115765. return c
  115766. }
  115767. // PageToken sets the optional parameter "pageToken": Specifies a page
  115768. // token to use. Set pageToken to the nextPageToken returned by a
  115769. // previous list request to get the next page of results.
  115770. func (c *VpnGatewaysAggregatedListCall) PageToken(pageToken string) *VpnGatewaysAggregatedListCall {
  115771. c.urlParams_.Set("pageToken", pageToken)
  115772. return c
  115773. }
  115774. // Fields allows partial responses to be retrieved. See
  115775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115776. // for more information.
  115777. func (c *VpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *VpnGatewaysAggregatedListCall {
  115778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115779. return c
  115780. }
  115781. // IfNoneMatch sets the optional parameter which makes the operation
  115782. // fail if the object's ETag matches the given value. This is useful for
  115783. // getting updates only after the object has changed since the last
  115784. // request. Use googleapi.IsNotModified to check whether the response
  115785. // error from Do is the result of In-None-Match.
  115786. func (c *VpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *VpnGatewaysAggregatedListCall {
  115787. c.ifNoneMatch_ = entityTag
  115788. return c
  115789. }
  115790. // Context sets the context to be used in this call's Do method. Any
  115791. // pending HTTP request will be aborted if the provided context is
  115792. // canceled.
  115793. func (c *VpnGatewaysAggregatedListCall) Context(ctx context.Context) *VpnGatewaysAggregatedListCall {
  115794. c.ctx_ = ctx
  115795. return c
  115796. }
  115797. // Header returns an http.Header that can be modified by the caller to
  115798. // add HTTP headers to the request.
  115799. func (c *VpnGatewaysAggregatedListCall) Header() http.Header {
  115800. if c.header_ == nil {
  115801. c.header_ = make(http.Header)
  115802. }
  115803. return c.header_
  115804. }
  115805. func (c *VpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  115806. reqHeaders := make(http.Header)
  115807. for k, v := range c.header_ {
  115808. reqHeaders[k] = v
  115809. }
  115810. reqHeaders.Set("User-Agent", c.s.userAgent())
  115811. if c.ifNoneMatch_ != "" {
  115812. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  115813. }
  115814. var body io.Reader = nil
  115815. c.urlParams_.Set("alt", alt)
  115816. c.urlParams_.Set("prettyPrint", "false")
  115817. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnGateways")
  115818. urls += "?" + c.urlParams_.Encode()
  115819. req, err := http.NewRequest("GET", 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. })
  115827. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115828. }
  115829. // Do executes the "compute.vpnGateways.aggregatedList" call.
  115830. // Exactly one of *VpnGatewayAggregatedList or error will be non-nil.
  115831. // Any non-2xx status code is an error. Response headers are in either
  115832. // *VpnGatewayAggregatedList.ServerResponse.Header or (if a response was
  115833. // returned at all) in error.(*googleapi.Error).Header. Use
  115834. // googleapi.IsNotModified to check whether the returned error was
  115835. // because http.StatusNotModified was returned.
  115836. func (c *VpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayAggregatedList, error) {
  115837. gensupport.SetOptions(c.urlParams_, opts...)
  115838. res, err := c.doRequest("json")
  115839. if res != nil && res.StatusCode == http.StatusNotModified {
  115840. if res.Body != nil {
  115841. res.Body.Close()
  115842. }
  115843. return nil, &googleapi.Error{
  115844. Code: res.StatusCode,
  115845. Header: res.Header,
  115846. }
  115847. }
  115848. if err != nil {
  115849. return nil, err
  115850. }
  115851. defer googleapi.CloseBody(res)
  115852. if err := googleapi.CheckResponse(res); err != nil {
  115853. return nil, err
  115854. }
  115855. ret := &VpnGatewayAggregatedList{
  115856. ServerResponse: googleapi.ServerResponse{
  115857. Header: res.Header,
  115858. HTTPStatusCode: res.StatusCode,
  115859. },
  115860. }
  115861. target := &ret
  115862. if err := gensupport.DecodeResponse(target, res); err != nil {
  115863. return nil, err
  115864. }
  115865. return ret, nil
  115866. // {
  115867. // "description": "Retrieves an aggregated list of VPN gateways.",
  115868. // "httpMethod": "GET",
  115869. // "id": "compute.vpnGateways.aggregatedList",
  115870. // "parameterOrder": [
  115871. // "project"
  115872. // ],
  115873. // "parameters": {
  115874. // "filter": {
  115875. // "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).",
  115876. // "location": "query",
  115877. // "type": "string"
  115878. // },
  115879. // "maxResults": {
  115880. // "default": "500",
  115881. // "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)",
  115882. // "format": "uint32",
  115883. // "location": "query",
  115884. // "minimum": "0",
  115885. // "type": "integer"
  115886. // },
  115887. // "orderBy": {
  115888. // "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.",
  115889. // "location": "query",
  115890. // "type": "string"
  115891. // },
  115892. // "pageToken": {
  115893. // "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.",
  115894. // "location": "query",
  115895. // "type": "string"
  115896. // },
  115897. // "project": {
  115898. // "description": "Project ID for this request.",
  115899. // "location": "path",
  115900. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115901. // "required": true,
  115902. // "type": "string"
  115903. // }
  115904. // },
  115905. // "path": "{project}/aggregated/vpnGateways",
  115906. // "response": {
  115907. // "$ref": "VpnGatewayAggregatedList"
  115908. // },
  115909. // "scopes": [
  115910. // "https://www.googleapis.com/auth/cloud-platform",
  115911. // "https://www.googleapis.com/auth/compute",
  115912. // "https://www.googleapis.com/auth/compute.readonly"
  115913. // ]
  115914. // }
  115915. }
  115916. // Pages invokes f for each page of results.
  115917. // A non-nil error returned from f will halt the iteration.
  115918. // The provided context supersedes any context provided to the Context method.
  115919. func (c *VpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*VpnGatewayAggregatedList) error) error {
  115920. c.ctx_ = ctx
  115921. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  115922. for {
  115923. x, err := c.Do()
  115924. if err != nil {
  115925. return err
  115926. }
  115927. if err := f(x); err != nil {
  115928. return err
  115929. }
  115930. if x.NextPageToken == "" {
  115931. return nil
  115932. }
  115933. c.PageToken(x.NextPageToken)
  115934. }
  115935. }
  115936. // method id "compute.vpnGateways.delete":
  115937. type VpnGatewaysDeleteCall struct {
  115938. s *Service
  115939. project string
  115940. region string
  115941. vpnGateway string
  115942. urlParams_ gensupport.URLParams
  115943. ctx_ context.Context
  115944. header_ http.Header
  115945. }
  115946. // Delete: Deletes the specified VPN gateway.
  115947. func (r *VpnGatewaysService) Delete(project string, region string, vpnGateway string) *VpnGatewaysDeleteCall {
  115948. c := &VpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115949. c.project = project
  115950. c.region = region
  115951. c.vpnGateway = vpnGateway
  115952. return c
  115953. }
  115954. // RequestId sets the optional parameter "requestId": An optional
  115955. // request ID to identify requests. Specify a unique request ID so that
  115956. // if you must retry your request, the server will know to ignore the
  115957. // request if it has already been completed.
  115958. //
  115959. // For example, consider a situation where you make an initial request
  115960. // and the request times out. If you make the request again with the
  115961. // same request ID, the server can check if original operation with the
  115962. // same request ID was received, and if so, will ignore the second
  115963. // request. This prevents clients from accidentally creating duplicate
  115964. // commitments.
  115965. //
  115966. // The request ID must be a valid UUID with the exception that zero UUID
  115967. // is not supported (00000000-0000-0000-0000-000000000000).
  115968. func (c *VpnGatewaysDeleteCall) RequestId(requestId string) *VpnGatewaysDeleteCall {
  115969. c.urlParams_.Set("requestId", requestId)
  115970. return c
  115971. }
  115972. // Fields allows partial responses to be retrieved. See
  115973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115974. // for more information.
  115975. func (c *VpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *VpnGatewaysDeleteCall {
  115976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115977. return c
  115978. }
  115979. // Context sets the context to be used in this call's Do method. Any
  115980. // pending HTTP request will be aborted if the provided context is
  115981. // canceled.
  115982. func (c *VpnGatewaysDeleteCall) Context(ctx context.Context) *VpnGatewaysDeleteCall {
  115983. c.ctx_ = ctx
  115984. return c
  115985. }
  115986. // Header returns an http.Header that can be modified by the caller to
  115987. // add HTTP headers to the request.
  115988. func (c *VpnGatewaysDeleteCall) Header() http.Header {
  115989. if c.header_ == nil {
  115990. c.header_ = make(http.Header)
  115991. }
  115992. return c.header_
  115993. }
  115994. func (c *VpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  115995. reqHeaders := make(http.Header)
  115996. for k, v := range c.header_ {
  115997. reqHeaders[k] = v
  115998. }
  115999. reqHeaders.Set("User-Agent", c.s.userAgent())
  116000. var body io.Reader = nil
  116001. c.urlParams_.Set("alt", alt)
  116002. c.urlParams_.Set("prettyPrint", "false")
  116003. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  116004. urls += "?" + c.urlParams_.Encode()
  116005. req, err := http.NewRequest("DELETE", urls, body)
  116006. if err != nil {
  116007. return nil, err
  116008. }
  116009. req.Header = reqHeaders
  116010. googleapi.Expand(req.URL, map[string]string{
  116011. "project": c.project,
  116012. "region": c.region,
  116013. "vpnGateway": c.vpnGateway,
  116014. })
  116015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116016. }
  116017. // Do executes the "compute.vpnGateways.delete" call.
  116018. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116019. // status code is an error. Response headers are in either
  116020. // *Operation.ServerResponse.Header or (if a response was returned at
  116021. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116022. // to check whether the returned error was because
  116023. // http.StatusNotModified was returned.
  116024. func (c *VpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116025. gensupport.SetOptions(c.urlParams_, opts...)
  116026. res, err := c.doRequest("json")
  116027. if res != nil && res.StatusCode == http.StatusNotModified {
  116028. if res.Body != nil {
  116029. res.Body.Close()
  116030. }
  116031. return nil, &googleapi.Error{
  116032. Code: res.StatusCode,
  116033. Header: res.Header,
  116034. }
  116035. }
  116036. if err != nil {
  116037. return nil, err
  116038. }
  116039. defer googleapi.CloseBody(res)
  116040. if err := googleapi.CheckResponse(res); err != nil {
  116041. return nil, err
  116042. }
  116043. ret := &Operation{
  116044. ServerResponse: googleapi.ServerResponse{
  116045. Header: res.Header,
  116046. HTTPStatusCode: res.StatusCode,
  116047. },
  116048. }
  116049. target := &ret
  116050. if err := gensupport.DecodeResponse(target, res); err != nil {
  116051. return nil, err
  116052. }
  116053. return ret, nil
  116054. // {
  116055. // "description": "Deletes the specified VPN gateway.",
  116056. // "httpMethod": "DELETE",
  116057. // "id": "compute.vpnGateways.delete",
  116058. // "parameterOrder": [
  116059. // "project",
  116060. // "region",
  116061. // "vpnGateway"
  116062. // ],
  116063. // "parameters": {
  116064. // "project": {
  116065. // "description": "Project ID for this request.",
  116066. // "location": "path",
  116067. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116068. // "required": true,
  116069. // "type": "string"
  116070. // },
  116071. // "region": {
  116072. // "description": "Name of the region for this request.",
  116073. // "location": "path",
  116074. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116075. // "required": true,
  116076. // "type": "string"
  116077. // },
  116078. // "requestId": {
  116079. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116080. // "location": "query",
  116081. // "type": "string"
  116082. // },
  116083. // "vpnGateway": {
  116084. // "description": "Name of the VPN gateway to delete.",
  116085. // "location": "path",
  116086. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116087. // "required": true,
  116088. // "type": "string"
  116089. // }
  116090. // },
  116091. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  116092. // "response": {
  116093. // "$ref": "Operation"
  116094. // },
  116095. // "scopes": [
  116096. // "https://www.googleapis.com/auth/cloud-platform",
  116097. // "https://www.googleapis.com/auth/compute"
  116098. // ]
  116099. // }
  116100. }
  116101. // method id "compute.vpnGateways.get":
  116102. type VpnGatewaysGetCall struct {
  116103. s *Service
  116104. project string
  116105. region string
  116106. vpnGateway string
  116107. urlParams_ gensupport.URLParams
  116108. ifNoneMatch_ string
  116109. ctx_ context.Context
  116110. header_ http.Header
  116111. }
  116112. // Get: Returns the specified VPN gateway. Gets a list of available VPN
  116113. // gateways by making a list() request.
  116114. func (r *VpnGatewaysService) Get(project string, region string, vpnGateway string) *VpnGatewaysGetCall {
  116115. c := &VpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116116. c.project = project
  116117. c.region = region
  116118. c.vpnGateway = vpnGateway
  116119. return c
  116120. }
  116121. // Fields allows partial responses to be retrieved. See
  116122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116123. // for more information.
  116124. func (c *VpnGatewaysGetCall) Fields(s ...googleapi.Field) *VpnGatewaysGetCall {
  116125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116126. return c
  116127. }
  116128. // IfNoneMatch sets the optional parameter which makes the operation
  116129. // fail if the object's ETag matches the given value. This is useful for
  116130. // getting updates only after the object has changed since the last
  116131. // request. Use googleapi.IsNotModified to check whether the response
  116132. // error from Do is the result of In-None-Match.
  116133. func (c *VpnGatewaysGetCall) IfNoneMatch(entityTag string) *VpnGatewaysGetCall {
  116134. c.ifNoneMatch_ = entityTag
  116135. return c
  116136. }
  116137. // Context sets the context to be used in this call's Do method. Any
  116138. // pending HTTP request will be aborted if the provided context is
  116139. // canceled.
  116140. func (c *VpnGatewaysGetCall) Context(ctx context.Context) *VpnGatewaysGetCall {
  116141. c.ctx_ = ctx
  116142. return c
  116143. }
  116144. // Header returns an http.Header that can be modified by the caller to
  116145. // add HTTP headers to the request.
  116146. func (c *VpnGatewaysGetCall) Header() http.Header {
  116147. if c.header_ == nil {
  116148. c.header_ = make(http.Header)
  116149. }
  116150. return c.header_
  116151. }
  116152. func (c *VpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  116153. reqHeaders := make(http.Header)
  116154. for k, v := range c.header_ {
  116155. reqHeaders[k] = v
  116156. }
  116157. reqHeaders.Set("User-Agent", c.s.userAgent())
  116158. if c.ifNoneMatch_ != "" {
  116159. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  116160. }
  116161. var body io.Reader = nil
  116162. c.urlParams_.Set("alt", alt)
  116163. c.urlParams_.Set("prettyPrint", "false")
  116164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  116165. urls += "?" + c.urlParams_.Encode()
  116166. req, err := http.NewRequest("GET", urls, body)
  116167. if err != nil {
  116168. return nil, err
  116169. }
  116170. req.Header = reqHeaders
  116171. googleapi.Expand(req.URL, map[string]string{
  116172. "project": c.project,
  116173. "region": c.region,
  116174. "vpnGateway": c.vpnGateway,
  116175. })
  116176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116177. }
  116178. // Do executes the "compute.vpnGateways.get" call.
  116179. // Exactly one of *VpnGateway or error will be non-nil. Any non-2xx
  116180. // status code is an error. Response headers are in either
  116181. // *VpnGateway.ServerResponse.Header or (if a response was returned at
  116182. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116183. // to check whether the returned error was because
  116184. // http.StatusNotModified was returned.
  116185. func (c *VpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*VpnGateway, error) {
  116186. gensupport.SetOptions(c.urlParams_, opts...)
  116187. res, err := c.doRequest("json")
  116188. if res != nil && res.StatusCode == http.StatusNotModified {
  116189. if res.Body != nil {
  116190. res.Body.Close()
  116191. }
  116192. return nil, &googleapi.Error{
  116193. Code: res.StatusCode,
  116194. Header: res.Header,
  116195. }
  116196. }
  116197. if err != nil {
  116198. return nil, err
  116199. }
  116200. defer googleapi.CloseBody(res)
  116201. if err := googleapi.CheckResponse(res); err != nil {
  116202. return nil, err
  116203. }
  116204. ret := &VpnGateway{
  116205. ServerResponse: googleapi.ServerResponse{
  116206. Header: res.Header,
  116207. HTTPStatusCode: res.StatusCode,
  116208. },
  116209. }
  116210. target := &ret
  116211. if err := gensupport.DecodeResponse(target, res); err != nil {
  116212. return nil, err
  116213. }
  116214. return ret, nil
  116215. // {
  116216. // "description": "Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request.",
  116217. // "httpMethod": "GET",
  116218. // "id": "compute.vpnGateways.get",
  116219. // "parameterOrder": [
  116220. // "project",
  116221. // "region",
  116222. // "vpnGateway"
  116223. // ],
  116224. // "parameters": {
  116225. // "project": {
  116226. // "description": "Project ID for this request.",
  116227. // "location": "path",
  116228. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116229. // "required": true,
  116230. // "type": "string"
  116231. // },
  116232. // "region": {
  116233. // "description": "Name of the region for this request.",
  116234. // "location": "path",
  116235. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116236. // "required": true,
  116237. // "type": "string"
  116238. // },
  116239. // "vpnGateway": {
  116240. // "description": "Name of the VPN gateway to return.",
  116241. // "location": "path",
  116242. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116243. // "required": true,
  116244. // "type": "string"
  116245. // }
  116246. // },
  116247. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  116248. // "response": {
  116249. // "$ref": "VpnGateway"
  116250. // },
  116251. // "scopes": [
  116252. // "https://www.googleapis.com/auth/cloud-platform",
  116253. // "https://www.googleapis.com/auth/compute",
  116254. // "https://www.googleapis.com/auth/compute.readonly"
  116255. // ]
  116256. // }
  116257. }
  116258. // method id "compute.vpnGateways.insert":
  116259. type VpnGatewaysInsertCall struct {
  116260. s *Service
  116261. project string
  116262. region string
  116263. vpngateway *VpnGateway
  116264. urlParams_ gensupport.URLParams
  116265. ctx_ context.Context
  116266. header_ http.Header
  116267. }
  116268. // Insert: Creates a VPN gateway in the specified project and region
  116269. // using the data included in the request.
  116270. func (r *VpnGatewaysService) Insert(project string, region string, vpngateway *VpnGateway) *VpnGatewaysInsertCall {
  116271. c := &VpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116272. c.project = project
  116273. c.region = region
  116274. c.vpngateway = vpngateway
  116275. return c
  116276. }
  116277. // RequestId sets the optional parameter "requestId": An optional
  116278. // request ID to identify requests. Specify a unique request ID so that
  116279. // if you must retry your request, the server will know to ignore the
  116280. // request if it has already been completed.
  116281. //
  116282. // For example, consider a situation where you make an initial request
  116283. // and the request times out. If you make the request again with the
  116284. // same request ID, the server can check if original operation with the
  116285. // same request ID was received, and if so, will ignore the second
  116286. // request. This prevents clients from accidentally creating duplicate
  116287. // commitments.
  116288. //
  116289. // The request ID must be a valid UUID with the exception that zero UUID
  116290. // is not supported (00000000-0000-0000-0000-000000000000).
  116291. func (c *VpnGatewaysInsertCall) RequestId(requestId string) *VpnGatewaysInsertCall {
  116292. c.urlParams_.Set("requestId", requestId)
  116293. return c
  116294. }
  116295. // Fields allows partial responses to be retrieved. See
  116296. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116297. // for more information.
  116298. func (c *VpnGatewaysInsertCall) Fields(s ...googleapi.Field) *VpnGatewaysInsertCall {
  116299. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116300. return c
  116301. }
  116302. // Context sets the context to be used in this call's Do method. Any
  116303. // pending HTTP request will be aborted if the provided context is
  116304. // canceled.
  116305. func (c *VpnGatewaysInsertCall) Context(ctx context.Context) *VpnGatewaysInsertCall {
  116306. c.ctx_ = ctx
  116307. return c
  116308. }
  116309. // Header returns an http.Header that can be modified by the caller to
  116310. // add HTTP headers to the request.
  116311. func (c *VpnGatewaysInsertCall) Header() http.Header {
  116312. if c.header_ == nil {
  116313. c.header_ = make(http.Header)
  116314. }
  116315. return c.header_
  116316. }
  116317. func (c *VpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  116318. reqHeaders := make(http.Header)
  116319. for k, v := range c.header_ {
  116320. reqHeaders[k] = v
  116321. }
  116322. reqHeaders.Set("User-Agent", c.s.userAgent())
  116323. var body io.Reader = nil
  116324. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpngateway)
  116325. if err != nil {
  116326. return nil, err
  116327. }
  116328. reqHeaders.Set("Content-Type", "application/json")
  116329. c.urlParams_.Set("alt", alt)
  116330. c.urlParams_.Set("prettyPrint", "false")
  116331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  116332. urls += "?" + c.urlParams_.Encode()
  116333. req, err := http.NewRequest("POST", urls, body)
  116334. if err != nil {
  116335. return nil, err
  116336. }
  116337. req.Header = reqHeaders
  116338. googleapi.Expand(req.URL, map[string]string{
  116339. "project": c.project,
  116340. "region": c.region,
  116341. })
  116342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116343. }
  116344. // Do executes the "compute.vpnGateways.insert" call.
  116345. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116346. // status code is an error. Response headers are in either
  116347. // *Operation.ServerResponse.Header or (if a response was returned at
  116348. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116349. // to check whether the returned error was because
  116350. // http.StatusNotModified was returned.
  116351. func (c *VpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116352. gensupport.SetOptions(c.urlParams_, opts...)
  116353. res, err := c.doRequest("json")
  116354. if res != nil && res.StatusCode == http.StatusNotModified {
  116355. if res.Body != nil {
  116356. res.Body.Close()
  116357. }
  116358. return nil, &googleapi.Error{
  116359. Code: res.StatusCode,
  116360. Header: res.Header,
  116361. }
  116362. }
  116363. if err != nil {
  116364. return nil, err
  116365. }
  116366. defer googleapi.CloseBody(res)
  116367. if err := googleapi.CheckResponse(res); err != nil {
  116368. return nil, err
  116369. }
  116370. ret := &Operation{
  116371. ServerResponse: googleapi.ServerResponse{
  116372. Header: res.Header,
  116373. HTTPStatusCode: res.StatusCode,
  116374. },
  116375. }
  116376. target := &ret
  116377. if err := gensupport.DecodeResponse(target, res); err != nil {
  116378. return nil, err
  116379. }
  116380. return ret, nil
  116381. // {
  116382. // "description": "Creates a VPN gateway in the specified project and region using the data included in the request.",
  116383. // "httpMethod": "POST",
  116384. // "id": "compute.vpnGateways.insert",
  116385. // "parameterOrder": [
  116386. // "project",
  116387. // "region"
  116388. // ],
  116389. // "parameters": {
  116390. // "project": {
  116391. // "description": "Project ID for this request.",
  116392. // "location": "path",
  116393. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116394. // "required": true,
  116395. // "type": "string"
  116396. // },
  116397. // "region": {
  116398. // "description": "Name of the region for this request.",
  116399. // "location": "path",
  116400. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116401. // "required": true,
  116402. // "type": "string"
  116403. // },
  116404. // "requestId": {
  116405. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116406. // "location": "query",
  116407. // "type": "string"
  116408. // }
  116409. // },
  116410. // "path": "{project}/regions/{region}/vpnGateways",
  116411. // "request": {
  116412. // "$ref": "VpnGateway"
  116413. // },
  116414. // "response": {
  116415. // "$ref": "Operation"
  116416. // },
  116417. // "scopes": [
  116418. // "https://www.googleapis.com/auth/cloud-platform",
  116419. // "https://www.googleapis.com/auth/compute"
  116420. // ]
  116421. // }
  116422. }
  116423. // method id "compute.vpnGateways.list":
  116424. type VpnGatewaysListCall struct {
  116425. s *Service
  116426. project string
  116427. region string
  116428. urlParams_ gensupport.URLParams
  116429. ifNoneMatch_ string
  116430. ctx_ context.Context
  116431. header_ http.Header
  116432. }
  116433. // List: Retrieves a list of VPN gateways available to the specified
  116434. // project and region.
  116435. func (r *VpnGatewaysService) List(project string, region string) *VpnGatewaysListCall {
  116436. c := &VpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116437. c.project = project
  116438. c.region = region
  116439. return c
  116440. }
  116441. // Filter sets the optional parameter "filter": A filter expression that
  116442. // filters resources listed in the response. The expression must specify
  116443. // the field name, a comparison operator, and the value that you want to
  116444. // use for filtering. The value must be a string, a number, or a
  116445. // boolean. The comparison operator must be either =, !=, >, or <.
  116446. //
  116447. // For example, if you are filtering Compute Engine instances, you can
  116448. // exclude instances named example-instance by specifying name !=
  116449. // example-instance.
  116450. //
  116451. // You can also filter nested fields. For example, you could specify
  116452. // scheduling.automaticRestart = false to include instances only if they
  116453. // are not scheduled for automatic restarts. You can use filtering on
  116454. // nested fields to filter based on resource labels.
  116455. //
  116456. // To filter on multiple expressions, provide each separate expression
  116457. // within parentheses. For example, (scheduling.automaticRestart = true)
  116458. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  116459. // AND expression. However, you can include AND and OR expressions
  116460. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  116461. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  116462. // true).
  116463. func (c *VpnGatewaysListCall) Filter(filter string) *VpnGatewaysListCall {
  116464. c.urlParams_.Set("filter", filter)
  116465. return c
  116466. }
  116467. // MaxResults sets the optional parameter "maxResults": The maximum
  116468. // number of results per page that should be returned. If the number of
  116469. // available results is larger than maxResults, Compute Engine returns a
  116470. // nextPageToken that can be used to get the next page of results in
  116471. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  116472. // (Default: 500)
  116473. func (c *VpnGatewaysListCall) MaxResults(maxResults int64) *VpnGatewaysListCall {
  116474. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  116475. return c
  116476. }
  116477. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  116478. // a certain order. By default, results are returned in alphanumerical
  116479. // order based on the resource name.
  116480. //
  116481. // You can also sort results in descending order based on the creation
  116482. // timestamp using orderBy="creationTimestamp desc". This sorts results
  116483. // based on the creationTimestamp field in reverse chronological order
  116484. // (newest result first). Use this to sort resources like operations so
  116485. // that the newest operation is returned first.
  116486. //
  116487. // Currently, only sorting by name or creationTimestamp desc is
  116488. // supported.
  116489. func (c *VpnGatewaysListCall) OrderBy(orderBy string) *VpnGatewaysListCall {
  116490. c.urlParams_.Set("orderBy", orderBy)
  116491. return c
  116492. }
  116493. // PageToken sets the optional parameter "pageToken": Specifies a page
  116494. // token to use. Set pageToken to the nextPageToken returned by a
  116495. // previous list request to get the next page of results.
  116496. func (c *VpnGatewaysListCall) PageToken(pageToken string) *VpnGatewaysListCall {
  116497. c.urlParams_.Set("pageToken", pageToken)
  116498. return c
  116499. }
  116500. // Fields allows partial responses to be retrieved. See
  116501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116502. // for more information.
  116503. func (c *VpnGatewaysListCall) Fields(s ...googleapi.Field) *VpnGatewaysListCall {
  116504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116505. return c
  116506. }
  116507. // IfNoneMatch sets the optional parameter which makes the operation
  116508. // fail if the object's ETag matches the given value. This is useful for
  116509. // getting updates only after the object has changed since the last
  116510. // request. Use googleapi.IsNotModified to check whether the response
  116511. // error from Do is the result of In-None-Match.
  116512. func (c *VpnGatewaysListCall) IfNoneMatch(entityTag string) *VpnGatewaysListCall {
  116513. c.ifNoneMatch_ = entityTag
  116514. return c
  116515. }
  116516. // Context sets the context to be used in this call's Do method. Any
  116517. // pending HTTP request will be aborted if the provided context is
  116518. // canceled.
  116519. func (c *VpnGatewaysListCall) Context(ctx context.Context) *VpnGatewaysListCall {
  116520. c.ctx_ = ctx
  116521. return c
  116522. }
  116523. // Header returns an http.Header that can be modified by the caller to
  116524. // add HTTP headers to the request.
  116525. func (c *VpnGatewaysListCall) Header() http.Header {
  116526. if c.header_ == nil {
  116527. c.header_ = make(http.Header)
  116528. }
  116529. return c.header_
  116530. }
  116531. func (c *VpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  116532. reqHeaders := make(http.Header)
  116533. for k, v := range c.header_ {
  116534. reqHeaders[k] = v
  116535. }
  116536. reqHeaders.Set("User-Agent", c.s.userAgent())
  116537. if c.ifNoneMatch_ != "" {
  116538. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  116539. }
  116540. var body io.Reader = nil
  116541. c.urlParams_.Set("alt", alt)
  116542. c.urlParams_.Set("prettyPrint", "false")
  116543. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  116544. urls += "?" + c.urlParams_.Encode()
  116545. req, err := http.NewRequest("GET", 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. })
  116554. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116555. }
  116556. // Do executes the "compute.vpnGateways.list" call.
  116557. // Exactly one of *VpnGatewayList or error will be non-nil. Any non-2xx
  116558. // status code is an error. Response headers are in either
  116559. // *VpnGatewayList.ServerResponse.Header or (if a response was returned
  116560. // at all) in error.(*googleapi.Error).Header. Use
  116561. // googleapi.IsNotModified to check whether the returned error was
  116562. // because http.StatusNotModified was returned.
  116563. func (c *VpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayList, error) {
  116564. gensupport.SetOptions(c.urlParams_, opts...)
  116565. res, err := c.doRequest("json")
  116566. if res != nil && res.StatusCode == http.StatusNotModified {
  116567. if res.Body != nil {
  116568. res.Body.Close()
  116569. }
  116570. return nil, &googleapi.Error{
  116571. Code: res.StatusCode,
  116572. Header: res.Header,
  116573. }
  116574. }
  116575. if err != nil {
  116576. return nil, err
  116577. }
  116578. defer googleapi.CloseBody(res)
  116579. if err := googleapi.CheckResponse(res); err != nil {
  116580. return nil, err
  116581. }
  116582. ret := &VpnGatewayList{
  116583. ServerResponse: googleapi.ServerResponse{
  116584. Header: res.Header,
  116585. HTTPStatusCode: res.StatusCode,
  116586. },
  116587. }
  116588. target := &ret
  116589. if err := gensupport.DecodeResponse(target, res); err != nil {
  116590. return nil, err
  116591. }
  116592. return ret, nil
  116593. // {
  116594. // "description": "Retrieves a list of VPN gateways available to the specified project and region.",
  116595. // "httpMethod": "GET",
  116596. // "id": "compute.vpnGateways.list",
  116597. // "parameterOrder": [
  116598. // "project",
  116599. // "region"
  116600. // ],
  116601. // "parameters": {
  116602. // "filter": {
  116603. // "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).",
  116604. // "location": "query",
  116605. // "type": "string"
  116606. // },
  116607. // "maxResults": {
  116608. // "default": "500",
  116609. // "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)",
  116610. // "format": "uint32",
  116611. // "location": "query",
  116612. // "minimum": "0",
  116613. // "type": "integer"
  116614. // },
  116615. // "orderBy": {
  116616. // "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.",
  116617. // "location": "query",
  116618. // "type": "string"
  116619. // },
  116620. // "pageToken": {
  116621. // "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.",
  116622. // "location": "query",
  116623. // "type": "string"
  116624. // },
  116625. // "project": {
  116626. // "description": "Project ID for this request.",
  116627. // "location": "path",
  116628. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116629. // "required": true,
  116630. // "type": "string"
  116631. // },
  116632. // "region": {
  116633. // "description": "Name of the region for this request.",
  116634. // "location": "path",
  116635. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116636. // "required": true,
  116637. // "type": "string"
  116638. // }
  116639. // },
  116640. // "path": "{project}/regions/{region}/vpnGateways",
  116641. // "response": {
  116642. // "$ref": "VpnGatewayList"
  116643. // },
  116644. // "scopes": [
  116645. // "https://www.googleapis.com/auth/cloud-platform",
  116646. // "https://www.googleapis.com/auth/compute",
  116647. // "https://www.googleapis.com/auth/compute.readonly"
  116648. // ]
  116649. // }
  116650. }
  116651. // Pages invokes f for each page of results.
  116652. // A non-nil error returned from f will halt the iteration.
  116653. // The provided context supersedes any context provided to the Context method.
  116654. func (c *VpnGatewaysListCall) Pages(ctx context.Context, f func(*VpnGatewayList) error) error {
  116655. c.ctx_ = ctx
  116656. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  116657. for {
  116658. x, err := c.Do()
  116659. if err != nil {
  116660. return err
  116661. }
  116662. if err := f(x); err != nil {
  116663. return err
  116664. }
  116665. if x.NextPageToken == "" {
  116666. return nil
  116667. }
  116668. c.PageToken(x.NextPageToken)
  116669. }
  116670. }
  116671. // method id "compute.vpnGateways.setLabels":
  116672. type VpnGatewaysSetLabelsCall struct {
  116673. s *Service
  116674. project string
  116675. region string
  116676. resource string
  116677. regionsetlabelsrequest *RegionSetLabelsRequest
  116678. urlParams_ gensupport.URLParams
  116679. ctx_ context.Context
  116680. header_ http.Header
  116681. }
  116682. // SetLabels: Sets the labels on a VpnGateway. To learn more about
  116683. // labels, read the Labeling Resources documentation.
  116684. func (r *VpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnGatewaysSetLabelsCall {
  116685. c := &VpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116686. c.project = project
  116687. c.region = region
  116688. c.resource = resource
  116689. c.regionsetlabelsrequest = regionsetlabelsrequest
  116690. return c
  116691. }
  116692. // RequestId sets the optional parameter "requestId": An optional
  116693. // request ID to identify requests. Specify a unique request ID so that
  116694. // if you must retry your request, the server will know to ignore the
  116695. // request if it has already been completed.
  116696. //
  116697. // For example, consider a situation where you make an initial request
  116698. // and the request times out. If you make the request again with the
  116699. // same request ID, the server can check if original operation with the
  116700. // same request ID was received, and if so, will ignore the second
  116701. // request. This prevents clients from accidentally creating duplicate
  116702. // commitments.
  116703. //
  116704. // The request ID must be a valid UUID with the exception that zero UUID
  116705. // is not supported (00000000-0000-0000-0000-000000000000).
  116706. func (c *VpnGatewaysSetLabelsCall) RequestId(requestId string) *VpnGatewaysSetLabelsCall {
  116707. c.urlParams_.Set("requestId", requestId)
  116708. return c
  116709. }
  116710. // Fields allows partial responses to be retrieved. See
  116711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116712. // for more information.
  116713. func (c *VpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *VpnGatewaysSetLabelsCall {
  116714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116715. return c
  116716. }
  116717. // Context sets the context to be used in this call's Do method. Any
  116718. // pending HTTP request will be aborted if the provided context is
  116719. // canceled.
  116720. func (c *VpnGatewaysSetLabelsCall) Context(ctx context.Context) *VpnGatewaysSetLabelsCall {
  116721. c.ctx_ = ctx
  116722. return c
  116723. }
  116724. // Header returns an http.Header that can be modified by the caller to
  116725. // add HTTP headers to the request.
  116726. func (c *VpnGatewaysSetLabelsCall) Header() http.Header {
  116727. if c.header_ == nil {
  116728. c.header_ = make(http.Header)
  116729. }
  116730. return c.header_
  116731. }
  116732. func (c *VpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  116733. reqHeaders := make(http.Header)
  116734. for k, v := range c.header_ {
  116735. reqHeaders[k] = v
  116736. }
  116737. reqHeaders.Set("User-Agent", c.s.userAgent())
  116738. var body io.Reader = nil
  116739. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  116740. if err != nil {
  116741. return nil, err
  116742. }
  116743. reqHeaders.Set("Content-Type", "application/json")
  116744. c.urlParams_.Set("alt", alt)
  116745. c.urlParams_.Set("prettyPrint", "false")
  116746. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{resource}/setLabels")
  116747. urls += "?" + c.urlParams_.Encode()
  116748. req, err := http.NewRequest("POST", urls, body)
  116749. if err != nil {
  116750. return nil, err
  116751. }
  116752. req.Header = reqHeaders
  116753. googleapi.Expand(req.URL, map[string]string{
  116754. "project": c.project,
  116755. "region": c.region,
  116756. "resource": c.resource,
  116757. })
  116758. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116759. }
  116760. // Do executes the "compute.vpnGateways.setLabels" call.
  116761. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116762. // status code is an error. Response headers are in either
  116763. // *Operation.ServerResponse.Header or (if a response was returned at
  116764. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116765. // to check whether the returned error was because
  116766. // http.StatusNotModified was returned.
  116767. func (c *VpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116768. gensupport.SetOptions(c.urlParams_, opts...)
  116769. res, err := c.doRequest("json")
  116770. if res != nil && res.StatusCode == http.StatusNotModified {
  116771. if res.Body != nil {
  116772. res.Body.Close()
  116773. }
  116774. return nil, &googleapi.Error{
  116775. Code: res.StatusCode,
  116776. Header: res.Header,
  116777. }
  116778. }
  116779. if err != nil {
  116780. return nil, err
  116781. }
  116782. defer googleapi.CloseBody(res)
  116783. if err := googleapi.CheckResponse(res); err != nil {
  116784. return nil, err
  116785. }
  116786. ret := &Operation{
  116787. ServerResponse: googleapi.ServerResponse{
  116788. Header: res.Header,
  116789. HTTPStatusCode: res.StatusCode,
  116790. },
  116791. }
  116792. target := &ret
  116793. if err := gensupport.DecodeResponse(target, res); err != nil {
  116794. return nil, err
  116795. }
  116796. return ret, nil
  116797. // {
  116798. // "description": "Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  116799. // "httpMethod": "POST",
  116800. // "id": "compute.vpnGateways.setLabels",
  116801. // "parameterOrder": [
  116802. // "project",
  116803. // "region",
  116804. // "resource"
  116805. // ],
  116806. // "parameters": {
  116807. // "project": {
  116808. // "description": "Project ID for this request.",
  116809. // "location": "path",
  116810. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116811. // "required": true,
  116812. // "type": "string"
  116813. // },
  116814. // "region": {
  116815. // "description": "The region for this request.",
  116816. // "location": "path",
  116817. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116818. // "required": true,
  116819. // "type": "string"
  116820. // },
  116821. // "requestId": {
  116822. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116823. // "location": "query",
  116824. // "type": "string"
  116825. // },
  116826. // "resource": {
  116827. // "description": "Name or id of the resource for this request.",
  116828. // "location": "path",
  116829. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116830. // "required": true,
  116831. // "type": "string"
  116832. // }
  116833. // },
  116834. // "path": "{project}/regions/{region}/vpnGateways/{resource}/setLabels",
  116835. // "request": {
  116836. // "$ref": "RegionSetLabelsRequest"
  116837. // },
  116838. // "response": {
  116839. // "$ref": "Operation"
  116840. // },
  116841. // "scopes": [
  116842. // "https://www.googleapis.com/auth/cloud-platform",
  116843. // "https://www.googleapis.com/auth/compute"
  116844. // ]
  116845. // }
  116846. }
  116847. // method id "compute.vpnTunnels.aggregatedList":
  116848. type VpnTunnelsAggregatedListCall struct {
  116849. s *Service
  116850. project string
  116851. urlParams_ gensupport.URLParams
  116852. ifNoneMatch_ string
  116853. ctx_ context.Context
  116854. header_ http.Header
  116855. }
  116856. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  116857. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  116858. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116859. c.project = project
  116860. return c
  116861. }
  116862. // Filter sets the optional parameter "filter": A filter expression that
  116863. // filters resources listed in the response. The expression must specify
  116864. // the field name, a comparison operator, and the value that you want to
  116865. // use for filtering. The value must be a string, a number, or a
  116866. // boolean. The comparison operator must be either =, !=, >, or <.
  116867. //
  116868. // For example, if you are filtering Compute Engine instances, you can
  116869. // exclude instances named example-instance by specifying name !=
  116870. // example-instance.
  116871. //
  116872. // You can also filter nested fields. For example, you could specify
  116873. // scheduling.automaticRestart = false to include instances only if they
  116874. // are not scheduled for automatic restarts. You can use filtering on
  116875. // nested fields to filter based on resource labels.
  116876. //
  116877. // To filter on multiple expressions, provide each separate expression
  116878. // within parentheses. For example, (scheduling.automaticRestart = true)
  116879. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  116880. // AND expression. However, you can include AND and OR expressions
  116881. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  116882. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  116883. // true).
  116884. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  116885. c.urlParams_.Set("filter", filter)
  116886. return c
  116887. }
  116888. // MaxResults sets the optional parameter "maxResults": The maximum
  116889. // number of results per page that should be returned. If the number of
  116890. // available results is larger than maxResults, Compute Engine returns a
  116891. // nextPageToken that can be used to get the next page of results in
  116892. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  116893. // (Default: 500)
  116894. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  116895. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  116896. return c
  116897. }
  116898. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  116899. // a certain order. By default, results are returned in alphanumerical
  116900. // order based on the resource name.
  116901. //
  116902. // You can also sort results in descending order based on the creation
  116903. // timestamp using orderBy="creationTimestamp desc". This sorts results
  116904. // based on the creationTimestamp field in reverse chronological order
  116905. // (newest result first). Use this to sort resources like operations so
  116906. // that the newest operation is returned first.
  116907. //
  116908. // Currently, only sorting by name or creationTimestamp desc is
  116909. // supported.
  116910. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  116911. c.urlParams_.Set("orderBy", orderBy)
  116912. return c
  116913. }
  116914. // PageToken sets the optional parameter "pageToken": Specifies a page
  116915. // token to use. Set pageToken to the nextPageToken returned by a
  116916. // previous list request to get the next page of results.
  116917. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  116918. c.urlParams_.Set("pageToken", pageToken)
  116919. return c
  116920. }
  116921. // Fields allows partial responses to be retrieved. See
  116922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116923. // for more information.
  116924. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  116925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116926. return c
  116927. }
  116928. // IfNoneMatch sets the optional parameter which makes the operation
  116929. // fail if the object's ETag matches the given value. This is useful for
  116930. // getting updates only after the object has changed since the last
  116931. // request. Use googleapi.IsNotModified to check whether the response
  116932. // error from Do is the result of In-None-Match.
  116933. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  116934. c.ifNoneMatch_ = entityTag
  116935. return c
  116936. }
  116937. // Context sets the context to be used in this call's Do method. Any
  116938. // pending HTTP request will be aborted if the provided context is
  116939. // canceled.
  116940. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  116941. c.ctx_ = ctx
  116942. return c
  116943. }
  116944. // Header returns an http.Header that can be modified by the caller to
  116945. // add HTTP headers to the request.
  116946. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  116947. if c.header_ == nil {
  116948. c.header_ = make(http.Header)
  116949. }
  116950. return c.header_
  116951. }
  116952. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  116953. reqHeaders := make(http.Header)
  116954. for k, v := range c.header_ {
  116955. reqHeaders[k] = v
  116956. }
  116957. reqHeaders.Set("User-Agent", c.s.userAgent())
  116958. if c.ifNoneMatch_ != "" {
  116959. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  116960. }
  116961. var body io.Reader = nil
  116962. c.urlParams_.Set("alt", alt)
  116963. c.urlParams_.Set("prettyPrint", "false")
  116964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  116965. urls += "?" + c.urlParams_.Encode()
  116966. req, err := http.NewRequest("GET", urls, body)
  116967. if err != nil {
  116968. return nil, err
  116969. }
  116970. req.Header = reqHeaders
  116971. googleapi.Expand(req.URL, map[string]string{
  116972. "project": c.project,
  116973. })
  116974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116975. }
  116976. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  116977. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  116978. // non-2xx status code is an error. Response headers are in either
  116979. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  116980. // returned at all) in error.(*googleapi.Error).Header. Use
  116981. // googleapi.IsNotModified to check whether the returned error was
  116982. // because http.StatusNotModified was returned.
  116983. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  116984. gensupport.SetOptions(c.urlParams_, opts...)
  116985. res, err := c.doRequest("json")
  116986. if res != nil && res.StatusCode == http.StatusNotModified {
  116987. if res.Body != nil {
  116988. res.Body.Close()
  116989. }
  116990. return nil, &googleapi.Error{
  116991. Code: res.StatusCode,
  116992. Header: res.Header,
  116993. }
  116994. }
  116995. if err != nil {
  116996. return nil, err
  116997. }
  116998. defer googleapi.CloseBody(res)
  116999. if err := googleapi.CheckResponse(res); err != nil {
  117000. return nil, err
  117001. }
  117002. ret := &VpnTunnelAggregatedList{
  117003. ServerResponse: googleapi.ServerResponse{
  117004. Header: res.Header,
  117005. HTTPStatusCode: res.StatusCode,
  117006. },
  117007. }
  117008. target := &ret
  117009. if err := gensupport.DecodeResponse(target, res); err != nil {
  117010. return nil, err
  117011. }
  117012. return ret, nil
  117013. // {
  117014. // "description": "Retrieves an aggregated list of VPN tunnels.",
  117015. // "httpMethod": "GET",
  117016. // "id": "compute.vpnTunnels.aggregatedList",
  117017. // "parameterOrder": [
  117018. // "project"
  117019. // ],
  117020. // "parameters": {
  117021. // "filter": {
  117022. // "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).",
  117023. // "location": "query",
  117024. // "type": "string"
  117025. // },
  117026. // "maxResults": {
  117027. // "default": "500",
  117028. // "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)",
  117029. // "format": "uint32",
  117030. // "location": "query",
  117031. // "minimum": "0",
  117032. // "type": "integer"
  117033. // },
  117034. // "orderBy": {
  117035. // "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.",
  117036. // "location": "query",
  117037. // "type": "string"
  117038. // },
  117039. // "pageToken": {
  117040. // "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.",
  117041. // "location": "query",
  117042. // "type": "string"
  117043. // },
  117044. // "project": {
  117045. // "description": "Project ID for this request.",
  117046. // "location": "path",
  117047. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117048. // "required": true,
  117049. // "type": "string"
  117050. // }
  117051. // },
  117052. // "path": "{project}/aggregated/vpnTunnels",
  117053. // "response": {
  117054. // "$ref": "VpnTunnelAggregatedList"
  117055. // },
  117056. // "scopes": [
  117057. // "https://www.googleapis.com/auth/cloud-platform",
  117058. // "https://www.googleapis.com/auth/compute",
  117059. // "https://www.googleapis.com/auth/compute.readonly"
  117060. // ]
  117061. // }
  117062. }
  117063. // Pages invokes f for each page of results.
  117064. // A non-nil error returned from f will halt the iteration.
  117065. // The provided context supersedes any context provided to the Context method.
  117066. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  117067. c.ctx_ = ctx
  117068. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  117069. for {
  117070. x, err := c.Do()
  117071. if err != nil {
  117072. return err
  117073. }
  117074. if err := f(x); err != nil {
  117075. return err
  117076. }
  117077. if x.NextPageToken == "" {
  117078. return nil
  117079. }
  117080. c.PageToken(x.NextPageToken)
  117081. }
  117082. }
  117083. // method id "compute.vpnTunnels.delete":
  117084. type VpnTunnelsDeleteCall struct {
  117085. s *Service
  117086. project string
  117087. region string
  117088. vpnTunnel string
  117089. urlParams_ gensupport.URLParams
  117090. ctx_ context.Context
  117091. header_ http.Header
  117092. }
  117093. // Delete: Deletes the specified VpnTunnel resource.
  117094. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  117095. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117096. c.project = project
  117097. c.region = region
  117098. c.vpnTunnel = vpnTunnel
  117099. return c
  117100. }
  117101. // RequestId sets the optional parameter "requestId": An optional
  117102. // request ID to identify requests. Specify a unique request ID so that
  117103. // if you must retry your request, the server will know to ignore the
  117104. // request if it has already been completed.
  117105. //
  117106. // For example, consider a situation where you make an initial request
  117107. // and the request times out. If you make the request again with the
  117108. // same request ID, the server can check if original operation with the
  117109. // same request ID was received, and if so, will ignore the second
  117110. // request. This prevents clients from accidentally creating duplicate
  117111. // commitments.
  117112. //
  117113. // The request ID must be a valid UUID with the exception that zero UUID
  117114. // is not supported (00000000-0000-0000-0000-000000000000).
  117115. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  117116. c.urlParams_.Set("requestId", requestId)
  117117. return c
  117118. }
  117119. // Fields allows partial responses to be retrieved. See
  117120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117121. // for more information.
  117122. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  117123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117124. return c
  117125. }
  117126. // Context sets the context to be used in this call's Do method. Any
  117127. // pending HTTP request will be aborted if the provided context is
  117128. // canceled.
  117129. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  117130. c.ctx_ = ctx
  117131. return c
  117132. }
  117133. // Header returns an http.Header that can be modified by the caller to
  117134. // add HTTP headers to the request.
  117135. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  117136. if c.header_ == nil {
  117137. c.header_ = make(http.Header)
  117138. }
  117139. return c.header_
  117140. }
  117141. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  117142. reqHeaders := make(http.Header)
  117143. for k, v := range c.header_ {
  117144. reqHeaders[k] = v
  117145. }
  117146. reqHeaders.Set("User-Agent", c.s.userAgent())
  117147. var body io.Reader = nil
  117148. c.urlParams_.Set("alt", alt)
  117149. c.urlParams_.Set("prettyPrint", "false")
  117150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  117151. urls += "?" + c.urlParams_.Encode()
  117152. req, err := http.NewRequest("DELETE", urls, body)
  117153. if err != nil {
  117154. return nil, err
  117155. }
  117156. req.Header = reqHeaders
  117157. googleapi.Expand(req.URL, map[string]string{
  117158. "project": c.project,
  117159. "region": c.region,
  117160. "vpnTunnel": c.vpnTunnel,
  117161. })
  117162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117163. }
  117164. // Do executes the "compute.vpnTunnels.delete" call.
  117165. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117166. // status code is an error. Response headers are in either
  117167. // *Operation.ServerResponse.Header or (if a response was returned at
  117168. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117169. // to check whether the returned error was because
  117170. // http.StatusNotModified was returned.
  117171. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117172. gensupport.SetOptions(c.urlParams_, opts...)
  117173. res, err := c.doRequest("json")
  117174. if res != nil && res.StatusCode == http.StatusNotModified {
  117175. if res.Body != nil {
  117176. res.Body.Close()
  117177. }
  117178. return nil, &googleapi.Error{
  117179. Code: res.StatusCode,
  117180. Header: res.Header,
  117181. }
  117182. }
  117183. if err != nil {
  117184. return nil, err
  117185. }
  117186. defer googleapi.CloseBody(res)
  117187. if err := googleapi.CheckResponse(res); err != nil {
  117188. return nil, err
  117189. }
  117190. ret := &Operation{
  117191. ServerResponse: googleapi.ServerResponse{
  117192. Header: res.Header,
  117193. HTTPStatusCode: res.StatusCode,
  117194. },
  117195. }
  117196. target := &ret
  117197. if err := gensupport.DecodeResponse(target, res); err != nil {
  117198. return nil, err
  117199. }
  117200. return ret, nil
  117201. // {
  117202. // "description": "Deletes the specified VpnTunnel resource.",
  117203. // "httpMethod": "DELETE",
  117204. // "id": "compute.vpnTunnels.delete",
  117205. // "parameterOrder": [
  117206. // "project",
  117207. // "region",
  117208. // "vpnTunnel"
  117209. // ],
  117210. // "parameters": {
  117211. // "project": {
  117212. // "description": "Project ID for this request.",
  117213. // "location": "path",
  117214. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117215. // "required": true,
  117216. // "type": "string"
  117217. // },
  117218. // "region": {
  117219. // "description": "Name of the region for this request.",
  117220. // "location": "path",
  117221. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117222. // "required": true,
  117223. // "type": "string"
  117224. // },
  117225. // "requestId": {
  117226. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  117227. // "location": "query",
  117228. // "type": "string"
  117229. // },
  117230. // "vpnTunnel": {
  117231. // "description": "Name of the VpnTunnel resource to delete.",
  117232. // "location": "path",
  117233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117234. // "required": true,
  117235. // "type": "string"
  117236. // }
  117237. // },
  117238. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  117239. // "response": {
  117240. // "$ref": "Operation"
  117241. // },
  117242. // "scopes": [
  117243. // "https://www.googleapis.com/auth/cloud-platform",
  117244. // "https://www.googleapis.com/auth/compute"
  117245. // ]
  117246. // }
  117247. }
  117248. // method id "compute.vpnTunnels.get":
  117249. type VpnTunnelsGetCall struct {
  117250. s *Service
  117251. project string
  117252. region string
  117253. vpnTunnel string
  117254. urlParams_ gensupport.URLParams
  117255. ifNoneMatch_ string
  117256. ctx_ context.Context
  117257. header_ http.Header
  117258. }
  117259. // Get: Returns the specified VpnTunnel resource. Gets a list of
  117260. // available VPN tunnels by making a list() request.
  117261. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  117262. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117263. c.project = project
  117264. c.region = region
  117265. c.vpnTunnel = vpnTunnel
  117266. return c
  117267. }
  117268. // Fields allows partial responses to be retrieved. See
  117269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117270. // for more information.
  117271. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  117272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117273. return c
  117274. }
  117275. // IfNoneMatch sets the optional parameter which makes the operation
  117276. // fail if the object's ETag matches the given value. This is useful for
  117277. // getting updates only after the object has changed since the last
  117278. // request. Use googleapi.IsNotModified to check whether the response
  117279. // error from Do is the result of In-None-Match.
  117280. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  117281. c.ifNoneMatch_ = entityTag
  117282. return c
  117283. }
  117284. // Context sets the context to be used in this call's Do method. Any
  117285. // pending HTTP request will be aborted if the provided context is
  117286. // canceled.
  117287. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  117288. c.ctx_ = ctx
  117289. return c
  117290. }
  117291. // Header returns an http.Header that can be modified by the caller to
  117292. // add HTTP headers to the request.
  117293. func (c *VpnTunnelsGetCall) Header() http.Header {
  117294. if c.header_ == nil {
  117295. c.header_ = make(http.Header)
  117296. }
  117297. return c.header_
  117298. }
  117299. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  117300. reqHeaders := make(http.Header)
  117301. for k, v := range c.header_ {
  117302. reqHeaders[k] = v
  117303. }
  117304. reqHeaders.Set("User-Agent", c.s.userAgent())
  117305. if c.ifNoneMatch_ != "" {
  117306. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117307. }
  117308. var body io.Reader = nil
  117309. c.urlParams_.Set("alt", alt)
  117310. c.urlParams_.Set("prettyPrint", "false")
  117311. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  117312. urls += "?" + c.urlParams_.Encode()
  117313. req, err := http.NewRequest("GET", urls, body)
  117314. if err != nil {
  117315. return nil, err
  117316. }
  117317. req.Header = reqHeaders
  117318. googleapi.Expand(req.URL, map[string]string{
  117319. "project": c.project,
  117320. "region": c.region,
  117321. "vpnTunnel": c.vpnTunnel,
  117322. })
  117323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117324. }
  117325. // Do executes the "compute.vpnTunnels.get" call.
  117326. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  117327. // status code is an error. Response headers are in either
  117328. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  117329. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117330. // to check whether the returned error was because
  117331. // http.StatusNotModified was returned.
  117332. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  117333. gensupport.SetOptions(c.urlParams_, opts...)
  117334. res, err := c.doRequest("json")
  117335. if res != nil && res.StatusCode == http.StatusNotModified {
  117336. if res.Body != nil {
  117337. res.Body.Close()
  117338. }
  117339. return nil, &googleapi.Error{
  117340. Code: res.StatusCode,
  117341. Header: res.Header,
  117342. }
  117343. }
  117344. if err != nil {
  117345. return nil, err
  117346. }
  117347. defer googleapi.CloseBody(res)
  117348. if err := googleapi.CheckResponse(res); err != nil {
  117349. return nil, err
  117350. }
  117351. ret := &VpnTunnel{
  117352. ServerResponse: googleapi.ServerResponse{
  117353. Header: res.Header,
  117354. HTTPStatusCode: res.StatusCode,
  117355. },
  117356. }
  117357. target := &ret
  117358. if err := gensupport.DecodeResponse(target, res); err != nil {
  117359. return nil, err
  117360. }
  117361. return ret, nil
  117362. // {
  117363. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  117364. // "httpMethod": "GET",
  117365. // "id": "compute.vpnTunnels.get",
  117366. // "parameterOrder": [
  117367. // "project",
  117368. // "region",
  117369. // "vpnTunnel"
  117370. // ],
  117371. // "parameters": {
  117372. // "project": {
  117373. // "description": "Project ID for this request.",
  117374. // "location": "path",
  117375. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117376. // "required": true,
  117377. // "type": "string"
  117378. // },
  117379. // "region": {
  117380. // "description": "Name of the region for this request.",
  117381. // "location": "path",
  117382. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117383. // "required": true,
  117384. // "type": "string"
  117385. // },
  117386. // "vpnTunnel": {
  117387. // "description": "Name of the VpnTunnel resource to return.",
  117388. // "location": "path",
  117389. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117390. // "required": true,
  117391. // "type": "string"
  117392. // }
  117393. // },
  117394. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  117395. // "response": {
  117396. // "$ref": "VpnTunnel"
  117397. // },
  117398. // "scopes": [
  117399. // "https://www.googleapis.com/auth/cloud-platform",
  117400. // "https://www.googleapis.com/auth/compute",
  117401. // "https://www.googleapis.com/auth/compute.readonly"
  117402. // ]
  117403. // }
  117404. }
  117405. // method id "compute.vpnTunnels.insert":
  117406. type VpnTunnelsInsertCall struct {
  117407. s *Service
  117408. project string
  117409. region string
  117410. vpntunnel *VpnTunnel
  117411. urlParams_ gensupport.URLParams
  117412. ctx_ context.Context
  117413. header_ http.Header
  117414. }
  117415. // Insert: Creates a VpnTunnel resource in the specified project and
  117416. // region using the data included in the request.
  117417. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  117418. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117419. c.project = project
  117420. c.region = region
  117421. c.vpntunnel = vpntunnel
  117422. return c
  117423. }
  117424. // RequestId sets the optional parameter "requestId": An optional
  117425. // request ID to identify requests. Specify a unique request ID so that
  117426. // if you must retry your request, the server will know to ignore the
  117427. // request if it has already been completed.
  117428. //
  117429. // For example, consider a situation where you make an initial request
  117430. // and the request times out. If you make the request again with the
  117431. // same request ID, the server can check if original operation with the
  117432. // same request ID was received, and if so, will ignore the second
  117433. // request. This prevents clients from accidentally creating duplicate
  117434. // commitments.
  117435. //
  117436. // The request ID must be a valid UUID with the exception that zero UUID
  117437. // is not supported (00000000-0000-0000-0000-000000000000).
  117438. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  117439. c.urlParams_.Set("requestId", requestId)
  117440. return c
  117441. }
  117442. // Fields allows partial responses to be retrieved. See
  117443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117444. // for more information.
  117445. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  117446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117447. return c
  117448. }
  117449. // Context sets the context to be used in this call's Do method. Any
  117450. // pending HTTP request will be aborted if the provided context is
  117451. // canceled.
  117452. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  117453. c.ctx_ = ctx
  117454. return c
  117455. }
  117456. // Header returns an http.Header that can be modified by the caller to
  117457. // add HTTP headers to the request.
  117458. func (c *VpnTunnelsInsertCall) Header() http.Header {
  117459. if c.header_ == nil {
  117460. c.header_ = make(http.Header)
  117461. }
  117462. return c.header_
  117463. }
  117464. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  117465. reqHeaders := make(http.Header)
  117466. for k, v := range c.header_ {
  117467. reqHeaders[k] = v
  117468. }
  117469. reqHeaders.Set("User-Agent", c.s.userAgent())
  117470. var body io.Reader = nil
  117471. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  117472. if err != nil {
  117473. return nil, err
  117474. }
  117475. reqHeaders.Set("Content-Type", "application/json")
  117476. c.urlParams_.Set("alt", alt)
  117477. c.urlParams_.Set("prettyPrint", "false")
  117478. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  117479. urls += "?" + c.urlParams_.Encode()
  117480. req, err := http.NewRequest("POST", urls, body)
  117481. if err != nil {
  117482. return nil, err
  117483. }
  117484. req.Header = reqHeaders
  117485. googleapi.Expand(req.URL, map[string]string{
  117486. "project": c.project,
  117487. "region": c.region,
  117488. })
  117489. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117490. }
  117491. // Do executes the "compute.vpnTunnels.insert" call.
  117492. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117493. // status code is an error. Response headers are in either
  117494. // *Operation.ServerResponse.Header or (if a response was returned at
  117495. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117496. // to check whether the returned error was because
  117497. // http.StatusNotModified was returned.
  117498. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117499. gensupport.SetOptions(c.urlParams_, opts...)
  117500. res, err := c.doRequest("json")
  117501. if res != nil && res.StatusCode == http.StatusNotModified {
  117502. if res.Body != nil {
  117503. res.Body.Close()
  117504. }
  117505. return nil, &googleapi.Error{
  117506. Code: res.StatusCode,
  117507. Header: res.Header,
  117508. }
  117509. }
  117510. if err != nil {
  117511. return nil, err
  117512. }
  117513. defer googleapi.CloseBody(res)
  117514. if err := googleapi.CheckResponse(res); err != nil {
  117515. return nil, err
  117516. }
  117517. ret := &Operation{
  117518. ServerResponse: googleapi.ServerResponse{
  117519. Header: res.Header,
  117520. HTTPStatusCode: res.StatusCode,
  117521. },
  117522. }
  117523. target := &ret
  117524. if err := gensupport.DecodeResponse(target, res); err != nil {
  117525. return nil, err
  117526. }
  117527. return ret, nil
  117528. // {
  117529. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  117530. // "httpMethod": "POST",
  117531. // "id": "compute.vpnTunnels.insert",
  117532. // "parameterOrder": [
  117533. // "project",
  117534. // "region"
  117535. // ],
  117536. // "parameters": {
  117537. // "project": {
  117538. // "description": "Project ID for this request.",
  117539. // "location": "path",
  117540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117541. // "required": true,
  117542. // "type": "string"
  117543. // },
  117544. // "region": {
  117545. // "description": "Name of the region for this request.",
  117546. // "location": "path",
  117547. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117548. // "required": true,
  117549. // "type": "string"
  117550. // },
  117551. // "requestId": {
  117552. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  117553. // "location": "query",
  117554. // "type": "string"
  117555. // }
  117556. // },
  117557. // "path": "{project}/regions/{region}/vpnTunnels",
  117558. // "request": {
  117559. // "$ref": "VpnTunnel"
  117560. // },
  117561. // "response": {
  117562. // "$ref": "Operation"
  117563. // },
  117564. // "scopes": [
  117565. // "https://www.googleapis.com/auth/cloud-platform",
  117566. // "https://www.googleapis.com/auth/compute"
  117567. // ]
  117568. // }
  117569. }
  117570. // method id "compute.vpnTunnels.list":
  117571. type VpnTunnelsListCall struct {
  117572. s *Service
  117573. project string
  117574. region string
  117575. urlParams_ gensupport.URLParams
  117576. ifNoneMatch_ string
  117577. ctx_ context.Context
  117578. header_ http.Header
  117579. }
  117580. // List: Retrieves a list of VpnTunnel resources contained in the
  117581. // specified project and region.
  117582. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  117583. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117584. c.project = project
  117585. c.region = region
  117586. return c
  117587. }
  117588. // Filter sets the optional parameter "filter": A filter expression that
  117589. // filters resources listed in the response. The expression must specify
  117590. // the field name, a comparison operator, and the value that you want to
  117591. // use for filtering. The value must be a string, a number, or a
  117592. // boolean. The comparison operator must be either =, !=, >, or <.
  117593. //
  117594. // For example, if you are filtering Compute Engine instances, you can
  117595. // exclude instances named example-instance by specifying name !=
  117596. // example-instance.
  117597. //
  117598. // You can also filter nested fields. For example, you could specify
  117599. // scheduling.automaticRestart = false to include instances only if they
  117600. // are not scheduled for automatic restarts. You can use filtering on
  117601. // nested fields to filter based on resource labels.
  117602. //
  117603. // To filter on multiple expressions, provide each separate expression
  117604. // within parentheses. For example, (scheduling.automaticRestart = true)
  117605. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  117606. // AND expression. However, you can include AND and OR expressions
  117607. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  117608. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  117609. // true).
  117610. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  117611. c.urlParams_.Set("filter", filter)
  117612. return c
  117613. }
  117614. // MaxResults sets the optional parameter "maxResults": The maximum
  117615. // number of results per page that should be returned. If the number of
  117616. // available results is larger than maxResults, Compute Engine returns a
  117617. // nextPageToken that can be used to get the next page of results in
  117618. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  117619. // (Default: 500)
  117620. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  117621. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  117622. return c
  117623. }
  117624. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  117625. // a certain order. By default, results are returned in alphanumerical
  117626. // order based on the resource name.
  117627. //
  117628. // You can also sort results in descending order based on the creation
  117629. // timestamp using orderBy="creationTimestamp desc". This sorts results
  117630. // based on the creationTimestamp field in reverse chronological order
  117631. // (newest result first). Use this to sort resources like operations so
  117632. // that the newest operation is returned first.
  117633. //
  117634. // Currently, only sorting by name or creationTimestamp desc is
  117635. // supported.
  117636. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  117637. c.urlParams_.Set("orderBy", orderBy)
  117638. return c
  117639. }
  117640. // PageToken sets the optional parameter "pageToken": Specifies a page
  117641. // token to use. Set pageToken to the nextPageToken returned by a
  117642. // previous list request to get the next page of results.
  117643. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  117644. c.urlParams_.Set("pageToken", pageToken)
  117645. return c
  117646. }
  117647. // Fields allows partial responses to be retrieved. See
  117648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117649. // for more information.
  117650. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  117651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117652. return c
  117653. }
  117654. // IfNoneMatch sets the optional parameter which makes the operation
  117655. // fail if the object's ETag matches the given value. This is useful for
  117656. // getting updates only after the object has changed since the last
  117657. // request. Use googleapi.IsNotModified to check whether the response
  117658. // error from Do is the result of In-None-Match.
  117659. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  117660. c.ifNoneMatch_ = entityTag
  117661. return c
  117662. }
  117663. // Context sets the context to be used in this call's Do method. Any
  117664. // pending HTTP request will be aborted if the provided context is
  117665. // canceled.
  117666. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  117667. c.ctx_ = ctx
  117668. return c
  117669. }
  117670. // Header returns an http.Header that can be modified by the caller to
  117671. // add HTTP headers to the request.
  117672. func (c *VpnTunnelsListCall) Header() http.Header {
  117673. if c.header_ == nil {
  117674. c.header_ = make(http.Header)
  117675. }
  117676. return c.header_
  117677. }
  117678. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  117679. reqHeaders := make(http.Header)
  117680. for k, v := range c.header_ {
  117681. reqHeaders[k] = v
  117682. }
  117683. reqHeaders.Set("User-Agent", c.s.userAgent())
  117684. if c.ifNoneMatch_ != "" {
  117685. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117686. }
  117687. var body io.Reader = nil
  117688. c.urlParams_.Set("alt", alt)
  117689. c.urlParams_.Set("prettyPrint", "false")
  117690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  117691. urls += "?" + c.urlParams_.Encode()
  117692. req, err := http.NewRequest("GET", urls, body)
  117693. if err != nil {
  117694. return nil, err
  117695. }
  117696. req.Header = reqHeaders
  117697. googleapi.Expand(req.URL, map[string]string{
  117698. "project": c.project,
  117699. "region": c.region,
  117700. })
  117701. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117702. }
  117703. // Do executes the "compute.vpnTunnels.list" call.
  117704. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  117705. // status code is an error. Response headers are in either
  117706. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  117707. // at all) in error.(*googleapi.Error).Header. Use
  117708. // googleapi.IsNotModified to check whether the returned error was
  117709. // because http.StatusNotModified was returned.
  117710. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  117711. gensupport.SetOptions(c.urlParams_, opts...)
  117712. res, err := c.doRequest("json")
  117713. if res != nil && res.StatusCode == http.StatusNotModified {
  117714. if res.Body != nil {
  117715. res.Body.Close()
  117716. }
  117717. return nil, &googleapi.Error{
  117718. Code: res.StatusCode,
  117719. Header: res.Header,
  117720. }
  117721. }
  117722. if err != nil {
  117723. return nil, err
  117724. }
  117725. defer googleapi.CloseBody(res)
  117726. if err := googleapi.CheckResponse(res); err != nil {
  117727. return nil, err
  117728. }
  117729. ret := &VpnTunnelList{
  117730. ServerResponse: googleapi.ServerResponse{
  117731. Header: res.Header,
  117732. HTTPStatusCode: res.StatusCode,
  117733. },
  117734. }
  117735. target := &ret
  117736. if err := gensupport.DecodeResponse(target, res); err != nil {
  117737. return nil, err
  117738. }
  117739. return ret, nil
  117740. // {
  117741. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  117742. // "httpMethod": "GET",
  117743. // "id": "compute.vpnTunnels.list",
  117744. // "parameterOrder": [
  117745. // "project",
  117746. // "region"
  117747. // ],
  117748. // "parameters": {
  117749. // "filter": {
  117750. // "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).",
  117751. // "location": "query",
  117752. // "type": "string"
  117753. // },
  117754. // "maxResults": {
  117755. // "default": "500",
  117756. // "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)",
  117757. // "format": "uint32",
  117758. // "location": "query",
  117759. // "minimum": "0",
  117760. // "type": "integer"
  117761. // },
  117762. // "orderBy": {
  117763. // "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.",
  117764. // "location": "query",
  117765. // "type": "string"
  117766. // },
  117767. // "pageToken": {
  117768. // "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.",
  117769. // "location": "query",
  117770. // "type": "string"
  117771. // },
  117772. // "project": {
  117773. // "description": "Project ID for this request.",
  117774. // "location": "path",
  117775. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117776. // "required": true,
  117777. // "type": "string"
  117778. // },
  117779. // "region": {
  117780. // "description": "Name of the region for this request.",
  117781. // "location": "path",
  117782. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117783. // "required": true,
  117784. // "type": "string"
  117785. // }
  117786. // },
  117787. // "path": "{project}/regions/{region}/vpnTunnels",
  117788. // "response": {
  117789. // "$ref": "VpnTunnelList"
  117790. // },
  117791. // "scopes": [
  117792. // "https://www.googleapis.com/auth/cloud-platform",
  117793. // "https://www.googleapis.com/auth/compute",
  117794. // "https://www.googleapis.com/auth/compute.readonly"
  117795. // ]
  117796. // }
  117797. }
  117798. // Pages invokes f for each page of results.
  117799. // A non-nil error returned from f will halt the iteration.
  117800. // The provided context supersedes any context provided to the Context method.
  117801. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  117802. c.ctx_ = ctx
  117803. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  117804. for {
  117805. x, err := c.Do()
  117806. if err != nil {
  117807. return err
  117808. }
  117809. if err := f(x); err != nil {
  117810. return err
  117811. }
  117812. if x.NextPageToken == "" {
  117813. return nil
  117814. }
  117815. c.PageToken(x.NextPageToken)
  117816. }
  117817. }
  117818. // method id "compute.vpnTunnels.setLabels":
  117819. type VpnTunnelsSetLabelsCall struct {
  117820. s *Service
  117821. project string
  117822. region string
  117823. resource string
  117824. regionsetlabelsrequest *RegionSetLabelsRequest
  117825. urlParams_ gensupport.URLParams
  117826. ctx_ context.Context
  117827. header_ http.Header
  117828. }
  117829. // SetLabels: Sets the labels on a VpnTunnel. To learn more about
  117830. // labels, read the Labeling Resources documentation.
  117831. func (r *VpnTunnelsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnTunnelsSetLabelsCall {
  117832. c := &VpnTunnelsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117833. c.project = project
  117834. c.region = region
  117835. c.resource = resource
  117836. c.regionsetlabelsrequest = regionsetlabelsrequest
  117837. return c
  117838. }
  117839. // RequestId sets the optional parameter "requestId": An optional
  117840. // request ID to identify requests. Specify a unique request ID so that
  117841. // if you must retry your request, the server will know to ignore the
  117842. // request if it has already been completed.
  117843. //
  117844. // For example, consider a situation where you make an initial request
  117845. // and the request times out. If you make the request again with the
  117846. // same request ID, the server can check if original operation with the
  117847. // same request ID was received, and if so, will ignore the second
  117848. // request. This prevents clients from accidentally creating duplicate
  117849. // commitments.
  117850. //
  117851. // The request ID must be a valid UUID with the exception that zero UUID
  117852. // is not supported (00000000-0000-0000-0000-000000000000).
  117853. func (c *VpnTunnelsSetLabelsCall) RequestId(requestId string) *VpnTunnelsSetLabelsCall {
  117854. c.urlParams_.Set("requestId", requestId)
  117855. return c
  117856. }
  117857. // Fields allows partial responses to be retrieved. See
  117858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117859. // for more information.
  117860. func (c *VpnTunnelsSetLabelsCall) Fields(s ...googleapi.Field) *VpnTunnelsSetLabelsCall {
  117861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117862. return c
  117863. }
  117864. // Context sets the context to be used in this call's Do method. Any
  117865. // pending HTTP request will be aborted if the provided context is
  117866. // canceled.
  117867. func (c *VpnTunnelsSetLabelsCall) Context(ctx context.Context) *VpnTunnelsSetLabelsCall {
  117868. c.ctx_ = ctx
  117869. return c
  117870. }
  117871. // Header returns an http.Header that can be modified by the caller to
  117872. // add HTTP headers to the request.
  117873. func (c *VpnTunnelsSetLabelsCall) Header() http.Header {
  117874. if c.header_ == nil {
  117875. c.header_ = make(http.Header)
  117876. }
  117877. return c.header_
  117878. }
  117879. func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  117880. reqHeaders := make(http.Header)
  117881. for k, v := range c.header_ {
  117882. reqHeaders[k] = v
  117883. }
  117884. reqHeaders.Set("User-Agent", c.s.userAgent())
  117885. var body io.Reader = nil
  117886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  117887. if err != nil {
  117888. return nil, err
  117889. }
  117890. reqHeaders.Set("Content-Type", "application/json")
  117891. c.urlParams_.Set("alt", alt)
  117892. c.urlParams_.Set("prettyPrint", "false")
  117893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/setLabels")
  117894. urls += "?" + c.urlParams_.Encode()
  117895. req, err := http.NewRequest("POST", urls, body)
  117896. if err != nil {
  117897. return nil, err
  117898. }
  117899. req.Header = reqHeaders
  117900. googleapi.Expand(req.URL, map[string]string{
  117901. "project": c.project,
  117902. "region": c.region,
  117903. "resource": c.resource,
  117904. })
  117905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117906. }
  117907. // Do executes the "compute.vpnTunnels.setLabels" call.
  117908. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117909. // status code is an error. Response headers are in either
  117910. // *Operation.ServerResponse.Header or (if a response was returned at
  117911. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117912. // to check whether the returned error was because
  117913. // http.StatusNotModified was returned.
  117914. func (c *VpnTunnelsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117915. gensupport.SetOptions(c.urlParams_, opts...)
  117916. res, err := c.doRequest("json")
  117917. if res != nil && res.StatusCode == http.StatusNotModified {
  117918. if res.Body != nil {
  117919. res.Body.Close()
  117920. }
  117921. return nil, &googleapi.Error{
  117922. Code: res.StatusCode,
  117923. Header: res.Header,
  117924. }
  117925. }
  117926. if err != nil {
  117927. return nil, err
  117928. }
  117929. defer googleapi.CloseBody(res)
  117930. if err := googleapi.CheckResponse(res); err != nil {
  117931. return nil, err
  117932. }
  117933. ret := &Operation{
  117934. ServerResponse: googleapi.ServerResponse{
  117935. Header: res.Header,
  117936. HTTPStatusCode: res.StatusCode,
  117937. },
  117938. }
  117939. target := &ret
  117940. if err := gensupport.DecodeResponse(target, res); err != nil {
  117941. return nil, err
  117942. }
  117943. return ret, nil
  117944. // {
  117945. // "description": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.",
  117946. // "httpMethod": "POST",
  117947. // "id": "compute.vpnTunnels.setLabels",
  117948. // "parameterOrder": [
  117949. // "project",
  117950. // "region",
  117951. // "resource"
  117952. // ],
  117953. // "parameters": {
  117954. // "project": {
  117955. // "description": "Project ID for this request.",
  117956. // "location": "path",
  117957. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117958. // "required": true,
  117959. // "type": "string"
  117960. // },
  117961. // "region": {
  117962. // "description": "The region for this request.",
  117963. // "location": "path",
  117964. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117965. // "required": true,
  117966. // "type": "string"
  117967. // },
  117968. // "requestId": {
  117969. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  117970. // "location": "query",
  117971. // "type": "string"
  117972. // },
  117973. // "resource": {
  117974. // "description": "Name or id of the resource for this request.",
  117975. // "location": "path",
  117976. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117977. // "required": true,
  117978. // "type": "string"
  117979. // }
  117980. // },
  117981. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/setLabels",
  117982. // "request": {
  117983. // "$ref": "RegionSetLabelsRequest"
  117984. // },
  117985. // "response": {
  117986. // "$ref": "Operation"
  117987. // },
  117988. // "scopes": [
  117989. // "https://www.googleapis.com/auth/cloud-platform",
  117990. // "https://www.googleapis.com/auth/compute"
  117991. // ]
  117992. // }
  117993. }
  117994. // method id "compute.vpnTunnels.testIamPermissions":
  117995. type VpnTunnelsTestIamPermissionsCall struct {
  117996. s *Service
  117997. project string
  117998. region string
  117999. resource string
  118000. testpermissionsrequest *TestPermissionsRequest
  118001. urlParams_ gensupport.URLParams
  118002. ctx_ context.Context
  118003. header_ http.Header
  118004. }
  118005. // TestIamPermissions: Returns permissions that a caller has on the
  118006. // specified resource.
  118007. func (r *VpnTunnelsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnTunnelsTestIamPermissionsCall {
  118008. c := &VpnTunnelsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118009. c.project = project
  118010. c.region = region
  118011. c.resource = resource
  118012. c.testpermissionsrequest = testpermissionsrequest
  118013. return c
  118014. }
  118015. // Fields allows partial responses to be retrieved. See
  118016. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118017. // for more information.
  118018. func (c *VpnTunnelsTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnTunnelsTestIamPermissionsCall {
  118019. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118020. return c
  118021. }
  118022. // Context sets the context to be used in this call's Do method. Any
  118023. // pending HTTP request will be aborted if the provided context is
  118024. // canceled.
  118025. func (c *VpnTunnelsTestIamPermissionsCall) Context(ctx context.Context) *VpnTunnelsTestIamPermissionsCall {
  118026. c.ctx_ = ctx
  118027. return c
  118028. }
  118029. // Header returns an http.Header that can be modified by the caller to
  118030. // add HTTP headers to the request.
  118031. func (c *VpnTunnelsTestIamPermissionsCall) Header() http.Header {
  118032. if c.header_ == nil {
  118033. c.header_ = make(http.Header)
  118034. }
  118035. return c.header_
  118036. }
  118037. func (c *VpnTunnelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  118038. reqHeaders := make(http.Header)
  118039. for k, v := range c.header_ {
  118040. reqHeaders[k] = v
  118041. }
  118042. reqHeaders.Set("User-Agent", c.s.userAgent())
  118043. var body io.Reader = nil
  118044. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  118045. if err != nil {
  118046. return nil, err
  118047. }
  118048. reqHeaders.Set("Content-Type", "application/json")
  118049. c.urlParams_.Set("alt", alt)
  118050. c.urlParams_.Set("prettyPrint", "false")
  118051. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions")
  118052. urls += "?" + c.urlParams_.Encode()
  118053. req, err := http.NewRequest("POST", urls, body)
  118054. if err != nil {
  118055. return nil, err
  118056. }
  118057. req.Header = reqHeaders
  118058. googleapi.Expand(req.URL, map[string]string{
  118059. "project": c.project,
  118060. "region": c.region,
  118061. "resource": c.resource,
  118062. })
  118063. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118064. }
  118065. // Do executes the "compute.vpnTunnels.testIamPermissions" call.
  118066. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  118067. // non-2xx status code is an error. Response headers are in either
  118068. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  118069. // returned at all) in error.(*googleapi.Error).Header. Use
  118070. // googleapi.IsNotModified to check whether the returned error was
  118071. // because http.StatusNotModified was returned.
  118072. func (c *VpnTunnelsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  118073. gensupport.SetOptions(c.urlParams_, opts...)
  118074. res, err := c.doRequest("json")
  118075. if res != nil && res.StatusCode == http.StatusNotModified {
  118076. if res.Body != nil {
  118077. res.Body.Close()
  118078. }
  118079. return nil, &googleapi.Error{
  118080. Code: res.StatusCode,
  118081. Header: res.Header,
  118082. }
  118083. }
  118084. if err != nil {
  118085. return nil, err
  118086. }
  118087. defer googleapi.CloseBody(res)
  118088. if err := googleapi.CheckResponse(res); err != nil {
  118089. return nil, err
  118090. }
  118091. ret := &TestPermissionsResponse{
  118092. ServerResponse: googleapi.ServerResponse{
  118093. Header: res.Header,
  118094. HTTPStatusCode: res.StatusCode,
  118095. },
  118096. }
  118097. target := &ret
  118098. if err := gensupport.DecodeResponse(target, res); err != nil {
  118099. return nil, err
  118100. }
  118101. return ret, nil
  118102. // {
  118103. // "description": "Returns permissions that a caller has on the specified resource.",
  118104. // "httpMethod": "POST",
  118105. // "id": "compute.vpnTunnels.testIamPermissions",
  118106. // "parameterOrder": [
  118107. // "project",
  118108. // "region",
  118109. // "resource"
  118110. // ],
  118111. // "parameters": {
  118112. // "project": {
  118113. // "description": "Project ID for this request.",
  118114. // "location": "path",
  118115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118116. // "required": true,
  118117. // "type": "string"
  118118. // },
  118119. // "region": {
  118120. // "description": "The name of the region for this request.",
  118121. // "location": "path",
  118122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118123. // "required": true,
  118124. // "type": "string"
  118125. // },
  118126. // "resource": {
  118127. // "description": "Name or id of the resource for this request.",
  118128. // "location": "path",
  118129. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118130. // "required": true,
  118131. // "type": "string"
  118132. // }
  118133. // },
  118134. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions",
  118135. // "request": {
  118136. // "$ref": "TestPermissionsRequest"
  118137. // },
  118138. // "response": {
  118139. // "$ref": "TestPermissionsResponse"
  118140. // },
  118141. // "scopes": [
  118142. // "https://www.googleapis.com/auth/cloud-platform",
  118143. // "https://www.googleapis.com/auth/compute",
  118144. // "https://www.googleapis.com/auth/compute.readonly"
  118145. // ]
  118146. // }
  118147. }
  118148. // method id "compute.zoneOperations.delete":
  118149. type ZoneOperationsDeleteCall struct {
  118150. s *Service
  118151. project string
  118152. zone string
  118153. operation string
  118154. urlParams_ gensupport.URLParams
  118155. ctx_ context.Context
  118156. header_ http.Header
  118157. }
  118158. // Delete: Deletes the specified zone-specific Operations resource.
  118159. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  118160. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  118161. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118162. c.project = project
  118163. c.zone = zone
  118164. c.operation = operation
  118165. return c
  118166. }
  118167. // Fields allows partial responses to be retrieved. See
  118168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118169. // for more information.
  118170. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  118171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118172. return c
  118173. }
  118174. // Context sets the context to be used in this call's Do method. Any
  118175. // pending HTTP request will be aborted if the provided context is
  118176. // canceled.
  118177. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  118178. c.ctx_ = ctx
  118179. return c
  118180. }
  118181. // Header returns an http.Header that can be modified by the caller to
  118182. // add HTTP headers to the request.
  118183. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  118184. if c.header_ == nil {
  118185. c.header_ = make(http.Header)
  118186. }
  118187. return c.header_
  118188. }
  118189. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  118190. reqHeaders := make(http.Header)
  118191. for k, v := range c.header_ {
  118192. reqHeaders[k] = v
  118193. }
  118194. reqHeaders.Set("User-Agent", c.s.userAgent())
  118195. var body io.Reader = nil
  118196. c.urlParams_.Set("alt", alt)
  118197. c.urlParams_.Set("prettyPrint", "false")
  118198. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  118199. urls += "?" + c.urlParams_.Encode()
  118200. req, err := http.NewRequest("DELETE", urls, body)
  118201. if err != nil {
  118202. return nil, err
  118203. }
  118204. req.Header = reqHeaders
  118205. googleapi.Expand(req.URL, map[string]string{
  118206. "project": c.project,
  118207. "zone": c.zone,
  118208. "operation": c.operation,
  118209. })
  118210. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118211. }
  118212. // Do executes the "compute.zoneOperations.delete" call.
  118213. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  118214. gensupport.SetOptions(c.urlParams_, opts...)
  118215. res, err := c.doRequest("json")
  118216. if err != nil {
  118217. return err
  118218. }
  118219. defer googleapi.CloseBody(res)
  118220. if err := googleapi.CheckResponse(res); err != nil {
  118221. return err
  118222. }
  118223. return nil
  118224. // {
  118225. // "description": "Deletes the specified zone-specific Operations resource.",
  118226. // "httpMethod": "DELETE",
  118227. // "id": "compute.zoneOperations.delete",
  118228. // "parameterOrder": [
  118229. // "project",
  118230. // "zone",
  118231. // "operation"
  118232. // ],
  118233. // "parameters": {
  118234. // "operation": {
  118235. // "description": "Name of the Operations resource to delete.",
  118236. // "location": "path",
  118237. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118238. // "required": true,
  118239. // "type": "string"
  118240. // },
  118241. // "project": {
  118242. // "description": "Project ID for this request.",
  118243. // "location": "path",
  118244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118245. // "required": true,
  118246. // "type": "string"
  118247. // },
  118248. // "zone": {
  118249. // "description": "Name of the zone for this request.",
  118250. // "location": "path",
  118251. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118252. // "required": true,
  118253. // "type": "string"
  118254. // }
  118255. // },
  118256. // "path": "{project}/zones/{zone}/operations/{operation}",
  118257. // "scopes": [
  118258. // "https://www.googleapis.com/auth/cloud-platform",
  118259. // "https://www.googleapis.com/auth/compute"
  118260. // ]
  118261. // }
  118262. }
  118263. // method id "compute.zoneOperations.get":
  118264. type ZoneOperationsGetCall struct {
  118265. s *Service
  118266. project string
  118267. zone string
  118268. operation string
  118269. urlParams_ gensupport.URLParams
  118270. ifNoneMatch_ string
  118271. ctx_ context.Context
  118272. header_ http.Header
  118273. }
  118274. // Get: Retrieves the specified zone-specific Operations resource.
  118275. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  118276. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  118277. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118278. c.project = project
  118279. c.zone = zone
  118280. c.operation = operation
  118281. return c
  118282. }
  118283. // Fields allows partial responses to be retrieved. See
  118284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118285. // for more information.
  118286. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  118287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118288. return c
  118289. }
  118290. // IfNoneMatch sets the optional parameter which makes the operation
  118291. // fail if the object's ETag matches the given value. This is useful for
  118292. // getting updates only after the object has changed since the last
  118293. // request. Use googleapi.IsNotModified to check whether the response
  118294. // error from Do is the result of In-None-Match.
  118295. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  118296. c.ifNoneMatch_ = entityTag
  118297. return c
  118298. }
  118299. // Context sets the context to be used in this call's Do method. Any
  118300. // pending HTTP request will be aborted if the provided context is
  118301. // canceled.
  118302. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  118303. c.ctx_ = ctx
  118304. return c
  118305. }
  118306. // Header returns an http.Header that can be modified by the caller to
  118307. // add HTTP headers to the request.
  118308. func (c *ZoneOperationsGetCall) Header() http.Header {
  118309. if c.header_ == nil {
  118310. c.header_ = make(http.Header)
  118311. }
  118312. return c.header_
  118313. }
  118314. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  118315. reqHeaders := make(http.Header)
  118316. for k, v := range c.header_ {
  118317. reqHeaders[k] = v
  118318. }
  118319. reqHeaders.Set("User-Agent", c.s.userAgent())
  118320. if c.ifNoneMatch_ != "" {
  118321. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118322. }
  118323. var body io.Reader = nil
  118324. c.urlParams_.Set("alt", alt)
  118325. c.urlParams_.Set("prettyPrint", "false")
  118326. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  118327. urls += "?" + c.urlParams_.Encode()
  118328. req, err := http.NewRequest("GET", urls, body)
  118329. if err != nil {
  118330. return nil, err
  118331. }
  118332. req.Header = reqHeaders
  118333. googleapi.Expand(req.URL, map[string]string{
  118334. "project": c.project,
  118335. "zone": c.zone,
  118336. "operation": c.operation,
  118337. })
  118338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118339. }
  118340. // Do executes the "compute.zoneOperations.get" call.
  118341. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  118342. // status code is an error. Response headers are in either
  118343. // *Operation.ServerResponse.Header or (if a response was returned at
  118344. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118345. // to check whether the returned error was because
  118346. // http.StatusNotModified was returned.
  118347. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  118348. gensupport.SetOptions(c.urlParams_, opts...)
  118349. res, err := c.doRequest("json")
  118350. if res != nil && res.StatusCode == http.StatusNotModified {
  118351. if res.Body != nil {
  118352. res.Body.Close()
  118353. }
  118354. return nil, &googleapi.Error{
  118355. Code: res.StatusCode,
  118356. Header: res.Header,
  118357. }
  118358. }
  118359. if err != nil {
  118360. return nil, err
  118361. }
  118362. defer googleapi.CloseBody(res)
  118363. if err := googleapi.CheckResponse(res); err != nil {
  118364. return nil, err
  118365. }
  118366. ret := &Operation{
  118367. ServerResponse: googleapi.ServerResponse{
  118368. Header: res.Header,
  118369. HTTPStatusCode: res.StatusCode,
  118370. },
  118371. }
  118372. target := &ret
  118373. if err := gensupport.DecodeResponse(target, res); err != nil {
  118374. return nil, err
  118375. }
  118376. return ret, nil
  118377. // {
  118378. // "description": "Retrieves the specified zone-specific Operations resource.",
  118379. // "httpMethod": "GET",
  118380. // "id": "compute.zoneOperations.get",
  118381. // "parameterOrder": [
  118382. // "project",
  118383. // "zone",
  118384. // "operation"
  118385. // ],
  118386. // "parameters": {
  118387. // "operation": {
  118388. // "description": "Name of the Operations resource to return.",
  118389. // "location": "path",
  118390. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118391. // "required": true,
  118392. // "type": "string"
  118393. // },
  118394. // "project": {
  118395. // "description": "Project ID for this request.",
  118396. // "location": "path",
  118397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118398. // "required": true,
  118399. // "type": "string"
  118400. // },
  118401. // "zone": {
  118402. // "description": "Name of the zone for this request.",
  118403. // "location": "path",
  118404. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118405. // "required": true,
  118406. // "type": "string"
  118407. // }
  118408. // },
  118409. // "path": "{project}/zones/{zone}/operations/{operation}",
  118410. // "response": {
  118411. // "$ref": "Operation"
  118412. // },
  118413. // "scopes": [
  118414. // "https://www.googleapis.com/auth/cloud-platform",
  118415. // "https://www.googleapis.com/auth/compute",
  118416. // "https://www.googleapis.com/auth/compute.readonly"
  118417. // ]
  118418. // }
  118419. }
  118420. // method id "compute.zoneOperations.list":
  118421. type ZoneOperationsListCall struct {
  118422. s *Service
  118423. project string
  118424. zone string
  118425. urlParams_ gensupport.URLParams
  118426. ifNoneMatch_ string
  118427. ctx_ context.Context
  118428. header_ http.Header
  118429. }
  118430. // List: Retrieves a list of Operation resources contained within the
  118431. // specified zone.
  118432. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  118433. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  118434. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118435. c.project = project
  118436. c.zone = zone
  118437. return c
  118438. }
  118439. // Filter sets the optional parameter "filter": A filter expression that
  118440. // filters resources listed in the response. The expression must specify
  118441. // the field name, a comparison operator, and the value that you want to
  118442. // use for filtering. The value must be a string, a number, or a
  118443. // boolean. The comparison operator must be either =, !=, >, or <.
  118444. //
  118445. // For example, if you are filtering Compute Engine instances, you can
  118446. // exclude instances named example-instance by specifying name !=
  118447. // example-instance.
  118448. //
  118449. // You can also filter nested fields. For example, you could specify
  118450. // scheduling.automaticRestart = false to include instances only if they
  118451. // are not scheduled for automatic restarts. You can use filtering on
  118452. // nested fields to filter based on resource labels.
  118453. //
  118454. // To filter on multiple expressions, provide each separate expression
  118455. // within parentheses. For example, (scheduling.automaticRestart = true)
  118456. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118457. // AND expression. However, you can include AND and OR expressions
  118458. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118459. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118460. // true).
  118461. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  118462. c.urlParams_.Set("filter", filter)
  118463. return c
  118464. }
  118465. // MaxResults sets the optional parameter "maxResults": The maximum
  118466. // number of results per page that should be returned. If the number of
  118467. // available results is larger than maxResults, Compute Engine returns a
  118468. // nextPageToken that can be used to get the next page of results in
  118469. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118470. // (Default: 500)
  118471. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  118472. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118473. return c
  118474. }
  118475. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118476. // a certain order. By default, results are returned in alphanumerical
  118477. // order based on the resource name.
  118478. //
  118479. // You can also sort results in descending order based on the creation
  118480. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118481. // based on the creationTimestamp field in reverse chronological order
  118482. // (newest result first). Use this to sort resources like operations so
  118483. // that the newest operation is returned first.
  118484. //
  118485. // Currently, only sorting by name or creationTimestamp desc is
  118486. // supported.
  118487. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  118488. c.urlParams_.Set("orderBy", orderBy)
  118489. return c
  118490. }
  118491. // PageToken sets the optional parameter "pageToken": Specifies a page
  118492. // token to use. Set pageToken to the nextPageToken returned by a
  118493. // previous list request to get the next page of results.
  118494. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  118495. c.urlParams_.Set("pageToken", pageToken)
  118496. return c
  118497. }
  118498. // Fields allows partial responses to be retrieved. See
  118499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118500. // for more information.
  118501. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  118502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118503. return c
  118504. }
  118505. // IfNoneMatch sets the optional parameter which makes the operation
  118506. // fail if the object's ETag matches the given value. This is useful for
  118507. // getting updates only after the object has changed since the last
  118508. // request. Use googleapi.IsNotModified to check whether the response
  118509. // error from Do is the result of In-None-Match.
  118510. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  118511. c.ifNoneMatch_ = entityTag
  118512. return c
  118513. }
  118514. // Context sets the context to be used in this call's Do method. Any
  118515. // pending HTTP request will be aborted if the provided context is
  118516. // canceled.
  118517. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  118518. c.ctx_ = ctx
  118519. return c
  118520. }
  118521. // Header returns an http.Header that can be modified by the caller to
  118522. // add HTTP headers to the request.
  118523. func (c *ZoneOperationsListCall) Header() http.Header {
  118524. if c.header_ == nil {
  118525. c.header_ = make(http.Header)
  118526. }
  118527. return c.header_
  118528. }
  118529. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  118530. reqHeaders := make(http.Header)
  118531. for k, v := range c.header_ {
  118532. reqHeaders[k] = v
  118533. }
  118534. reqHeaders.Set("User-Agent", c.s.userAgent())
  118535. if c.ifNoneMatch_ != "" {
  118536. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118537. }
  118538. var body io.Reader = nil
  118539. c.urlParams_.Set("alt", alt)
  118540. c.urlParams_.Set("prettyPrint", "false")
  118541. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  118542. urls += "?" + c.urlParams_.Encode()
  118543. req, err := http.NewRequest("GET", urls, body)
  118544. if err != nil {
  118545. return nil, err
  118546. }
  118547. req.Header = reqHeaders
  118548. googleapi.Expand(req.URL, map[string]string{
  118549. "project": c.project,
  118550. "zone": c.zone,
  118551. })
  118552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118553. }
  118554. // Do executes the "compute.zoneOperations.list" call.
  118555. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  118556. // status code is an error. Response headers are in either
  118557. // *OperationList.ServerResponse.Header or (if a response was returned
  118558. // at all) in error.(*googleapi.Error).Header. Use
  118559. // googleapi.IsNotModified to check whether the returned error was
  118560. // because http.StatusNotModified was returned.
  118561. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  118562. gensupport.SetOptions(c.urlParams_, opts...)
  118563. res, err := c.doRequest("json")
  118564. if res != nil && res.StatusCode == http.StatusNotModified {
  118565. if res.Body != nil {
  118566. res.Body.Close()
  118567. }
  118568. return nil, &googleapi.Error{
  118569. Code: res.StatusCode,
  118570. Header: res.Header,
  118571. }
  118572. }
  118573. if err != nil {
  118574. return nil, err
  118575. }
  118576. defer googleapi.CloseBody(res)
  118577. if err := googleapi.CheckResponse(res); err != nil {
  118578. return nil, err
  118579. }
  118580. ret := &OperationList{
  118581. ServerResponse: googleapi.ServerResponse{
  118582. Header: res.Header,
  118583. HTTPStatusCode: res.StatusCode,
  118584. },
  118585. }
  118586. target := &ret
  118587. if err := gensupport.DecodeResponse(target, res); err != nil {
  118588. return nil, err
  118589. }
  118590. return ret, nil
  118591. // {
  118592. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  118593. // "httpMethod": "GET",
  118594. // "id": "compute.zoneOperations.list",
  118595. // "parameterOrder": [
  118596. // "project",
  118597. // "zone"
  118598. // ],
  118599. // "parameters": {
  118600. // "filter": {
  118601. // "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).",
  118602. // "location": "query",
  118603. // "type": "string"
  118604. // },
  118605. // "maxResults": {
  118606. // "default": "500",
  118607. // "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)",
  118608. // "format": "uint32",
  118609. // "location": "query",
  118610. // "minimum": "0",
  118611. // "type": "integer"
  118612. // },
  118613. // "orderBy": {
  118614. // "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.",
  118615. // "location": "query",
  118616. // "type": "string"
  118617. // },
  118618. // "pageToken": {
  118619. // "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.",
  118620. // "location": "query",
  118621. // "type": "string"
  118622. // },
  118623. // "project": {
  118624. // "description": "Project ID for this request.",
  118625. // "location": "path",
  118626. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118627. // "required": true,
  118628. // "type": "string"
  118629. // },
  118630. // "zone": {
  118631. // "description": "Name of the zone for request.",
  118632. // "location": "path",
  118633. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118634. // "required": true,
  118635. // "type": "string"
  118636. // }
  118637. // },
  118638. // "path": "{project}/zones/{zone}/operations",
  118639. // "response": {
  118640. // "$ref": "OperationList"
  118641. // },
  118642. // "scopes": [
  118643. // "https://www.googleapis.com/auth/cloud-platform",
  118644. // "https://www.googleapis.com/auth/compute",
  118645. // "https://www.googleapis.com/auth/compute.readonly"
  118646. // ]
  118647. // }
  118648. }
  118649. // Pages invokes f for each page of results.
  118650. // A non-nil error returned from f will halt the iteration.
  118651. // The provided context supersedes any context provided to the Context method.
  118652. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  118653. c.ctx_ = ctx
  118654. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  118655. for {
  118656. x, err := c.Do()
  118657. if err != nil {
  118658. return err
  118659. }
  118660. if err := f(x); err != nil {
  118661. return err
  118662. }
  118663. if x.NextPageToken == "" {
  118664. return nil
  118665. }
  118666. c.PageToken(x.NextPageToken)
  118667. }
  118668. }
  118669. // method id "compute.zones.get":
  118670. type ZonesGetCall struct {
  118671. s *Service
  118672. project string
  118673. zone string
  118674. urlParams_ gensupport.URLParams
  118675. ifNoneMatch_ string
  118676. ctx_ context.Context
  118677. header_ http.Header
  118678. }
  118679. // Get: Returns the specified Zone resource. Gets a list of available
  118680. // zones by making a list() request.
  118681. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  118682. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  118683. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118684. c.project = project
  118685. c.zone = zone
  118686. return c
  118687. }
  118688. // Fields allows partial responses to be retrieved. See
  118689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118690. // for more information.
  118691. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  118692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118693. return c
  118694. }
  118695. // IfNoneMatch sets the optional parameter which makes the operation
  118696. // fail if the object's ETag matches the given value. This is useful for
  118697. // getting updates only after the object has changed since the last
  118698. // request. Use googleapi.IsNotModified to check whether the response
  118699. // error from Do is the result of In-None-Match.
  118700. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  118701. c.ifNoneMatch_ = entityTag
  118702. return c
  118703. }
  118704. // Context sets the context to be used in this call's Do method. Any
  118705. // pending HTTP request will be aborted if the provided context is
  118706. // canceled.
  118707. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  118708. c.ctx_ = ctx
  118709. return c
  118710. }
  118711. // Header returns an http.Header that can be modified by the caller to
  118712. // add HTTP headers to the request.
  118713. func (c *ZonesGetCall) Header() http.Header {
  118714. if c.header_ == nil {
  118715. c.header_ = make(http.Header)
  118716. }
  118717. return c.header_
  118718. }
  118719. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  118720. reqHeaders := make(http.Header)
  118721. for k, v := range c.header_ {
  118722. reqHeaders[k] = v
  118723. }
  118724. reqHeaders.Set("User-Agent", c.s.userAgent())
  118725. if c.ifNoneMatch_ != "" {
  118726. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118727. }
  118728. var body io.Reader = nil
  118729. c.urlParams_.Set("alt", alt)
  118730. c.urlParams_.Set("prettyPrint", "false")
  118731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  118732. urls += "?" + c.urlParams_.Encode()
  118733. req, err := http.NewRequest("GET", urls, body)
  118734. if err != nil {
  118735. return nil, err
  118736. }
  118737. req.Header = reqHeaders
  118738. googleapi.Expand(req.URL, map[string]string{
  118739. "project": c.project,
  118740. "zone": c.zone,
  118741. })
  118742. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118743. }
  118744. // Do executes the "compute.zones.get" call.
  118745. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  118746. // code is an error. Response headers are in either
  118747. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  118748. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  118749. // whether the returned error was because http.StatusNotModified was
  118750. // returned.
  118751. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  118752. gensupport.SetOptions(c.urlParams_, opts...)
  118753. res, err := c.doRequest("json")
  118754. if res != nil && res.StatusCode == http.StatusNotModified {
  118755. if res.Body != nil {
  118756. res.Body.Close()
  118757. }
  118758. return nil, &googleapi.Error{
  118759. Code: res.StatusCode,
  118760. Header: res.Header,
  118761. }
  118762. }
  118763. if err != nil {
  118764. return nil, err
  118765. }
  118766. defer googleapi.CloseBody(res)
  118767. if err := googleapi.CheckResponse(res); err != nil {
  118768. return nil, err
  118769. }
  118770. ret := &Zone{
  118771. ServerResponse: googleapi.ServerResponse{
  118772. Header: res.Header,
  118773. HTTPStatusCode: res.StatusCode,
  118774. },
  118775. }
  118776. target := &ret
  118777. if err := gensupport.DecodeResponse(target, res); err != nil {
  118778. return nil, err
  118779. }
  118780. return ret, nil
  118781. // {
  118782. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  118783. // "httpMethod": "GET",
  118784. // "id": "compute.zones.get",
  118785. // "parameterOrder": [
  118786. // "project",
  118787. // "zone"
  118788. // ],
  118789. // "parameters": {
  118790. // "project": {
  118791. // "description": "Project ID for this request.",
  118792. // "location": "path",
  118793. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118794. // "required": true,
  118795. // "type": "string"
  118796. // },
  118797. // "zone": {
  118798. // "description": "Name of the zone resource to return.",
  118799. // "location": "path",
  118800. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118801. // "required": true,
  118802. // "type": "string"
  118803. // }
  118804. // },
  118805. // "path": "{project}/zones/{zone}",
  118806. // "response": {
  118807. // "$ref": "Zone"
  118808. // },
  118809. // "scopes": [
  118810. // "https://www.googleapis.com/auth/cloud-platform",
  118811. // "https://www.googleapis.com/auth/compute",
  118812. // "https://www.googleapis.com/auth/compute.readonly"
  118813. // ]
  118814. // }
  118815. }
  118816. // method id "compute.zones.list":
  118817. type ZonesListCall struct {
  118818. s *Service
  118819. project string
  118820. urlParams_ gensupport.URLParams
  118821. ifNoneMatch_ string
  118822. ctx_ context.Context
  118823. header_ http.Header
  118824. }
  118825. // List: Retrieves the list of Zone resources available to the specified
  118826. // project.
  118827. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  118828. func (r *ZonesService) List(project string) *ZonesListCall {
  118829. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118830. c.project = project
  118831. return c
  118832. }
  118833. // Filter sets the optional parameter "filter": A filter expression that
  118834. // filters resources listed in the response. The expression must specify
  118835. // the field name, a comparison operator, and the value that you want to
  118836. // use for filtering. The value must be a string, a number, or a
  118837. // boolean. The comparison operator must be either =, !=, >, or <.
  118838. //
  118839. // For example, if you are filtering Compute Engine instances, you can
  118840. // exclude instances named example-instance by specifying name !=
  118841. // example-instance.
  118842. //
  118843. // You can also filter nested fields. For example, you could specify
  118844. // scheduling.automaticRestart = false to include instances only if they
  118845. // are not scheduled for automatic restarts. You can use filtering on
  118846. // nested fields to filter based on resource labels.
  118847. //
  118848. // To filter on multiple expressions, provide each separate expression
  118849. // within parentheses. For example, (scheduling.automaticRestart = true)
  118850. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118851. // AND expression. However, you can include AND and OR expressions
  118852. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118853. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118854. // true).
  118855. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  118856. c.urlParams_.Set("filter", filter)
  118857. return c
  118858. }
  118859. // MaxResults sets the optional parameter "maxResults": The maximum
  118860. // number of results per page that should be returned. If the number of
  118861. // available results is larger than maxResults, Compute Engine returns a
  118862. // nextPageToken that can be used to get the next page of results in
  118863. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118864. // (Default: 500)
  118865. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  118866. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118867. return c
  118868. }
  118869. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118870. // a certain order. By default, results are returned in alphanumerical
  118871. // order based on the resource name.
  118872. //
  118873. // You can also sort results in descending order based on the creation
  118874. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118875. // based on the creationTimestamp field in reverse chronological order
  118876. // (newest result first). Use this to sort resources like operations so
  118877. // that the newest operation is returned first.
  118878. //
  118879. // Currently, only sorting by name or creationTimestamp desc is
  118880. // supported.
  118881. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  118882. c.urlParams_.Set("orderBy", orderBy)
  118883. return c
  118884. }
  118885. // PageToken sets the optional parameter "pageToken": Specifies a page
  118886. // token to use. Set pageToken to the nextPageToken returned by a
  118887. // previous list request to get the next page of results.
  118888. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  118889. c.urlParams_.Set("pageToken", pageToken)
  118890. return c
  118891. }
  118892. // Fields allows partial responses to be retrieved. See
  118893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118894. // for more information.
  118895. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  118896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118897. return c
  118898. }
  118899. // IfNoneMatch sets the optional parameter which makes the operation
  118900. // fail if the object's ETag matches the given value. This is useful for
  118901. // getting updates only after the object has changed since the last
  118902. // request. Use googleapi.IsNotModified to check whether the response
  118903. // error from Do is the result of In-None-Match.
  118904. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  118905. c.ifNoneMatch_ = entityTag
  118906. return c
  118907. }
  118908. // Context sets the context to be used in this call's Do method. Any
  118909. // pending HTTP request will be aborted if the provided context is
  118910. // canceled.
  118911. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  118912. c.ctx_ = ctx
  118913. return c
  118914. }
  118915. // Header returns an http.Header that can be modified by the caller to
  118916. // add HTTP headers to the request.
  118917. func (c *ZonesListCall) Header() http.Header {
  118918. if c.header_ == nil {
  118919. c.header_ = make(http.Header)
  118920. }
  118921. return c.header_
  118922. }
  118923. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  118924. reqHeaders := make(http.Header)
  118925. for k, v := range c.header_ {
  118926. reqHeaders[k] = v
  118927. }
  118928. reqHeaders.Set("User-Agent", c.s.userAgent())
  118929. if c.ifNoneMatch_ != "" {
  118930. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118931. }
  118932. var body io.Reader = nil
  118933. c.urlParams_.Set("alt", alt)
  118934. c.urlParams_.Set("prettyPrint", "false")
  118935. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  118936. urls += "?" + c.urlParams_.Encode()
  118937. req, err := http.NewRequest("GET", urls, body)
  118938. if err != nil {
  118939. return nil, err
  118940. }
  118941. req.Header = reqHeaders
  118942. googleapi.Expand(req.URL, map[string]string{
  118943. "project": c.project,
  118944. })
  118945. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118946. }
  118947. // Do executes the "compute.zones.list" call.
  118948. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  118949. // code is an error. Response headers are in either
  118950. // *ZoneList.ServerResponse.Header or (if a response was returned at
  118951. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118952. // to check whether the returned error was because
  118953. // http.StatusNotModified was returned.
  118954. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  118955. gensupport.SetOptions(c.urlParams_, opts...)
  118956. res, err := c.doRequest("json")
  118957. if res != nil && res.StatusCode == http.StatusNotModified {
  118958. if res.Body != nil {
  118959. res.Body.Close()
  118960. }
  118961. return nil, &googleapi.Error{
  118962. Code: res.StatusCode,
  118963. Header: res.Header,
  118964. }
  118965. }
  118966. if err != nil {
  118967. return nil, err
  118968. }
  118969. defer googleapi.CloseBody(res)
  118970. if err := googleapi.CheckResponse(res); err != nil {
  118971. return nil, err
  118972. }
  118973. ret := &ZoneList{
  118974. ServerResponse: googleapi.ServerResponse{
  118975. Header: res.Header,
  118976. HTTPStatusCode: res.StatusCode,
  118977. },
  118978. }
  118979. target := &ret
  118980. if err := gensupport.DecodeResponse(target, res); err != nil {
  118981. return nil, err
  118982. }
  118983. return ret, nil
  118984. // {
  118985. // "description": "Retrieves the list of Zone resources available to the specified project.",
  118986. // "httpMethod": "GET",
  118987. // "id": "compute.zones.list",
  118988. // "parameterOrder": [
  118989. // "project"
  118990. // ],
  118991. // "parameters": {
  118992. // "filter": {
  118993. // "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).",
  118994. // "location": "query",
  118995. // "type": "string"
  118996. // },
  118997. // "maxResults": {
  118998. // "default": "500",
  118999. // "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)",
  119000. // "format": "uint32",
  119001. // "location": "query",
  119002. // "minimum": "0",
  119003. // "type": "integer"
  119004. // },
  119005. // "orderBy": {
  119006. // "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.",
  119007. // "location": "query",
  119008. // "type": "string"
  119009. // },
  119010. // "pageToken": {
  119011. // "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.",
  119012. // "location": "query",
  119013. // "type": "string"
  119014. // },
  119015. // "project": {
  119016. // "description": "Project ID for this request.",
  119017. // "location": "path",
  119018. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119019. // "required": true,
  119020. // "type": "string"
  119021. // }
  119022. // },
  119023. // "path": "{project}/zones",
  119024. // "response": {
  119025. // "$ref": "ZoneList"
  119026. // },
  119027. // "scopes": [
  119028. // "https://www.googleapis.com/auth/cloud-platform",
  119029. // "https://www.googleapis.com/auth/compute",
  119030. // "https://www.googleapis.com/auth/compute.readonly"
  119031. // ]
  119032. // }
  119033. }
  119034. // Pages invokes f for each page of results.
  119035. // A non-nil error returned from f will halt the iteration.
  119036. // The provided context supersedes any context provided to the Context method.
  119037. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  119038. c.ctx_ = ctx
  119039. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  119040. for {
  119041. x, err := c.Do()
  119042. if err != nil {
  119043. return err
  119044. }
  119045. if err := f(x); err != nil {
  119046. return err
  119047. }
  119048. if x.NextPageToken == "" {
  119049. return nil
  119050. }
  119051. c.PageToken(x.NextPageToken)
  119052. }
  119053. }